问题描述
我有一个签名的应用程序和几个密钥库文件。我想更新应用程序,所以我需要找出哪个键被使用。我怎样才能匹配哪个密钥库被用来签署我的应用程序对我在我的机器上的各种keystores?解决方案首先,解压缩APK并提取文件/ META-INF / ANDROID_。 RSA(这个文件也可能是CERT.RSA,但是应该只有一个.RSA文件)。然后发出这个命令:
$ p $ c $ keytool -printcert -file ANDROID_ .RSA
您将获得像这样的证书指纹:
MD5:B3:4F:BE:07:AA:78:24:DC:CA:92:36:FF:AE:8C:17:DB
SHA1:16:59:E7:E3:0C:AA:7A:0D:F2:0D:05:20:12:A8:85:0B:32:C5:4F:68
签名算法名称:SHA1withRSA
然后再次使用keytool打印签名密钥库的所有别名:
keytool -list -keystore my-signing-key.keystore
你会得到别名和他们的证书指纹列表:
android_key,Jan 23 ,2010,PrivateKeyEntry,
证书指纹(MD5):B3:4F:BE:07:AA:78:24:DC:CA:92:36:FF:AE:8C:17:DB
瞧!我们现在可以确定apk已经用这个keystore和别名'android_key'来签名。
Keytool是Java的一部分,所以确保你的PATH安装了Java目录中。
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 keystore was used to originally sign my app against various keystores I have on my machine?
First, unzip the APK and extract the file /META-INF/ANDROID_.RSA (this file may also be CERT.RSA, but there should only be one .RSA file).
Then issue this command:
keytool -printcert -file ANDROID_.RSA
You will get certificate fingerprints like this:
MD5: B3:4F:BE:07:AA:78:24:DC:CA:92:36:FF:AE:8C:17:DB
SHA1: 16:59:E7:E3:0C:AA:7A:0D:F2:0D:05:20:12:A8:85:0B:32:C5:4F:68
Signature algorithm name: SHA1withRSA
Then use the keytool again to print out all the aliases of your signing keystore:
keytool -list -keystore my-signing-key.keystore
You will get a list of aliases and their certificate fingerprint:
android_key, Jan 23, 2010, PrivateKeyEntry,
Certificate fingerprint (MD5): B3:4F:BE:07:AA:78:24:DC:CA:92:36:FF:AE:8C:17:DB
Voila! we can now determined the apk has been signed with this keystore, and with the alias 'android_key'.
Keytool is part of Java, so make sure your PATH has Java installation dir in it.
这篇关于如何找出哪个密钥库用于签署应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!