blob: 04a214097f6437082c9dc1b0316ca5d5dd9e72ca [file] [log] [blame]
Jeongik Cha4d8477e2024-10-30 13:27:51 +09001##---------------Begin: proguard configuration for Gson ----------
2# Gson uses generic type information stored in a class file when working with fields. Proguard
3# removes such information by default, so configure it to keep all of it.
4-keepattributes Signature
5
6# For using GSON @Expose annotation
Christoffer Adamsenefcac112025-01-17 04:42:46 -08007-keepattributes RuntimeVisibleAnnotations,
8 RuntimeVisibleParameterAnnotations,
9 RuntimeVisibleTypeAnnotations,
10 AnnotationDefault
Jeongik Cha4d8477e2024-10-30 13:27:51 +090011
12# Gson specific classes
13-dontwarn sun.misc.**
14#-keep class com.google.gson.stream.** { *; }
15
16# Application classes that will be serialized/deserialized over Gson
Seungjae Yoo675f1332024-11-20 19:29:05 +090017-keep class com.android.virtualization.terminal.ConfigJson { <fields>; }
18-keep class com.android.virtualization.terminal.ConfigJson$* { <fields>; }
Jeongik Cha4d8477e2024-10-30 13:27:51 +090019
20# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
21# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
22-keep class * extends com.google.gson.TypeAdapter
23-keep class * implements com.google.gson.TypeAdapterFactory
24-keep class * implements com.google.gson.JsonSerializer
25-keep class * implements com.google.gson.JsonDeserializer
26
27# Prevent R8 from leaving Data object members always null
28-keepclassmembers,allowobfuscation class * {
29 @com.google.gson.annotations.SerializedName <fields>;
Jeongik Cha4a8ee3a2024-09-20 18:06:29 +090030}
Jeongik Cha4d8477e2024-10-30 13:27:51 +090031
32# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
33-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
34-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
35
Jiyong Park6a2a4dc2024-11-05 07:33:00 +090036##---------------End: proguard configuration for Gson ----------