I have the following:
public class A extends B {
static class C {
Object field1;
int field2;
boolean field3;
}
}
I cannot get the C class via reflection!
I've tried the following:
-keep class com.path.to._class.A$** {*;}
-keep class com.path.to._class.A$* {*;}
-keep class com.path.to._class.A$C {*;}
-keep class com.path.to._class.A$C {
<fields>;
}
-keep class com.path.to._class.A$C {
Object field1;
int field2;
boolean field3;
}
None of the above worked. Am I doing something completely wrong here?
Perhaps its worth mentioning that B extends View...
-keepclassmembernames. This is the most permissive keep directive; it lets ProGuard do almost all of its work. Unused classes are removed, the remaining classes are renamed, unused members of those classes are removed, but then the remaining members keep their original names.
Inner Classes As with instance methods and variables, an inner class is associated with an instance of its enclosing class and has direct access to that object's methods and fields. Also, because an inner class is associated with an instance, it cannot define any static members itself.
Which statement is true about a static nested class? You must have a reference to an instance of the enclosing class in order to instantiate it.
All of those should work (only Object -> java.lang.Object). You can check bin/proguard/seeds.txt to see if they are listed. Otherwise, you might be modifying the wrong configuration file, or there might be a typo in the names.
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