How do I get the signature checksum of my APK that is signed with only the v2 scheme?

久未见 提交于 2019-12-03 16:03:14

To build on the example How do I get the signature checksum of my APK? you mentioned:

apksigner verify -print-certs [path to your apk] | grep -Po "(?<=SHA-256 digest:) .*" | xxd -r -p | openssl base64 | tr -d '=' | tr -- '+/=' '-_'`

The "signature checksum" you're referring to is the URL-safe Base64 encoded SHA-256 digest of the APK's signing cert. apksigner verify --print-certs prints the various digests of the APK's signing certs, regardless of whether the APK is JAR signed, APK Signature Scheme v2-signed, or both.

apksigner is distributed via Android SDK Build Tools 24.0.3 and newer (except for 26.0.0 which is accidentally missing apksigner). https://developer.android.com/studio/command-line/apksigner.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!