Ionic project signature and ionic Signature

Source: Internet
Author: User

Ionic project signature and ionic Signature

I. Advantages and Disadvantages of ionic Automatic Signature (ionic build android/ios)

The advantage is that you can directly install and test the installation on your mobile phone, or upload it to the Android or iOS platform.

The bad thing is: Your computer environment has changed to a computer, and the packaged signature will be different. The packaged app will not be able to overwrite the previous version, different signatures will be reported

 

Ii. Do not use automatic signature

1. Package and run the ionic build -- release android (android is used as an example)

2. Generate a certificate file

Keytool-genkey-v-keystore test. keystore-alias demo. keystore-keyalg RSA-validity 20000
After running the command, you will be asked to enter the keystore password,
Confirm again, followed by some related personal and company information. If you have not entered the information once, press Enter,
There will also be a keystore password, which can be the same as the keystore or re-written;

Keytool is the tool name.-genkey indicates that the digital certificate generation operation is performed.-v indicates that the detailed information of the generated certificate is printed out;
-File Name of the keystore test. keystore certificate;
-Alias sign. keystore indicates the certificate alias;
-The algorithm used by keyalg RSA to generate the key file;
-Validity 20000 the validity period of the digital certificate, in days;
Problems:
(1). keytool is not an internal or available command. You need to configure this path to the parent folder of this tool,
For example, if my keytool.exe file is in the Java \ jdk1.8.0 _ 121 \ bin \ file, configure the directory
Java \ jdk1.8.0 _ 121 \ bin \; at last, do not discard this \. Pay attention to the configuration; (semicolon) should be added when it is gone;
(2) The key library password is input but not displayed in the window;
3. Sign the generated unsigned apk
Jarsigner-verbose-keystore/yourpath/demo. keystore-signedjar signafter.apk android-Release. Apk sign. keystore

 

Jarsigner is the tool name, and-verbose indicates that the detailed information in the signature process is printed out;
-Locate the certificate location for the certificate generated before keystore/yourpath/test. keystore
Signafter.apk signed apk
Android-Release. Apk to be signed
Sign. Alias of the keystore Certificate

Notes:

(1). the configured variable directory should be similar to the preceding one. Otherwise, the command is unavailable.

In the jdk1.6.0 _ 24 \ bin \ directory

(2) When running this command, you need to switch the directory to the apk directory you need to sign. Otherwise, an error will be reported that the jar file cannot be opened.

(3 ). if you run this command in the directory where your signature certificate is stored, You need to copy the apk you want to sign to this directory. Otherwise, the jar file cannot be opened.

4. Optimize the signed apk without Optimization

Zipalign-v 4 signafter.apk signend.apk

1) zipalign is the tool name.-v indicates that the detailed optimization information is printed in the DOS window;
2) indicates a signed file.Signafter.apkOptimized. The optimized file name isSignend.apk

5. view the apk Signature

 

Under Mac, change the apk suffix to zip open, and then view the. RSA file under the META-INF
In Windows, use winner to open the apk and view the. RSA file.
Execute Command

Keytool-printcert-file META-INF/CERT. RSA

Pay attention to the name and path of the following file. You can view the signature information, mainly to view the MD5 and SHA1 values under Certificate fingerprints. The two differences indicate different signatures.

 

6. Use the Certificate file to change the computer to package the same app, so that the app signature remains unchanged.

I am studying it. I hope you can see it. Thank you.

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.