From da0b2c28e39f61b64a981c8b114ab5e6d4be7406 Mon Sep 17 00:00:00 2001 From: Kaartic Sivaraam Date: Sun, 28 Apr 2024 16:21:14 +0530 Subject: [PATCH] app: adjust R8 rules to ensure our model classes are not obfuscated With refactoring of the dataclient module, the model classes now live within the app's source code itself. So, the existing R8 rules became obsolete and resulted in the prodRelease version of the app not working. So, adjust the R8 rules so that R8 doesn't obsfuscate the model classes that now live within the app. --- app/proguard-rules.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/proguard-rules.txt b/app/proguard-rules.txt index 8a0b24e83..63981633b 100644 --- a/app/proguard-rules.txt +++ b/app/proguard-rules.txt @@ -32,13 +32,15 @@ # Retain declared checked exceptions for use by a Proxy instance. -keepattributes Exceptions -# 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.** { *; } +-keepclasseswithmembers class fr.free.nrw.commons.actions.** { *; } +-keepclasseswithmembers class fr.free.nrw.commons.auth.csrf.** { *; } +-keepclasseswithmembers class fr.free.nrw.commons.auth.login.** { *; } +-keepclasseswithmembers class fr.free.nrw.commons.wikidata.mwapi.** { *; } # --- /Retrofit ---