简体   繁体   English

如何从签名的 apk 中获取密钥库文件

[英]How to get keystore file from signed apk

I have already signed my apk with default debug.keystore key.But unfortunately my system destroyed,Now I need to get the key store from the already signed apk.我已经使用默认的 debug.keystore 密钥对我的 apk 进行了签名。但不幸的是我的系统被破坏了,现在我需要从已经签名的 apk 中获取密钥库。

to replace with old apk with new apk.用新的 apk 替换旧的 apk。

I have MD5,SHA fingerprints with.But i could make them as keystore to sign the apk.我有 MD5,SHA 指纹,但我可以将它们作为密钥库来签署 apk。

Any suggestions would be appreciated.Thank you in advance.任何建议将不胜感激。在此先感谢您。

unzip -p Name-of-apk.apk META-INF/CERT.RSA | keytool -printcert

is what I used.是我用的。

It produces information such as the owner, issuer, serial number, valid through, certificate finger prints, signature algorithms and version.它产生诸如所有者、发行者、序列号、有效通过、证书指纹、签名算法和版本等信息。

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).首先,解压APK并解压文件/META-INF/ANDROID_.RSA(这个文件也可能是CERT.RSA,但应该只有一个.RSA文件)。

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 打印出签名密钥库的所有别名:

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! android_key,2010 年 1 月 23 日,PrivateKeyEntry,证书指纹 (MD5):B3:4F:BE:07:AA:78:24:DC:CA:92:36:FF:AE:8C:17:DB 瞧! we can now determined the apk has been signed with this keystore, and with the alias 'android_key'.我们现在可以确定 apk 已使用此密钥库签名,并使用别名“android_key”。

Keytool is part of Java, so make sure your PATH has Java installation dir in it. Keytool 是 Java 的一部分,因此请确保您的 PATH 中包含 Java 安装目录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM