andbook!.pdf - Learning Android Get an anddev.org - Android-Shirt Back to index
anddev.org Header Logo
FAQ Search Top rated articles Browse Feeds anddev.org - Authors Contact Details Register Log in

Signing your apk/application for release (keytool,jarsigner)

Goto page Previous  1, 2, 3  Next
 
       anddev.org - Android Development Community | Android Tutorials | Index -> Advanced Tutorials
Author Message
darolla
Master Developer
Master Developer


Joined: 25 Sep 2008
Posts: 228
Location: Dortmund, Germany

PostPosted: Wed Dec 10, 2008 11:07 am    Post subject: Reply with quote

use export like this Very Happy


exort.jpg
 Description:
how to export unsigned .apk
 Filesize:  57.46 KB
 Viewed:  7460 Time(s)

exort.jpg


Back to top
View user's profile Send private message
sazabo
Junior Developer
Junior Developer


Joined: 19 Nov 2008
Posts: 24

PostPosted: Wed Dec 10, 2008 6:19 pm    Post subject: I did use export, jarsigner error no valid keystore Reply with quote

thanks for the post

I was setting -verify and it was not asking for the passwd, fix that but...

I do have some more info

C:\mykeytools>c:\"Program Files"\Java\jdk1.6.0_07\bin\jarsigner -verbose -keysto
re c:\mykeytools\keys\csi.keystore -signedjar mymedbox_signed.pdk pmPhr.apk csi.
keystore
Enter Passphrase for keystore:
jarsigner: Certificate chain not found for: csi.keystore. csi.keystore must ref
erence a valid KeyStore key entry containing a private key and corresponding pub
lic key certificate chain.

Here is the list output form the keytool not sure what a good out put should be I only see a PrivateKeyEntry. Should there be at Public?

C:\mykeytools>c:\"Program Files"\Java\jdk1.6.0_07\bin\keytool -list -alias comsi
key -keystore keys/csi.keystore
Enter keystore password:
comsikey, Dec 10, 2008, PrivateKeyEntry,
Certificate fingerprint (MD5): 67:6E:F4:40:47:D3:F7:65:32:93:83:83:5F:AB:BD:13
C:\mykeytools>
Back to top
View user's profile Send private message
sazabo
Junior Developer
Junior Developer


Joined: 19 Nov 2008
Posts: 24

PostPosted: Wed Dec 10, 2008 10:21 pm    Post subject: Found it!! Reply with quote

looks like the jarsigner -signed flag is not working correctly. I resigned the jar with the simplest variation and it worked.

thanks

Jeff
Back to top
View user's profile Send private message
avolovoy
Experienced Developer
Experienced Developer


Joined: 03 Nov 2008
Posts: 68
Location: kansas

PostPosted: Thu Dec 11, 2008 4:05 pm    Post subject: Reply with quote

soniya wrote:

How to use "export" function????

Really ? That is the question ? I don't mean to be rude, but dammit..

Something tells we're up to see some interesting applications.

_________________
Alexey Volovoy
Bytesharp.NET
Back to top
View user's profile Send private message Visit poster's website
MrSnowflake
Moderator
Moderator


Joined: 16 Feb 2008
Posts: 1437
Location: Flanders, Belgium

PostPosted: Thu Dec 11, 2008 6:12 pm    Post subject: Reply with quote

avolovoy wrote:
Something tells we're up to see some interesting applications.
You haven't seen many questions here yet, I guess... Very Happy
Back to top
View user's profile Send private message
sazabo
Junior Developer
Junior Developer


Joined: 19 Nov 2008
Posts: 24

PostPosted: Thu Dec 11, 2008 8:07 pm    Post subject: bad flag -signed Reply with quote

I fixed it thanks,

I removed the option flag -signed and it worked???

Bleeding edge

thanks
Back to top
View user's profile Send private message
Sparkletron
Developer
Developer


Joined: 04 Nov 2008
Posts: 26

PostPosted: Fri Dec 12, 2008 4:15 am    Post subject: Reply with quote

darolla wrote:
well, this tutorial works fine. but only one time. after updating your source code, and updating version name and version number in manifest.mf, deploying wont work anymore on g1.


I have no solution but I can confirm this. First time it worked. Every subsequent install fails.
Back to top
View user's profile Send private message
sazabo
Junior Developer
Junior Developer


Joined: 19 Nov 2008
Posts: 24

PostPosted: Fri Dec 12, 2008 5:18 pm    Post subject: update Reply with quote

Try just updating the version number

Jeff
Back to top
View user's profile Send private message
Sparkletron
Developer
Developer


Joined: 04 Nov 2008
Posts: 26

PostPosted: Fri Dec 12, 2008 9:47 pm    Post subject: Re: update Reply with quote

sazabo wrote:
Try just updating the version number
Jeff


That was already tried by darolla and I can confirm it has no effect whatsoever. The actual error is...

Package [my.package] signatures do not match the previously installed version; ignoring!

In the user data folder that we don't have access to, the G1 continues to store some reference to the file even *after* it's removed. And then it compares the digital sigs of every subsequent app with the original. If they don't match it rejects them. Now the question is: why don't the sigs match? Is there something about the formulation of that jarsigner command that creates a new sig each time? Certainly we are using the same keystores.
Back to top
View user's profile Send private message
KanedaSyndrome
Developer
Developer


Joined: 11 Nov 2008
Posts: 41

PostPosted: Tue Jan 06, 2009 2:00 am    Post subject: Reply with quote

