# Add project specific ProGuard rules here. # You can control the set of applied configuration files using the # proguardFiles setting in build.gradle. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html # If your project uses WebView with JS, uncomment the following # and specify the fully qualified class name to the JavaScript interface # class: #-keepclassmembers class fqcn.of.javascript.interface.for.webview { # public *; #} # Uncomment this to preserve the line number information for # debugging stack traces. #-keepattributes SourceFile,LineNumberTable # If you keep the line number information, uncomment this to # hide the original source file name. #-renamesourcefileattribute SourceFile -dontwarn org.slf4j.impl.StaticLoggerBinder -dontwarn java.lang.management.ManagementFactory -dontwarn java.lang.management.RuntimeMXBean -dontwarn org.slf4j.impl.StaticMDCBinder -dontwarn org.slf4j.impl.StaticMarkerBinder # Gson 的混淆规则 # 保持 Gson 所使用的类及其字段名称 -keep class com.google.gson.** { *; } -keep class com.google.gson.stream.** { *; } # 保持使用 @Expose 注解的字段 -keepattributes *Annotation* # 保持被序列化/反序列化的类(确保您的模型类不会被混淆) -keep class your.package.name.** { *; } # 保持使用 @SerializedName 注解的字段 -keep class ** { @com.google.gson.annotations.SerializedName ; } # 保持 Gson TypeAdapter 类 -keep class * extends com.google.gson.TypeAdapter { *; }