From eed5bdaf4c6f26286f46791b74401b5206e0c8b1 Mon Sep 17 00:00:00 2001 From: sictiru Date: Fri, 29 Mar 2024 10:28:22 -0700 Subject: [PATCH] Keep default constructors on Gson with R8 full mode --- clients/android/NewsBlur/app/proguard-rules.pro | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/clients/android/NewsBlur/app/proguard-rules.pro b/clients/android/NewsBlur/app/proguard-rules.pro index 32fbae6bd2..733b29f6f7 100644 --- a/clients/android/NewsBlur/app/proguard-rules.pro +++ b/clients/android/NewsBlur/app/proguard-rules.pro @@ -19,11 +19,12 @@ -keep class * implements com.google.gson.JsonSerializer -keep class * implements com.google.gson.JsonDeserializer -# Prevent R8 from leaving Data object members always null --keepclassmembers, allowobfuscation class * { +# R8 +-if class * +-keepclasseswithmembers, allowobfuscation class <1> { + (...); @com.google.gson.annotations.SerializedName ; } -# 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