0

In order to check if the app is running on a non modified version of the APK I'm checking the app SHA1 signature at runtime. This was working fine until now, but if I now want to target Android 28 it doesn't work anymore

java.security.NoSuchAlgorithmException: The BC provider no longer provides an implementation for MessageDigest.SHA1.  Please see https://android-developers.googleblog.com/2018/03/cryptography-changes-in-android-p.html for more details.

Is there another way to do this from code? I failed to find any solution until now...

user1026605
  • 1,633
  • 4
  • 22
  • 58

1 Answers1

0

You can use sha-1 by code below. Note that "SHA-1", not the "SHA1"

MessageDigest md = MessageDigest.getInstance("SHA-1");

Details: Make SHA1 encryption on Android?

Stanley Ko
  • 3,383
  • 3
  • 34
  • 60