[Preface]
We usually develop Android applicationsProgramGenerally, the integrated development environment of eclipse is used, so the generated APK has the signature permission for the debug version. However, if we want to release an application, if you want to run on a real machine, you need to sign it.
[Tools]
Keytool and jarsigner in the Java Development Environment. Note that the Environment path is configured. The following prompt is displayed after you enter the command:
C: \ Documents and Settings \ f10000040 \ Desktop \ blogArticle> Keytool
Keytool usage:
-certreq [-V] [-protected]
[-alias ] [-sigalg algorithm ]
[-file ] [-keypass ]
[-keystore storage metadata>] [-storepass ]
[-storetype ] [-providername ]
[-providerclass [-provi Derarg ]...
[-providerpath <>]
......
C: \ Documents and Settings \ f10000040 \ Desktop \ blog post> jarsigner
Usage: jarsigner [Options] jar-file alias
Jarsigner-verify [Options] jar-File
[-Keystore <URL>] keystore location
[-Storepass <password>] password for keystore integrity
[-Storetype <type>] keystore type
[-Keypass <password>] password for private key (if different)
[-Sigfile <File>] Name of. SF/. DSA File
......
[Create a signature file]
Let's create a name named Carey. keystore (generated and saved in the current operation directory), keystore signature file with the password (not displayed during Password Input, next we will use it to sign our own APK.
C: \ Documents and Settings \ f10000040 \ Desktop \ blog post> keytool-genkey-alias Carey. k
Ystore-keyalg RSA-validity 20000-keystore Carey. keystore
Secret: <password>
Rebind to the new password: <password>
What is your first name and last name?
[UNKNOWN]: Carey Zhou
What is the name of your province-specific single bit?
[UNKNOWN]: Foxconn
What is your organization name?
[UNKNOWN]: it
What is the name of your city or region?
[UNKNOWN]: Shenzhen
What is the name of your state and province?
[UNKNOWN]: Guangdong
Why is the single-digit two-character country?
[UNKNOWN]: CN
CN = Carey Zhou, ou = Foxconn, O = it, L = Shenzhen, St = Guangdong, c = cn OK?
[No]: Y
Primary Key secret of <Carey. keystore>
(Return if it is the same as the keystore secret): <password>
Rebind to the new password: <password>
[Signature process]
Token)
C: \ Documents and Settings \ f10000040 \ Desktop \ blog post> jarsigner-verbose-keystore Carey. keystore-signedjar HomeIP2-signed.apk HomeIP2-unsigned.apk Carey. keystore
Enter passphrase for keystore: <password>
Adding: META-INF/manifest. MF
Adding: META-INF/carey_ke.sf
Adding: META-INF/carey_ke.rsa
Signing: Res/anim/fade_in.xml
Signing: Res/anim/fade_out.xml
Signing: Res/anim/fadeout. xml
Signing: Res/anim/grid_entry.xml
Signing: Res/anim/grid_exit.xml
Signing: Res/anim/hide_applications.xml
Signing: Res/anim/noneshow. xml
Signing: Res/anim/show. xml
Signing: Res/anim/show_applications.xml
Signing: Res/color/bright_text_dark_focused.xml
Signing: Res/color/listtextcolor. xml
Signing: Res/drawable/apparrow. xml
Signing: Res/drawable/application_background.9.png
Signing: Res/drawable/button. xml
......
[Summary]
The above is the process of making the signature file and signing the APK, For details, please refer to the android official development documentation http://developer.android.com/guide/publishing/app-signing.html