1

I am using proguard GUI to obfuscate my java code.

My requirement is I don't want to obfuscate my Getter and setters. Is there any option in the proguard GUI to exclude the obfuscation for the Getter, setters alone.

If so please provide me where to specify with an example.

Karthick88it
  • 601
  • 2
  • 12
  • 28

2 Answers2

7

You can add the following rules to keep all getters/setters:

-keepclassmembers class * {
    *** get*();
    void set*(***);
}

Assuming that your setters do not return a value.

T. Neidhart
  • 6,060
  • 2
  • 15
  • 38
0

With Dotfuscator you have to add a custom exclusion rule like this (see the documentation for details) enter image description here

Homer1982
  • 441
  • 4
  • 16