Applying Obfuscation by Itself

Is it possible to only use Proguard for obfuscation? I want to avoid stripping any classes from my projects. My intention to use ProGuard is only for obfuscation so as to prevent reverse engineering.

That’s definitely possible! At its core, ProGuard is split into three distinct processing phases that can be toggled on/off separately:

  • Shrinking, can be disabled by adding the rule -dontshrink
  • Optimization, can be disabled by adding the rule -dontoptimize
  • Obfuscation, can be disabled by adding the rule -dontobfuscate

The short answer for you is to add these rules to your PG config:

-dontshrink
-dontoptimize

But if you want to get the most obfuscation possible, make sure to consider this post that discusses the added value of optimization from a security perspective:


and see if you maybe want to enable optimization after all :wink:

3 Likes