Lets say I have..
public class SomeClass {
public interface someInterface {
public void firstMethod(String variable);
public void secondMethod(String variable);
public void thirdMethod();
}
}
and I do..
-keep,includedescriptorclasses public class com.somepackage.SomeClass {
<fields>;
<methods>;
}
-keep public interface com.somepackage.someInterface {*;}
I end up with
public interface someInterface {
public void a(String variable);
public void a(String variable);
public void a();
}
How do I ensure this interface's method names are not obfuscated while still obfuscating the rest of the class?
ProGuard uses the naming convention of Java bytecode, as seen in class file names and stacktraces. Therefore:
-keep public interface com.somepackage.SomeClass$someInterface {*;}
I tried the following and it seemed to work:
-keep interface com.somepackage.SomeClass$someInterface
For those who are looking for how to keep a custom annotation (which is defined in a @interface in java) retaining its all members,
you should actually use like below to keep it:
-keep @interface com.your.annotation.interface. {*;}
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