##加签名##
格式:
$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore -signedjar my_application_signed.apk my_application.apk alias_name例:jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore D:/xx/key/xx.jks -signedjar e:/app-product-release-signed.apk e:/app-product-release-unsigned.apk alisasxx提示“jar 已签名。”则成功
问题:
1、jarsigner: 无法对 jar 进行签名: java.util.zip.ZipException: invalid entry compressed size (expected 47019 but got 48319 bytes)原因:应为次apk包已经被签过名。
##验证签名##
jarsigner -verify -verbose -certs e:/app-product-release-unsigned.apk
##对齐##
zipalign -v 4 your_project_name-unaligned.apk your_project_name.apk
##参考##
https://developer.android.com/studio/publish/app-signing.htmlhttp://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.htmlhttp://blog.csdn.net/yangxt/article/details/1796965