From 60ff495037465601c37851eec60c5fa22f51662d Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Tue, 14 Apr 2026 22:26:39 -0500 Subject: [PATCH] chore(r8): clean up ProGuard rules and enable Compose Hot Reload (#5139) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- app/build.gradle.kts | 2 -- app/proguard-rules.pro | 14 ++++---------- desktop/proguard-rules.pro | 6 ------ gradle.properties | 1 + 4 files changed, 5 insertions(+), 18 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 39e6bbcc7..c0d16a86b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -171,8 +171,6 @@ configure { } else { signingConfig = signingConfigs.getByName("debug") } - isMinifyEnabled = true - isShrinkResources = true isDebuggable = false } } diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index f504e7bb6..190d9b891 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -13,6 +13,10 @@ # Open-source — no need to obfuscate -dontobfuscate +# Dump the full merged R8 configuration (app rules + all library consumer rules) +# for auditing. Inspect this file after a release build to see what libraries inject. +-printconfiguration build/outputs/mapping/r8-merged-config.txt + # ---- Networking (transitive references from Ktor) --------------------------- -dontwarn org.conscrypt.** @@ -43,13 +47,3 @@ # R8 exception-class merging. -keep class org.jetbrains.compose.resources.** { *; } -keep class org.meshtastic.core.resources.** { *; } - -# Compose Animation: prevent R8 from merging animation spec classes (easing -# curves, transition specs, Animatable internals) which can cause animations to -# silently snap in release builds. -# -# We use a full -keep here without allowshrinking/allowobfuscation. While it -# might keep some unused transition APIs, R8's aggressive shrinking is known -# to incorrectly remove internal states or merging empty transitions (like None) -# causing AnimatedVisibility and others to snap. --keep class androidx.compose.animation.** { *; } diff --git a/desktop/proguard-rules.pro b/desktop/proguard-rules.pro index 3a074d9ac..ef1576555 100644 --- a/desktop/proguard-rules.pro +++ b/desktop/proguard-rules.pro @@ -147,12 +147,6 @@ -keep class org.jetbrains.compose.resources.** { *; } -keep class org.meshtastic.core.resources.** { *; } -# ---- Compose Animation (anti-merge) ---------------------------------------- - -# Prevent ProGuard from merging animation spec class hierarchies (same issue -# as R8 on Android). We use a full keep to prevent incorrect tree-shaking -# of internal transitions. --keep class androidx.compose.animation.** { *; } # ---- AboutLibraries --------------------------------------------------------- diff --git a/gradle.properties b/gradle.properties index 8e67ce164..2f265135a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -29,3 +29,4 @@ org.gradle.jvmargs=-Xmx8g -XX:+UseParallelGC -XX:MaxMetaspaceSize=2g -XX:+HeapDu org.gradle.parallel=true org.gradle.vfs.watch=true org.gradle.welcome=never +compose.hot.reload=true