Jeongik Cha | 4d8477e | 2024-10-30 13:27:51 +0900 | [diff] [blame] | 1 | ##---------------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 Yoo | 675f133 | 2024-11-20 19:29:05 +0900 | [diff] [blame] | 14 | -keep class com.android.virtualization.terminal.ConfigJson { <fields>; } |
| 15 | -keep class com.android.virtualization.terminal.ConfigJson$* { <fields>; } |
Jeongik Cha | 4d8477e | 2024-10-30 13:27:51 +0900 | [diff] [blame] | 16 | |
| 17 | # Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory, |
| 18 | # JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter) |
| 19 | -keep class * extends com.google.gson.TypeAdapter |
| 20 | -keep class * implements com.google.gson.TypeAdapterFactory |
| 21 | -keep class * implements com.google.gson.JsonSerializer |
| 22 | -keep class * implements com.google.gson.JsonDeserializer |
| 23 | |
| 24 | # Prevent R8 from leaving Data object members always null |
| 25 | -keepclassmembers,allowobfuscation class * { |
| 26 | @com.google.gson.annotations.SerializedName <fields>; |
Jeongik Cha | 4a8ee3a | 2024-09-20 18:06:29 +0900 | [diff] [blame] | 27 | } |
Jeongik Cha | 4d8477e | 2024-10-30 13:27:51 +0900 | [diff] [blame] | 28 | |
| 29 | # Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher. |
| 30 | -keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken |
| 31 | -keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken |
| 32 | |
Jiyong Park | 6a2a4dc | 2024-11-05 07:33:00 +0900 | [diff] [blame] | 33 | ##---------------End: proguard configuration for Gson ---------- |