Android proguard, keep inner class

后端 未结 6 1685
故里飘歌
故里飘歌 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:40

    Most of the top answers does the job but they are using wildcard (*;) for adding everything which is not the accurate answer. Below configuration only adds the fields and method properties to preserve inner class methods.

    -keepattributes Exceptions,InnerClasses,Signature, ...
    
    # preserve class and nested classes' fields and methods
    -keep class com.abc.package.clazzes.** {
        ;
        ;
    }
    
    

提交回复
热议问题