-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproguard-rules.pro
More file actions
271 lines (207 loc) · 7.33 KB
/
proguard-rules.pro
File metadata and controls
271 lines (207 loc) · 7.33 KB
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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
############################################
# BACKPACK LIBRARY
############################################
-keep class com.vdx.backpack.** { *; }
-keepclassmembers class com.vdx.backpack.** { *; }
# Public APIs
-keep public class com.vdx.backpack.core.BackpackManager { *; }
-keep public class com.vdx.backpack.core.BackupConfig { *; }
-keep public class com.vdx.backpack.core.BackupResult { *; }
-keep public class com.vdx.backpack.core.BackupMetadata { *; }
-keep public interface com.vdx.backpack.storage.CloudStorageProvider { *; }
############################################
# ROOM DATABASE
############################################
-keep class * extends androidx.room.RoomDatabase
-keep @androidx.room.Entity class *
-keep @androidx.room.Dao class *
-dontwarn androidx.room.paging.**
-keepclassmembers class * extends androidx.room.RoomDatabase {
public static ** getDatabase(...);
}
############################################
# GOOGLE DRIVE & GOOGLE API CLIENT
############################################
# Core Google API client libraries
-keep class com.google.api.** { *; }
-keep class com.google.api.client.** { *; }
-keep class com.google.api.services.drive.** { *; }
-dontwarn com.google.api.**
-dontwarn com.google.api.client.**
-dontwarn com.google.api.services.drive.**
# FIX: required for GoogleJsonError & parsing
-keep class com.google.api.client.googleapis.json.** { *; }
-keep class com.google.api.client.googleapis.services.json.** { *; }
-keep class com.google.api.client.json.** { *; }
-keep class com.google.api.client.util.** { *; }
# Keep all fields with @Key annotation
-keepclassmembers class * {
@com.google.api.client.util.Key <fields>;
}
# Required for HTTP + parsing
-keep class com.google.api.client.http.** { *; }
# Required so JSON parser can instantiate models
-keep class com.google.api.services.drive.model.** { *; }
# Prevent stripping annotation + signature metadata
-keepattributes Signature
-keepattributes *Annotation*
-keepattributes EnclosingMethod, InnerClasses
############################################
# GOOGLE OAUTH / PLAY SERVICES
############################################
-keep class com.google.android.gms.** { *; }
-keep class com.google.android.gms.auth.** { *; }
-keep class com.google.android.gms.common.** { *; }
-dontwarn com.google.android.gms.**
############################################
# ANDROID KEYSTORE / CRYPTO
############################################
-keep class android.security.keystore.** { *; }
-keep class javax.crypto.** { *; }
-keep class java.security.** { *; }
-dontwarn javax.crypto.**
-dontwarn java.security.**
############################################
# KOTLIN
############################################
-keep class kotlin.** { *; }
-keep class kotlin.Metadata { *; }
-dontwarn kotlin.**
-keepclassmembers class **$WhenMappings { <fields>; }
-keepclassmembers class kotlin.Metadata {
public <methods>;
}
# Coroutines
-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
-keepclassmembers class kotlinx.coroutines.** {
volatile <fields>;
}
-keepclassmembers class kotlin.coroutines.SafeContinuation {
volatile <fields>;
}
-dontwarn kotlinx.coroutines.**
############################################
# HILT / DAGGER
############################################
-keep class dagger.** { *; }
-keep class javax.inject.** { *; }
-keepclassmembers,allowobfuscation class * {
@javax.inject.* *;
@dagger.* *;
}
-keep @dagger.Module class *
-keep @dagger.hilt.** class *
############################################
# GSON
############################################
-keepattributes Signature
-keepattributes *Annotation*
-keep class com.google.gson.** { *; }
-keep class * implements com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}
-dontwarn sun.misc.**
############################################
# TIMBER
############################################
-keep class timber.log.** { *; }
-dontwarn timber.log.**
############################################
# ANDROID GENERAL
############################################
-keepattributes SourceFile,LineNumberTable
-keepattributes *Annotation*
-keepattributes Signature
-keepattributes Exceptions
-keepattributes InnerClasses
-keepattributes EnclosingMethod
# Keep native methods
-keepclasseswithmembernames class * {
native <methods>;
}
# View getters/setters
-keepclassmembers public class * extends android.view.View {
void set*(***);
*** get*();
}
# Activities & Fragments
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Fragment
-keep public class * extends androidx.fragment.app.Fragment
############################################
# WORKMANAGER
############################################
-keep class androidx.work.** { *; }
-dontwarn androidx.work.**
-keep class * extends androidx.work.Worker
-keep class * extends androidx.work.ListenableWorker
# Required Worker constructors
-keepclassmembers class * extends androidx.work.Worker {
public <init>(android.content.Context, androidx.work.WorkerParameters);
}
-keepclassmembers class * extends androidx.work.ListenableWorker {
public <init>(android.content.Context, androidx.work.WorkerParameters);
}
# Backpack-specific workers
-keep class com.vdx.backpack.worker.AutoBackupWorker {
public <init>(android.content.Context, androidx.work.WorkerParameters);
}
-keep class com.vdx.backpack.worker.** extends androidx.work.Worker {
public <init>(...);
}
############################################
# PARCELABLE
############################################
-keepclassmembers class * implements android.os.Parcelable {
public static final ** CREATOR;
}
############################################
# SERIALIZABLE
############################################
-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();
}
############################################
# LOG REMOVAL (RELEASE ONLY)
############################################
-assumenosideeffects class android.util.Log {
public static *** d(...);
public static *** v(...);
public static *** i(...);
}
-assumenosideeffects class timber.log.Timber {
public static *** d(...);
public static *** v(...);
public static *** i(...);
}
############################################
# OPTIMIZATION
############################################
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-verbose
-keep class com.google.** { *;}
-keep interface com.google.** { *;}
-dontwarn com.google.**
-dontwarn sun.misc.Unsafe
-dontwarn com.google.common.collect.MinMaxPriorityQueue
-keepattributes *Annotation*,Signature
-keep class * extends com.google.api.client.json.GenericJson {
*;
}
-keep class com.google.api.services.drive.** {
*;
}