I obfuscated a public inner class, e.g.
public class OuterClass {
public static class ProblemWithInnerClass {
}
}
In another class I access the public inner class, e.g.
public class ObfuscatorTest {
public static void main(String[] args) {
OuterClass.ProblemWithInnerClass test;
}
}
This is a common pattern where OuterClass stands for
a library and ObfuscaterTest is an application using that
library.
The problem is now that I cannot compile the class
ObfuscatorTest! The javac compiler tells me the
following:
"Error: (9, 21) cannot resolve symbol class
ProblemInnerClass"
It only happens for inner classes. Maybe it is related to
the limitation you mention that ProGuard's obfuscation
process doesn't follow the naming rule specifying that
internal classes must be named as
ExternalClass$InternalClass.
Logged In: YES
user_id=555208
You're right. I'm surprised noone has reported this before.
It appears one also has to keep the file name part of the
InnerClasses attribute, in order to keep the inner class
accessible. The following option will do just that:
-keepattributes InnerClasses
That's pretty painless. It should be added to the
library.pro example.
Thanks for your report!
Eric.