Ignore external libraries with Android proguard

后端 未结 3 775
生来不讨喜
生来不讨喜 2021-01-06 02:51

I want to use Proguard mainly for obfuscation reasons.

I have a problem with proguard in Android. I used simpleframework to parse XML; its external.

In prog

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-06 03:19

    Thanks to eXistPierre post, this is the minimum I needed to get it working:

    -libraryjars /lib/rt.jar(java/**,javax/**)
    -keep public class org.simpleframework.**{ *; }
    -keep class org.simpleframework.xml.**{ *; }
    -keep class org.simpleframework.xml.core.**{ *; }
    -keep class org.simpleframework.xml.util.**{ *; }
    -keepattributes *Annotation*
    -keepattributes Signature
    

    I also needed to add the following so I could read and write my class objects:

    -keepclassmembers class com.package.app.ClassItem{ *; }
    

提交回复
热议问题