Skip to content
This repository was archived by the owner on Aug 11, 2025. It is now read-only.

Commit 5b36e2b

Browse files
Fix Retrofit proguard problems
1 parent 0789853 commit 5b36e2b

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

app/proguard-rules.pro

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,27 @@
1111
-keepattributes Signature
1212
-keep class com.google.gson.reflect.TypeToken { *; }
1313
-keep class * extends com.google.gson.reflect.TypeToken
14-
-keep class com.google.gson.** { *; }
14+
-keep class com.google.gson.** { *; }
15+
16+
# Keep inherited services.
17+
-if interface * { @retrofit2.http.* <methods>; }
18+
-keep,allowobfuscation interface * extends <1>
19+
20+
# With R8 full mode generic signatures are stripped for classes that are not
21+
# kept. Suspend functions are wrapped in continuations where the type argument
22+
# is used.
23+
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
24+
25+
# R8 full mode strips generic signatures from return types if not kept.
26+
-if interface * { @retrofit2.http.* public *** *(...); }
27+
-keep,allowoptimization,allowshrinking,allowobfuscation class <3>
28+
29+
# If a class is used in some way by the application, and has fields annotated with @SerializedName
30+
# and a no-args constructor, keep those fields and the constructor
31+
# Based on https://issuetracker.google.com/issues/150189783#comment11
32+
# See also https://github.com/google/gson/pull/2420#discussion_r1241813541 for a more detailed explanation
33+
-if class *
34+
-keepclasseswithmembers,allowobfuscation,allowoptimization class <1> {
35+
<init>();
36+
@com.google.gson.annotations.SerializedName <fields>;
37+
}

buildSrc/src/main/java/com/ivy/wallet/buildsrc/dependencies.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ fun DependencyHandler.Networking(
238238

239239

240240
//URL: https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor
241-
implementation("com.squareup.okhttp3:logging-interceptor:4.9.1")
241+
implementation("com.squareup.okhttp3:logging-interceptor:4.11.0")
242242
}
243243

244244
/**

0 commit comments

Comments
 (0)