给apk签名
一、签名
把apk和签名文件放在jdk bin目录下,然后在jkd bin目录下执行以下代码:
jarsigner -verbose -keystore xxx.keystore -signedjar android-release-signed.apk android-release-unsigned.apk xxx.keystore
这一步是签名
二、优化对齐
把生成的 android-release-unsigned.apk 放在 androidsdk\build-tools\x.x.x目录下,运行以下命令:
zipalign -v 4 android-release-signed.apk android-release-signed-zipaligned.apk
参考:https://developer.android.com/studio/publish/app-signing.html