##---------------Begin: proguard configuration for Gson  ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature

# Gson specific classes
-keep class sun.misc.Unsafe { *; }

# Application classes that will be serialized/deserialized over Gson
-keep class ca.mimic.oauth2library.Token { *; }
-keepclassmembers class ca.mimic.oauth2library.Token { *; }

# Prevent proguard from stripping interface information from TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

# Prevent proguard from stripping Moshi bits
-keep class com.squareup.moshi.** { *; }
-keep interface com.squareup.moshi.** { *; }

##---------------End: proguard configuration for Gson  ----------

##---------------Begin: proguard configuration for Gson  ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature

# Gson specific classes
-keep class sun.misc.Unsafe { *; }

# Application classes that will be serialized/deserialized over Gson
-keep class ca.mimic.oauth2library.Token { *; }
-keepclassmembers class ca.mimic.oauth2library.Token { *; }
-keepclassmembers class ca.mimic.oauth2library.OAuthError {
    protected <fields>;
}

# Prevent proguard from stripping interface information from TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

# Prevent proguard from stripping Moshi bits
-keep class com.squareup.moshi.** { *; }
-keep interface com.squareup.moshi.** { *; }

##---------------End: proguard configuration for Gson  ----------

Add proguard rules for OAuthError
Add proguard rules for OAuthError

AGP 3.6.0 uses newer R8 version which stripes all protected fields if you are using `-allowaccessmodification` flag.
