From 0b70f52ad263536a00e7578557ad0d0012bcf7e4 Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Fri, 21 Jan 2022 18:26:57 +0100 Subject: [PATCH] add proguard rules to make Jsondadapter annotation work (#2299) --- app/proguard-rules.pro | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index d5092d82..8b372a47 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -52,6 +52,14 @@ } # https://github.com/google/gson/blob/master/examples/android-proguard-example/proguard.cfg + +# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory, +# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter) +-keep class * extends 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 + # Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher. -keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken -keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken