10-27-2009 08:24 AM - edited 10-27-2009 08:28 AM
I have a j2me application consisting of a jad and a jar file. I want to create a .cod file, sign it and put it on a web server for ota downloads.
I have created the .cod like this (blackberry jde 4.7.0):
rapc.exe -import=net_rim_api.jar codename=appname -midlet -jad=appname.jad appname.jar
This creates a .cod file ok.
The problem now is that the jad file is not updated with the rim specific jad properties.
I have used the http://www.jatfq.com/archives/20 to extract the properties from the cod file
java -jar cod2jad.jar appname.cod appname
This outputs the properties that should be added to the jad file:
RIM-COD-SHA1: 5d ca c0 97 59 27 1d 7b fb de f7 b8 9f 32 48 e1 12 43 a2 b9
RIM-COD-SHA1-1: 0d df 87 09 70 c0 82 1f f3 bd 13 90 a2 0d e9 d5 e4 82 94 17
RIM-COD-SHA1-2: b9 7a 82 c9 67 1e 91 94 f5 89 94 a1 1c ba 6d 25 ce ad cb 8d
I have uploaded this jad file to my web server, set the mime types for jad and cod and unpacked the cod file to be able to provide the appname.cod, appname-1.cod and appname-2.cod for download.
This works fine and the blackberry (8900 and 9000 models) are able to download, install and run ok.
Now to the problem. If I sign the cod file, its not possible to extract the child cod files from the main cod to provide them for download.
file #1: bad zipfile offset (lseek): 557056
file #2: bad zipfile offset (lseek): 630784
file #3: bad zipfile offset (lseek): 696320
Is it possible to provide signed applications OTA that consist of more than one child cod file?
How do I first sign and then unpack?
Solved! Go to Solution.
10-27-2009 09:03 AM
You need to sign the COD file that is actually a ZIP archive. The Signature Tool will unpack it, sign the individual modules, and then repack. I've never seen it not work. You then need to unpack the signed COD and reference the unpacked files in your JAD file, same as you did for the unsigned COD.
10-27-2009 09:26 AM
Yes, what I did was to sign the original cod file that rapc.exe created from the jar file. It is not the actual signing process that fails.
The only way i've managed to install a cod from a jad file OTA is to unpack the cod zip and provide it's contained cod files on the web server.
Without the cod2jad.jar helper application, i'm not able to create a jad file that contains the rim specific attributes (RIM-COD-SHA1 and so on)
1. create cod file
2. sign cod file
3. create a jad file that holds all the rim specifics? <-- This is the main step where I fail
10-27-2009 09:55 AM
I thought you said you couldn't generate a signed COD that would work...
There isn't much mandatory information that you need to provide in the JAD. For example, SHA-1 hashes are optional. It's pretty trivial to generate a JAD file.