Problems with native methods
Java class file shrinker, optimizer, obfuscator, and preverifier
Brought to you by:
guardsquare
I'm using the following option to preserve native methods from
obfuscation:
-keepclassmembernames class * {
native <methods>;
}
But this is not enough, because
the preserved class name is required, too.
BTW, native
methods should *always* be kept, because it just does not make
sense to obfuscate them.
Logged In: YES
user_id=555208
You're right, the class names have to be preserved as well.
I've always dealt with classes that weren't renamed, so it
had slipped my attention. I'll update the example that
discusses native methods.
Native methods should always be kept, unless the user is
willing to obfuscate his native code manually, based on
ProGuard's obfuscation map. In general, I'd like to leave
all options open to the user. In this case, there isn't a
single directive you can specify; you'll have to explicitly
list your classes with native methods. If the configuration
becomes too cumbersome, I might consider hard-coding it. Of
course, everyone is free to change his copy of the source
code to suit his personal tastes. :)
Eric.