Ionic Build--release Android

Source: Internet
Author: User
Tags sha1

Ionic Bulid Android

Ionic Build--release Android

Keytool-genkey-v-keystore demo.keystore-alias demo.keystore-keyalg rsa-validity 20000

Jarsigner-verbose-keystore/yourpath/demo.keystore-signedjar demo_signed.apk demo.apk Demo.keystore

Zipalign-v 4 your_project_name-unaligned.apk your_project_name.apk


Signing Your App Manually
You don't need Android Studio to the sign your app. You can sign your app from the command line using standard tools from the Android SDK and the JDK. To sign a app in release mode from the command line:

Generate a private key using Keytool. For example:

1, keytool-genkey-v-keystore my-release-key.keystore-alias alias_name-keyalg rsa-keysize 2048-validity 10000
2,jarsigner-verbose-sigalg sha1withrsa-digestalg sha1-keystore my-release-key.keystore my_application.apk Alias_ Name
3,jarsigner-verify-verbose-certs my_application.apk
4,zipalign-v 4 your_project_name-unaligned.apk your_project_name.apk

This example prompts-passwords for the KeyStore and key, and to provide the distinguished Name fields for your key . It then generates the KeyStore as a file called My-release-key.keystore. The keystore contains a single key, valid for 10000 days. The alias is a name, you'll use later when signing your app.
Compile your app in release mode to obtain an unsigned APK.
Sign your app with your private key using Jarsigner:
$ jarsigner-verbose-sigalg Sha1withrsa-digestalg SHA1
-keystore My-release-key.keystore my_application.apk Alias_name
This example prompts-passwords for the KeyStore and key. It then modifies the APK in-place to sign it. Note that you can sign a APK multiple times with different keys.
Verify that your APK is signed. For example:
$ jarsigner-verify-verbose-certs my_application.apk
Align the final APK package using Zipalign.
$ zipalign-v 4 your_project_name-unaligned.apk your_project_name.apk
Zipalign ensures that all uncompressed data starts with a particular byte alignment relative to the start of the file, whi CH reduces the amount of RAM consumed by an app.

https://play.google.com/apps/publish/?


Jarsigner is the name of the tool,-verbose means that the details of the signature process are printed out;
-keystore/yourpath/demo.keystore The certificate that was generated before
-signedjar demo_signed.apk after the signature apk
demo.apk need to sign the APK
Demo.keystore the name of the certificate

Attached: Check the APK signature

Under Mac, change the suffix of the apk to zip to open, and then view the. rsa file under Meta-inf
Under Windows, open the APK with winner and view it again. RSA file
Execute command

Keytool-printcert-file Meta-inf/cert. Rsa
1
Note the name and path of the following file, you can view the signature information, mainly to see the certificate fingerprints under the MD5 and SHA1, these two differences represent a different signature.

Ionic Build--release Android

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.