Using Proguard to obfuscate your classes in your midlets is a must. The jar size is reduced and the code is optimized.
But when I obfuscated my app an error is displayed and the jar is not obfustaced. The error is similar to:
java.lang.ArrayIndexOutOfBoundsException: 2
WTF is this? :)
I don't know why, I didn't download the source of proguard (BTW this amazing tool is opensource)
How to fix it? Two options:
* disable optimization. It's not the best option but it helps. Use parameter -dontoptimize
* disable optimization partially. I used this option. The last proguard has many parameters for optimization, and I found the parameter that worked in my midlet:
-optimizations !method/marking/static
this means the optimizer will avoid marking methods as static.
It worked for me, I hope it works for you.
Proguard optimizations site: http://proguard.sourceforge.net/manual/optimizations.html
Great help. Spent hours trying to sort through this, but your entry here quickly got me on the right track. In my case, !method/removal/* did the trick.
ReplyDeleteThanks both of you, especially Anonymous - you guys saved my day! :)
ReplyDeleteThat works for me, thanks for the tip!!
ReplyDelete