From 4e60b62af4f7da3363e96d17ab0b33199fb9b654 Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Thu, 30 Oct 2025 17:47:18 -0500 Subject: [PATCH] feat: Enable minification and add ProGuard rules (#3576) Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com> --- app/build.gradle.kts | 7 +++---- core/model/consumer-rules.pro | 2 ++ core/proto/consumer-rules.pro | 6 ++++++ 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 core/model/consumer-rules.pro create mode 100644 core/proto/consumer-rules.pro diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 268948990..f1be226dc 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -158,10 +158,9 @@ android { } else { signingConfig = signingConfigs.getByName("debug") } - productFlavors.getByName("fdroid") { - isMinifyEnabled = false - isShrinkResources = false - } + isMinifyEnabled = true + isShrinkResources = true + isDebuggable = false } } bundle { language { enableSplit = false } } diff --git a/core/model/consumer-rules.pro b/core/model/consumer-rules.pro new file mode 100644 index 000000000..5f75d687d --- /dev/null +++ b/core/model/consumer-rules.pro @@ -0,0 +1,2 @@ +-keep class org.meshtastic.core.model.DataPacket +-keep class org.meshtastic.core.model.DataPacket$CREATOR diff --git a/core/proto/consumer-rules.pro b/core/proto/consumer-rules.pro new file mode 100644 index 000000000..92c60d123 --- /dev/null +++ b/core/proto/consumer-rules.pro @@ -0,0 +1,6 @@ +-keep class org.meshtastic.proto.MeshProtos$DeviceMetadata +-keep class org.meshtastic.proto.MeshProtos$FromRadio +-keep class org.meshtastic.proto.MeshProtos$Position +-keep class org.meshtastic.proto.MeshProtos$User +-keep class org.meshtastic.proto.PaxcountProtos$Paxcount +-keep class org.meshtastic.proto.TelemetryProtos$Telemetry