I have a set of classes (more than 50) that contain a few static methods called parse()
that returns an instance of that class. This is an example of one of those classes:
class SomeType {
// Parse methods
public static SomeType parse(String text) { ... }
public static SomeType parse(Object obj) { ... }
...
// Other methods
public void static somethingStatic(...) { ... }
public void somethingNotStatic(...) { ... }
...
}
I'm trying to configure ProGuard to obfuscate these classes and all their methods and fields except the parse(...)
methods. Basically, I want to obfuscate the class name, all static and non-static methods, plus the class fields.
I've tried to use:
-keepclassmembers class SomeType {
public static SomeType parse(***);
}
and that worked fine for SomeType
, but I don't want to have to write this rule for each of my 50 classes... so how can I generalize it?
I tried:
-keepclassmembers class ** {
public static * parse(***);
}
but ProGuard complains about the syntax of the return type...