APK承袭JAVA,证书RSA文件生成方式与JAVA同源,获取APK证书MD5思路:
- 得到APK的RSA证书文件
- 使用Java工具的keyytool命令获取
使用该工具准备条件(2选1即可):
- 安装JDK(Java Development Kit)环境即可
为确保运行,可添加到环境变量或者在cmd窗口中中cd到对应路径执行。keytool命令对应文件keytool.exe的目录一般为C:\Program Files\Java\jre7\bin\keytool.exe
具体步骤
1、解压得到RSA文件
APK以zip文件方式打开,在\META-INF\目录中存在一个.RSA后缀的文件,一般名为CERT.RSA
2、使用keytool命令获取证书信息(包括MD5)
运行如下keytool命令即可:
<span class="pln" style="border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; color: rgb(0, 0, 0); background-color: transparent; background-position: initial initial; background-repeat: initial initial;">keytool </span><span class="pun" style="border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; color: rgb(102, 102, 0); background-color: transparent; background-position: initial initial; background-repeat: initial initial;">-</span><span class="pln" style="border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; color: rgb(0, 0, 0); background-color: transparent; background-position: initial initial; background-repeat: initial initial;">printcert </span><span class="pun" style="border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; color: rgb(102, 102, 0); background-color: transparent; background-position: initial initial; background-repeat: initial initial;">-</span><span class="pln" style="border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; color: rgb(0, 0, 0); background-color: transparent; background-position: initial initial; background-repeat: initial initial;">file CERT</span><span class="pun" style="border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; color: rgb(102, 102, 0); background-color: transparent; background-position: initial initial; background-repeat: initial initial;">.</span><span class="pln" style="border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; color: rgb(0, 0, 0); background-color: transparent; background-position: initial initial; background-repeat: initial initial;">RSA</span>