80 lines
2.9 KiB
Prolog
80 lines
2.9 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
|
|
|
|
# Keep Attribute
|
|
-keepattributes *Annotation*,Signature,InnerClasses,EnclosingMethod,SourceFile,LineNumberTable
|
|
|
|
-assumenosideeffects class com.lightgame.config.CommonDebug {
|
|
private static String getLogTag(...);
|
|
private static String getMethodName();
|
|
public static void logMethodName(...);
|
|
public static void logParams(...);
|
|
public static void logFields(...);
|
|
public static void logMethodWithParams(...);
|
|
}
|
|
|
|
-assumenosideeffects class com.lightgame.utils.Utils {
|
|
public static void log(...);
|
|
}
|
|
|
|
-assumenosideeffects class com.gh.gamecenter.core.utils.MtaHelper {
|
|
public static void onEvent(...);
|
|
public static void onEventWithTime(...);
|
|
public static void onEventWithBasicDeviceInfo(...);
|
|
}
|
|
|
|
### 避免 WebChromeClient 被混淆
|
|
-keepclassmembers class * extends android.webkit.WebChromeClient{
|
|
public void openFileChooser(...);
|
|
}
|
|
|
|
# ARouter
|
|
-keep public class com.alibaba.android.arouter.routes.**{*;}
|
|
-keep public class com.alibaba.android.arouter.facade.**{*;}
|
|
-keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;}
|
|
# 如果使用了 byType 的方式获取 Service,需添加下面规则,保护接口
|
|
-keep interface * implements com.alibaba.android.arouter.facade.template.IProvider
|
|
# 如果使用了 单类注入,即不定义接口实现 IProvider,需添加下面规则,保护实现
|
|
-keep class * implements com.alibaba.android.arouter.facade.template.IProvider
|
|
|
|
# WebView
|
|
-dontwarn android.webkit.WebView
|
|
-dontwarn android.webkit.WebViewClient
|
|
-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);
|
|
}
|
|
|
|
# 避免 gson 找不到 enum
|
|
-keepclassmembers enum * { *; }
|
|
|
|
-keep class androidx.recyclerview.widget.RecyclerView {
|
|
<fields>;
|
|
*** get*();
|
|
void set*(***);
|
|
public <init>(android.content.Context);
|
|
public <init>(android.content.Context, android.util.AttributeSet);
|
|
public <init>(android.content.Context, android.util.AttributeSet, int);
|
|
} |