In my proguard, I have the following to keep public enums from being obfuscated.
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
My question is, does this also keep the public enum Currency in a class like this?
public class Foo {
public enum **Currency** {PENNY, NICKLE, DIME, QUARTER};
...
}
If not, what do I have to add separately?
Adding the following doesn't seem to help.
-keepattributes InnerClasses
Any advice? Thanks
If you want to safe enum names and all fields, methods for it:
-keep enum * { *; }
You could try
-keep public enum com.stuff.TheEnclosingClass$** {
**[] $VALUES;
public *;
}
As shown on this answer Proguard won't keep a class member's enums
Just don't forget to put
-keepattributes InnerClasses
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With