Android Signature Comparison

Source: Internet
Author: User

I. keytool-list-printcert-jarfile "%filename%"

Two. Very low method: Download the application installation can successfully overwrite the original application then the signature is consistent
Three.

Chenzi Teng
Links: https://www.zhihu.com/question/20749413/answer/16715284
Source: Know
Copyright belongs to the author, please contact the author for authorization.

1. Find the RSA file in APK

(Windows)
> Jar TF helloworld.apk |findstr RSA

(Linux)
$ jar TF helloworld.apk |grep RSA


Meta-inf/cert. Rsa

2. Unzip the RSA file from the APK

Jar XF helloworld.apk Meta-inf/cert. Rsa

3. Get the fingerprints of the signature

Keytool-printcert-file Meta-inf/cert. Rsa

...
Certificate Fingerprints:
Md5:bc:6d:bd:6e:49:69:2a:57:a8:b8:28:89:04:3b:93:a8
Sha1:0d:df:76:f4:85:96:df:17:c2:68:1d:3d:ff:9b:0f:d2:a1:cf:14:60
Signature algorithm Name:sha1withrsa
Version:3
...

4. Cleanup work, delete RSA files

(Windows)
RMDIR/S/q Meta-inf

(Linux)
RM-RF Meta-inf


If you want to know whether the two apk is the same signature, then it is not the same as the MD5 code (or SHA1 code) they signed. Pasting

Four.

Wang Zhongyu
Links: https://www.zhihu.com/question/20749413/answer/17436681
Source: Know
Copyright belongs to the author, please contact the author for authorization.

Bishi do is the Android app repacking detection, first of all need to batch detect the consistency between Android app signing. So here is how to write a script in the terminal or direct Input command batch detection application signature is consistent.

Android App Release Form APK contains the signature encryption method in addition to RSA and DSA, so you can not only extract the common Meta-inf/cert from the APK. RSA, the first step should be to check what the specific signature file in the APK is.
FILE="yourapp.apk"cert_XSA=`$FILE| grep SA`
At this point the Cert_xsa may be meta-inf/*. RSA or meta-inf/*. Dsa.

Next, extract the specific signature file from the APK.
$FILE$cert_XSA
The Cert_xsa file is now available in the current directory.

Then, for the resulting signature file, extract the MD5 value of the signature
$cert_XSA|"$FILE.certMD5"
At this time yourapp.certmd5 the signature MD5 value in YOURAPP.APKK is saved in this file.

Finally, compare the signatures of two apps with a diff
FILE1="yourapp1.apk"FILE2="yourapp2.apk"# ...# ... After the above steps to get $file1.certmd5 and $file2.certmd5# ...Certmd5_diff=`Diff$FILE 1. certMD5$FILE 2. certMD5`if [ "$certMD 5_diff" = "" ];  ThenEcho "$FILE 1. certMD5 = =$FILE 2. CertMD5 "fi
If the output yourapp1.apk.certMD5 = = Yourapp2.apk.certMD5 Then the signatures of the two applications are consistent. Pasting

Android Signature Comparison

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.