views:

1168

answers:

3

An important part of mobile development, especially when you are talking about mobile games, is dealing with the application size restrictions. Some devices enforce their own size limits, while all the carriers have their own size requirements for applications to be released in their deck space.

My question is, is there a java obfuscation application that gets better size reduction results than the other java obfuscation apps that are out there?

I use Proguard because it is the default Netbeans obfuscator and you can get fairly good size reduction results out of it (by the way, the version of Proguard that comes with Netbeans 6.1 is 3.7. There are newer versions that get even better results, I recommend getting the latest). But, I'm interested in what else is out there and whether they do a better job than Proguard.

My Conclusion:

I appreciate the responses. Carlos, your response was enough to convince me that Proguard is the current way to go. I could still be convinced otherwise, but don't feel bad with my current setup.

I have also had some issues with proguard obfuscating and running on some phones, but not too many. I was always able to fix the problem by not using the Proguard argument "-overloadaggressively". Just something to keep in mind if you are experiencing odd behavior related to obfuscating.

Thanks again.

+5  A: 

I also prefer ProGuard for both it's size reduction and breadth of obfuscation - see http://proguard.sourceforge.net/. I don't necessarily have size constraints other than download speeds, but haven't found anything that shrinks further.

Steve Moyer
+3  A: 

When it comes to J2ME and obfuscation it pays to be a bit cautious. Proguard is the best choice because of the many years it has been in development, and the many bugfixes that it has received. I remember the version transition between 2.X and 3.X and how it broke many of my (then) employer builds. This happened because some of the changes that enabled more size savings also broke the class files in subtle ways in some handsets, while being perfectly fine in others and on desktop JVMs.

Nowadays Proguard 3.11 is the safest choice in obfuscators. 4.XX is probably fine if you don't have to support very old handsets.

Carlos Carrasco
+2  A: 

Strange that no one remembered that ProGuard can not just shrink and obfuscate the code, but optimize as well. The last versions allow to specify several passes for optimization (by default there is a single pass), I may specify, say, 9 passes.

After I decompile my classes I can hardly recognise them, ProGuard restructures a lot of method calls. All it takes is just a bit of tweaking this wonderful app. So I think ProGuard is the way to go, just don't forget to adjust it a little. It also has a very nice manual.

Malcolm