Sorry, but I have no experience what so ever with signing and this tutorial really explains nothing to me..

I have created the folders in my workspace folders.. that keytool and key folder.. But that is about it, trying to run the command just tells me that there is no such thing as a keytool executable, which is kinda an expected response seeing as I just have an empty folder...

Also I can't find a keytool program anywhere, and that is with having Eclipse Ganymedes and android sdk of course.. I have exported my .apk file, but haven't really gotten to the point of "signing" it yet since I don't even have the keytool thingie set up, but really, this is something I have never ever used before, so please don't get patronizing on me.

Perhaps this is one of those things that would have eluded me when I have never ever worked with Java before?

Btw, am using winXP so it is Eclipse, Android SDK and cmd that I have at my disposal for this, I am sure it is super easy, if just someone would explain in 100% detail how to do this since I have no clue... Easy enough to follow the tutorial once I have the missing pieces.. like the keytool and jarsigner programs.. not sure if those are some I should download separately of if they come with the Android SDK or Eclipse IDE somewhere..

[update]
Been looking around for a bit now.. and well, nothing call keytool, so no program to launch from my cmd that can create that key thingies.. So probably no jarsigner either..

Tbh, I would have thought this would've been an automated Eclipse function, what's up with making it so complicated when it could be soo simple.. I really need this damn program signed before one day has passed.. Didn't think this would be the thing to halt me.. Sad
Back to top
View user's profile Send private message
KanedaSyndrome
Developer
Developer


Joined: 11 Nov 2008
Posts: 41

PostPosted: Tue Jan 06, 2009 2:49 am    Post subject: Reply with quote

Ok I downloaded some keytool plugin for Eclipse..

But seriously, us here that have not done Java nor Linux or something before, we need a step by step guide for making it work with Eclipse..

And download links to the Keytool and jarsigner applications please...

It might be that I am tired, but I just can't make it work..

The keytool plugin I downloaded let me make a certificate, but couldn't reopen it with either passwords I made... And I don't know what this "keystore" thing is, I assume it is a bundle file where you can keep all your cerficicates/keys in?

Need this stuff explained really, never ever ever used it before in my life.. I need to know how to:

create that key thingie for my exported .apk file

sign said .apk file

if I need to download any programs to do this, is keytool and jarsigner something I need to download first to be able to use.
Back to top
View user's profile Send private message
glassfish
Freshman
Freshman


Joined: 18 Jan 2009
Posts: 9

PostPosted: Sun Jan 18, 2009 11:00 pm    Post subject: Use Keytool On Windows Vista / XP / Eclipse Reply with quote

This describes it pretty well:

http://groups.google.com/group/android-developers/browse_thread/thread/38545a723378005f/7cfc6ca3237bf348?lnk=raot
Back to top
View user's profile Send private message Visit poster's website
kanzlr
Developer
Developer


Joined: 15 Mar 2009
Posts: 25
Location: Vienna/Austria/EU

PostPosted: Sun Mar 15, 2009 5:09 pm    Post subject: Re: update Reply with quote

found a solution to this on the android developer mailing list. you just have to delete your package from the

/data/system/packages.xml

file if you change the signature.



Sparkletron wrote:
sazabo wrote:
Try just updating the version number
Jeff


That was already tried by darolla and I can confirm it has no effect whatsoever. The actual error is...

Package [my.package] signatures do not match the previously installed version; ignoring!

In the user data folder that we don't have access to, the G1 continues to store some reference to the file even *after* it's removed. And then it compares the digital sigs of every subsequent app with the original. If they don't match it rejects them. Now the question is: why don't the sigs match? Is there something about the formulation of that jarsigner command that creates a new sig each time? Certainly we are using the same keystores.
Back to top
View user's profile Send private message Visit poster's website
lostInTransit
Developer
Developer


Joined: 12 Feb 2009
Posts: 26
Location: India

PostPosted: Mon Mar 23, 2009 6:52 pm    Post subject: Re: Found it!! Reply with quote

sazabo wrote:
looks like the jarsigner -signed flag is not working correctly. I resigned the jar with the simplest variation and it worked.

thanks

Jeff


Jeff, can you please post the exact commands that you used. I am facing a similar issue when signing my apk using jarsigner.

Thanks.
Back to top
View user's profile Send private message
guruk
Junior Developer
Junior Developer


Joined: 08 Mar 2009
Posts: 23

PostPosted: Wed Apr 01, 2009 2:15 pm    Post subject: Reply with quote

I get the following Error from jarsigner .. what can i do??

Enter Passphrase for keystore:
Exception in thread "main" java.util.zip.ZipError: jzentry == 0,
jzfile = 34283992,
total = 22,
name = mydays04.apk,
i = 1,
message = null
at java.util.zip.ZipFile$2.nextElement(ZipFile.java:321)
at java.util.zip.ZipFile$2.nextElement(ZipFile.java:299)
at sun.security.tools.JarSigner.getManifestFile(JarSigner.java:1554)
at sun.security.tools.JarSigner.signJar(JarSigner.java:892)
at sun.security.tools.JarSigner.run(JarSigner.java:203)
at sun.security.tools.JarSigner.main(JarSigner.java:74)

greets
chris
Back to top
View user's profile Send private message
Display posts from previous:   
       anddev.org - Android Development Community | Android Tutorials | Index -> Advanced Tutorials All times are GMT + 1 Hour
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


© 2007, Android Development Community
All rights reserved.
Powered by phpBB.