# 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.iflytek.**{*;}
|
-keepattributes Signature
|
|
-keep class cn.rongcloud.rtc.core.** { *; }
|
-keep class cn.rongcloud.rtc.engine.binstack.json.** { *; }
|
-keepclassmembers class ** {
|
public void onEvent*(**);
|
}
|
#指定压缩级别
|
-optimizationpasses 5
|
#不跳过非公共的库的类成员
|
-dontskipnonpubliclibraryclassmembers
|
#混淆时采用的算法
|
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
|
#把混淆类中的方法名也混淆了
|
-useuniqueclassmembernames
|
#优化时允许访问并修改有修饰符的类和类的成员
|
-allowaccessmodification
|
#将文件来源重命名为“SourceFile”字符串
|
-renamesourcefileattribute SourceFile
|
#保留行号
|
-keepattributes SourceFile,LineNumberTable
|
#保持泛型
|
-keepattributes Signature
|
#保持所有实现 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();
|
}
|
|
#Fragment不需要在AndroidManifest.xml中注册,需要额外保护下
|
-keep public class * extends androidx.fragment.app.Fragment
|
-keep public class * extends android.app.Fragment
|
|
# 保持测试相关的代码
|
-dontnote junit.framework.**
|
-dontnote junit.runner.**
|
-dontwarn android.test.**
|
-dontwarn android.support.test.**
|
-dontwarn org.junit.**
|
# Gson specific classes
|
-keep class sun.misc.Unsafe { *; }
|
#-keep class com.google.gson.stream.** { *; }
|
#实体类不混淆(自己项目实体类不被混淆,因为Gson中用到了反射)
|
-keep public class **.*bean*.** {*;} ##这里需要根据项目结构指定bean目录
|
-keep public class **.*wxapi*.** {*;} ##这里需要根据项目结构指定bean目录
|
-keep public class **.*BaseEvent*.** {*;} ##这里需要根据项目结构指定bean目录
|
-keep public class **.*Const*.** {*;} ##这里需要根据项目结构指定bean目录
|
-keep public class **.*InnerJsInterface*.** {*;} ##这里需要根据项目结构指定bean目录
|
-keep public class **.*netUtls*.** {*;} ##这里需要根据项目结构指定bean目录
|
-keep public class **.*NettyClient*.** {*;} ##这里需要根据项目结构指定bean目录
|
-keep public class **.*Config*.** {*;} ##这里需要根据项目结构指定bean目录
|
-keep public class **.*CoreService*.** {*;} ##这里需要根据项目结构指定bean目录
|
-keep public class **.*NJobService*.** {*;} ##这里需要根据项目结构指定bean目录
|
-keep public class **.*netStatus*.** {*;} ##这里需要根据项目结构指定bean目录
|
-keep public class **.*pipeline*.** {*;} ##这里需要根据项目结构指定bean目录
|
|
|
#常用类配置
|
-dontwarn org.codehaus.**
|
-dontwarn java.nio.**
|
-dontwarn java.lang.invoke.**
|
#android 网络
|
-dontwarn android.net.**
|
-keep class android.net.SSLCertificateSocketFactory{*;}
|
-dontwarn com.umeng.**
|
-dontwarn com.taobao.**
|
-dontwarn anet.channel.**
|
-dontwarn anetwork.channel.**
|
-dontwarn org.android.**
|
-dontwarn org.apache.thrift.**
|
-dontwarn com.xiaomi.**
|
-dontwarn com.huawei.**
|
-dontwarn com.meizu.**
|
|
-keepattributes *Annotation*
|
|
-keep public class **.R$*{
|
public static final int *;
|
}
|
|
|
-dontwarn com.amap.api.**
|
-dontwarn com.a.a.**
|
-dontwarn com.autonavi.**
|
-keep class com.amap.api.** {*;}
|
-keep class com.autonavi.** {*;}
|
-keep class com.a.a.** {*;}
|
|
-keep class cn.sinata.*.netStatue** {*;}
|
-keep class cn.sinata.*.pipeline** {*;}
|
|
#eventbus传递的类
|
-keep class com.wang.*.eventbus.** {*;}
|
#zxing相关,目前没动过
|
-keep class com.wang.*.zxingjava.** {*;}
|
|
#极光
|
-dontoptimize
|
-dontpreverify
|
|
-dontwarn cn.jpush.**
|
-keep class cn.jpush.** { *; }
|
-keep class * extends cn.jpush.android.helpers.JPushMessageReceiver { *; }
|
|
-dontwarn cn.jiguang.**
|
-keep class cn.jiguang.** { *; }
|
-dontwarn com.google.**
|
-keep class com.google.gson.** {*;}
|
-keep class com.google.protobuf.** {*;}
|