From c636401232014ab47c6fd71cc2f5493e9c5702ba Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sun, 22 Oct 2023 21:29:05 +0200 Subject: [PATCH] add proguard rules to fix issue in retrofit --- proguard-rules.pro | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/proguard-rules.pro b/proguard-rules.pro index 7e4d7d31d..03044d525 100644 --- a/proguard-rules.pro +++ b/proguard-rules.pro @@ -64,7 +64,21 @@ -dontwarn retrofit2.KotlinExtensions -dontwarn retrofit2.KotlinExtensions$* + # With R8 full mode, it sees no subtypes of Retrofit interfaces since they are created with a Proxy # and replaces all potential values with null. Explicitly keeping the interfaces prevents this. -if interface * { @retrofit2.http.* ; } -keep,allowobfuscation interface <1> + +# Keep inherited services. +-if interface * { @retrofit2.http.* ; } +-keep,allowobfuscation interface * extends <1> + +# With R8 full mode generic signatures are stripped for classes that are not +# kept. Suspend functions are wrapped in continuations where the type argument +# is used. +-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation + +# R8 full mode strips generic signatures from return types if not kept. +-if interface * { @retrofit2.http.* public *** *(...); } +-keep,allowoptimization,allowshrinking,allowobfuscation class <3>