Ionic after the project has been developed, it needs to be packaged. If you need to be on the shelves, on the Android side, you'll need to sign and upload them to the App store after the package is finished.
The first is about apk signatures, where the installation of the Android program is distinguished by the package name (package name), that is, the same package name is considered to be the same program. This allows for upgrades, replacements. But the package name is a string that can be viewed, so that it can be faked, and then someone else can create an application to replace your application with the result imaginable. The signature is to prevent such a situation from happening, when your program is signed and installed, only the same package name and signature of the program can be replaced by installation. The signature is not simple to be forged, thus ensuring the security of the program.
First, packing APK
Ionic bulid Android//pack Test Kit
Ionic build--release Android//Packaged official package
The ionic package is particularly simple, only one command, the above command is used to pack the test package, which already contains a signature, can be directly installed on the phone, but not used to apply the market, the second command is packaged into a unsigned apk, can not be directly installed, requires a second step.
Ii. Signature APK
1. Generate signature (. keystore) file
Keytool-genkey-v-keystore demo.keystore-alias demo.keystore-keyalg rsa-validity 20000
Keytool is the tool name,-genkey means to perform a digital certificate operation, and-V indicates that the details of the generated certificate will be printed;
-keystore the filename of the Demo.keystore certificate;
-alias Demo.keystore indicates the alias of the certificate
-keyalg RSA to generate a key file of the algorithm used;
-validity 20000 The validity period of the digital certificate;
Input will let you answer some questions about your company and area, these answers must remember, later update apk need to use, the best screenshot record.
2. Signature APK
Jarsigner-verbose-keystore/yourpath/demo.keystore-signedjar demo_signed.apk demo.apk Demo.keystore
Jarsigner is the tool name,-verbose indicates that the details of the signature process are printed;
Certificates generated prior to-keystore/yourpath/demo.keystore
-signedjar demo_signed.apk after signing the APK
demo.apk need to sign the APK
Alias of Demo.keystore Certificate