Current location - Quotes Website - Signature design - How to generate a signature for an android application
How to generate a signature for an android application
1. Signature step

A. create a key

B. use the key generated in step a to sign the apk.

2. Specific operations

Method 1: sign apk (principle) on the command line.

You need Keytool.exe (located in jdk 1.6.0_24\jre\bin directory) to create the key, and use jarsigner.exe (located in jdk 1.6.0_24\bin directory) to sign the apk. After adding the directories where the last two softwares are located to the environment variable path, open the cmd input.

d:\ & gt; keytool-genkey-alias demo . keystore-keyalg RSA-validity 40000-keystore demo . keystore

/* Description: -genkey generates a key.

-alias demo . keystore alias demo . keystore

-keyalg RSA uses RSA algorithm to encrypt the signature.

-Valid for 40,000 days.

-keystore demo.keystore */

d:\ & gt; jarsigner-verbose-keystore demo . keystore-signed jar demo _ signed . apk demo . apk demo . keystore

/* Description: -verbose outputs the details of the signature.

-Keystore? Demo.keystore keystore location

-signed jardemo _ signed.apkdemo. apkdemo.keystore is formally signed, and the three parameters are the signed file demo _ signed, the file to be signed demo.apk and keystore demo.keystore.*/

Note: demo.apk in the bin directory of android project has been signed by debug user by default, so you can't use the above steps to sign the file again. The correct step should be: right-click the item-> The apk exported by anroid tools-export unsigned application package is signed by the above steps.

Method 2: Export apk with signature using Eclipse.

Eclipse can directly export the final apk with signature, which is very convenient and recommended. The steps are as follows:

Step 1: Export.

Step 2: Create a keystore keystore, enter the location and password of the keystore export, and remember the password, which will be used next time.

Step 3: Fill in the keystore information, and fill in the password, service life and organizational unit information of some apk files.

Step 4: Generate a signed apk file, and that's it.

Step 5: If the version is released next time, re-sign it with the previously generated keystore.

Step 6: Next step, next step, end!

Method 3: export signed apk with IntelliJ IDEA?

The method steps are basically the same as Eclipse, and the approximate operation path is: menu tools->; andr oid-& gt; Export signature apk.