proguard-rules.pro 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  1. # Add project specific ProGuard rules here.
  2. # By default, the flags in this file are appended to flags specified
  3. # in D:\work\software\SDK/tools/proguard/proguard-android.txt
  4. # You can edit the include path and order by changing the proguardFiles
  5. # directive in build.gradle.
  6. #
  7. # For more details, see
  8. # http://developer.android.com/guide/developing/tools/proguard.html
  9. # Add any project specific keep options here:
  10. # If your project uses WebView with JS, uncomment the following
  11. # and specify the fully qualified class name to the JavaScript interface
  12. # class:
  13. -keepclassmembers class fqcn.of.javascript.interface.for.webview {
  14. public *;
  15. }
  16. # Uncomment this to preserve the line number information for
  17. # debugging stack traces.
  18. #-keepattributes SourceFile,LineNumberTable
  19. # If you keep the line number information, uncomment this to
  20. # hide the original source file name.
  21. #-renamesourcefileattribute SourceFile
  22. -dontshrink
  23. -dontwarn com.google.android.maps.**
  24. -dontwarn android.webkit.WebView
  25. -dontwarn okhttp3.**
  26. -dontwarn okio.**
  27. -dontwarn javax.annotation.**
  28. # A resource is loaded with a relative path so the package of this class must be preserved.
  29. -keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
  30. -keep class com.tencent.mm.opensdk.** { *;}
  31. -keep class com.tencent.wxop.** { *;}
  32. -keep class com.tencent.mm.sdk.** { *;}
  33. -dontwarn com.tencent.bugly.**
  34. -keep public class com.tencent.**{*;}
  35. -keep class android.support.**{*;}
  36. #友盟
  37. -keep class com.umeng.** {*;}
  38. -keep public interface com.umeng.**
  39. -keep public interface com.tencent.**
  40. -keep public class com.umeng.* {*;}
  41. -keep class UMMoreHandler{*;}
  42. -keep class com.tencent.mm.sdk.modelmsg.WXMediaMessage {*;}
  43. -keep class com.tencent.mm.sdk.modelmsg.** implements com.tencent.mm.sdk.modelmsg.WXMediaMessage$IMediaObject {*;}
  44. -keep class com.tencent.mm.** {
  45. *;
  46. }
  47. -dontwarn twitter4j.**
  48. -keep class twitter4j.** { *; }
  49. -keep class com.tencent.** {*;}
  50. -dontwarn com.tencent.**
  51. -keep class com.kakao.** {*;}
  52. -dontwarn com.kakao.**
  53. -keep public class com.umeng.com.umeng.soexample.R$*{
  54. public static final int *;
  55. }
  56. -keep public class com.linkedin.android.mobilesdk.R$*{
  57. public static final int *;
  58. }
  59. -keepclassmembers enum * {
  60. public static **[] values();
  61. public static ** valueOf(java.lang.String);
  62. }
  63. -keep class com.tencent.open.TDialog$*
  64. -keep class com.tencent.open.TDialog$* {*;}
  65. -keep class com.tencent.open.PKDialog
  66. -keep class com.tencent.open.PKDialog {*;}
  67. -keep class com.tencent.open.PKDialog$*
  68. -keep class com.tencent.open.PKDialog$* {*;}
  69. -keep class com.umeng.socialize.impl.ImageImpl {*;}
  70. -keep class com.sina.** {*;}
  71. -dontwarn com.sina.**
  72. -keep class com.alipay.share.sdk.** {
  73. *;
  74. }
  75. -keepnames class * implements android.os.Parcelable {
  76. public static final ** CREATOR;
  77. }
  78. -keep class com.linkedin.** { *; }
  79. -keep class com.android.dingtalk.share.ddsharemodule.** { *; }
  80. #指定代码的压缩级别
  81. -optimizationpasses 5
  82. #不去忽略非公共的库类
  83. -dontskipnonpubliclibraryclasses
  84. -dontskipnonpubliclibraryclassmembers
  85. # 是否使用大小写混合
  86. -dontusemixedcaseclassnames
  87. #预校验
  88. -dontpreverify
  89. #混淆时是否记录日志
  90. -verbose
  91. #忽略警告,避免打包时某些警告出现
  92. -ignorewarning
  93. # 混淆时所采用的算法
  94. -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
  95. #保护注解
  96. -keepattributes *Annotation*
  97. #记录生成的日志数据,gradle build时在本项目根目录输出
  98. #apk 包内所有 class 的内部结构
  99. -dump class_files.txt
  100. #未混淆的类和成员
  101. -printseeds seeds.txt
  102. #列出从 apk 中删除的代码
  103. -printusage unused.txt
  104. #混淆前后的映射
  105. -printmapping mapping.txt
  106. # 保持哪些类不被混淆
  107. -keep public class * extends android.app.Activity
  108. -keep public class * extends android.app.Fragment
  109. -keep public class * extends android.app.Application
  110. -keep public class * extends android.app.Service
  111. -keep public class * extends android.content.BroadcastReceiver
  112. -keep public class * extends android.content.ContentProvider
  113. -keep public class * extends android.app.backup.BackupAgentHelper
  114. -keep public class * extends android.preference.Preference
  115. -keep public class com.android.vending.licensing.ILicensingService
  116. -keep class * implements java.io.Serializable
  117. -keepattributes *Annotation*
  118. -keepclassmembers class ** {
  119. @org.greenrobot.eventbus.Subscribe <methods>;
  120. }
  121. -keep enum org.greenrobot.eventbus.ThreadMode { *; }
  122. # Only required if you use AsyncExecutor
  123. -keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
  124. <init>(java.lang.Throwable);
  125. }
  126. #app
  127. #忽略bean类
  128. -keep class com.googlecode.protobuf.format.** { *; }
  129. -keep class com.kfzs.duanduan.bean.** { *; }
  130. -keep class com.kfzs.duanduan.proto.** { *; }
  131. -keep class com.sheep.gamegroup.model.** { *; }
  132. -keep class com.jcodecraeer.** { *; }
  133. -keep class com.sheep.jiuyan.samllsheep.service.DownloadService { *; }
  134. #datashare
  135. -keep class com.kfzs.duanduan.data.graph.** { *; }
  136. -keep class com.kfzs.duanduan.datashare.** { *; }
  137. #ari
  138. #-keep class com.arialyy.** { *; }
  139. -dontwarn com.arialyy.aria.**
  140. -keep class com.arialyy.aria.**{*;}
  141. -keep class **$$DownloadListenerProxy{ *; }
  142. -keep class **$$UploadListenerProxy{ *; }
  143. -keep class **$$DownloadGroupListenerProxy{ *; }
  144. -keepclasseswithmembernames class * {
  145. @Download.* <methods>;
  146. @Upload.* <methods>;
  147. @DownloadGroup.* <methods>;
  148. }
  149. -keep class org.** { *; }
  150. -keep class sun.** { *; }
  151. -keep class net.** { *; }
  152. -keep class com.fasterxml.** { *; }
  153. -keep class javax.** { *; }
  154. -keep class rx.** { *; }
  155. # Retrofit 2.X
  156. ## https://square.github.io/retrofit/ ##
  157. -dontwarn retrofit2.**
  158. -keep class retrofit2.** { *; }
  159. -keepattributes Signature
  160. -keepattributes Exceptions
  161. -keepclasseswithmembers class * {
  162. @retrofit2.http.* <methods>;
  163. }
  164. # Retrofit 1.X
  165. -keep class com.squareup.okhttp.** { *; }
  166. -keep class retrofit.** { *; }
  167. -keep interface com.squareup.okhttp.** { *; }
  168. -dontwarn com.squareup.okhttp.**
  169. -dontwarn okio.**
  170. -dontwarn retrofit.**
  171. -dontwarn rx.**
  172. -keepclasseswithmembers class * {
  173. @retrofit.http.* <methods>;
  174. }
  175. # If in your rest service interface you use methods with Callback argument.
  176. -keepattributes Exceptions
  177. # If your rest service methods throw custom exceptions, because you've defined an ErrorHandler.
  178. -keepattributes Signature
  179. # Also you must note that if you are using GSON for conversion from JSON to POJO representation, you must ignore those POJO classes from being obfuscated.
  180. # Here include the POJO's that have you have created for mapping JSON response to POJO for example.
  181. ## Square Otto specific rules ##
  182. ## https://square.github.io/otto/ ##
  183. -keepattributes *Annotation*
  184. -keepclassmembers class ** {
  185. @com.squareup.otto.Subscribe public *;
  186. @com.squareup.otto.Produce public *;
  187. }
  188. ## Square Picasso specific rules ##
  189. ## https://square.github.io/picasso/ ##
  190. -dontwarn com.squareup.okhttp.**
  191. # OkHttp
  192. -keepattributes Signature
  193. -keepattributes *Annotation*
  194. -keep class okhttp3.** { *; }
  195. -keep interface okhttp3.** { *; }
  196. -dontwarn okhttp3.**
  197. # Dagger ProGuard rules.
  198. # https://github.com/square/dagger
  199. -dontwarn dagger.internal.codegen.**
  200. -keepclassmembers,allowobfuscation class * {
  201. @javax.inject.* *;
  202. @dagger.* *;
  203. <init>();
  204. }
  205. -keep class dagger.* { *; }
  206. -keep class javax.inject.* { *; }
  207. -keep class * extends dagger.internal.Binding
  208. -keep class * extends dagger.internal.ModuleAdapter
  209. -keep class * extends dagger.internal.StaticInjection
  210. # RxJava 0.21
  211. -keep class rx.schedulers.Schedulers {
  212. public static <methods>;
  213. }
  214. -keep class rx.schedulers.ImmediateScheduler {
  215. public <methods>;
  216. }
  217. -keep class rx.schedulers.TestScheduler {
  218. public <methods>;
  219. }
  220. -keep class rx.schedulers.Schedulers {
  221. public static ** test();
  222. }
  223. # Configuration for Guava 18.0
  224. #
  225. # disagrees with instructions provided by Guava project: https://code.google.com/p/guava-libraries/wiki/UsingProGuardWithGuava
  226. -keep class com.google.common.io.Resources {
  227. public static <methods>;
  228. }
  229. -keep class com.google.common.collect.Lists {
  230. public static ** reverse(**);
  231. }
  232. -keep class com.google.common.base.Charsets {
  233. public static <fields>;
  234. }
  235. -keep class com.google.common.base.Joiner {
  236. public static com.google.common.base.Joiner on(java.lang.String);
  237. public ** join(...);
  238. }
  239. -keep class com.google.common.collect.MapMakerInternalMap$ReferenceEntry
  240. -keep class com.google.common.cache.LocalCache$ReferenceEntry
  241. # http://stackoverflow.com/questions/9120338/proguard-configuration-for-guava-with-obfuscation-and-optimization
  242. -dontwarn javax.annotation.**
  243. -dontwarn javax.inject.**
  244. -dontwarn sun.misc.Unsafe
  245. # Guava 19.0
  246. -dontwarn java.lang.ClassValue
  247. -dontwarn com.google.j2objc.annotations.Weak
  248. -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
  249. ## GSON 2.2.4 specific rules ##
  250. # Gson uses generic type information stored in a class file when working with fields. Proguard
  251. # removes such information by default, so configure it to keep all of it.
  252. -keepattributes Signature
  253. # For using GSON @Expose annotation
  254. -keepattributes *Annotation*
  255. -keepattributes EnclosingMethod
  256. # Gson specific classes
  257. -keep class sun.misc.Unsafe { *; }
  258. -keep class com.google.gson.stream.** { *; }
  259. # GreenDao rules
  260. # Source: http://greendao-orm.com/documentation/technical-faq
  261. #
  262. -keepclassmembers class * extends de.greenrobot.dao.AbstractDao {
  263. public static java.lang.String TABLENAME;
  264. }
  265. -keep class **$Properties
  266. # Glide specific rules #
  267. # https://github.com/bumptech/glide
  268. -keep public class * implements com.bumptech.glide.module.GlideModule
  269. -keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
  270. **[] $VALUES;
  271. public *;
  272. }
  273. # Fresco v0.8.1 ProGuard rules.
  274. # https://github.com/facebook/fresco
  275. -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
  276. # Do not strip any method/class that is annotated with @DoNotStrip
  277. -keep @com.facebook.common.internal.DoNotStrip class *
  278. -keepclassmembers class * {
  279. @com.facebook.common.internal.DoNotStrip *;
  280. }
  281. # Keep native methods
  282. -keepclassmembers class * {
  283. native <methods>;
  284. }
  285. -dontwarn okio.**
  286. -dontwarn javax.annotation.**
  287. -dontwarn com.android.volley.toolbox.**
  288. ## New rules for EventBus 3.0.x ##
  289. # http://greenrobot.org/eventbus/documentation/proguard/
  290. -keepattributes *Annotation*
  291. -keepclassmembers class ** {
  292. @org.greenrobot.eventbus.Subscribe <methods>;
  293. }
  294. -keep enum org.greenrobot.eventbus.ThreadMode { *; }
  295. # Only required if you use AsyncExecutor
  296. -keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
  297. <init>(java.lang.Throwable);
  298. }
  299. #Easy-Adapter v1.5.0
  300. -keepattributes *Annotation*
  301. -keepclassmembers class * extends uk.co.ribot.easyadapter.ItemViewHolder {
  302. public <init>(...);
  303. }
  304. # Crashlytics 2.+
  305. -keep class com.crashlytics.** { *; }
  306. -keep class com.crashlytics.android.**
  307. -keepattributes SourceFile, LineNumberTable, *Annotation*
  308. # If you are using custom exceptions, add this line so that custom exception types are skipped during obfuscation:
  309. -keep public class * extends java.lang.Exception
  310. # For Fabric to properly de-
  311. # ButterKnife 7
  312. -keep class butterknife.** { *; }
  313. -dontwarn butterknife.internal.**
  314. -keep class **$$ViewBinder { *; }
  315. -keepclasseswithmembernames class * {
  316. @butterknife.* <fields>;
  317. }
  318. -keepclasseswithmembernames class * {
  319. @butterknife.* <methods>;
  320. }
  321. # fastjson proguard rules
  322. # https://github.com/alibaba/fastjson
  323. -dontwarn com.alibaba.fastjson.**
  324. -keepattributes Signature
  325. -keepattributes *Annotation*
  326. ## ActionBarSherlock 4.4.0 specific rules ##
  327. -keep class android.support.v4.app.** { *; }
  328. -keep interface android.support.v4.app.** { *; }
  329. -keep class com.actionbarsherlock.** { *; }
  330. -keep interface com.actionbarsherlock.** { *; }
  331. -keepattributes *Annotation*
  332. ## hack for Actionbarsherlock 4.4.0, see https://github.com/JakeWharton/ActionBarSherlock/issues/1001 ##
  333. -dontwarn com.actionbarsherlock.internal.**
  334. ## SVG Android ##
  335. #https://github.com/pents90/svg-android
  336. -keep class com.larvalabs.svgandroid.** {*;}
  337. -keep class com.larvalabs.svgandroid.*$* {*;}
  338. -keep public class android.support.v7.widget.** { *; }
  339. -keep public class android.support.v7.internal.widget.** { *; }
  340. -keep public class android.support.v7.internal.view.menu.** { *; }
  341. -keep public class * extends android.support.v4.view.ActionProvider {
  342. public <init>(android.content.Context);
  343. }
  344. -dontwarn android.support.design.**
  345. -keep class android.support.design.** { *; }
  346. -keep interface android.support.design.** { *; }
  347. -keep public class android.support.design.R$* { *; }
  348. ##极光推送
  349. -dontoptimize
  350. -dontpreverify
  351. -dontwarn cn.jpush.**
  352. -keep class cn.jpush.** { *; }
  353. -keep class * extends cn.jpush.android.helpers.JPushMessageReceiver { *; }
  354. -dontwarn cn.jiguang.**
  355. -keep class cn.jiguang.** { *; }
  356. #2.0.5 ~ 2.1.7 版本有引入 gson 和 protobuf ,增加排除混淆的配置。(2.1.8版本不需配置)
  357. #==================gson && protobuf==========================
  358. -dontwarn com.google.**
  359. -keep class com.google.gson.** {*;}
  360. -keep class com.google.protobuf.** {*;}
  361. # banner 的混淆代码
  362. -keep class com.youth.banner.** {
  363. *;
  364. }
  365. #==================compile 'com.haibin:calendarview:3.4.4'==========================
  366. -keepclasseswithmembers class * {
  367. public <init>(android.content.Context);
  368. }