-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathproguard.cfg
238 lines (198 loc) · 7.7 KB
/
proguard.cfg
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
-optimizationpasses 15
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-dontobfuscate
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-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
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-keepattributes Signature,RuntimeVisibleAnnotations,AnnotationDefault,*Annotation*
-keep,allowshrinking,allowoptimization class org.xmlpull.**
-keep,includedescriptorclasses class org.commcare.** { *; }
-keep,includedescriptorclasses class org.odk.collect.android.** { *; }
-keep,includedescriptorclasses class org.javarosa.** { *; }
-keep class in.uncod.android.bypass.** { *; }
-keep class org.bouncycastle.** { *; }
-keep class org.joda.time.DateTime { *; }
-dontwarn sun.misc.Unsafe
-dontwarn org.xmlpull.v1.**
-dontwarn org.kxml2.io.**
-dontwarn android.content.res.**
-dontwarn javax.annotation.**,javax.microedition.**
-dontwarn org.apache.**
-dontwarn org.joda.**
-dontwarn org.jdom.**
-dontwarn net.jcip.annotations.**
-dontwarn org.bouncycastle.**
-dontwarn com.google.android.gms.internal.zzhu
-dontwarn org.jdom2.**
-dontwarn net.nightwhistler.htmlspanner.**
-dontwarn au.com.bytecode.opencsv.**
-dontwarn uk.co.westhawk.snmp.**
-dontwarn com.fasterxml.jackson.databind.**
-dontwarn com.google.zxing.**
-dontwarn javax.ws.rs.core.UriBuilder
-dontwarn javax.xml.datatype.*
-allowaccessmodification
-flattenpackagehierarchy
-keep class net.sqlcipher.** { *; }
-keep public class * extends android.view.View {
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
public void set*(...);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keep class javax.xml.bind.annotation.** { *; }
-dontwarn javax.xml.bind.annotation.**
#OkHttp3
-keepattributes Signature
-keepattributes *Annotation*
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**
-dontnote okhttp3.**
#Retrofit Stuff
-keep class retrofit2.Call { *; }
-dontnote retrofit2.Platform
-dontwarn retrofit2.Platform$Java8
-keepattributes Signature
-keepattributes Exceptions
-dontwarn okio.**
-dontwarn java.lang.invoke.*
-dontwarn **$$Lambda$*
#Crashlytics (https://docs.fabric.io/android/crashlytics/dex-and-proguard.html)
-keepattributes *Annotation*
-keepattributes SourceFile,LineNumberTable
-keep public class * extends java.lang.Exception
-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**
-keep public class com.google.android.gms.* { public *; }
-dontwarn com.google.android.gms.**
-dontwarn com.caverock.androidsvg.**
-keep class com.caverock.androidsvg.** { *; }
#More rules so that instrumentation tests don't throw NoSuchMethodExceptions
-keepclassmembers class androidx.localbroadcastmanager.content.LocalBroadcastManager {
public void sendBroadcastSync(android.content.Intent);
}
-keep class kotlin.collections.ArraysKt { *; }
-keep class kotlin.collections.CollectionsKt { *; }
-keep class kotlin.text.StringsKt { *; }
# Guava Config Start
-dontwarn javax.lang.model.element.Modifier
# Note: We intentionally don't add the flags we'd need to make Enums work.
# That's because the Proguard configuration required to make it work on
# optimized code would preclude lots of optimization, like converting enums
# into ints.
# Throwables uses internal APIs for lazy stack trace resolution
-dontnote sun.misc.SharedSecrets
-keep class sun.misc.SharedSecrets {
*** getJavaLangAccess(...);
}
-dontnote sun.misc.JavaLangAccess
-keep class sun.misc.JavaLangAccess {
*** getStackTraceElement(...);
*** getStackTraceDepth(...);
}
# FinalizableReferenceQueue calls this reflectively
# Proguard is intelligent enough to spot the use of reflection onto this, so we
# only need to keep the names, and allow it to be stripped out if
# FinalizableReferenceQueue is unused.
-keepnames class com.google.common.base.internal.Finalizer {
*** startFinalizer(...);
}
# However, it cannot "spot" that this method needs to be kept IF the class is.
-keepclassmembers class com.google.common.base.internal.Finalizer {
*** startFinalizer(...);
}
-keepnames class com.google.common.base.FinalizableReference {
void finalizeReferent();
}
-keepclassmembers class com.google.common.base.FinalizableReference {
void finalizeReferent();
}
# Striped64, LittleEndianByteArray, UnsignedBytes, AbstractFuture
-dontwarn sun.misc.Unsafe
# Striped64 appears to make some assumptions about object layout that
# really might not be safe. This should be investigated.
-keepclassmembers class com.google.common.cache.Striped64 {
*** base;
*** busy;
}
-keepclassmembers class com.google.common.cache.Striped64$Cell {
<fields>;
}
-dontwarn java.lang.SafeVarargs
-keep class java.lang.Throwable {
*** addSuppressed(...);
}
# Futures.getChecked, in both of its variants, is incompatible with proguard.
# Used by AtomicReferenceFieldUpdater and sun.misc.Unsafe
-keepclassmembers class com.google.common.util.concurrent.AbstractFuture** {
*** waiters;
*** value;
*** listeners;
*** thread;
*** next;
}
-keepclassmembers class com.google.common.util.concurrent.AtomicDouble {
*** value;
}
-keepclassmembers class com.google.common.util.concurrent.AggregateFutureState {
*** remaining;
*** seenExceptions;
}
# Since Unsafe is using the field offsets of these inner classes, we don't want
# to have class merging or similar tricks applied to these classes and their
# fields. It's safe to allow obfuscation, since the by-name references are
# already preserved in the -keep statement above.
-keep,allowshrinking,allowobfuscation class com.google.common.util.concurrent.AbstractFuture** {
<fields>;
}
# Futures.getChecked (which often won't work with Proguard anyway) uses this. It
# has a fallback, but again, don't use Futures.getChecked on Android regardless.
-dontwarn java.lang.ClassValue
# MoreExecutors references AppEngine
-dontnote com.google.appengine.api.ThreadManager
-keep class com.google.appengine.api.ThreadManager {
static *** currentRequestThreadFactory(...);
}
-dontnote com.google.apphosting.api.ApiProxy
-keep class com.google.apphosting.api.ApiProxy {
static *** getCurrentEnvironment (...);
}
# Multimaps come as null from bundle.getExtra without this
-keep class com.google.common.collect.** { *; }
# androidx.test.ext.truth.content.IntentSubject.hasAction fails in it-tests without this
-keep class com.google.common.base.Preconditions { *; }
# Guava Config End