有没有办法从签名的 APK 中获取 key 哈希?
我们有一个签名的 Android apk 文件,我们想找出这个 APK 的 key 哈希,用于 Facebook SDK。
我们可以通过 jarsigner 之类的方法来做到这一点吗?
有什么建议吗?
最佳答案
在 linux 上,我使用此命令从 apk 中获取 key 哈希:
keytool -list -printcert -jarfile [path_to_your_apk] | grep -Po "(?<=SHA1:) .*" | xxd -r -p | openssl base64
对于 Mac 用户 (OS X),因为没有 grep -P 支持
keytool -list -printcert -jarfile ~/Downloads/YOURAPKFILE.apk | grep "SHA1:"|剪切 -d ""-f 3 | xxd -r -p | openssl base64
关于android - 有没有办法从签名的 APK 中获取 key 哈希?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17423870/