Skip to content

Commit ada3908

Browse files
committed
Merge branch 'refs/heads/develop'
2 parents 1b464bb + 5ed00c5 commit ada3908

File tree

5 files changed

+33
-4
lines changed

5 files changed

+33
-4
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ android {
4646

4747
release {
4848
minifyEnabled true
49-
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
49+
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
5050
signingConfig signingConfigs.release
5151
}
5252

app/proguard-rules.pro

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,39 @@
1919
# If you keep the line number information, uncomment this to
2020
# hide the original source file name.
2121
#-renamesourcefileattribute SourceFile
22-
-keepclassmembers enum * { *; }
2322

24-
-keep class io.github.sds100.keymapper.** { *; }
25-
-keep interface io.github.sds100.keymapper.** { *; }
23+
-keepclassmembers enum * {
24+
public static **[] values();
25+
public static ** valueOf(java.lang.String);
26+
}
27+
28+
-keepattributes Signature
29+
30+
# For using GSON @Expose annotation
31+
-keepattributes *Annotation*
32+
33+
# Gson specific classes
34+
-dontwarn sun.misc.**
35+
#-keep class com.google.gson.stream.** { *; }
36+
37+
# Keep data entities so proguard doesn't break serialization/deserialization.
38+
-keep class io.github.sds100.keymapper.data.entities.** { <fields>; }
39+
40+
# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
41+
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
42+
-keep class * extends com.google.gson.TypeAdapter
43+
-keep class * implements com.google.gson.TypeAdapterFactory
44+
-keep class * implements com.google.gson.JsonSerializer
45+
-keep class * implements com.google.gson.JsonDeserializer
46+
47+
# Prevent R8 from leaving Data object members always null
48+
-keepclassmembers,allowobfuscation class * {
49+
@com.google.gson.annotations.SerializedName <fields>;
50+
}
51+
52+
# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
53+
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
54+
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
2655

2756
-keep class com.google.android.material.** { *; }
2857

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)