I've been obfuscating my apps for a long while, with the following settings I took like mantras, because they were Google's recommendations
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
However, the other day I commented this line by mistake, the app got built correctly, and "apparently" works. I've made a lot of tests and couldn't made it crash.
So I wonder if those disabled optimization settings are needed ...
- as of today's Android SDK and latest Proguard versions, I only target devices from Android 4.0.3 onwards (15), and use Proguard 5.1.
- and for applications that don't do exotic stuff and have a properly written
proguard.cfg
instructing to keep the relevant problematic classes, etc.
Most answers here releated to this very issue have conflicting information, and are related to pretty old API versions.
One by one:
!code/simplification/arithmetic
I found a discussion on Google Groups where they say that simplification/arithmethic
is not needed for SDK's after Android Donut. I assume then, I can safely enable this optimization.
!class/merging/*
It looks like proguard makes a good job in my projects with this optimization turned on:
[proguard] Number of vertically merged classes: 296
[proguard] Number of horizontally merged classes: 445
Are there other side effects besides the stack traces being incorrect? I mean, side effects related to the application crashing rather than to debug issues. I found this related question but it doesn't conclude wether it is safe or not.
!field/* and !code/simplification/cast
I read in this question answered by ProGuard's author that those were included to avoid bugs with older Proguard versions. So is it safe to activate them on Proguard 5.1?