所有关于比较您的应用程序的签名
a) get signature of both aps
b) check if sig.hashCode() == releaseSig.hashCode
Run Code Online (Sandbox Code Playgroud)
1)使用Android API通过运行时检查:
Signature[] sigs = context.getPackageManager()
.getPackageInfo(context.getPackageName(), PackageManager.GET_SIGNATURES)
.signatures;
Run Code Online (Sandbox Code Playgroud)
从文件:
Signature releaseSig = context.getPackageManager()
.getPackageAchiveInfo("/path2apk/app.apk",PackageManager.GET_SIGNATURES)
.signatures[0];
Run Code Online (Sandbox Code Playgroud)
2)在Android之外获取签名,请参见:
http://androidcracking.blogspot.com/2010/12/getting-apk-signature-outside-of.html
您可以使用:
openssl pkcs7 -inform DER -in CERT.RSA -noout -print_certs -text
unzip -p application.apk META-INF/CERT.RSA | keytool -printcert
Run Code Online (Sandbox Code Playgroud)
opensl的即时用法:
(解压缩并通过管道传递证书,而不是定义-infile选项):
unzip -p application.apk META-INF/CERT.RSA
| openssl pkcs7 -inform DER -noout -print_certs -text
Run Code Online (Sandbox Code Playgroud)
额外资源:
我可以向您推荐Scott Alexander-Bown(scottyab)在本主题中撰写的一篇不错的文章
https://www.airpair.com/android/posts/adding-tampering-detection-to-your-android-app
在此处尝试此链接开发人员指南
并且您可以知道它们是否使用相同的签名进行签名,或者不使用带有创建日期的证书验证。
首先导航到终端中包含文件夹的 .apk
$ jarsigner -verify -verbose -certs my_application.apk
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4581 次 |
| 最近记录: |