Home > Enterprise >  Getting SHA256 digest of an APK programmatically android
Getting SHA256 digest of an APK programmatically android

Time:07-14

I have an installed APK on my device, and I am trying to get the SHA256 digest of the same. Manually, I do it like this:

apksigner verify --print-certs path/to/apk.apk and use the SHA256 digest.

But I need to do the same thing programmatically, by passing the package name of the APK, I get the SHA256 digest. Is there anyway I can achieve it?

CodePudding user response:

I've been using this to generate SHA256 hash for Google SMS API. Hope this helps.

AppSignatureHelper

CodePudding user response:

I am still relativly new to programming so not sure if there is a difference between SHA256 and SHA256 digest but if you follow these steps here up to step 3,after scrolling down to the answer: Users are not saved/registered on the Firebase authentication You can use the same method and get the SHA 256 key. Hopefully this will Help!

  • Related