Use the command line to generate a signature file and use it to sign the APK File

Source: Internet
Author: User
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

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.