Getting certificate details from an apk

☆樱花仙子☆ 提交于 2019-11-26 09:20:52

问题


How do i go about getting the details of the certificate an apk was signed with. I have a bunch of apks signed with different certificate and I am trying to group them based on their certificate.

I can get the certificate expiry details using the jarsigner and complete my task but I was curious if I can get any more details or extract the public key ( I believe it stored in META-INF/cert.RSA but its not readable )


回答1:


Try the following:

openssl pkcs7 -inform DER -in CERT.RSA -noout -print_certs -text



回答2:


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 .




回答3:


Based on the existing answers, here's the command line for on-the-fly usage of openssl (unzip & pipe the cert instead of defining an -infile option):

unzip -p App.apk META-INF/CERT.RSA |openssl pkcs7 -inform DER -noout -print_certs -text



回答4:


without unpacking you can use ApkSigner from Android SDK and following:

apksigner.jar verify --print-certs myApplication.apk



回答5:


The easiest of all:

keytool -printcert -jarfile file.apk

This also works for Android App Bundles (.aab)



来源:https://stackoverflow.com/questions/11361452/getting-certificate-details-from-an-apk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!