2023-08-22 17:40:31 +02:00
|
|
|
# Include common rules
|
|
|
|
-include common.pro
|
2023-05-28 21:24:05 +02:00
|
|
|
|
|
|
|
### The following rules are needed for R8 in "full mode", which performs more aggressive optimizations than ProGuard
|
2023-06-07 20:02:13 +02:00
|
|
|
### See https://r8.googlesource.com/r8/+/refs/heads/main/compatibility-faq.md#r8-full-mode
|
2023-05-28 21:24:05 +02:00
|
|
|
|
|
|
|
# For classes with generic type parameter R8 in "full mode" requires to have a keep rule to
|
|
|
|
# preserve the generic signature
|
|
|
|
-keep,allowshrinking,allowoptimization,allowobfuscation,allowaccessmodification class com.example.GenericClasses$GenericClass
|
|
|
|
-keep,allowshrinking,allowoptimization,allowobfuscation,allowaccessmodification class com.example.GenericClasses$GenericUsingGenericClass
|
|
|
|
|
|
|
|
# Don't obfuscate class name, to check it in exception message
|
2023-09-05 15:47:54 +02:00
|
|
|
-keep,allowshrinking,allowoptimization class com.example.NoSerializedNameMain$TestClassNoArgsConstructor
|
|
|
|
-keep,allowshrinking,allowoptimization class com.example.NoSerializedNameMain$TestClassHasArgsConstructor
|
2023-07-24 16:34:02 +02:00
|
|
|
|
2023-05-28 21:24:05 +02:00
|
|
|
# This rule has the side-effect that R8 still removes the no-args constructor, but does not make the class abstract
|
2023-08-22 17:40:31 +02:00
|
|
|
-keep class com.example.NoSerializedNameMain$TestClassNotAbstract {
|
2023-05-28 21:24:05 +02:00
|
|
|
@com.google.gson.annotations.SerializedName <fields>;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Keep enum constants which are not explicitly used in code
|
2023-07-24 16:34:02 +02:00
|
|
|
-keepclassmembers class com.example.EnumClass {
|
2023-05-28 21:24:05 +02:00
|
|
|
** SECOND;
|
|
|
|
}
|