How to generate a keystore and complete a signature for Android package Signature

Source: Internet
Author: User

If an APK uses a key signature, the file with the other key signature cannot be installed or overwrite the old version at the time of release, which can prevent your installed application from being overwritten or replaced by malicious third parties, this is useful.

 

Currently, Google's attitude and strategy in the Android system are both non-profit-oriented and essentially different from Symbian signatures, the APK file installed from the development environment to the mobile phone using the eclipse + ADT plug-in already contains the debug signature file of the ADT plug-in, so it is not installed, however, the final version must be signed by its own key.

Keystore generated by Android

First, we need a keystore. If you already have one, you don't need this step:

CMD:

Go to the bin directory of JDK. In this way, the android. keystore file will be generated under this directory. We need this file when signing.

C: \ Program Files \ Java \ jdk1.6.0 _ 10 \ bin> keytool-genkey-alias Android. keystore-keyalg RSA-validity 20000-keystore Android. keystore

Enter the keystore password:
Enter the new password again:
What is your first name and last name?
[UNKNOWN]: qiaoling what is the name of your organization?
[UNKNOWN]: www.chinaandroid.com
What is your organization name?
[UNKNOWN]: www.chinaandroid.com
What is the name of your city or region?
[UNKNOWN]: Haidian
What is the name of your state or province?
[UNKNOWN]: BJ
What is the two-letter country code for this unit?
[UNKNOWN]: 86
CN = qiaoling, ou = www.chinaandroid.com, O = www.chinaandroid.com, L = Haidian, St = BJ, c = 86 correct?
[No]: Y
Enter the primary password of <Android. keystore> (if the password is the same as that of keystore, press Enter ):

Here, the parameter-validity indicates the number of days valid for the certificate. Here we write a maximum of 10000 days. In addition, the password is not displayed again (even if the password is lost), and the tables are all in the password. This password is required when you sign the .apk file.

 

Then sign:
In eclipse, right-click the project to be signed --> Android tools --> export signed application package...
The following dialog box appears. Select the project to be signed.

Next, select the location and password of the android. keystore file generated above

Next

Next, select the location and name of the file generated by the signature

Finish, get it done...

Related Article

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.