Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use jarsigner for signing an apk?

Tags:

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?

like image 756
user3143901 Avatar asked Jan 30 '14 13:01

user3143901


People also ask

How do I sign an APK file?

Sign an APK You can include this information in two different ways: Specify a KeyStore file using the --ks option. Specify the private key file and certificate file separately using the --key and --cert options, respectively. The private key file must use the PKCS #8 format, and the certificate file must use the X.

Which key is used for signing an .APK file using Jarsigner utility?

Sign the APK – This step involves using the apksigner utility from the Android SDK and signing the APK with the private key that was created in the previous step. Applications that are developed with older versions of the Android SDK build tools prior to v24. 0.3 will use the jarsigner app from the JDK.

Can we manually sign a APK?

The app signing key is private and must be kept secret. You can, however, share the certificate that is generated using your app signing key. Upload key: The key you use to sign the app bundle or APK before you upload it for app signing with Google Play. You must keep the upload key secret.


1 Answers

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

like image 128
TomTasche Avatar answered Oct 02 '22 13:10

TomTasche



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!