Android ProGuard - only obfuscation

15,512

Yes, by specifying

-dontshrink
-dontoptimize

You can find details on all configuration options in the ProGuard manual.

Note that shrinking and optimization may help preventing reverse engineering a bit.

Share:
15,512
Vinoth
Author by

Vinoth

Updated on June 16, 2022

Comments

  • Vinoth
    Vinoth almost 2 years

    Is it possible to use ProGuard for only obfuscation. I don't want ProGuard to remove any classes from my projects. My intention to use ProGuard is only for obfuscation so as to prevent reverse engineering.

  • Vinoth
    Vinoth almost 13 years
    Thanks.I tried -dontoptimze before but it was still removing class files. When i tried both -dontshrink and -dontoptimize it works.
  • Vinay W
    Vinay W about 9 years
    Hello, Its 2015 and things have changed. The android world is moving to gradle, for one. Is this still supposed to work? With Gradle?
  • arnt
    arnt almost 9 years
    Why would shrinking optimizing help prevent reverse engineering?
  • Ankesh kumar Jaisansaria
    Ankesh kumar Jaisansaria about 8 years
    @Eric Lafortune How to Obfuscate code. I also want to only rename classes so that the decompiled code is unreadable. If I dont write anything in Proguard.pro then will it rename all the classes
  • NukeouT
    NukeouT over 7 years
    Is this what I need to get it to run? # Add project specific ProGuard rules here. -dontshrink { *; } -dontoptimize { *; }
  • tribbloid
    tribbloid almost 7 years
    No it doesn't work, a quick experiment is to keep everything (**) in a jar. The output jar is still much smaller (about 3/4 in size)