From cf5666351555e8211001026eb434c99ff32f0ec8 Mon Sep 17 00:00:00 2001 From: sagarwal Date: Fri, 18 Sep 2026 16:52:48 +0530 Subject: [PATCH 1/2] Fix Moshi enum obfuscation --- app/proguard-rules.pro | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 4eaaa5c6416..c004fd4b070 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -46,6 +46,12 @@ ; } +# SyncProgress is serialized by Moshi's reflective EnumJsonAdapter. +# Keep enum field names unchanged so Moshi can resolve them by reflection. +-keepclassmembers enum org.simple.clinic.sync.SyncProgress { + ; +} + # The name of @JsonClass types is used to look up the generated adapter. -keepnames @com.squareup.moshi.JsonClass class * From e2c019fd4137e5a571ecbca318c2970b5005cea1 Mon Sep 17 00:00:00 2001 From: sagarwal Date: Fri, 18 Sep 2026 17:19:36 +0530 Subject: [PATCH 2/2] Enable R8 obfuscation for production builds --- app/proguard-rules.pro | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index c004fd4b070..7ee71d1f5c7 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -1,8 +1,8 @@ -# No obfuscation because open source -# We depend on the convention of generated DAO names by Room in order to support performance profiling. -# If you decide to obfuscate the final APK, please verify the performance profiling tool continues to function. +# We obfuscate the final APK while keeping generated Room DAO names unchanged. +# We depend on the convention of generated DAO names by Room to support performance profiling. +# If you modify this rule, please verify that the performance profiling tool continues to function. # See: https://github.com/simpledotorg/simple-android/issues/2470 --dontobfuscate +-keepnames class **_RoomDao_Impl # We process generated Room DAO metadata and use a runtime exception for performance profiling. # If you remove this, please ensure that the profiling does not break.