
-禁用 release 和 debug 构建类型的代码压缩 - 添加 publishNonDefault 配置项 -将版本号从 1.0.1.9.9.126 升级到 1.0.1.9.9.127
279 lines
7.8 KiB
Prolog
279 lines
7.8 KiB
Prolog
# 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 java.lang.invoke.StringConcatFactory
|
|
|
|
# 保留行号用于调试
|
|
-keepattributes SourceFile,LineNumberTable
|
|
-renamesourcefileattribute SourceFile
|
|
|
|
# 保留基本属性
|
|
-keepattributes Signature
|
|
-keepattributes *Annotation*
|
|
-keepattributes Exceptions
|
|
-keepattributes InnerClasses
|
|
|
|
-dontwarn com.github.luben.zstd.BufferPool
|
|
-dontwarn com.github.luben.zstd.ZstdInputStream
|
|
-dontwarn com.github.luben.zstd.ZstdOutputStream
|
|
-dontwarn org.brotli.dec.BrotliInputStream
|
|
-dontwarn org.objectweb.asm.AnnotationVisitor
|
|
-dontwarn org.objectweb.asm.Attribute
|
|
-dontwarn org.objectweb.asm.ClassReader
|
|
-dontwarn org.objectweb.asm.ClassVisitor
|
|
-dontwarn org.objectweb.asm.FieldVisitor
|
|
-dontwarn org.objectweb.asm.Label
|
|
-dontwarn org.objectweb.asm.MethodVisitor
|
|
-dontwarn org.objectweb.asm.Type
|
|
|
|
# 保留R文件
|
|
-keepclassmembers class **.R$* {
|
|
public static <fields>;
|
|
}
|
|
|
|
## 保留servicing模块中的所有model类
|
|
#-keep class com.za.bean.** { *; }
|
|
#-keep class com.za.bean.db.** { *; }
|
|
#-keep class com.za.bean.request.** { *; }
|
|
#
|
|
## 保留servicing模块中的所有接口
|
|
#-keep interface com.za.servicing.** { *; }
|
|
#-keep interface com.za.net.** { *; }
|
|
#
|
|
## 保留servicing模块中的所有枚举
|
|
#-keepclassmembers enum com.za.** { *; }
|
|
#
|
|
## 保留Room数据库相关类
|
|
#-keep class com.za.room.** { *; }
|
|
#-keep class com.za.room.db.** { *; }
|
|
#-keep class * extends androidx.room.RoomDatabase
|
|
#-keep @androidx.room.Entity class *
|
|
#-keep @androidx.room.Dao interface *
|
|
|
|
# 保留Parcelable实现类
|
|
-keep class * implements android.os.Parcelable {
|
|
public static final android.os.Parcelable$Creator *;
|
|
}
|
|
|
|
# 保留Serializable实现类
|
|
-keepnames class * implements java.io.Serializable
|
|
-keepclassmembers class * implements java.io.Serializable {
|
|
static final long serialVersionUID;
|
|
private static final java.io.ObjectStreamField[] serialPersistentFields;
|
|
!static !transient <fields>;
|
|
private void writeObject(java.io.ObjectOutputStream);
|
|
private void readObject(java.io.ObjectInputStream);
|
|
java.lang.Object writeReplace();
|
|
java.lang.Object readResolve();
|
|
}
|
|
|
|
# 保留WebView相关
|
|
-keepclassmembers class * extends android.webkit.WebViewClient {
|
|
public void *(android.webkit.WebView, java.lang.String, android.graphics.Bitmap);
|
|
public boolean *(android.webkit.WebView, java.lang.String);
|
|
}
|
|
-keepclassmembers class * extends android.webkit.WebViewClient {
|
|
public void *(android.webkit.WebView, java.lang.String);
|
|
}
|
|
|
|
# 保留native方法
|
|
-keepclasseswithmembernames class * {
|
|
native <methods>;
|
|
}
|
|
|
|
## 保留View的getter和setter
|
|
#-keepclassmembers public class * extends android.view.View {
|
|
# void set*(***); *** get*();
|
|
#}
|
|
|
|
# CameraX相关
|
|
#-keep class androidx.camera.** { *; }
|
|
#-dontwarn androidx.camera.**
|
|
#
|
|
## Coil图片加载库
|
|
#-keep class coil.** { *; }
|
|
#-dontwarn coil.**
|
|
#
|
|
## PermissionX权限库
|
|
#-keep class com.permissionx.guolindev.** { *; }
|
|
#
|
|
## 高德地图相关
|
|
#-keep class com.amap.api.**{*;}
|
|
#-keep class com.autonavi.**{*;}
|
|
#-keep class com.loc.**{*;}
|
|
#-dontwarn com.amap.api.**
|
|
#-dontwarn com.autonavi.**
|
|
#-dontwarn com.loc.**
|
|
#
|
|
## JPush相关
|
|
#-dontoptimize
|
|
#-dontwarn cn.jpush.**
|
|
#-keep class cn.jpush.** { *; }
|
|
#-dontwarn cn.jcore.**
|
|
#-keep class cn.jcore.** { *; }
|
|
#
|
|
## Retrofit网络库
|
|
#-keepattributes Signature
|
|
#-keepattributes Exceptions
|
|
#-dontwarn retrofit2.**
|
|
#-keep class retrofit2.** { *; }
|
|
#-keepclasseswithmembers class * {
|
|
# @retrofit2.http.* <methods>;
|
|
#}
|
|
#
|
|
## OkHttp
|
|
#-dontwarn okhttp3.**
|
|
#-dontwarn okio.**
|
|
#-keep class okhttp3.** { *; }
|
|
#-keep class okio.** { *; }
|
|
#
|
|
## RxJava
|
|
#-dontwarn io.reactivex.**
|
|
#-keep class io.reactivex.** { *; }
|
|
#-dontwarn sun.misc.**
|
|
#-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
|
|
# long producerIndex;
|
|
# long consumerIndex;
|
|
#}
|
|
#
|
|
## BlankJ工具库
|
|
#-dontwarn com.blankj.utilcode.**
|
|
#-keep class com.blankj.utilcode.** { *; }
|
|
#-keepclassmembers class * {
|
|
# @com.blankj.utilcode.util.BusUtils$Bus <methods>;
|
|
#}
|
|
#-keep public class * extends com.blankj.utilcode.util.ApiUtils$BaseApi
|
|
#-keep,allowobfuscation @interface com.blankj.utilcode.util.ApiUtils$Api
|
|
#-keep @com.blankj.utilcode.util.ApiUtils$Api class *
|
|
#
|
|
##mmkv
|
|
#-renamesourcefileattribute SourceFile
|
|
#-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,EnclosingMethod
|
|
#-keep public class * {
|
|
# public protected *;
|
|
#}
|
|
##
|
|
### 保留所有类的方法名
|
|
##-keepclassmembernames class * {
|
|
## java.lang.Class class$(java.lang.String);
|
|
## java.lang.Class class$(java.lang.String, boolean);
|
|
##}
|
|
#
|
|
## 保留枚举类中的特殊静态方法
|
|
#-keepclassmembers class * extends java.lang.Enum {
|
|
# public static **[] values();
|
|
# public static ** valueOf(java.lang.String);
|
|
#}
|
|
#
|
|
## MQTT相关
|
|
#-keep class org.eclipse.paho.** { *; }
|
|
#-dontwarn org.eclipse.paho.**
|
|
#
|
|
## Gson
|
|
#-keep class com.google.gson.** { *; }
|
|
#-keepattributes Signature
|
|
#-keepattributes *Annotation*
|
|
#-keep class * implements com.google.gson.TypeAdapterFactory
|
|
#-keep class * implements com.google.gson.JsonSerializer
|
|
#-keep class * implements com.google.gson.JsonDeserializer
|
|
#
|
|
### Kotlin相关
|
|
###-keep class kotlin.** { *; }
|
|
##-keep class kotlin.Metadata { *; }
|
|
##-dontwarn kotlin.**
|
|
##-keepclassmembers class **$WhenMappings {
|
|
## <fields>;
|
|
##}
|
|
##-keepclassmembers class kotlin.Metadata {
|
|
## public <methods>;
|
|
##}
|
|
#
|
|
## Kotlin协程
|
|
##-keepclassmembernames class kotlinx.** {
|
|
## volatile <fields>;
|
|
##}
|
|
##-keepclassmembers class * {
|
|
## @kotlin.coroutines.jvm.internal.DebugMetadata *;
|
|
## @kotlin.coroutines.jvm.internal.SuspendLambda *;
|
|
##}
|
|
##-keep class kotlinx.coroutines.** { *; }
|
|
##-dontwarn kotlinx.coroutines.**
|
|
#
|
|
## Kotlin反射
|
|
##-keep class kotlin.reflect.** { *; }
|
|
##-dontwarn kotlin.reflect.**
|
|
#
|
|
## 保留Kotlin数据类
|
|
##-keepclassmembers class ** {
|
|
## public ** component*();
|
|
## public ** copy(...);
|
|
##}
|
|
#
|
|
## 保留Kotlin数据类的toString/hashCode/equals方法
|
|
##-keepclassmembers class ** {
|
|
## public java.lang.String toString();
|
|
## public int hashCode();
|
|
## public boolean equals(java.lang.Object);
|
|
##}
|
|
##
|
|
### 保留Compose相关
|
|
##-keep class androidx.compose.** { *; }
|
|
##-dontwarn androidx.compose.**
|
|
##
|
|
### 保留自定义签名相关类
|
|
##-keep class com.za.signature.** { *; }
|
|
##
|
|
### 保留Face Detection相关
|
|
##-keep class com.google.mlkit.** { *; }
|
|
##-dontwarn com.google.mlkit.**
|
|
#
|
|
## 保留ZXing相关
|
|
#-keep class com.google.zxing.** { *; }
|
|
#-dontwarn com.google.zxing.**
|
|
#
|
|
## 保留Glide相关
|
|
#-keep public class * implements com.bumptech.glide.module.GlideModule
|
|
#-keep class * extends com.bumptech.glide.module.AppGlideModule {
|
|
# <init>(...);
|
|
#}
|
|
#-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
|
|
# **[] $VALUES;
|
|
# public *;
|
|
#}
|
|
#-keep class com.bumptech.glide.load.data.ParcelFileDescriptorRewinder$InternalRewinder {
|
|
# *** rewind();
|
|
#}
|
|
#
|
|
## 保留FastJSON相关
|
|
#-keep class com.alibaba.fastjson.** { *; }
|
|
#-dontwarn com.alibaba.fastjson.**
|
|
#
|
|
## 保留Bugly相关
|
|
#-keep class com.tencent.bugly.** { *; }
|
|
#-dontwarn com.tencent.bugly.**
|
|
##
|
|
### 保留自定义UI组件
|
|
###-keep class com.za.ui.** { *; }
|
|
###-keep class com.za.base.** { *; }
|
|
##
|
|
### 保留Java 8 Lambda表达式
|
|
##-dontwarn java.lang.invoke.StringConcatFactory |