# 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 ### 忽略警告 #-ignorewarning #(Basic 包名不混合大小写 -dontusemixedcaseclassnames #(Basic)不忽略非公共的库类 -dontskipnonpubliclibraryclasses #(Basic)输出混淆日志 -verbose # Optimization is turned off by default. Dex does not like code run # through the ProGuard optimize and preverify steps (and performs some # of these optimizations on its own). #(Basic)不进行优化 -dontoptimize #(Basic)不进行预检验 -dontpreverify # Note that if you want to enable optimization, you cannot just # include optimization flags in your own project configuration file; # instead you will need to point to the # "proguard-android-optimize.txt" file instead of this one from your # project.properties file. #混淆注意事项第一条,保留四大组件及Android的其它组件 -keep public class * extends android.app.Activity #(Basic) -keepclassmembers class * extends android.app.Activity { public void *(android.view.View); } -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 #(Basic) -keep public class com.google.vending.licensing.ILicensingService #(Basic) -keep public class com.android.vending.licensing.ILicensingService #(Basic)混淆注意事项第二条,保持 native 方法不被混淆 -keepclasseswithmembernames class * { native ; } # 混淆注意事项第四条,保持WebView中JavaScript调用的方法 -keepclassmembers class * { @android.webkit.JavascriptInterface ; } #混淆注意事项第五条 自定义View (Basic) -keepclassmembers public class * extends android.view.View { void set*(***); *** get*(); } # (Basic)混淆注意事项第七条,保持 Parcelable 不被混淆 -keepclassmembers class * implements android.os.Parcelable { public static final android.os.Parcelable$Creator CREATOR; } #(Basic) 混淆注意事项第八条,保持枚举 enum 类不被混淆 -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); } #(Basic) -keepclassmembers class **.R$* { public static ; } #(Basic)保留注解 -keepattributes *Annotation* # (Basic)排除警告 -dontwarn android.support.** # Understand the @Keep support annotation. # (Basic)不混淆指定的类及其类成员 -keep class android.support.annotation.Keep # (Basic)不混淆使用注解的类及其类成员 -keep @android.support.annotation.Keep class * {*;} # (Basic)不混淆所有类及其类成员中的使用注解的方法 -keepclasseswithmembers class * { @android.support.annotation.Keep ; } # (Basic)不混淆所有类及其类成员中的使用注解的字段 -keepclasseswithmembers class * { @android.support.annotation.Keep ; } # 不混淆所有类及其类成员中的使用注解的初始化方法 -keepclasseswithmembers class * { @android.support.annotation.Keep (...); } #保留源文件以及行号 方便查看具体的崩溃信息 -keepattributes SourceFile,LineNumberTable #kotlin -keep class kotlin.** { *; } -keep class kotlin.Metadata { *; } -dontwarn kotlin.** -keepclassmembers class **$WhenMappings { ; } -keepclassmembers class kotlin.Metadata { public ; } -assumenosideeffects class kotlin.jvm.internal.Intrinsics { static void checkParameterIsNotNull(java.lang.Object, java.lang.String); } -keep class kotlinx.coroutines.android.** {*;} # ServiceLoader support -keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {} -keepnames class kotlinx.coroutines.CoroutineExceptionHandler {} -keepnames class kotlinx.coroutines.android.AndroidExceptionPreHandler {} -keepnames class kotlinx.coroutines.android.AndroidDispatcherFactory {} # Most of volatile fields are updated with AFU and should not be mangled -keepclassmembernames class kotlinx.** { volatile ; } -keepclasseswithmembernames class * { native ; } -target 1.6 -useuniqueclassmembernames -renamesourcefileattribute SourceFile -adaptresourcefilenames **.properties -adaptresourcefilecontents **.properties,META-INF/MANIFEST.MF -verbose # Also keep - Enumerations. Keep the special static methods that are required in # enumeration classes. -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); } # Keep names - Native method names. Keep all native class/method names. -keepclasseswithmembers,allowshrinking class * { native ; } #如果有其它包有warning,在报出warning的包加入下面类似的-dontwarn 报名 -dontwarn org.apache.*.** -dontwarn org.dom4j.*.** -dontwarn com.pdager.*.** -dontwarn com.*.** -dontwarn javax.*.** #如果引用了v4或者v7包 -dontwarn android.support.** -keepattributes EnclosingMethod -keep class com.autonavi.nge.**{*;} -keep class io.netty.**{*;} -keep class com.zhidaoauto.map.sdk.inner.abs.**{*;} -keep class com.zhidaoauto.map.sdk.inner.panel.**{*;} -keep class com.zhidaoauto.map.sdk.inner.search.**{*;} -keep class com.zhidaoauto.map.sdk.inner.element.**{*;} -keep class com.zhidaoauto.map.sdk.inner.obj.**{*;} -keep class com.zhidaoauto.map.sdk.open.**{*;} -keepattributes Exceptions,InnerClasses -keep class com.zhidaoauto.map.sdk.open.camera.**{ *; } -keep class com.zhidaoauto.map.sdk.open.camera.CameraPosition$B { *; } -keep class com.zhidaoauto.map.sdk.open.camera.CameraPosition$C { *; }