blob: 71ca30462b8334d84c81986301f09b6ff0389490 [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
7-keepattributes *Annotation*
8
9# Gson specific classes
10-dontwarn sun.misc.**
11#-keep class com.google.gson.stream.** { *; }
12
13# Application classes that will be serialized/deserialized over Gson
Seungjae Yoo675f1332024-11-20 19:29:05 +090014-keep class com.android.virtualization.terminal.ConfigJson { <fields>; }
15-keep class com.android.virtualization.terminal.ConfigJson$* { <fields>; }
Jeongik Cha4d8477e2024-10-30 13:27:51 +090016
17# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
18# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
Christoffer Adamsen13537732025-01-06 17:22:22 +010019# TODO(b/373579455): Evaluate if <init> needs to be kept.
20-keep class * extends com.google.gson.TypeAdapter {
21 void <init>();
22}
23# TODO(b/373579455): Evaluate if <init> needs to be kept.
24-keep class * implements com.google.gson.TypeAdapterFactory {
25 void <init>();
26}
27# TODO(b/373579455): Evaluate if <init> needs to be kept.
28-keep class * implements com.google.gson.JsonSerializer {
29 void <init>();
30}
31# TODO(b/373579455): Evaluate if <init> needs to be kept.
32-keep class * implements com.google.gson.JsonDeserializer {
33 void <init>();
34}
Jeongik Cha4d8477e2024-10-30 13:27:51 +090035
36# Prevent R8 from leaving Data object members always null
37-keepclassmembers,allowobfuscation class * {
38 @com.google.gson.annotations.SerializedName <fields>;
Jeongik Cha4a8ee3a2024-09-20 18:06:29 +090039}
Jeongik Cha4d8477e2024-10-30 13:27:51 +090040
41# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
Christoffer Adamsen13537732025-01-06 17:22:22 +010042# TODO(b/373579455): Evaluate if <init> needs to be kept.
43-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken {
44 void <init>();
45}
46# TODO(b/373579455): Evaluate if <init> needs to be kept.
47-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken {
48 void <init>();
49}
Jeongik Cha4d8477e2024-10-30 13:27:51 +090050
Jiyong Park6a2a4dc2024-11-05 07:33:00 +090051##---------------End: proguard configuration for Gson ----------