Write a script to view the apk signature using shell. Very few and very simple codes
Copy codeThe Code is as follows :#! /Bin/bash
Mkdir. temp_for_certificate
Cd. temp_for_certificate
Count = 0
While [-n "$1"]
Do
Count = $ [$ count + 1]
Echo "(# $ count)" 'basename "$1 "'":"
Echo ""
Path = 'jar tf "$1" | grep RSA '# Find the RSA file in the apk.
Jar xf $1 $ path # decompress the RSA File
Keytool-printcert-file $ path # view fingerprint Certificate
Rm-r $ path # Delete the decompressed File
Echo "--------------------------------------------"
Shift
Done
Cd ..
Rm-r. temp_for_certificate
(Save it to a file and name it getcertificate)
Usage:Copy codeThe Code is as follows: getcertificate Superuser.apk Skype3.0.apk
Output:Copy codeThe Code is as follows: (#1) Superuser.apk:
Owner: CN = Adam Shanks, OU = Android, O = SoupCoconut, L = FWB, ST = Florida, C = US
Issuer: CN = Adam Shanks, OU = Android, O = SoupCoconut, L = FWB, ST = Florida, C = US
Serial number: 4c614057
Validity Period: Tue Aug 10 20:04:39 CST 2010 to Sat Dec 26 20:04:39 CST 2037
Certificate fingerprint:
MD5: D2: 42: 30: AA: BE: 81: 62: 30: FE: B4: 0E: F1: CF: 11: B0: C0
SHA1: 5F: 11: 3F: C2: C2: 0A: 7C: 9B: D9: 28: 19: 22: 6A: 32: A1: 90: 4B: 75: EF: 8B
Signature algorithm name: SHA1withRSA
Version: 3
--------------------------------------------
(#2) Skype3.0.apk:
Owner: CN = Skype, OU = Mobile Client, O = Skype, L = London, C = GB
Issuer: CN = Skype, OU = Mobile Client, O = Skype, L = London, C = GB
Serial number: 4c0e1962
Validity Period: Tue Jun 08 18:20:18 CST 2010 to Fri Jul 20 18:20:18 CST 2040
Certificate fingerprint:
MD5: 37: 5F: 1A: 56: C5: 2A: 51: FF: 35: F3: 6C: C5: A6: 69: 54: EC
SHA1: 77: 18: 07: D1: B8: 41: 4D: 69: 89: E7: D8: EF: 0B: 97: 97: 24: 3B: 93: 1F: 95
Signature algorithm name: SHA1withRSA
Version: 3
--------------------------------------------
You can also use jarsigner to view the signature.Copy codeThe Code is as follows: jarsigner-verify-verbose-certs Superuser.apk
For detailed usage of jarsigner, see help.