Android proguard, keep inner class

后端 未结 6 1677
故里飘歌
故里飘歌 2020-11-30 07:12

My android program has a class A, which has two static inner class. They are found to be stripped from .dex after applying proguard.

6条回答
  •  离开以前
    2020-11-30 07:45

    This did the trick for me

    -keepattributes InnerClasses
     -keep class com.yourpackage.YourClass**
     -keepclassmembers class com.yourpackage.YourClass** {
        *;
     }
    

    It may be a bit overkill with the wildcards but I wanted to make sure I didn't miss anything. The main thing is you need the InnerClasses attributes the keep on the class and the keepclassmembers on the class.

提交回复
热议问题