Files
Abbidot_Android/baselibrary/proguard-rules.pro
yezhiqiu a25e4a093d 1.移除ACCESS_MOCK_LOCATION 权限
2.MMKV启用AES-256加密保存
3.修复导出组件和 Deep Links的处理建议
4.加入混淆代码
5.删除蓝牙透传RAW TCP(socket)
2026-07-14 11:08:43 +08:00

70 lines
3.1 KiB
Prolog

# ============================================================
# baselibrary 库模块自身的混淆规则(仅当 baselibrary minifyEnabled=true 时生效)
# 注意:对 App 模块生效的规则写在 consumer-rules.pro
# ============================================================
# 保留注解泛型签名运行时注解(网络层反射核心属性)
-keepattributes Signature,*Annotation*,AnnotationDefault,RuntimeVisibleAnnotations,RuntimeVisibleParameterAnnotations,InnerClasses,EnclosingMethod
# BaseNetworkApi 反射泛型基类
-keep class com.abbidot.baselibrary.network.base.BaseNetworkApi { *; }
-keep class * extends com.abbidot.baselibrary.network.base.BaseNetworkApi { *; }
-keep interface com.abbidot.baselibrary.network.base.IService { *; }
# BaseResponse<T> 网络响应泛型基类
-keep class com.abbidot.baselibrary.network.base.BaseResponse { *; }
# Gson TypeAdapter
-keep class com.abbidot.baselibrary.network.interceptor.StringNullAdapter { *; }
-keep class com.abbidot.baselibrary.network.interceptor.DoubleDefault0Adapter { *; }
# OkHttp Interceptor
-keep class com.abbidot.baselibrary.network.interceptor.CommonRequestInterceptor { *; }
-keep class com.abbidot.baselibrary.network.interceptor.CommonResponseInterceptor { *; }
# 异常类
-keep class com.abbidot.baselibrary.network.exception.** { *; }
# 公共工具类(反射用到的保留)
-keep class com.abbidot.baselibrary.util.** { *; }
-keep class com.abbidot.baselibrary.constant.** { *; }
# EventBus
-keep class com.abbidot.baselibrary.eventbus.** { *; }
# RecyclerView 公共基类
-keep class com.abbidot.baselibrary.list.** { *; }
# Retrofit + Gson + OkHttp
-keep,allowobfuscation,allowshrinking interface retrofit2.Call
-keep,allowobfuscation,allowshrinking class retrofit2.Response
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
-if interface * { @retrofit2.http.* <methods>; }
-keep,allowobfuscation interface * { <methods>; }
-keep class com.google.gson.** { *; }
-keep class com.google.gson.reflect.TypeToken { *; }
-keep class * extends com.google.gson.reflect.TypeToken { *; }
-dontwarn okhttp3.internal.platform.**
-dontwarn org.conscrypt.**
-dontwarn org.bouncycastle.**
-dontwarn org.openjsse.**
-dontwarn org.codehaus.mojo.animal_sniffer.*
-dontwarn com.google.gson.**
# ==============================
# 自定义 View / LayoutInflater 反射构造函数保留
# ==============================
-keepclassmembers class * extends android.view.View {
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
public <init>(android.content.Context, android.util.AttributeSet, int, int);
void set*(***);
*** get*();
}
-keepclassmembers class * extends android.view.ViewGroup {
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
public <init>(android.content.Context, android.util.AttributeSet, int, int);
}
-keep class com.abbidot.baselibrary.widget.** { *; }