Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
New Developer
Posts: 3
Registered: ‎10-27-2009
My Device: Not Specified
Accepted Solution

Providing a signed COD from jad/jar for OTA downloads

[ Edited ]

 

 

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-URL: appname.cod
RIM-COD-Size: 77128
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-URL-1: appname-1.cod
RIM-COD-Size-1: 59748
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-URL-2: appname-2.cod
RIM-COD-Size-2: 49424
RIM-COD-SHA1-2: b9 7a 82 c9 67 1e 91 94 f5 89 94 a1 1c ba 6d 25 ce ad cb 8d
RIM-COD-Module-Name:appname
RIM-COD-Module-Dependencies: net_rim_cldc
RIM-COD-Creation-Time: 1202924527


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.

 


unzip appname.cod
Archive: appname.cod
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?

 

 

 

 

 

 

 

 

 

 

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Providing a signed COD from jad/jar for OTA downloads

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.

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Providing a signed COD from jad/jar for OTA downloads

If signing the composite COD still doesn't work, you can always sign the unpacked modules individually.

New Developer
Posts: 3
Registered: ‎10-27-2009
My Device: Not Specified

Re: Providing a signed COD from jad/jar for OTA downloads

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

 

 

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Providing a signed COD from jad/jar for OTA downloads

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.

New Developer
Posts: 3
Registered: ‎10-27-2009
My Device: Not Specified

Re: Providing a signed COD from jad/jar for OTA downloads

Actually, I have gotten it working now when unpacking the cod first and signing the child cod's file by file. Thanks