How do I find out which keystore was used to sign an app?

前端 未结 6 1999
无人及你
无人及你 2020-11-22 15:47

I have an app which is signed and several keystore files. I\'d like to update the app, so I need to find out which one of keys was used.

How can I match which keysto

6条回答
  •  情话喂你
    2020-11-22 16:23

    You can use Java 7's Key and Certificate Management Tool keytool to check the signature of a keystore or an APK without extracting any files.

    Signature of an APK

    keytool -printcert -jarfile app.apk
    

    The output will reveal the signature owner/issuer and MD5, SHA1 and SHA256 fingerprints of the APK file app.apk.

    (Note that the -jarfile argument was introduced in Java 7; see the documentation for more details.)

    Signature of a keystore

    keytool -list -v -keystore release.jks
    

    The output will reveal the aliases (entries) in the keystore file release.jks, with the certificate fingerprints (MD5, SHA1 and SHA256).

    If the SHA1 fingerprints between the APK and the keystore match, then you can rest assured that that app is signed with the key.

提交回复
热议问题