From 63561737e17e6200334f47a45882c78f47433133 Mon Sep 17 00:00:00 2001 From: inventory69 Date: Tue, 10 Feb 2026 23:10:43 +0100 Subject: [PATCH] feat(proguard): IMPL_07 - Add missing Widget & Compose ProGuard rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add Widget ActionCallback rules to prevent R8 removal (fixes potential widget crashes) - Add Glance state preservation rules for widget preferences - Add Compose TextLayout rules to prevent gradient regression in release builds - Bump version to 1.8.1 (versionCode 21, versionName "1.8.1") Fixes: - Widget actions (ToggleChecklistItemAction, etc.) could be stripped by R8 - Glance widget state (DataStore-based) needs reflection protection - Compose onTextLayout callbacks could be optimized away causing gradient issues Files changed: - android/app/proguard-rules.pro: Added v1.8.1 rules section (+17 lines) - android/app/build.gradle.kts: Version bump 1.8.0 → 1.8.1 --- android/app/build.gradle.kts | 4 ++-- android/app/proguard-rules.pro | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 117f9d4..455fcab 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -20,8 +20,8 @@ android { applicationId = "dev.dettmer.simplenotes" minSdk = 24 targetSdk = 36 - versionCode = 20 // 🎉 v1.8.0: Widgets, Sorting, UI Polish, Post-Update Changelog - versionName = "1.8.0" // 🎉 v1.8.0: Major Feature Release + versionCode = 21 // 🐛 v1.8.1: Checklist Fixes, Widget Sorting, ProGuard Audit + versionName = "1.8.1" // 🐛 v1.8.1: Bugfix & Polish Release testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro index 4e87efa..c187894 100644 --- a/android/app/proguard-rules.pro +++ b/android/app/proguard-rules.pro @@ -82,3 +82,23 @@ # v1.7.1: Suppress TextInclusionStrategy warnings on older Android versions # This class only exists on API 35+ but Compose handles the fallback gracefully -dontwarn android.text.Layout$TextInclusionStrategy + +# ═══════════════════════════════════════════════════════════════════════ +# v1.8.1: Widget & Compose Fixes +# ═══════════════════════════════════════════════════════════════════════ + +# Glance Widget ActionCallbacks (instanziiert via Reflection durch actionRunCallback()) +# Ohne diese Rule findet R8 die Klassen nicht zur Laufzeit → Widget-Crash +-keep class dev.dettmer.simplenotes.widget.*Action { *; } +-keep class dev.dettmer.simplenotes.widget.*Receiver { *; } + +# Glance Widget State (Preferences-basiert, intern via Reflection) +-keep class androidx.glance.appwidget.state.** { *; } +-keep class androidx.datastore.preferences.** { *; } + +# Compose Text Layout: Verhindert dass R8 onTextLayout-Callbacks +# als Side-Effect-Free optimiert (behebt Gradient-Regression) +-keepclassmembers class androidx.compose.foundation.text.** { + ; +} +-keep class androidx.compose.ui.text.TextLayoutResult { *; }