proguard-rules.pro 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  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. -keep class com.tencent.** { *;}
  34. -dontwarn com.tencent.bugly.**
  35. -keep public class com.tencent.**{*;}
  36. -keep class android.support.**{*;}
  37. #友盟
  38. -keep class com.umeng.** {*;}
  39. -keep public interface com.umeng.**
  40. -keep public interface com.tencent.**
  41. -keep public class com.umeng.* {*;}
  42. -keep class UMMoreHandler{*;}
  43. -keep class com.tencent.mm.sdk.modelmsg.WXMediaMessage {*;}
  44. -keep class com.tencent.mm.sdk.modelmsg.** implements com.tencent.mm.sdk.modelmsg.WXMediaMessage$IMediaObject {*;}
  45. -keep class com.tencent.mm.** {
  46. *;
  47. }
  48. -dontwarn twitter4j.**
  49. -keep class twitter4j.** { *; }
  50. -keep class com.tencent.** {*;}
  51. -dontwarn com.tencent.**
  52. -keep class com.kakao.** {*;}
  53. -dontwarn com.kakao.**
  54. -keep public class com.umeng.com.umeng.soexample.R$*{
  55. public static final int *;
  56. }
  57. -keep public class com.linkedin.android.mobilesdk.R$*{
  58. public static final int *;
  59. }
  60. -keepclassmembers enum * {
  61. public static **[] values();
  62. public static ** valueOf(java.lang.String);
  63. }
  64. -keep class com.tencent.open.TDialog$*
  65. -keep class com.tencent.open.TDialog$* {*;}
  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.tencent.open.PKDialog$* {*;}
  70. -keep class com.umeng.socialize.impl.ImageImpl {*;}
  71. -keep class com.sina.** {*;}
  72. -dontwarn com.sina.**
  73. -keep class com.alipay.share.sdk.** {
  74. *;
  75. }
  76. -keepnames class * implements android.os.Parcelable {
  77. public static final ** CREATOR;
  78. }
  79. -keep class com.linkedin.** { *; }
  80. -keep class com.android.dingtalk.share.ddsharemodule.** { *; }
  81. #指定代码的压缩级别
  82. -optimizationpasses 5
  83. #不去忽略非公共的库类
  84. -dontskipnonpubliclibraryclasses
  85. -dontskipnonpubliclibraryclassmembers
  86. # 是否使用大小写混合
  87. -dontusemixedcaseclassnames
  88. #预校验
  89. -dontpreverify
  90. #混淆时是否记录日志
  91. -verbose
  92. #忽略警告,避免打包时某些警告出现
  93. -ignorewarning
  94. # 混淆时所采用的算法
  95. -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
  96. #保护注解
  97. -keepattributes *Annotation*
  98. #记录生成的日志数据,gradle build时在本项目根目录输出
  99. #apk 包内所有 class 的内部结构
  100. -dump class_files.txt
  101. #未混淆的类和成员
  102. -printseeds seeds.txt
  103. #列出从 apk 中删除的代码
  104. -printusage unused.txt
  105. #混淆前后的映射
  106. -printmapping mapping.txt
  107. # 保持哪些类不被混淆
  108. -keep public class * extends android.app.Activity
  109. -keep public class * extends android.app.Fragment
  110. -keep public class * extends android.app.Application
  111. -keep public class * extends android.app.Service
  112. -keep public class * extends android.content.BroadcastReceiver
  113. -keep public class * extends android.content.ContentProvider
  114. -keep public class * extends android.app.backup.BackupAgentHelper
  115. -keep public class * extends android.preference.Preference
  116. -keep public class com.android.vending.licensing.ILicensingService
  117. -keep class * implements java.io.Serializable
  118. -keepattributes *Annotation*
  119. -keepclassmembers class ** {
  120. @org.greenrobot.eventbus.Subscribe <methods>;
  121. }
  122. -keep enum org.greenrobot.eventbus.ThreadMode { *; }
  123. # Only required if you use AsyncExecutor
  124. -keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
  125. <init>(java.lang.Throwable);
  126. }
  127. #app
  128. #忽略bean类
  129. -keep class com.googlecode.protobuf.format.** { *; }
  130. -keep class com.kfzs.duanduan.bean.** { *; }
  131. -keep class com.kfzs.duanduan.proto.** { *; }
  132. -keep class com.sheep.gamegroup.model.** { *; }
  133. -keep class com.sheep.gamegroup.module.*.model.** { *; }
  134. -keep class com.sheep.jiuyan.samllsheep.bean.** { *; }
  135. -keep class com.sheep.gamegroup.greendao.** { *; }
  136. -keep class com.jcodecraeer.** { *; }
  137. -keep class com.sheep.jiuyan.samllsheep.service.DownloadService { *; }
  138. -keep class com.sheep.jiuyan.samllsheep.wxapi.WXEntryActivity.** { *; }
  139. #datashare
  140. -keep class com.kfzs.duanduan.data.graph.** { *; }
  141. -keep class com.kfzs.duanduan.datashare.** { *; }
  142. #ari
  143. #-keep class com.arialyy.** { *; }
  144. -dontwarn com.arialyy.aria.**
  145. -keep class com.arialyy.aria.**{*;}
  146. -keep class **$$DownloadListenerProxy{ *; }
  147. -keep class **$$UploadListenerProxy{ *; }
  148. -keep class **$$DownloadGroupListenerProxy{ *; }
  149. -keepclasseswithmembernames class * {
  150. @Download.* <methods>;
  151. @Upload.* <methods>;
  152. @DownloadGroup.* <methods>;
  153. }
  154. -keep class org.** { *; }
  155. -keep class sun.** { *; }
  156. -keep class net.** { *; }
  157. -keep class com.fasterxml.** { *; }
  158. -keep class javax.** { *; }
  159. -keep class rx.** { *; }
  160. # klein
  161. -keep class com.tencent.tgpa.**{*;}
  162. -keep class com.tencent.klevin.**{*;}
  163. -keep class com.tencent.protocol.sspservice.**{*;}
  164. # Retrofit 2.X
  165. ## https://square.github.io/retrofit/ ##
  166. -dontwarn retrofit2.**
  167. -keep class retrofit2.** { *; }
  168. -keepattributes Signature
  169. -keepattributes Exceptions
  170. -keepclasseswithmembers class * {
  171. @retrofit2.http.* <methods>;
  172. }
  173. # Retrofit 1.X
  174. -keep class com.squareup.okhttp.** { *; }
  175. -keep class retrofit.** { *; }
  176. -keep interface com.squareup.okhttp.** { *; }
  177. -dontwarn com.squareup.okhttp.**
  178. -dontwarn okio.**
  179. -dontwarn retrofit.**
  180. -dontwarn rx.**
  181. -keepclasseswithmembers class * {
  182. @retrofit.http.* <methods>;
  183. }
  184. # If in your rest service interface you use methods with Callback argument.
  185. -keepattributes Exceptions
  186. # If your rest service methods throw custom exceptions, because you've defined an ErrorHandler.
  187. -keepattributes Signature
  188. # 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.
  189. # Here include the POJO's that have you have created for mapping JSON response to POJO for example.
  190. ## Square Otto specific rules ##
  191. ## https://square.github.io/otto/ ##
  192. -keepattributes *Annotation*
  193. -keepclassmembers class ** {
  194. @com.squareup.otto.Subscribe public *;
  195. @com.squareup.otto.Produce public *;
  196. }
  197. ## Square Picasso specific rules ##
  198. ## https://square.github.io/picasso/ ##
  199. -dontwarn com.squareup.okhttp.**
  200. # OkHttp
  201. -keepattributes Signature
  202. -keepattributes *Annotation*
  203. -keep class okhttp3.** { *; }
  204. -keep interface okhttp3.** { *; }
  205. -dontwarn okhttp3.**
  206. # Dagger ProGuard rules.
  207. # https://github.com/square/dagger
  208. -dontwarn dagger.internal.codegen.**
  209. -keepclassmembers,allowobfuscation class * {
  210. @javax.inject.* *;
  211. @dagger.* *;
  212. <init>();
  213. }
  214. -keep class dagger.* { *; }
  215. -keep class javax.inject.* { *; }
  216. -keep class * extends dagger.internal.Binding
  217. -keep class * extends dagger.internal.ModuleAdapter
  218. -keep class * extends dagger.internal.StaticInjection
  219. # RxJava 0.21
  220. -keep class rx.schedulers.Schedulers {
  221. public static <methods>;
  222. }
  223. -keep class rx.schedulers.ImmediateScheduler {
  224. public <methods>;
  225. }
  226. -keep class rx.schedulers.TestScheduler {
  227. public <methods>;
  228. }
  229. -keep class rx.schedulers.Schedulers {
  230. public static ** test();
  231. }
  232. # Configuration for Guava 18.0
  233. #
  234. # disagrees with instructions provided by Guava project: https://code.google.com/p/guava-libraries/wiki/UsingProGuardWithGuava
  235. -keep class com.google.common.io.Resources {
  236. public static <methods>;
  237. }
  238. -keep class com.google.common.collect.Lists {
  239. public static ** reverse(**);
  240. }
  241. -keep class com.google.common.base.Charsets {
  242. public static <fields>;
  243. }
  244. -keep class com.google.common.base.Joiner {
  245. public static com.google.common.base.Joiner on(java.lang.String);
  246. public ** join(...);
  247. }
  248. -keep class com.google.common.collect.MapMakerInternalMap$ReferenceEntry
  249. -keep class com.google.common.cache.LocalCache$ReferenceEntry
  250. # http://stackoverflow.com/questions/9120338/proguard-configuration-for-guava-with-obfuscation-and-optimization
  251. -dontwarn javax.annotation.**
  252. -dontwarn javax.inject.**
  253. -dontwarn sun.misc.Unsafe
  254. # Guava 19.0
  255. -dontwarn java.lang.ClassValue
  256. -dontwarn com.google.j2objc.annotations.Weak
  257. -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
  258. ## GSON 2.2.4 specific rules ##
  259. # Gson uses generic type information stored in a class file when working with fields. Proguard
  260. # removes such information by default, so configure it to keep all of it.
  261. -keepattributes Signature
  262. # For using GSON @Expose annotation
  263. -keepattributes *Annotation*
  264. -keepattributes EnclosingMethod
  265. # Gson specific classes
  266. -keep class sun.misc.Unsafe { *; }
  267. -keep class com.google.gson.stream.** { *; }
  268. # GreenDao rules
  269. # Source: http://greendao-orm.com/documentation/technical-faq
  270. #
  271. -keepclassmembers class * extends de.greenrobot.dao.AbstractDao {
  272. public static java.lang.String TABLENAME;
  273. }
  274. -keep class **$Properties
  275. # Glide specific rules #
  276. # https://github.com/bumptech/glide
  277. -keep public class * implements com.bumptech.glide.module.GlideModule
  278. -keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
  279. **[] $VALUES;
  280. public *;
  281. }
  282. # Fresco v0.8.1 ProGuard rules.
  283. # https://github.com/facebook/fresco
  284. -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
  285. # Do not strip any method/class that is annotated with @DoNotStrip
  286. -keep @com.facebook.common.internal.DoNotStrip class *
  287. -keepclassmembers class * {
  288. @com.facebook.common.internal.DoNotStrip *;
  289. }
  290. # Keep native methods
  291. -keepclassmembers class * {
  292. native <methods>;
  293. }
  294. -dontwarn okio.**
  295. -dontwarn javax.annotation.**
  296. -dontwarn com.android.volley.toolbox.**
  297. ## New rules for EventBus 3.0.x ##
  298. # http://greenrobot.org/eventbus/documentation/proguard/
  299. -keepattributes *Annotation*
  300. -keepclassmembers class ** {
  301. @org.greenrobot.eventbus.Subscribe <methods>;
  302. }
  303. -keep enum org.greenrobot.eventbus.ThreadMode { *; }
  304. # Only required if you use AsyncExecutor
  305. -keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
  306. <init>(java.lang.Throwable);
  307. }
  308. #Easy-Adapter v1.5.0
  309. -keepattributes *Annotation*
  310. -keepclassmembers class * extends uk.co.ribot.easyadapter.ItemViewHolder {
  311. public <init>(...);
  312. }
  313. # Crashlytics 2.+
  314. -keep class com.crashlytics.** { *; }
  315. -keep class com.crashlytics.android.**
  316. -keepattributes SourceFile, LineNumberTable, *Annotation*
  317. # If you are using custom exceptions, add this line so that custom exception types are skipped during obfuscation:
  318. -keep public class * extends java.lang.Exception
  319. # For Fabric to properly de-
  320. # ButterKnife 7
  321. -keep class butterknife.** { *; }
  322. -dontwarn butterknife.internal.**
  323. -keep class **$$ViewBinder { *; }
  324. -keepclasseswithmembernames class * {
  325. @butterknife.* <fields>;
  326. }
  327. -keepclasseswithmembernames class * {
  328. @butterknife.* <methods>;
  329. }
  330. # fastjson proguard rules
  331. # https://github.com/alibaba/fastjson
  332. -dontwarn com.alibaba.fastjson.**
  333. -keepattributes Signature
  334. -keepattributes *Annotation*
  335. ## ActionBarSherlock 4.4.0 specific rules ##
  336. -keep class android.support.v4.app.** { *; }
  337. -keep interface android.support.v4.app.** { *; }
  338. -keep class com.actionbarsherlock.** { *; }
  339. -keep interface com.actionbarsherlock.** { *; }
  340. -keepattributes *Annotation*
  341. ## hack for Actionbarsherlock 4.4.0, see https://github.com/JakeWharton/ActionBarSherlock/issues/1001 ##
  342. -dontwarn com.actionbarsherlock.internal.**
  343. ## SVG Android ##
  344. #https://github.com/pents90/svg-android
  345. -keep class com.larvalabs.svgandroid.** {*;}
  346. -keep class com.larvalabs.svgandroid.*$* {*;}
  347. -keep public class android.support.v7.widget.** { *; }
  348. -keep public class android.support.v7.internal.widget.** { *; }
  349. -keep public class android.support.v7.internal.view.menu.** { *; }
  350. -keep public class * extends android.support.v4.view.ActionProvider {
  351. public <init>(android.content.Context);
  352. }
  353. -dontwarn android.support.design.**
  354. -keep class android.support.design.** { *; }
  355. -keep interface android.support.design.** { *; }
  356. -keep public class android.support.design.R$* { *; }
  357. ##极光推送
  358. -dontoptimize
  359. -dontpreverify
  360. -dontwarn cn.jpush.**
  361. -keep class cn.jpush.** { *; }
  362. -keep class * extends cn.jpush.android.helpers.JPushMessageReceiver { *; }
  363. -dontwarn cn.jiguang.**
  364. -keep class cn.jiguang.** { *; }
  365. #2.0.5 ~ 2.1.7 版本有引入 gson 和 protobuf ,增加排除混淆的配置。(2.1.8版本不需配置)
  366. #==================gson && protobuf==========================
  367. -dontwarn com.google.**
  368. -keep class com.google.gson.** {*;}
  369. -keep class com.google.protobuf.** {*;}
  370. # banner 的混淆代码
  371. -keep class com.youth.banner.** {
  372. *;
  373. }
  374. #==================compile 'com.haibin:calendarview:3.4.4'==========================
  375. -keepclasseswithmembers class * {
  376. public <init>(android.content.Context);
  377. }
  378. #==================插件化框架 https://github.com/didi/VirtualAPK==========================
  379. -keep class com.didi.virtualapk.internal.VAInstrumentation { *; }
  380. -keep class com.didi.virtualapk.internal.PluginContentResolver { *; }
  381. -dontwarn com.didi.virtualapk.**
  382. -dontwarn android.**
  383. -keep class android.** { *; }
  384. #下面的库在host和media plugin中都有使用,混淆后在media中找不到类,暂时不混淆
  385. -keep class com.alibaba.fastjson.** { *; }
  386. -keep class com.chad.library.** { *; }
  387. -keep class com.bumptech.glide.** { *; }
  388. #==================webView 缓存优化初始化 https://github.com/yale8848/CacheWebView==========================
  389. #CacheWebview
  390. -dontwarn ren.yale.android.cachewebviewlib.**
  391. -keep class ren.yale.android.cachewebviewlib.**{*;}
  392. #okhttp
  393. -dontwarn okhttp3.**
  394. -keep class okhttp3.**{*;}
  395. #okio
  396. -dontwarn okio.**
  397. -keep class okio.**{*;}
  398. #==================GSYVideoPlayer https://github.com/CarGuo/GSYVideoPlayer==========================
  399. -keep class com.shuyu.gsyvideoplayer.video.** { *; }
  400. -dontwarn com.shuyu.gsyvideoplayer.video.**
  401. -keep class com.shuyu.gsyvideoplayer.video.base.** { *; }
  402. -dontwarn com.shuyu.gsyvideoplayer.video.base.**
  403. -keep class com.shuyu.gsyvideoplayer.utils.** { *; }
  404. -dontwarn com.shuyu.gsyvideoplayer.utils.**
  405. -keep class tv.danmaku.ijk.** { *; }
  406. -dontwarn tv.danmaku.ijk.**
  407. -keep public class * extends android.view.View{
  408. *** get*();
  409. void set*(***);
  410. public <init>(android.content.Context);
  411. public <init>(android.content.Context, android.util.AttributeSet);
  412. public <init>(android.content.Context, android.util.AttributeSet, int);
  413. }
  414. #==================https://github.com/koral--/android-gif-drawable==========================
  415. -keep public class pl.droidsonroids.gif.GifIOException{<init>(int, java.lang.String);}
  416. #==================鸿途信达广告sdk==========================
  417. -keep class com.hc.**{*;}
  418. -keep class com.hoc.**{*;}
  419. #==================现在支付保护区====================================
  420. -optimizationpasses 5
  421. -dontusemixedcaseclassnames
  422. -dontskipnonpubliclibraryclasses
  423. -dontskipnonpubliclibraryclassmembers
  424. -dontpreverify
  425. -verbose
  426. -printmapping proguardMapping.txt
  427. -optimizations !code/simplification/cast,!field/*,!class/merging/*
  428. -keepattributes *Annotation*,InnerClasses
  429. -keepattributes Signature
  430. -keepattributes SourceFile,LineNumberTable
  431. -ignorewarnings
  432. -keep class com.alipay.android.app.IAlixPay{*;}
  433. -keep class com.alipay.android.app.IAlixPay$Stub{*;}
  434. -keep class com.alipay.android.app.IRemoteServiceCallback{*;}
  435. -keep class com.alipay.android.app.IRemoteServiceCallback$Stub{*;}
  436. -keep class com.alipay.sdk.app.PayTask{ public *;}
  437. -keep class com.alipay.sdk.auth.AlipaySDK{ public *;}
  438. -keep class com.alipay.sdk.auth.APAuthInfo{ public *;}
  439. -keep class com.alipay.mobilesecuritysdk.*
  440. -keep class com.ut.*
  441. -keep class cn.gov.pbc.tsm.*{*;}
  442. -keep class com.UCMobile.PayPlugin.*{*;}
  443. -keep class com.unionpay.*{*;}
  444. -dontwarn com.unionpay.**
  445. -keep class com.ipaynow.plugin.api.IpaynowPlugin{
  446. <fields>;
  447. <methods>;
  448. }
  449. -keep class com.ipaynow.plugin.manager.route.dto.RequestParams{
  450. <fields>;
  451. <methods>;
  452. }
  453. -keep class com.ipaynow.plugin.manager.route.dto.ResponseParams{
  454. <fields>;
  455. <methods>;
  456. }
  457. -keep class com.ipaynow.plugin.manager.route.impl.ReceivePayResult{
  458. <fields>;
  459. <methods>;
  460. }
  461. -keep class com.alipay.android.app.IAlixPay {
  462. <fields>;
  463. <methods>;
  464. }
  465. -keep class com.ipaynow.plugin.utils.StringUtils{
  466. <fields>;
  467. <methods>;
  468. }
  469. -keep class com.alipay.android.app.IRemoteServiceCallback {
  470. <fields>;
  471. <methods>;
  472. }
  473. -keep class com.ipaynow.plugin.utils.NativeUtils{
  474. <fields>;
  475. <methods>;
  476. }
  477. #===============百度人脸识别======================
  478. -keep class com.baidu.idl.** { *; }
  479. -keep class com.baidu.aip.** { *; }
  480. #===============点客广告SDK======================
  481. -keep class btmsdkobf.** { *; }
  482. -keep class com.tmsdk.** { *; }
  483. -keep class tmsdk.** { *; }
  484. #===============安全联盟=========================
  485. -keep class com.bun.miitmdid.core.** {*;}