-
Notifications
You must be signed in to change notification settings - Fork 7
/
proguard-rules-common.pro
168 lines (136 loc) · 5.09 KB
/
proguard-rules-common.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#通用代码混淆文件
-optimizationpasses 7 # 指定代码的压缩级别
-dontusemixedcaseclassnames # 混合时不使用大小写混合,混合后的类名为小写
-dontskipnonpubliclibraryclasses # 是否混淆第三方jar
-dontskipnonpubliclibraryclassmembers # 指定不去忽略非公共库的类成员
-dontpreverify # 混淆时是否做预校验
-dontoptimize
-dontshrink
-verbose # 混淆时是否记录日志
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/* # 混淆时所采用的算法
-keepattributes SourceFile,LineNumberTable # 抛出异常时保留代码行数
-dontwarn java.nio.file.Files
-dontwarn java.nio.file.Path
-dontwarn java.nio.file.OpenOption
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-repackageclasses
-keepattributes Exceptions
-keepattributes Signature # 避免混淆泛型
-keepattributes InnerClasses
-keepattributes *Annotation* # 保留Annotation不混淆
-keep @**annotation** class * {*;}
-keepclassmembers class ** {
@org.greenrobot.eventbus.Subscribe <methods>;
}
-keep public class * extends android.app.Application
-keep public class * extends android.app.Activity
-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
-keep public class * extends android.support.v4.app.Fragment
-keep public class com.android.vending.licensing.ILicensingService
-keep public class * extends android.view.View
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
-keepclassmembers class **.R$* {
public static <fields>;
}
-keepclassmembers public class * extends android.view.View {
void set*(***);
*** get*();
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
}
# support包
-keep class android.support.**{ *; }
-keep class android.arch.** { *; }
-keep class android.os.** { *; }
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-keep class * implements java.io.Serializable {
}
-keepclasseswithmembernames class * {
native <methods>;
}
-keep class * extends android.widget.BaseAdapter
-keep,allowobfuscation @interface android.support.annotation.Keep
-keep @android.support.annotation.Keep class *
-keepclassmembers class * {
@android.support.annotation.Keep *;
}
# 灯塔
-keep class com.tencent.beacon.** {*;}
##Glide
-dontwarn com.bumptech.glide.**
-keep class com.bumptech.glide.**{*;}
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.AppGlideModule
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
**[] $VALUES;
public *;
}
-dontwarn com.bumptech.glide.load.resource.bitmap.VideoDecoder
-keep class com.bumptech.glide.integration.okhttp3.OkHttpGlideModule
#路由
-keep class com.bihe0832.android.lib.router.stub.* {*;}
# 下拉刷新组件
-keep class com.handmark.pulltorefresh.library.** { *; }
# 微信sdk jar
-keep class com.tencent.mm.**{*;}
-dontwarn com.tencent.mm.**
-keep class com.tencent.wxop.**{*;}
-dontwarn com.tencent.wxop.**
-keep class * extends com.tencent.mm.opensdk.openapi.IWXAPIEventHandler
# opensdk jar
-keep class com.tencent.connect.**{*;}
-keep class com.tencent.map.**{*;}
-keep class com.tencent.open.**{*;}
-keep class com.tencent.qqconnect.**{*;}
-keep class com.tencent.connect.**{*;}
-keep class com.tencent.tauth.**{*;}
#X5内核
-keep class com.tencent.smtt.**{*;}
-keep class com.tencent.mtt.**{*;}
-keep class com.tencent.tbs.**{*;}
#retrofit
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**
-keep class com.squareup.**{*;}
-dontwarn retrofit.**
-keep class retrofit.** { *; }
-keepclasseswithmembers class * {
@retrofit2.http.* <methods>;
}
#gson
-dontwarn com.google.gson.**
-keep class com.google.gson.** {*;}
-keep class com.google.**{*;}
-keep class sun.misc.Unsafe { *; }
-keep class com.google.gson.stream.** { *; }
#webview Jsbridge相关
-keep class com.bihe0832.android.lib.webview.jsbridge.BaseJsBridgeProxy
-keepclassmembernames class com.bihe0832.android.lib.webview.jsbridge.BaseJsBridgeProxy {
public *;
}
-keepclassmembers class * extends com.bihe0832.android.lib.adapter.CardBaseHolder {
public <init>(android.content.Context,android.view.View);
}