zhuguifei
2025-12-30 61eee1173c00a7ba9d9c748d28fe3acdb33b9441
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
#-------------------------------------------定制化区域----------------------------------------------
#---------------------------------1.实体类---------------------------------
 
-keep class com.shlb.comb.model.** { *; }
 
#-------------------------------------------------------------------------
 
#---------------------------------2.第三方包-------------------------------
 
#eventbus
-keepattributes *Annotation*
-keepclassmembers class * {
    @org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
 
# If using AsyncExecutord, keep required constructor of default event used.
# Adjust the class name if a custom failure event type is used.
-keepclassmembers class org.greenrobot.eventbus.util.ThrowableFailureEvent {
    <init>(java.lang.Throwable);
}
##--------------- Androidx ----------
-keep class com.google.android.material.** {*;}
-keep class androidx.** {*;}
-keep public class * extends androidx.**
-keep interface androidx.** {*;}
-dontwarn com.google.android.material.**
-dontnote com.google.android.material.**
-dontwarn androidx.**
##--------------- Androidx ----------
 
##--------------- QmUi ----------
-keep class **_FragmentFinder { *; }
-keep class androidx.fragment.app.* { *; }
 
-keep class com.qmuiteam.qmui.arch.record.RecordIdClassMap { *; }
-keep class com.qmuiteam.qmui.arch.record.RecordIdClassMapImpl { *; }
 
-keep class com.qmuiteam.qmui.arch.scheme.SchemeMap {*;}
-keep class com.qmuiteam.qmui.arch.scheme.SchemeMapImpl {*;}
##--------------- QmUi ----------
 
# Accessed via reflection, avoid renaming or removal
-keep class org.greenrobot.eventbus.android.AndroidComponentsImpl
 
#fastjson
-keepattributes Signature
-dontwarn com.alibaba.fastjson.**
-keep class com.alibaba.fastjson.**{*; }
#picasso
-dontwarn com.squareup.okhttp.**
#okhttp #okio
-dontwarn okhttp3.**
-dontwarn okio.**
-dontwarn javax.annotation.**
#retrofit2
-dontwarn retrofit2.**
#rx
-dontwarn rx.**
#alipay
-dontwarn com.alipay.**
#rxeasyhttp
-keep class com.zhouyou.http.model.** {*;}
-keep class com.zhouyou.http.cache.model.** {*;}
-keep class com.zhouyou.http.cache.stategy.**{*;}
 
 
# -keep class com.zhouyou.http.** { *;}
#MPAndroidchart
-keep class com.github.mikephil.** { *;}
#pgy
-dontwarn com.pgyersdk.**
-keep class com.pgyersdk.** { *; }
#litpal
-keep class org.litepal.** {
    *;
}
 
-keep class * extends org.litepal.crud.DataSupport {
    *;
}
 
 
 
 
 
#-------------------------------------------------------------------------
 
#---------------------------------3.与js互相调用的类------------------------
 
 
 
#-------------------------------------------------------------------------
 
#---------------------------------4.反射相关的类和方法-----------------------
#-keep class com.shlanbao.lbmonitoring.activity.LbSearchActivity
#
#-keep class com.shlanbao.lbmonitoring.view.LbSearchView
 
 
 
#----------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
 
#-------------------------------------------基本不用动区域--------------------------------------------
#---------------------------------基本指令区----------------------------------
# 代码混淆压缩比,在0~7之间
-optimizationpasses 5
 
# 混合时不使用大小写混合,混合后的类名为小写
-dontusemixedcaseclassnames
 
# 指定不去忽略非公共库的类成员
-dontskipnonpubliclibraryclasses
# 不做预校验,preverify是proguard的四个步骤之一,Android不需要preverify,去掉这一步能够加快混淆速度。
-dontpreverify
 
# 混淆时是否记录日志,这句话能够使我们的项目混淆后产生映射文件
# 包含有类名->混淆后类名的映射关系
-verbose
 
# 避免混淆泛型
-keepattributes Signature
 
# 保留Annotation不混淆
-keepattributes *Annotation*,InnerClasses
 
#google推荐算法
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
 
# 避免混淆Annotation、内部类、泛型、匿名类
-keepattributes *Annotation*,InnerClasses,Signature,EnclosingMethod
 
# 重命名抛出异常时的文件名称
-renamesourcefileattribute SourceFile
 
# 抛出异常时保留代码行号
-keepattributes SourceFile,LineNumberTable
 
# 忽略警告
-ignorewarnings
# 优化不优化输入的类文件
-dontoptimize
 
# 保留R下面的资源
-keep class **.R$* {*;}
 
# 保留枚举类不被混淆
-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}
#----------------------------------------------------------------------------
 
#---------------------------------默认保留区---------------------------------
-keep public class * extends android.app.Activity
-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
-keep public class * extends android.view.View
-keep public class com.android.vending.licensing.ILicensingService
-keep class android.support.** {*;}
 
-keep public class * extends android.view.View{
    *** get*();
    void set*(***);
    public <init>(android.content.Context);
    public <init>(android.content.Context, android.util.AttributeSet);
    public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclasseswithmembers class * {
    public <init>(android.content.Context);
    public <init>(android.content.Context, android.util.AttributeSet);
    public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers class * implements java.io.Serializable {
    static final long serialVersionUID;
    private static final java.io.ObjectStreamField[] serialPersistentFields;
    private void writeObject(java.io.ObjectOutputStream);
    private void readObject(java.io.ObjectInputStream);
    java.lang.Object writeReplace();
    java.lang.Object readResolve();
}
-keep class **.R$* {
 *;
}
-keepclassmembers class * {
    void *(**On*Event);
}
#----------------------------------------------------------------------------
 
#---------------------------------webview------------------------------------
-keepclassmembers class fqcn.of.javascript.interface.for.Webview {
   public *;
}
-keepclassmembers class * extends android.webkit.WebViewClient {
    public void *(android.webkit.WebView, java.lang.String, android.graphics.Bitmap);
    public boolean *(android.webkit.WebView, java.lang.String);
}
-keepclassmembers class * extends android.webkit.WebViewClient {
    public void *(android.webkit.WebView, jav.lang.String);
}
#----------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------