##加簽名##html
格式:java
$ 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 已簽名。」則成功
問題:android
一、jarsigner: 沒法對 jar 進行簽名: java.util.zip.ZipException: invalid entry compressed size (expected 47019 but got 48319 bytes) 緣由:應爲次apk包已經被簽過名。
##驗證簽名##windows
jarsigner -verify -verbose -certs e:/app-product-release-unsigned.apk
##對齊##oracle
zipalign -v 4 your_project_name-unaligned.apk your_project_name.apk
##參考##app
https://developer.android.com/studio/publish/app-signing.html http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.html http://blog.csdn.net/yangxt/article/details/1796965