In my quest for ever decreasing jar files I found one “simple” optimization which gave me a 10% decrease in file size!
I use antenna and proguard with my ant scripts. I use the wtkpackage task with preverify and obfuscation.
To make this optimization work, you need to give proguard two arguments:
<argument value="-defaultpackage ''"/>
<argument value="-overloadaggressively"/>
You will also need a -keep argument for the obfuscate task (previously done by the wtkpackage task)
<argument value="-keep public class my.package.MIDlet"/>
Unfortunatly you then have to use the wtkobfuscate task, since the wtkpackage doesn’t accept arguments. And by using the obfuscate task, you manually need to preverify it
So, do a wtkpackage without preverify and obfuscation. then obfuscate and finish off with a preverify.