#指定代碼的壓縮級別
-optimizationpasses 5
#包明不混合大小寫
-dontusemixedcaseclassnames
#不去忽略非公共的庫類
-dontskipnonpubliclibraryclasses
#優(yōu)化? 不優(yōu)化輸入的類文件
-dontoptimize
#預(yù)校驗(yàn)
-dontpreverify
#混淆時是否記錄日志
-verbose
# 混淆時所采用的算法
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
#保護(hù)注解
-keepattributes *Annotation*
#如果有引用v4包可以添加下面這行
-keep public class * extends android.support.v4.app.Fragment
#忽略警告
-ignorewarning
##記錄生成的日志數(shù)據(jù),gradle build時在本項(xiàng)目根目錄輸出##
#apk 包內(nèi)所有 class 的內(nèi)部結(jié)構(gòu)
-dump proguard/class_files.txt
#未混淆的類和成員
-printseeds proguard/seeds.txt
#列出從 apk 中刪除的代碼
-printusage proguard/unused.txt
#混淆前后的映射
-printmapping proguard/mapping.txt
########記錄生成的日志數(shù)據(jù),gradle build時 在本項(xiàng)目根目錄輸出-end######
#如果引用了v4或者v7包
-dontwarn android.support.**
#保持 native 方法不被混淆
-keepclasseswithmembernames class * {
native ;
}
#保持自定義控件類不被混淆
-keepclasseswithmembers class * {
public (android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public (android.content.Context, android.util.AttributeSet, int);
}
#保持自定義控件類不被混淆
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
-keep public class * extends android.view.View {
public (android.content.Context);
public (android.content.Context, android.util.AttributeSet);
public (android.content.Context, android.util.AttributeSet, int);
public void set*(...);
}
#保持 Parcelable 不被混淆
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
#保持 Serializable 不被混淆
-keepnames class * implements java.io.Serializable
#保持 Serializable 不被混淆并且enum 類也不被混淆
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
!static !transient ;
!private ;
!private ;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
#保持枚舉 enum 類不被混淆
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keepclassmembers class * {
public void *ButtonClicked(android.view.View);
}
#不混淆資源類
-keepclassmembers class **.R$* {
public static ;
}
#避免混淆泛型 如果混淆報錯建議關(guān)掉
-keepattributes Signature
#lib_common
-keep class com.gd.windtrend.lib.common.**{*;}
#lib_landi
-keep class com.example.landi.device.**{*;}
-keep class com.windtrend.**{*;}
-keep class com.landicorp.**{*;}
#lib_ocrplateid
-keep class com.kernal.**{*;}
-keep class utills.**{*;}
-keep class view.**{*;}
#lib_qrcodecore
-keep class cn.bingoogolapple.qrcode.core.**{*;}
#com.gd.windtrend.frontpos.lib_repository
#-keep class com.gd.windtrend.frontpos.com.gd.windtrend.frontpos.lib_repository.**{*;}
#lib_rv
-keep class cn.lemon.view.**{*;}
#lib_util
-keep class com.blankj.utilcode.**{*;}
#lib_zbar
-keep class cn.bingoogolapple.qrcode.zbar.**{*;}
-keep class net.sourceforge.zbar.**{*;}
#windtrend-frontpos
-keep class com.gd.windtrend.frontpos.bean.**{*;}
-keep class com.gd.windtrend.frontpos.db.**{*;}
-keep class com.gd.windtrend.frontpos.net.**{*;}
-keep class org.xmlpull.v1.** { *;}
-dontwarn org.xmlpull.v1.**
#constraint
-dontwarn android.support.constraint.**
-keep class android.support.constraint.**{*;}
-dontwarn android.support.constraint.solver.**
-keep class android.support.constraint.solver.**{*;}
#design
-dontwarn android.support.design.**
-keep class android.support.constraint.**{*;}
#butterknife
-keep class butterknife.** { *; }
-dontwarn butterknife.internal.**
-keep class **$$ViewBinder { *; }
-keepclasseswithmembernames class * {
@butterknife.* ;
}
-keepclasseswithmembernames class * {
@butterknife.* ;
}
#recyclerview
-keep class android.support.v7.recyclerview.extensions.** { *; }
-keep class android.support.v7.util.** { *; }
-keep class android.support.v7.widget.** { *; }
#rxpermissions2
-dontwarn com.tbruyelle.**
-keep class com.tbruyelle.** { *; }
#retrofit,rxjava2
-dontwarn javax.annotation.**
-dontwarn javax.inject.**
-keep class com.jakewharton.retrofit2.adapter.rxjava2.** { *; }
# OkHttp3
-dontwarn okhttp3.logging.**
-keep class okhttp3.internal.**{*;}
-dontwarn okio.**
# Retrofit
-dontwarn retrofit2.**
-keep class retrofit2.** { *; }
# RxAndroid
-dontwarn io.reactivex.android**
-keep class io.reactivex.android.** { *; }
#RxJava
-dontwarn io.reactivex.**
-keep class io.reactivex.** { *; }
#####EventBus混淆配置
-keepattributes *Annotation*
-keepclassmembers class ** {
@org.greenrobot.eventbus.Subscribe ;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
# Only required if you use AsyncExecutor
-keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
(java.lang.Throwable);
}
#okhttputils
-dontwarn com.zhy.http.**
-keep class com.zhy.http.**{*;}
#okhttp
-dontwarn okhttp3.**
-keep class okhttp3.**{*;}
#okio
-dontwarn okio.**
-keep class okio.**{*;}
-dontwarn com.squareup.okhttp.**
-dontwarn javax.annotation.**
-dontwarn com.android.volley.toolbox.**
-dontwarn com.facebook.infer.**
-keep class com.squareup.okhttp.** { *;}
-keep interface com.squareup.okhttp.** { *; }
-dontnote retrofit2.Platform
-dontnote retrofit2.Platform$IOS$MainThreadExecutor
-dontwarn retrofit2.Platform$Java8
-keepattributes Signature
-keepattributes Exceptions
-keepclassmembers class * {
public (org.json.JSONObject);
}
-keep public class [com.gd.windtrend.frontpos].R$*{
public static final int *;
}
#filedownloader
-dontwarn com.liulishuo.filedownloader.**
-keep class com.liulishuo.filedownloader.** { *; }
-dontwarn com.tencent.bugly.**
-keep public class com.tencent.bugly.**{*;}
#gson
-dontwarn com.google.gson.**
-keep class com.google.gson.** {*;}
-keep class retrofit2.convert.gson.** {*;}
-keepattributes SourceFile,LineNumberTable
-keepattributes Signature
-dontwarn com.jcraft.jzlib.**
-keep class com.jcraft.jzlib.**? { *;}
-dontwarn sun.misc.**
-keep class sun.misc.** { *;}
-dontwarn com.alibaba.fastjson.**
-keep class com.alibaba.fastjson.** { *;}
-dontwarn sun.security.**
-keep class sun.security.** { *; }
-dontwarn com.google.**
-keep class com.google.** { *;}
-dontwarn com.avos.**
-keep class com.avos.** { *;}
-keep public class android.net.http.SslError
-keep public class android.webkit.WebViewClient
-dontwarn android.webkit.WebView
-dontwarn android.net.http.SslEr
-dontwarn android.webkit.WebViewClient
-dontwarn android.support.**
-dontwarn org.apache.**
-keep class org.apache.** { *;}
-dontwarn org.jivesoftware.smack.**
-keep class org.jivesoftware.smack.** { *;}
-dontwarn com.loopj.**
-keep class com.loopj.** { *;}
-dontwarn org.xbill.**
-keep class org.xbill.** { *;}
-keepattributes *Annotation*
#gson
-keepattributes Signature
-keepattributes *Annotation*
-dontwarn sun.misc.**
#gson
-dontwarn com.google.gson.**
-keep class com.google.gson.** {*;}
-keep class retrofit2.convert.gson.** {*;}
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer
#autosize
-keep class me.jessyan.autosize.** { *; }
-keep interface me.jessyan.autosize.** { *; }