7

How to keep private Inner Class in ProGuard. I am already using($ for inner class) below code in my proguard.cfg but its not working.

-keep public class com.xxx.droid.activity.LoginActivity$JsInterface
Subrat
  • 3,928
  • 6
  • 39
  • 48

2 Answers2

12

This should work:

-keep public class com.xxx.droid.activity.LoginActivity$* {
        *;
 }
Jainendra
  • 24,713
  • 30
  • 122
  • 169
11

If the inner class is private, you shouldn't use the public keyword in the template, because it won't match. The compiler will actually compile the class as a package visible class (private classes don't exist at a bytecode level). Therefore:

-keep class com.xxx.droid.activity.LoginActivity$JsInterface
Eric Lafortune
  • 45,150
  • 8
  • 114
  • 106