How to use jarsigner for signing an apk?

◇◆丶佛笑我妖孽 提交于 2019-11-29 02:36:49

问题


I have very little programming knowledge.I am able to open jar signer through the command prompt then I get various jar signer options,which i do not know how to use them.Can anyone explain me what should i type in the command prompt in order to sign the app?


回答1:


You can find all the information you need about this topic on d.android.com: http://developer.android.com/tools/publishing/app-signing.html#signapp

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore
my_application.apk alias_name

One thing that cost me a few hours already, but is also mentioned in the official documentation:

As of JDK 7, the default signing algorithim has changed, requiring you to specify the signature and digest algorithims (-sigalg and -digestalg) when you sign an APK




回答2:


Use the jarsigner as below:

jarsigner -keystore <keystore_file> -storepass <storepassword> <filenameTosigned> <alias>



回答3:


For -tsa option enter the next one:

jarsigner -verbose -tsa http://timestamp.comodoca.com/rfc3161 -sigalg SHA1withRSA -digestalg SHA1 -keystore your_keystor_name.keystore YourAPK.apk youralias_key



来源:https://stackoverflow.com/questions/21457538/how-to-use-jarsigner-for-signing-an-apk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!