1

I am primarily interested in obfuscation capability. I see obfuscation only is possible: stackoverflow.com/questions/6633411/android-proguard-only-obfuscation

Is this less obfuscated than when using in combination with shrinking and optimizing, and if so how much less secure.

Also will removing the shrinking and optimizing make the application more likely to pass its test set, and less likely to have anomalies? What is the + and - of including these steps?

Community
  • 1
  • 1
Code Droid
  • 10,344
  • 17
  • 72
  • 112

2 Answers2

7

Shrinking certainly can affect the correctness of your code. If for example you set a clickhandler in an xml layout with a line like:

 android:onClick="myClickHandler"

then unless you explicitly tell Proguard to keep that code, it will remove it when shrinking is enabled. This error won't manifest itself until runtime when that widget is clicked/touched.

NickT
  • 23,844
  • 11
  • 78
  • 121
2

Shrinking and optimizing won't affect correctness at all; your program will work perfectly correctly. Realistically, the only way Proguard can introduce errors is to mess with certain aspects of reflection, and that'll be due to obfuscation, not shrinking or optimizing.

If you're asking how much shrinking and optimizing changes the size of the jars, check out http://proguard.sourceforge.net/#results.html for sample statistics.

Louis Wasserman
  • 191,574
  • 25
  • 345
  • 413
  • will removing shrinking and optimization make the code substantially less obfuscated? – Code Droid Apr 12 '12 at 19:53
  • ...Probably, yes. Decompiling will definitely be more difficult after shrinking and optimization, just because ProGuard isn't limited to bytecode constructs that can be constructed only with valid Java. – Louis Wasserman Apr 12 '12 at 21:33