1. Use command line to generate a signature file
(1) create a folder named android_publish to store the signature file.
(2) enter the command in the command line window: (in bold)
E: \ android_publish>
Keytool-genkey-alias alex_android.keystore-keyalg RSA-validity 20000-keystore alex_android.keystore
Enter the keystore password:
Enter the new password again:
What is your first name and last name?
[UNKNOWN]: zhoujianghai
What is the name of your organization?
[UNKNOWN]: jxust
What is your organization name?
[UNKNOWN]: jxust
What is the name of your city or region?
[UNKNOWN]: Ganzhou
What is the name of your state or province?
[UNKNOWN]: Jiangxi
Two-letter country in the unit Code What is
[UNKNOWN]: CN
CN = zhoujianghai, ou = jxust, O = jxust, L = Ganzhou, St = Jiangxi, c = cn correct?
[No]: Y
Enter the primary password of <alex_android.keystore>
(If the password is the same as the keystore password, press Enter ):
In this case, the alex_android.keystore file will be generated in the abdroid_publish folder of the E drive, which is the signature file we need. (-validity 20000 indicates that the certificate is valid for 20000 days)
Ii. Use the generated signature file to sign the APK File
(1) use the "export the unsigned apkloud" tool in eclipse to export the project, which is saved to the android_publish file folder on the edrive and named assistant.apk.
(2)use jarsignerto give android_infoassistant.apk
File signature:
E: \ android_publish> "E: \ jdk1.6 \ bin \ jarsigner.exe"-verbose-keystore alex_android.keystore-signedjar android_assistant.apk assistant.apk alex_android.keystore
Enter the key phrase:
......
The signature of the unsigned assistant.apk file is android_assistant.apk.
(3) check whether the signature is successful.
E: \ android_publish> "E: \ jdk1.6 \ bin \ jarsigner.exe"-verify android_assistant.apk
If yes
Output:
Jar verified