Keep `TypeAdapter`s from being stripped (#1546)

This commit is contained in:
hqzxzwb 2019-10-04 06:50:21 +08:00 committed by inder123
parent 7845c38077
commit d6e6a01f02
1 changed files with 2 additions and 1 deletions

View File

@ -13,8 +13,9 @@
# Application classes that will be serialized/deserialized over Gson
-keep class com.google.gson.examples.android.model.** { <fields>; }
# Prevent proguard from stripping interface information from TypeAdapterFactory,
# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * implements com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer