A Step By Step Guide to Getting One’s Android App Signed for Release
Dec 15
Now I must say that the Android Developer’s Guide to Signing Your Applications explains the process well enough, but a step by step guide still make things much easier.
And this, I found this little gem from the talkandroid.com forum by Destorythenseek. Now my experience with forum posts is they have a higher chance of it getting deleted than other corners of information (To be fair, blogs that is hosted on its own have an even higher chance. An abandoned blog means eventual shut down after ending payment, a blog on WordPress just get a left abandoned with last post dating to something like 2004.)
Either way, I’ll quote his writings here:
Hey Guys,
I had a really really really hard time figuring this out so here is exactly how to do it for those of you who need/want it.First of all,
jarsigner and keytool are .exe files that help create your “signed” application for release to the market to prevent fraud.1.
Make a folder somewhere called “keytools” and make a folder in that called “keys”2.
If you’re using Eclipse, in Package Exp window… right click on your project -> Android Tools -> Exports Unsigned Application Package … Save in keytools
“filename.apk” or something.3. Check
“C:\Program Files\Java\jdk1.6.0_12\bin” for jarsigner and keytools..
… or whatever jdk version you haveIf you DONT have it install the following .. https://cds.sun.com/is-bin/INTERSHOP…-CDS_Developer
4. open cmd.exe,
5. cd your way to where you have your keytools folder…
I had to do.. cd desktop, cd g1, cd keytools to get to C:\Users\Anton\Desktop\G1\keytools\In this directory is you apk file which we will manipulate.
type the following now (or something similar to my example)…
C:\”Program Files”\Java\jdk1.6.0_12\bin\keytool -genkey -alias donate.keystore -keyalg RSA -validity 20000 -keystore keys/donate.keystoreThen you will have be presented with:
Enter keystore password: (type in a password you will use)
Re-enter new password: (type in same password here)
What is your first and last name? Anton
What is the name of your Organization unit? (You dont have to type anything really)
What is the name of your city or locality?
What is the name of your state or providence?
what is the two-letter country code for this unit? US
is CN=Anton C=US correct?
[no]: yes (type yes there)
Enter key password for <donate.keystore>
<RETURN if same as keystore password>: (push enter)6.
type the following now (or something similar to my example)…
C:\”Program Files”\Java\jdk1.6.0_12\bin\jarsigner -verbose -keystore key/donate.keystore -signedjar Donate_signed.apk Donate.apk donate.keystoreEnter Passphase for keystore: (your password you made earlier)
adding: META-INF/MINFEST.MF ….
…….
…..
…Signing: classes.dexand you’re all set! you signed your Doante_signed.apk file or whatever you wanted to create!
Congratulations.
NOW STOP BEING FRUSTRATED LIKE I WAS FOR HOURS!
From there, I have a few observations that might make the step by step guide a little easier to read.
C:\”Program Files”\Java\jdk1.6.0_12\bin\keytool -genkey -alias donate.keystore -keyalg RSA -validity 20000 -keystore keys/donate.keystore
-alias is to make a screenname. It doesn’t have to be name.keystone. It could just be avo if you wish.
-validity is based on number of days. 10,000 can suffice.
-keystone is for naming the keystone. I think the .keystone is necessary, but there no need for any slashes. I used hyphens (or maybe it’s a dash).
C:\”Program Files”\Java\jdk1.6.0_12\bin\jarsigner -verbose -keystore key/donate.keystore -signedjar Donate_signed.apk Donate.apk donate.keystore
The interesting part of this is unlike the developer guide’s example, this shows how to take the original Apk and sign it while saving it as a separate instead of overwriting it. I also want to remind that the “donate.keystone” is alias name. This is why I was talking about an alias can just be “Avo” or “Avo.keystone” instead of using a similar name 3 times. It just makes things easier to read.

Recent Comments