1. Generate key: Keytool-genkey-alias demo.keystore-keyalg rsa-validity 40000-keystore demo.keystore
2. Signature file: Jarsigner-verbose-keystore demo.keystore-signedjar demo_signed.apk demo.apk demo.keystore
If the installation fails, add the parameter "-digestalg sha1-sigalg Md5withrsa" after re-signing the installation
If not available-tsa or-tsacert, this jar does not have a timestamp. If there is no timestamp, the user may not be able to verify the jar after the expiration date (XXXX-XX-XX) of the signer's certificate or any subsequent revocation date. "Warning Please add parameter"-tsa Https://timestamp.geotrust.com/tsa "after re-signing the installation
3, Alignment optimization: zipalign-v 4 demo_signed.apk final.apk
Reference: http://www.cnblogs.com/qianxudetianxia/archive/2011/04/09/2010468.html
Reference: http://blog.csdn.net/changcsw/article/details/45643607
APK signature, zipalign optimization (command line version)