From 91dfd9e5ae3c57b8f10dbda97619a03eefc2047f Mon Sep 17 00:00:00 2001 From: renhaoting <370797079@qq.com> Date: Fri, 9 Jan 2026 11:12:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B7=B7=E6=B7=86=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- StatisticReporter/proguard-rules.pro | 101 ++++++++++++++- app/build.gradle | 6 + app/proguard-rules.pro | 124 ++++++++++++++++++- base/proguard-rules.pro | 102 ++++++++++++++- bill/proguard-rules.pro | 101 ++++++++++++++- core/architecture-reflect/proguard-rules.pro | 101 ++++++++++++++- core/architecture/proguard-rules.pro | 101 ++++++++++++++- core/common/proguard-rules.pro | 102 ++++++++++++++- core/designsystem/proguard-rules.pro | 101 ++++++++++++++- core/model/proguard-rules.pro | 101 ++++++++++++++- notification/proguard-rules.pro | 101 ++++++++++++++- 11 files changed, 1031 insertions(+), 10 deletions(-) diff --git a/StatisticReporter/proguard-rules.pro b/StatisticReporter/proguard-rules.pro index 481bb43..2e21085 100644 --- a/StatisticReporter/proguard-rules.pro +++ b/StatisticReporter/proguard-rules.pro @@ -18,4 +18,103 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +#-renamesourcefileattribute SourceFile + +# ---------------------------------- 基础配置 ---------------------------------- +# 代码优化次数,通常设为5 +-optimizationpasses 5 +# 不使用混合大小写类名 +-dontusemixedcaseclassnames +# 不忽略非公共库类 +-dontskipnonpubliclibraryclasses +# 不进行预校验(Android不需要,可加快速度) +-dontpreverify +# 打印混淆详情 +-verbose +# 忽略警告 +-ignorewarnings + +# ---------------------------------- 保留重要属性 ---------------------------------- +# 保留泛型签名(重要,避免JSON解析等类型转换错误) +-keepattributes Signature +# 保留注解(如@Keep, @SerializedName等) +-keepattributes *Annotation* +# 保留异常信息 +-keepattributes Exceptions +# 保留源代码文件名和行号(便于崩溃日志分析) +-keepattributes SourceFile,LineNumberTable + +# ---------------------------------- 保留Android基本组件 ---------------------------------- +# 保留四大组件及其子类 +-keep public class * extends android.app.Activity +-keep public class * extends android.app.Application +-keep public class * extends android.app.Service +-keep public class * extends android.content.BroadcastReceiver +-keep public class * extends android.content.ContentProvider +-keep public class * extends android.app.backup.BackupAgentHelper +-keep public class * extends android.preference.Preference + +# 保持 Native 方法不被混淆 +-keepclasseswithmembernames class * { + native ; +} + +# 保持 Parcelable 序列化类不被混淆 +-keep class * implements android.os.Parcelable { + public static final android.os.Parcelable$Creator *; +} + +# 保持 Serializable 序列化的类成员不被混淆 +-keepclassmembers class * implements java.io.Serializable { + static final long serialVersionUID; + private static final java.io.ObjectStreamField[] serialPersistentFields; + private void writeObject(java.io.ObjectOutputStream); + private void readObject(java.io.ObjectInputStream); + java.lang.Object writeReplace(); + java.lang.Object readResolve(); +} + +# 保持自定义 View 的构造方法不被混淆(用于 XML 布局) +-keep public class * extends android.view.View { + public (android.content.Context); + public (android.content.Context, android.util.AttributeSet); + public (android.content.Context, android.util.AttributeSet, int); + public void set*(...); +} + +# 保持枚举类不被混淆 +-keepclassmembers enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +# 保持由 JSON 转换的 Bean 类(或者你的数据模型类)不被混淆 +-keep class com.gamedog.vididin.beans.** { *; } +-keep class com.gamedog.vididin.router.** { *; } + + +# 保留R文件中的静态字段(保证资源反射能正常工作) +-keepclassmembers class **.R$* { + public static ; +} + +# gson +-keep class com.google.gson.** { *; } +-keep class sun.misc.Unsafe { *; } +-keep class com.google.gson.stream.** { *; } +# 明确保护被@SerializedName注解的字段 +-keepclassmembers class * { + @com.google.gson.annotations.SerializedName ; +} + + +#okhttp +# OkHttp3 +-dontwarn okhttp3.** +-keep class okhttp3.** { *; } +-keep interface okhttp3.** { *; } +-dontwarn okio.** +# Retrofit2 +-dontwarn retrofit2.** +-keep class retrofit2.** { *; } +-keepattributes Signature, Exceptions \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index c36c64e..8e5b547 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -24,11 +24,17 @@ android { } buildTypes { + debug { + minifyEnabled false + zipAlignEnabled true + } release { minifyEnabled true + zipAlignEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } + compileOptions { sourceCompatibility libs.versions.javaVersion.get().toInteger() targetCompatibility libs.versions.javaVersion.get().toInteger() diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 7c2ddbd..b847dce 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -152,4 +152,126 @@ private void readObject(java.io.ObjectInputStream); java.lang.Object writeReplace(); java.lang.Object readResolve(); -} \ No newline at end of file +} + + + + + + +##############加密混淆########### +########腾讯X5内核浏览器中的的代码不被混淆##### +-keep class com.tencent.** {*;} +########RSA中的代码不被混淆 +-keep class Decoder.** {*;} +-keep class org.bouncycastle.** {*;} + +################Glide加载图片添加混淆 +-keep public class * implements com.bumptech.glide.module.GlideModule +-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** { + **[] $VALUES; + public *; +} +######## glide类库 +######## com.github.bumptech.glide:okhttp3-integration:1.4.0@aar中的代码不被混淆 +######## jp.wasabeef:glide-transformations:2.0.1 不被混淆 +-keep class com.bumptech.** {*;} +-keep class jp.wasabeef.glide.** {*;} +########## 保证类库Image 中导入的jar包不被混淆 +-keep class com.davemorrissey.** {*;} +-keep class com.filippudak.** {*;} +-keep class am.util.** {*;} +-keep class com.blankj.** {*;} + +#########################################################第三方的配置结束####################### + +#==================gson && protobuf========================== +-dontwarn com.google.** +-keep class com.google.gson.** {*;} +-keep class com.google.protobuf.** {*;} + +#ProGuard 混淆 + +# keep住源文件以及行号 +-keepattributes SourceFile,LineNumberTable + + +-keepattributes Signature +-dontwarn com.jcraft.jzlib.** +-keep class com.jcraft.jzlib.** { *;} + +-dontwarn sun.misc.** +-keep class sun.misc.** { *;} + +-dontwarn com.alibaba.fastjson.** +-keep class com.alibaba.fastjson.** { *;} + +-dontwarn sun.security.** +-keep class sun.security.** { *; } + +-dontwarn com.google.** +-keep class com.google.** { *;} + +-dontwarn com.avos.** +-keep class com.avos.** { *;} + +-keep public class android.net.http.SslError +-keep public class android.webkit.WebViewClient + +-dontwarn android.webkit.WebView +-dontwarn android.net.http.SslEr +-dontwarn android.webkit.WebViewClient + +-dontwarn android.support.** + +-dontwarn org.apache.** +-keep class org.apache.** { *;} + +-dontwarn org.jivesoftware.smack.** +-keep class org.jivesoftware.smack.** { *;} + +-dontwarn com.loopj.** +-keep class com.loopj.** { *;} + + +-dontwarn org.xbill.** +-keep class org.xbill.** { *;} + +-keepattributes *Annotation* + + +# Gson +-keep class com.example.testing.retrofitdemo.bean.**{*;} # 自定义数据模型的bean目录 +#gson +#如果用用到Gson解析包的,直接添加下面这几行就能成功混淆,不然会报错。 + +##---------------Begin: proguard configuration for Gson ---------- +# Gson uses generic type information stored in a class file when working with fields. Proguard +# removes such information by default, so configure it to keep all of it. +-keepattributes Signature + +# For using GSON @Expose annotation +-keepattributes *Annotation* + +# Gson specific classes +-dontwarn sun.misc.** +#-keep class com.google.gson.stream.** { *; } + +# Prevent proguard from stripping interface information from TypeAdapterFactory, +# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter) +-keep class * implements com.google.gson.TypeAdapterFactory +-keep class * implements com.google.gson.JsonSerializer +-keep class * implements com.google.gson.JsonDeserializer +# Application classes that will be serialized/deserialized over Gson + + +##---------------End: proguard configuration for Gson ---------- + +#基础混淆添加配置 +-keepclassmembers class **.R$* { + public static ; + public static final int *; +} +-keepclassmembers class * extends android.app.Activity { # 保持自定义控件类不被混淆 + public void *(android.view.View); +} diff --git a/base/proguard-rules.pro b/base/proguard-rules.pro index 481bb43..ace1e38 100644 --- a/base/proguard-rules.pro +++ b/base/proguard-rules.pro @@ -18,4 +18,104 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +#-renamesourcefileattribute SourceFile + + +# ---------------------------------- 基础配置 ---------------------------------- +# 代码优化次数,通常设为5 +-optimizationpasses 5 +# 不使用混合大小写类名 +-dontusemixedcaseclassnames +# 不忽略非公共库类 +-dontskipnonpubliclibraryclasses +# 不进行预校验(Android不需要,可加快速度) +-dontpreverify +# 打印混淆详情 +-verbose +# 忽略警告 +-ignorewarnings + +# ---------------------------------- 保留重要属性 ---------------------------------- +# 保留泛型签名(重要,避免JSON解析等类型转换错误) +-keepattributes Signature +# 保留注解(如@Keep, @SerializedName等) +-keepattributes *Annotation* +# 保留异常信息 +-keepattributes Exceptions +# 保留源代码文件名和行号(便于崩溃日志分析) +-keepattributes SourceFile,LineNumberTable + +# ---------------------------------- 保留Android基本组件 ---------------------------------- +# 保留四大组件及其子类 +-keep public class * extends android.app.Activity +-keep public class * extends android.app.Application +-keep public class * extends android.app.Service +-keep public class * extends android.content.BroadcastReceiver +-keep public class * extends android.content.ContentProvider +-keep public class * extends android.app.backup.BackupAgentHelper +-keep public class * extends android.preference.Preference + +# 保持 Native 方法不被混淆 +-keepclasseswithmembernames class * { + native ; +} + +# 保持 Parcelable 序列化类不被混淆 +-keep class * implements android.os.Parcelable { + public static final android.os.Parcelable$Creator *; +} + +# 保持 Serializable 序列化的类成员不被混淆 +-keepclassmembers class * implements java.io.Serializable { + static final long serialVersionUID; + private static final java.io.ObjectStreamField[] serialPersistentFields; + private void writeObject(java.io.ObjectOutputStream); + private void readObject(java.io.ObjectInputStream); + java.lang.Object writeReplace(); + java.lang.Object readResolve(); +} + +# 保持自定义 View 的构造方法不被混淆(用于 XML 布局) +-keep public class * extends android.view.View { + public (android.content.Context); + public (android.content.Context, android.util.AttributeSet); + public (android.content.Context, android.util.AttributeSet, int); + public void set*(...); +} + +# 保持枚举类不被混淆 +-keepclassmembers enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +# 保持由 JSON 转换的 Bean 类(或者你的数据模型类)不被混淆 +-keep class com.gamedog.vididin.beans.** { *; } +-keep class com.gamedog.vididin.router.** { *; } + + +# 保留R文件中的静态字段(保证资源反射能正常工作) +-keepclassmembers class **.R$* { + public static ; +} + +# gson +-keep class com.google.gson.** { *; } +-keep class sun.misc.Unsafe { *; } +-keep class com.google.gson.stream.** { *; } +# 明确保护被@SerializedName注解的字段 +-keepclassmembers class * { + @com.google.gson.annotations.SerializedName ; +} + + +#okhttp +# OkHttp3 +-dontwarn okhttp3.** +-keep class okhttp3.** { *; } +-keep interface okhttp3.** { *; } +-dontwarn okio.** +# Retrofit2 +-dontwarn retrofit2.** +-keep class retrofit2.** { *; } +-keepattributes Signature, Exceptions \ No newline at end of file diff --git a/bill/proguard-rules.pro b/bill/proguard-rules.pro index 481bb43..2e21085 100644 --- a/bill/proguard-rules.pro +++ b/bill/proguard-rules.pro @@ -18,4 +18,103 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +#-renamesourcefileattribute SourceFile + +# ---------------------------------- 基础配置 ---------------------------------- +# 代码优化次数,通常设为5 +-optimizationpasses 5 +# 不使用混合大小写类名 +-dontusemixedcaseclassnames +# 不忽略非公共库类 +-dontskipnonpubliclibraryclasses +# 不进行预校验(Android不需要,可加快速度) +-dontpreverify +# 打印混淆详情 +-verbose +# 忽略警告 +-ignorewarnings + +# ---------------------------------- 保留重要属性 ---------------------------------- +# 保留泛型签名(重要,避免JSON解析等类型转换错误) +-keepattributes Signature +# 保留注解(如@Keep, @SerializedName等) +-keepattributes *Annotation* +# 保留异常信息 +-keepattributes Exceptions +# 保留源代码文件名和行号(便于崩溃日志分析) +-keepattributes SourceFile,LineNumberTable + +# ---------------------------------- 保留Android基本组件 ---------------------------------- +# 保留四大组件及其子类 +-keep public class * extends android.app.Activity +-keep public class * extends android.app.Application +-keep public class * extends android.app.Service +-keep public class * extends android.content.BroadcastReceiver +-keep public class * extends android.content.ContentProvider +-keep public class * extends android.app.backup.BackupAgentHelper +-keep public class * extends android.preference.Preference + +# 保持 Native 方法不被混淆 +-keepclasseswithmembernames class * { + native ; +} + +# 保持 Parcelable 序列化类不被混淆 +-keep class * implements android.os.Parcelable { + public static final android.os.Parcelable$Creator *; +} + +# 保持 Serializable 序列化的类成员不被混淆 +-keepclassmembers class * implements java.io.Serializable { + static final long serialVersionUID; + private static final java.io.ObjectStreamField[] serialPersistentFields; + private void writeObject(java.io.ObjectOutputStream); + private void readObject(java.io.ObjectInputStream); + java.lang.Object writeReplace(); + java.lang.Object readResolve(); +} + +# 保持自定义 View 的构造方法不被混淆(用于 XML 布局) +-keep public class * extends android.view.View { + public (android.content.Context); + public (android.content.Context, android.util.AttributeSet); + public (android.content.Context, android.util.AttributeSet, int); + public void set*(...); +} + +# 保持枚举类不被混淆 +-keepclassmembers enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +# 保持由 JSON 转换的 Bean 类(或者你的数据模型类)不被混淆 +-keep class com.gamedog.vididin.beans.** { *; } +-keep class com.gamedog.vididin.router.** { *; } + + +# 保留R文件中的静态字段(保证资源反射能正常工作) +-keepclassmembers class **.R$* { + public static ; +} + +# gson +-keep class com.google.gson.** { *; } +-keep class sun.misc.Unsafe { *; } +-keep class com.google.gson.stream.** { *; } +# 明确保护被@SerializedName注解的字段 +-keepclassmembers class * { + @com.google.gson.annotations.SerializedName ; +} + + +#okhttp +# OkHttp3 +-dontwarn okhttp3.** +-keep class okhttp3.** { *; } +-keep interface okhttp3.** { *; } +-dontwarn okio.** +# Retrofit2 +-dontwarn retrofit2.** +-keep class retrofit2.** { *; } +-keepattributes Signature, Exceptions \ No newline at end of file diff --git a/core/architecture-reflect/proguard-rules.pro b/core/architecture-reflect/proguard-rules.pro index 481bb43..2e21085 100644 --- a/core/architecture-reflect/proguard-rules.pro +++ b/core/architecture-reflect/proguard-rules.pro @@ -18,4 +18,103 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +#-renamesourcefileattribute SourceFile + +# ---------------------------------- 基础配置 ---------------------------------- +# 代码优化次数,通常设为5 +-optimizationpasses 5 +# 不使用混合大小写类名 +-dontusemixedcaseclassnames +# 不忽略非公共库类 +-dontskipnonpubliclibraryclasses +# 不进行预校验(Android不需要,可加快速度) +-dontpreverify +# 打印混淆详情 +-verbose +# 忽略警告 +-ignorewarnings + +# ---------------------------------- 保留重要属性 ---------------------------------- +# 保留泛型签名(重要,避免JSON解析等类型转换错误) +-keepattributes Signature +# 保留注解(如@Keep, @SerializedName等) +-keepattributes *Annotation* +# 保留异常信息 +-keepattributes Exceptions +# 保留源代码文件名和行号(便于崩溃日志分析) +-keepattributes SourceFile,LineNumberTable + +# ---------------------------------- 保留Android基本组件 ---------------------------------- +# 保留四大组件及其子类 +-keep public class * extends android.app.Activity +-keep public class * extends android.app.Application +-keep public class * extends android.app.Service +-keep public class * extends android.content.BroadcastReceiver +-keep public class * extends android.content.ContentProvider +-keep public class * extends android.app.backup.BackupAgentHelper +-keep public class * extends android.preference.Preference + +# 保持 Native 方法不被混淆 +-keepclasseswithmembernames class * { + native ; +} + +# 保持 Parcelable 序列化类不被混淆 +-keep class * implements android.os.Parcelable { + public static final android.os.Parcelable$Creator *; +} + +# 保持 Serializable 序列化的类成员不被混淆 +-keepclassmembers class * implements java.io.Serializable { + static final long serialVersionUID; + private static final java.io.ObjectStreamField[] serialPersistentFields; + private void writeObject(java.io.ObjectOutputStream); + private void readObject(java.io.ObjectInputStream); + java.lang.Object writeReplace(); + java.lang.Object readResolve(); +} + +# 保持自定义 View 的构造方法不被混淆(用于 XML 布局) +-keep public class * extends android.view.View { + public (android.content.Context); + public (android.content.Context, android.util.AttributeSet); + public (android.content.Context, android.util.AttributeSet, int); + public void set*(...); +} + +# 保持枚举类不被混淆 +-keepclassmembers enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +# 保持由 JSON 转换的 Bean 类(或者你的数据模型类)不被混淆 +-keep class com.gamedog.vididin.beans.** { *; } +-keep class com.gamedog.vididin.router.** { *; } + + +# 保留R文件中的静态字段(保证资源反射能正常工作) +-keepclassmembers class **.R$* { + public static ; +} + +# gson +-keep class com.google.gson.** { *; } +-keep class sun.misc.Unsafe { *; } +-keep class com.google.gson.stream.** { *; } +# 明确保护被@SerializedName注解的字段 +-keepclassmembers class * { + @com.google.gson.annotations.SerializedName ; +} + + +#okhttp +# OkHttp3 +-dontwarn okhttp3.** +-keep class okhttp3.** { *; } +-keep interface okhttp3.** { *; } +-dontwarn okio.** +# Retrofit2 +-dontwarn retrofit2.** +-keep class retrofit2.** { *; } +-keepattributes Signature, Exceptions \ No newline at end of file diff --git a/core/architecture/proguard-rules.pro b/core/architecture/proguard-rules.pro index 91b3670..162569d 100644 --- a/core/architecture/proguard-rules.pro +++ b/core/architecture/proguard-rules.pro @@ -20,4 +20,103 @@ # hide the original source file name. #-renamesourcefileattribute SourceFile --dontwarn com.ama.core.common.interfaces.empty.DefaultActivityLifecycleCallbacks \ No newline at end of file +-dontwarn com.ama.core.common.interfaces.empty.DefaultActivityLifecycleCallbacks + +# ---------------------------------- 基础配置 ---------------------------------- +# 代码优化次数,通常设为5 +-optimizationpasses 5 +# 不使用混合大小写类名 +-dontusemixedcaseclassnames +# 不忽略非公共库类 +-dontskipnonpubliclibraryclasses +# 不进行预校验(Android不需要,可加快速度) +-dontpreverify +# 打印混淆详情 +-verbose +# 忽略警告 +-ignorewarnings + +# ---------------------------------- 保留重要属性 ---------------------------------- +# 保留泛型签名(重要,避免JSON解析等类型转换错误) +-keepattributes Signature +# 保留注解(如@Keep, @SerializedName等) +-keepattributes *Annotation* +# 保留异常信息 +-keepattributes Exceptions +# 保留源代码文件名和行号(便于崩溃日志分析) +-keepattributes SourceFile,LineNumberTable + +# ---------------------------------- 保留Android基本组件 ---------------------------------- +# 保留四大组件及其子类 +-keep public class * extends android.app.Activity +-keep public class * extends android.app.Application +-keep public class * extends android.app.Service +-keep public class * extends android.content.BroadcastReceiver +-keep public class * extends android.content.ContentProvider +-keep public class * extends android.app.backup.BackupAgentHelper +-keep public class * extends android.preference.Preference + +# 保持 Native 方法不被混淆 +-keepclasseswithmembernames class * { + native ; +} + +# 保持 Parcelable 序列化类不被混淆 +-keep class * implements android.os.Parcelable { + public static final android.os.Parcelable$Creator *; +} + +# 保持 Serializable 序列化的类成员不被混淆 +-keepclassmembers class * implements java.io.Serializable { + static final long serialVersionUID; + private static final java.io.ObjectStreamField[] serialPersistentFields; + private void writeObject(java.io.ObjectOutputStream); + private void readObject(java.io.ObjectInputStream); + java.lang.Object writeReplace(); + java.lang.Object readResolve(); +} + +# 保持自定义 View 的构造方法不被混淆(用于 XML 布局) +-keep public class * extends android.view.View { + public (android.content.Context); + public (android.content.Context, android.util.AttributeSet); + public (android.content.Context, android.util.AttributeSet, int); + public void set*(...); +} + +# 保持枚举类不被混淆 +-keepclassmembers enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +# 保持由 JSON 转换的 Bean 类(或者你的数据模型类)不被混淆 +-keep class com.gamedog.vididin.beans.** { *; } +-keep class com.gamedog.vididin.router.** { *; } + + +# 保留R文件中的静态字段(保证资源反射能正常工作) +-keepclassmembers class **.R$* { + public static ; +} + +# gson +-keep class com.google.gson.** { *; } +-keep class sun.misc.Unsafe { *; } +-keep class com.google.gson.stream.** { *; } +# 明确保护被@SerializedName注解的字段 +-keepclassmembers class * { + @com.google.gson.annotations.SerializedName ; +} + + +#okhttp +# OkHttp3 +-dontwarn okhttp3.** +-keep class okhttp3.** { *; } +-keep interface okhttp3.** { *; } +-dontwarn okio.** +# Retrofit2 +-dontwarn retrofit2.** +-keep class retrofit2.** { *; } +-keepattributes Signature, Exceptions \ No newline at end of file diff --git a/core/common/proguard-rules.pro b/core/common/proguard-rules.pro index 481bb43..ace1e38 100644 --- a/core/common/proguard-rules.pro +++ b/core/common/proguard-rules.pro @@ -18,4 +18,104 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +#-renamesourcefileattribute SourceFile + + +# ---------------------------------- 基础配置 ---------------------------------- +# 代码优化次数,通常设为5 +-optimizationpasses 5 +# 不使用混合大小写类名 +-dontusemixedcaseclassnames +# 不忽略非公共库类 +-dontskipnonpubliclibraryclasses +# 不进行预校验(Android不需要,可加快速度) +-dontpreverify +# 打印混淆详情 +-verbose +# 忽略警告 +-ignorewarnings + +# ---------------------------------- 保留重要属性 ---------------------------------- +# 保留泛型签名(重要,避免JSON解析等类型转换错误) +-keepattributes Signature +# 保留注解(如@Keep, @SerializedName等) +-keepattributes *Annotation* +# 保留异常信息 +-keepattributes Exceptions +# 保留源代码文件名和行号(便于崩溃日志分析) +-keepattributes SourceFile,LineNumberTable + +# ---------------------------------- 保留Android基本组件 ---------------------------------- +# 保留四大组件及其子类 +-keep public class * extends android.app.Activity +-keep public class * extends android.app.Application +-keep public class * extends android.app.Service +-keep public class * extends android.content.BroadcastReceiver +-keep public class * extends android.content.ContentProvider +-keep public class * extends android.app.backup.BackupAgentHelper +-keep public class * extends android.preference.Preference + +# 保持 Native 方法不被混淆 +-keepclasseswithmembernames class * { + native ; +} + +# 保持 Parcelable 序列化类不被混淆 +-keep class * implements android.os.Parcelable { + public static final android.os.Parcelable$Creator *; +} + +# 保持 Serializable 序列化的类成员不被混淆 +-keepclassmembers class * implements java.io.Serializable { + static final long serialVersionUID; + private static final java.io.ObjectStreamField[] serialPersistentFields; + private void writeObject(java.io.ObjectOutputStream); + private void readObject(java.io.ObjectInputStream); + java.lang.Object writeReplace(); + java.lang.Object readResolve(); +} + +# 保持自定义 View 的构造方法不被混淆(用于 XML 布局) +-keep public class * extends android.view.View { + public (android.content.Context); + public (android.content.Context, android.util.AttributeSet); + public (android.content.Context, android.util.AttributeSet, int); + public void set*(...); +} + +# 保持枚举类不被混淆 +-keepclassmembers enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +# 保持由 JSON 转换的 Bean 类(或者你的数据模型类)不被混淆 +-keep class com.gamedog.vididin.beans.** { *; } +-keep class com.gamedog.vididin.router.** { *; } + + +# 保留R文件中的静态字段(保证资源反射能正常工作) +-keepclassmembers class **.R$* { + public static ; +} + +# gson +-keep class com.google.gson.** { *; } +-keep class sun.misc.Unsafe { *; } +-keep class com.google.gson.stream.** { *; } +# 明确保护被@SerializedName注解的字段 +-keepclassmembers class * { + @com.google.gson.annotations.SerializedName ; +} + + +#okhttp +# OkHttp3 +-dontwarn okhttp3.** +-keep class okhttp3.** { *; } +-keep interface okhttp3.** { *; } +-dontwarn okio.** +# Retrofit2 +-dontwarn retrofit2.** +-keep class retrofit2.** { *; } +-keepattributes Signature, Exceptions \ No newline at end of file diff --git a/core/designsystem/proguard-rules.pro b/core/designsystem/proguard-rules.pro index 481bb43..2e21085 100644 --- a/core/designsystem/proguard-rules.pro +++ b/core/designsystem/proguard-rules.pro @@ -18,4 +18,103 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +#-renamesourcefileattribute SourceFile + +# ---------------------------------- 基础配置 ---------------------------------- +# 代码优化次数,通常设为5 +-optimizationpasses 5 +# 不使用混合大小写类名 +-dontusemixedcaseclassnames +# 不忽略非公共库类 +-dontskipnonpubliclibraryclasses +# 不进行预校验(Android不需要,可加快速度) +-dontpreverify +# 打印混淆详情 +-verbose +# 忽略警告 +-ignorewarnings + +# ---------------------------------- 保留重要属性 ---------------------------------- +# 保留泛型签名(重要,避免JSON解析等类型转换错误) +-keepattributes Signature +# 保留注解(如@Keep, @SerializedName等) +-keepattributes *Annotation* +# 保留异常信息 +-keepattributes Exceptions +# 保留源代码文件名和行号(便于崩溃日志分析) +-keepattributes SourceFile,LineNumberTable + +# ---------------------------------- 保留Android基本组件 ---------------------------------- +# 保留四大组件及其子类 +-keep public class * extends android.app.Activity +-keep public class * extends android.app.Application +-keep public class * extends android.app.Service +-keep public class * extends android.content.BroadcastReceiver +-keep public class * extends android.content.ContentProvider +-keep public class * extends android.app.backup.BackupAgentHelper +-keep public class * extends android.preference.Preference + +# 保持 Native 方法不被混淆 +-keepclasseswithmembernames class * { + native ; +} + +# 保持 Parcelable 序列化类不被混淆 +-keep class * implements android.os.Parcelable { + public static final android.os.Parcelable$Creator *; +} + +# 保持 Serializable 序列化的类成员不被混淆 +-keepclassmembers class * implements java.io.Serializable { + static final long serialVersionUID; + private static final java.io.ObjectStreamField[] serialPersistentFields; + private void writeObject(java.io.ObjectOutputStream); + private void readObject(java.io.ObjectInputStream); + java.lang.Object writeReplace(); + java.lang.Object readResolve(); +} + +# 保持自定义 View 的构造方法不被混淆(用于 XML 布局) +-keep public class * extends android.view.View { + public (android.content.Context); + public (android.content.Context, android.util.AttributeSet); + public (android.content.Context, android.util.AttributeSet, int); + public void set*(...); +} + +# 保持枚举类不被混淆 +-keepclassmembers enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +# 保持由 JSON 转换的 Bean 类(或者你的数据模型类)不被混淆 +-keep class com.gamedog.vididin.beans.** { *; } +-keep class com.gamedog.vididin.router.** { *; } + + +# 保留R文件中的静态字段(保证资源反射能正常工作) +-keepclassmembers class **.R$* { + public static ; +} + +# gson +-keep class com.google.gson.** { *; } +-keep class sun.misc.Unsafe { *; } +-keep class com.google.gson.stream.** { *; } +# 明确保护被@SerializedName注解的字段 +-keepclassmembers class * { + @com.google.gson.annotations.SerializedName ; +} + + +#okhttp +# OkHttp3 +-dontwarn okhttp3.** +-keep class okhttp3.** { *; } +-keep interface okhttp3.** { *; } +-dontwarn okio.** +# Retrofit2 +-dontwarn retrofit2.** +-keep class retrofit2.** { *; } +-keepattributes Signature, Exceptions \ No newline at end of file diff --git a/core/model/proguard-rules.pro b/core/model/proguard-rules.pro index 481bb43..2e21085 100644 --- a/core/model/proguard-rules.pro +++ b/core/model/proguard-rules.pro @@ -18,4 +18,103 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +#-renamesourcefileattribute SourceFile + +# ---------------------------------- 基础配置 ---------------------------------- +# 代码优化次数,通常设为5 +-optimizationpasses 5 +# 不使用混合大小写类名 +-dontusemixedcaseclassnames +# 不忽略非公共库类 +-dontskipnonpubliclibraryclasses +# 不进行预校验(Android不需要,可加快速度) +-dontpreverify +# 打印混淆详情 +-verbose +# 忽略警告 +-ignorewarnings + +# ---------------------------------- 保留重要属性 ---------------------------------- +# 保留泛型签名(重要,避免JSON解析等类型转换错误) +-keepattributes Signature +# 保留注解(如@Keep, @SerializedName等) +-keepattributes *Annotation* +# 保留异常信息 +-keepattributes Exceptions +# 保留源代码文件名和行号(便于崩溃日志分析) +-keepattributes SourceFile,LineNumberTable + +# ---------------------------------- 保留Android基本组件 ---------------------------------- +# 保留四大组件及其子类 +-keep public class * extends android.app.Activity +-keep public class * extends android.app.Application +-keep public class * extends android.app.Service +-keep public class * extends android.content.BroadcastReceiver +-keep public class * extends android.content.ContentProvider +-keep public class * extends android.app.backup.BackupAgentHelper +-keep public class * extends android.preference.Preference + +# 保持 Native 方法不被混淆 +-keepclasseswithmembernames class * { + native ; +} + +# 保持 Parcelable 序列化类不被混淆 +-keep class * implements android.os.Parcelable { + public static final android.os.Parcelable$Creator *; +} + +# 保持 Serializable 序列化的类成员不被混淆 +-keepclassmembers class * implements java.io.Serializable { + static final long serialVersionUID; + private static final java.io.ObjectStreamField[] serialPersistentFields; + private void writeObject(java.io.ObjectOutputStream); + private void readObject(java.io.ObjectInputStream); + java.lang.Object writeReplace(); + java.lang.Object readResolve(); +} + +# 保持自定义 View 的构造方法不被混淆(用于 XML 布局) +-keep public class * extends android.view.View { + public (android.content.Context); + public (android.content.Context, android.util.AttributeSet); + public (android.content.Context, android.util.AttributeSet, int); + public void set*(...); +} + +# 保持枚举类不被混淆 +-keepclassmembers enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +# 保持由 JSON 转换的 Bean 类(或者你的数据模型类)不被混淆 +-keep class com.gamedog.vididin.beans.** { *; } +-keep class com.gamedog.vididin.router.** { *; } + + +# 保留R文件中的静态字段(保证资源反射能正常工作) +-keepclassmembers class **.R$* { + public static ; +} + +# gson +-keep class com.google.gson.** { *; } +-keep class sun.misc.Unsafe { *; } +-keep class com.google.gson.stream.** { *; } +# 明确保护被@SerializedName注解的字段 +-keepclassmembers class * { + @com.google.gson.annotations.SerializedName ; +} + + +#okhttp +# OkHttp3 +-dontwarn okhttp3.** +-keep class okhttp3.** { *; } +-keep interface okhttp3.** { *; } +-dontwarn okio.** +# Retrofit2 +-dontwarn retrofit2.** +-keep class retrofit2.** { *; } +-keepattributes Signature, Exceptions \ No newline at end of file diff --git a/notification/proguard-rules.pro b/notification/proguard-rules.pro index 481bb43..2e21085 100644 --- a/notification/proguard-rules.pro +++ b/notification/proguard-rules.pro @@ -18,4 +18,103 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +#-renamesourcefileattribute SourceFile + +# ---------------------------------- 基础配置 ---------------------------------- +# 代码优化次数,通常设为5 +-optimizationpasses 5 +# 不使用混合大小写类名 +-dontusemixedcaseclassnames +# 不忽略非公共库类 +-dontskipnonpubliclibraryclasses +# 不进行预校验(Android不需要,可加快速度) +-dontpreverify +# 打印混淆详情 +-verbose +# 忽略警告 +-ignorewarnings + +# ---------------------------------- 保留重要属性 ---------------------------------- +# 保留泛型签名(重要,避免JSON解析等类型转换错误) +-keepattributes Signature +# 保留注解(如@Keep, @SerializedName等) +-keepattributes *Annotation* +# 保留异常信息 +-keepattributes Exceptions +# 保留源代码文件名和行号(便于崩溃日志分析) +-keepattributes SourceFile,LineNumberTable + +# ---------------------------------- 保留Android基本组件 ---------------------------------- +# 保留四大组件及其子类 +-keep public class * extends android.app.Activity +-keep public class * extends android.app.Application +-keep public class * extends android.app.Service +-keep public class * extends android.content.BroadcastReceiver +-keep public class * extends android.content.ContentProvider +-keep public class * extends android.app.backup.BackupAgentHelper +-keep public class * extends android.preference.Preference + +# 保持 Native 方法不被混淆 +-keepclasseswithmembernames class * { + native ; +} + +# 保持 Parcelable 序列化类不被混淆 +-keep class * implements android.os.Parcelable { + public static final android.os.Parcelable$Creator *; +} + +# 保持 Serializable 序列化的类成员不被混淆 +-keepclassmembers class * implements java.io.Serializable { + static final long serialVersionUID; + private static final java.io.ObjectStreamField[] serialPersistentFields; + private void writeObject(java.io.ObjectOutputStream); + private void readObject(java.io.ObjectInputStream); + java.lang.Object writeReplace(); + java.lang.Object readResolve(); +} + +# 保持自定义 View 的构造方法不被混淆(用于 XML 布局) +-keep public class * extends android.view.View { + public (android.content.Context); + public (android.content.Context, android.util.AttributeSet); + public (android.content.Context, android.util.AttributeSet, int); + public void set*(...); +} + +# 保持枚举类不被混淆 +-keepclassmembers enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +# 保持由 JSON 转换的 Bean 类(或者你的数据模型类)不被混淆 +-keep class com.gamedog.vididin.beans.** { *; } +-keep class com.gamedog.vididin.router.** { *; } + + +# 保留R文件中的静态字段(保证资源反射能正常工作) +-keepclassmembers class **.R$* { + public static ; +} + +# gson +-keep class com.google.gson.** { *; } +-keep class sun.misc.Unsafe { *; } +-keep class com.google.gson.stream.** { *; } +# 明确保护被@SerializedName注解的字段 +-keepclassmembers class * { + @com.google.gson.annotations.SerializedName ; +} + + +#okhttp +# OkHttp3 +-dontwarn okhttp3.** +-keep class okhttp3.** { *; } +-keep interface okhttp3.** { *; } +-dontwarn okio.** +# Retrofit2 +-dontwarn retrofit2.** +-keep class retrofit2.** { *; } +-keepattributes Signature, Exceptions \ No newline at end of file