J2ME Wireless Toolkit Integration

ProGuard can be seamlessly integrated in the Sun J2ME Wireless Toolkit (WTK).

The WTK already comes with a plug-in for ProGuard as of version 2.0. Alternatively, ProGuard offers its own implementation. The latter implementation is somewhat more efficient: it invokes the ProGuard engine directly, instead of writing out a configuration file and running ProGuard in a separate virtual machine.

In order to integrate this plug-in in the toolkit, you'll have to put the following lines in the file {j2mewtk.dir}/wtklib/Linux/ktools.properties or {j2mewtk.dir}\wtklib\Windows\ktools.properties (whichever is applicable).

obfuscator.runner.class.name: proguard.wtk.ProGuardObfuscator
obfuscator.runner.classpath: /usr/local/java/proguard/lib/proguard.jar

Please make sure the class path is set correctly for your system.

Once ProGuard has been set up, you can apply it to your projects as part of the build process. The build process is started from the WTK menu bar:

Project -> Package -> Create Obfuscated Package

This option will compile, shrink, obfuscate, verify, and install your midlets for testing.


Copyright © 2002-2003 Eric Lafortune.