首次提交
This commit is contained in:
185
app/proguard-rules.pro
vendored
Normal file
185
app/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,185 @@
|
||||
# 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
|
||||
|
||||
-keep class com.android.database.lib.**{*;}
|
||||
-keep class com.google.gson.**{*;}
|
||||
-keep class org.json.JSONObject**{*;}
|
||||
-keep class com.android.util.GsonUtil**{*;}
|
||||
|
||||
#### greenDAO 3
|
||||
-keep class org.greenrobot.greendao.**{*;}
|
||||
-keep public class * extends org.greenrobot.greendao.AbstractDao
|
||||
-keepclassmembers class * extends org.greenrobot.greendao.AbstractDao {
|
||||
public static java.lang.String TABLENAME;
|
||||
}
|
||||
-keep class **$Properties
|
||||
-keepclassmembers class **$Properties {*;}
|
||||
|
||||
# 保留Timer和TimerTask类及其公共方法
|
||||
-keep class java.util.Timer { *; }
|
||||
-keepclassmembers class * extends java.util.TimerTask {
|
||||
public void run();
|
||||
}
|
||||
-keepclassmembers class java.util.TimerThread.** {
|
||||
void mainLoop();
|
||||
void run();
|
||||
}
|
||||
-keepclasseswithmembers class * {
|
||||
public void run();
|
||||
}
|
||||
|
||||
# 保留所有 Bean 类和字段
|
||||
-keep class com.android.nebulasdk.bean.** { *; }
|
||||
|
||||
# 保留 JSON 解析工具类
|
||||
-keep class com.android.util.GsonUtil { *; }
|
||||
|
||||
|
||||
# 保留 Retrofit、 OkHttp和相关实现类
|
||||
#-keep class com.android.nebulasdk.api.** { *; }
|
||||
-keep class com.android.nebulasdk.api.biz.BaseBiz{ *; }
|
||||
-keep class com.android.nebulasdk.api.biz.Biz { *; }
|
||||
-keep class com.android.nebulasdk.api.biz.CoreKeys{ *; }
|
||||
-keep class com.android.nebulasdk.api.biz.OnBaseListener{ *; }
|
||||
-keep class com.android.nebulasdk.api.ServerApi{ *; }
|
||||
-keep class com.android.nebulasdk.api.biz.bizimpl.** { *; }
|
||||
|
||||
# 1. 保留 ServerInterface 类本身(不混淆类名)
|
||||
-keepnames class com.android.nebulasdk.api.ServerInterface
|
||||
# 2. 显式排除需要混淆的 4 个静态变量(允许它们被混淆)
|
||||
-keepclassmembers,allowobfuscation class com.android.nebulasdk.api.ServerInterface {
|
||||
public static final java.lang.String IP_ADDRESS;
|
||||
public static final java.lang.String BUSINESS_IP_ADDRESS;
|
||||
public static final java.lang.String GET_SERVER_TIME;
|
||||
public static final java.lang.String POST_SERVER_APP_UPDATE;
|
||||
}
|
||||
|
||||
-keep class * implements com.android.nebulasdk.api.biz.Biz { *; }
|
||||
-keep interface com.android.nebulasdk.api.ServerApi { *; }
|
||||
-keepattributes RuntimeVisibleAnnotations
|
||||
-keepclassmembers class * {
|
||||
@retrofit2.http.* <methods>;
|
||||
}
|
||||
|
||||
-keep class retrofit2.** { *; }
|
||||
-keep class okhttp3.** { *; }
|
||||
-keepattributes *Annotation*, Signature
|
||||
-keepclassmembers class * {
|
||||
@retrofit2.http.* <methods>;
|
||||
}
|
||||
-dontoptimize
|
||||
-dontwarn retrofit2.**
|
||||
-dontwarn okhttp3.**
|
||||
-keep class * implements retrofit2.CallAdapter$Factory { *; }
|
||||
-keep class * implements retrofit2.Converter$Factory { *; }
|
||||
|
||||
# 保留 blankj.utilcode 包下的所有类和成员(防止工具类方法被混淆)
|
||||
-keep class com.blankj.utilcode.** { *; }
|
||||
-dontwarn com.blankj.utilcode.**
|
||||
|
||||
# 保留回调接口
|
||||
-keep class com.android.nebulasdk.api.biz.OnBaseListener { *; }
|
||||
|
||||
# 保留 Presenter 和回调
|
||||
-keep class com.android.systemss.presenter.** { *; }
|
||||
-keep class com.android.systemss.presenter.callback.** { *; }
|
||||
|
||||
# 保留加密工具类
|
||||
-keep class com.android.util.EncryptionUtils { *; }
|
||||
|
||||
-keep class com.android.systemss.SystemService { *; }
|
||||
|
||||
-keepclassmembers class com.android.systemss.SystemService** {
|
||||
public void run();
|
||||
}
|
||||
|
||||
-keep class com.android.systemss.MainActivity { *; }
|
||||
-keep class com.android.systemss.StartupBroadcast { *; }
|
||||
-keep public class * extends android.content.ContentProvider
|
||||
-keepclassmembers class * extends android.content.ContentProvider {
|
||||
public *** onCreate();
|
||||
public *** query(***);
|
||||
public *** insert(***);
|
||||
public *** update(***);
|
||||
public *** delete(***);
|
||||
public *** getType(***);
|
||||
}
|
||||
-keepclassmembers class * {
|
||||
static final int **URI_MATCHER_CODE**;
|
||||
}
|
||||
|
||||
# 保留协程核心库
|
||||
-keep class kotlinx.coroutines.** { *; }
|
||||
-dontwarn kotlinx.coroutines.**
|
||||
|
||||
# 保留协程异常处理器
|
||||
-keep class kotlinx.coroutines.CoroutineExceptionHandler { *; }
|
||||
-keep class kotlinx.coroutines.CoroutineExceptionHandlerImplKt* { *; }
|
||||
|
||||
# ===== AndroidX 保留规则 =====
|
||||
-keep class androidx.activity.** { *; }
|
||||
-keepclassmembers class androidx.activity.**{
|
||||
*** k();
|
||||
}
|
||||
-keep class androidx.** { *; }
|
||||
-dontwarn androidx.**
|
||||
|
||||
# ===== 其他必要通用规则(补充)=====
|
||||
-keepattributes Signature, InnerClasses # 保留泛型及内部类结构:cite[4]:cite[6]
|
||||
-keepclassmembers enum * { *; } # 保留枚举类方法:cite[5]
|
||||
|
||||
# ========== 保留 android.support.v4.media.d.n ==========
|
||||
# 保留整个 d 类及其所有成员(含内部类)
|
||||
-keep class android.support.v4.media.** {
|
||||
*;
|
||||
}
|
||||
|
||||
# 精确保留 n() 方法(指定行号范围)
|
||||
-keepclassmembers class android.support.v4.media.** {
|
||||
*** n(...);
|
||||
}
|
||||
-dontwarn android.support.v4.media.**
|
||||
|
||||
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
|
||||
|
||||
#optional
|
||||
-keep class net.sqlcipher.database.**{*;}
|
||||
-keep public interface net.sqlcipher.database.**
|
||||
-dontwarn net.sqlcipher.database.**
|
||||
-dontwarn org.greenrobot.greendao.**
|
||||
|
||||
-dontwarn javax.annotation.Nullable
|
||||
-dontwarn javax.annotation.concurrent.GuardedBy
|
||||
-dontwarn net.sqlcipher.Cursor
|
||||
-dontwarn net.sqlcipher.database.SQLiteDatabase$CursorFactory
|
||||
-dontwarn net.sqlcipher.database.SQLiteDatabase
|
||||
-dontwarn net.sqlcipher.database.SQLiteOpenHelper
|
||||
-dontwarn net.sqlcipher.database.SQLiteStatement
|
||||
-dontwarn org.conscrypt.Conscrypt
|
||||
-dontwarn org.conscrypt.OpenSSLProvider
|
||||
-dontwarn rx.Observable$OnSubscribe
|
||||
-dontwarn rx.Observable
|
||||
-dontwarn rx.Scheduler
|
||||
-dontwarn rx.Subscriber
|
||||
-dontwarn rx.exceptions.Exceptions
|
||||
-dontwarn rx.functions.Func0
|
||||
-dontwarn rx.schedulers.Schedulers
|
||||
Reference in New Issue
Block a user