假定安裝了JDK,若是想查HelloWorld.apk所使用的簽名的fingerprint,能夠這樣作:
1. 查找apk裏的rsa文件shell
(Windows)spa
> jar tf HelloWorld.apk |findstr RSA
(Linux)code
$ jar tf HelloWorld.apk |grep RSA
META-INF/CERT.RSAit
2. 從apk中解壓rsa文件io
jar xf HelloWorld.apk META-INF/CERT.RSA
3. 獲取簽名的fingerprintsclass
keytool -printcert -file META-INF/CERT.RSA
...
Certificate fingerprints:
MD5: BC:6D:BD:6E:49:69:2A:57:A8:B8:28:89:04:3B:93:A8
SHA1: 0D:DF:76:F4:85:96:DF:17:C2:68:1D:3D:FF:9B:0F:D2:A1:CF:14:60
Signature algorithm name: SHA1withRSA
Version: 3
...file
4. 清理工做,刪除rsa文件rsa
(Windows)grep
rmdir /S /Q META-INF
(Linux)
di
rm -rf META-INF
若是你想知道兩個apk是否是用的同一個簽名,那比一下它們簽名的MD5碼(或SHA1碼)是否是同樣就好了。