The APK signature must first contain a keystore signature file.
The keystore is generated by the built-in JDK tool keytool.
Start-> Run-> cmd-> Cd to JDK Directory D: \ Java \ jdk1.7.0 _ 01 \ bin
(You can also add the JDK bin path to the environment variable so that keytool can be used anywhere)
Then enter:
Keytool-genkey-
Alias
Yourtion. Key-keyalg RSA-validity 20000-keystore yourtion. keystore
-Alias is followed by the alias yourtion. Key.
-Keyalg is the encryption method. Here it is RSA.
-Validity is valid. The value is 20000.
-Keystore is the name of the keystore to be generated. Here is yourtion. keystore.
Press ENTER
Press enter and you will be prompted to enter the password: remember what to use for signature.
Then confirm your password.
You will be asked to enter the name, organization unit, organization name, city area, Province name, and countryCode.
After running, you can find the generated keystore file in D: \ Java \ jdk1.7.0 _ 01 \ bin.
Next, sign the APK.
The command used is jarsigner under JDK bin.
Now, run the following command to sign the APK:
Jarsigner-verbose-keystore yourtion. keystore-signedjar yourtion_signed.apk yourtion.apk yourtion. Key
-Keystore: the name of the keystore.
Yourtion_signed.apk is the named APK
Yourtion.apk is the APK before the signature
Press enter to enter the password you just set. Press enter to start signing.
Note: Sometimes the signature will fail, because you may use the APK built by eclipse that has been signed by default, so please re-use the unsign APK.
Right-click Project> Android tools> export unsigned application package...
After running successfully, a signed APK file will be added to the D: \ Java \ jdk1.7.0 _ 01 \ bin directory.