Getting SHA256 digest of an APK programmatically android
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?