Have you ever tried to sign Java applications for Blackberry devices? It's
a real pain.
RIM ships the
JDE (Java Development Environment)
with a tool to sign JAR files, but there is a number of shortcomings:
main() method of the tool, since it has a lot of calls to System.exit()sigtool.csk file has to be in the same directory as the SignatureTool.jarTo solve at leaste the last 3 of these issues, I wrote a small wrapper for the SignatureTool that uses AspectJ to remove the password dialog, writes a file if the signing procedure was successful and lets you specify where your sign.csk file is located. In order to use this wrapper you have to:
java -javaagent:aspectjweaver.jar -jar SignatureToolRunner.jar <PATH_TO_DIR_WITH_CSK_FILE> <KEYSTORE_PASSWORD> <ARGS_FOR_SIGNING_TOOL...>If you use the command line switches -a -c and the name of the .cod file
you can sign applications fully automated. After a successful signing the SignatureToolRunner creates
a file called signing_result.txt in its working directory.
The SignatureToolRunner has been tested with JDK 1.6, AspectJ 1.5.3 and JDE 4.2.0. It probably works with other versions too, but its up to you to give it a try.
The source code is available here: SignatureToolRunnerSource.zip.
If you have any questions send an email to signaturetoolrunner [at] cive.de.