From c086ff264f508727aeeafafe2698ee92d486dcc9 Mon Sep 17 00:00:00 2001 From: Kaartic Sivaraam Date: Sun, 22 Oct 2023 11:12:26 +0530 Subject: [PATCH] app: avoid R8 from obfuscating our model classes (#5359) R8 shouldn't obfuscate the classes that we use for serialization / de-serialization over Gson. This causes issues with app functioning. Fixes #5358 --- app/proguard-rules.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/proguard-rules.txt b/app/proguard-rules.txt index 91f540693..8a0b24e83 100644 --- a/app/proguard-rules.txt +++ b/app/proguard-rules.txt @@ -31,8 +31,15 @@ -keepattributes Signature # Retain declared checked exceptions for use by a Proxy instance. -keepattributes Exceptions -# Classes used by retrofit to fetch API repsonse + +# Application classes that will be serialized/deserialized over Gson -keepclasseswithmembers class org.wikipedia.** { *; } +# Note: The model package right now seems to include some other classes that +# are not used for serialization / deserialization over Gson. Hopefully +# that's not a problem since it only prevents R8 from avoiding trimming +# of few more classes. +-keepclasseswithmembers class fr.free.nrw.commons.*.model.** { *; } + # --- /Retrofit --- # --- OkHttp + Okio ---