Skip to content

Commit 8a86540

Browse files
committed
fix(proguard): audit rules for v1.10.0, fix BackupData Gson obfuscation (v1.10.0)
- Add explicit keep rule for BackupData to prevent R8 renaming 'notes' field → silent data loss on backup import in release builds - Remove dead -keep for data/** package (doesn't exist) - Replace *Receiver wildcard with ActionCallback interface rule for more robust Glance widget reflection coverage - Remove redundant NoteWidgetReceiver rule (covered by BroadcastReceiver)
1 parent 099bb2d commit 8a86540

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

android/app/proguard-rules.pro

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,24 @@
6666
# 🔧 v1.8.2: Granulare Regeln statt breiter Wildcard
6767
# Ersetzt die v1.8.1-Notlösung (-keep class dev.dettmer.simplenotes.** { *; })
6868
# die JEGLICHES Tree-Shaking verhinderte → APK > 5MB.
69+
# 🔧 v1.10.0 Audit: BackupData-Fix, tote data/-Regel entfernt, ActionCallback robuster
6970

7071
# 1) DATA MODELS — Gson braucht Feldnamen + Konstruktoren
7172
# NoteRaw ist Note$Companion$NoteRaw (Companion-verschachtelt!)
7273
-keep class dev.dettmer.simplenotes.models.** { *; }
73-
-keep class dev.dettmer.simplenotes.data.** { *; }
7474

75-
# 2) WORKMANAGER — instanziiert SyncWorker via Reflection
75+
# 2) BACKUP — BackupData.notes hat kein @SerializedName; R8-Obfuscation würde
76+
# den Feldnamen umbenennen → Gson findet JSON-Key "notes" nicht → leere
77+
# Notizen-Liste beim Import (stiller Datenverlust im Release-Build!)
78+
-keep class dev.dettmer.simplenotes.backup.BackupData { *; }
79+
80+
# 3) WORKMANAGER — instanziiert SyncWorker via Reflection
7681
-keep class dev.dettmer.simplenotes.sync.SyncWorker { *; }
7782

78-
# 3) BROADCAST RECEIVERS — via AndroidManifest registriert
79-
-keep class dev.dettmer.simplenotes.widget.NoteWidgetReceiver { *; }
83+
# 4) BROADCAST RECEIVERS — via AndroidManifest registriert
8084
-keep class dev.dettmer.simplenotes.** extends android.content.BroadcastReceiver { *; }
8185

82-
# 4) ACTIVITIES & APPLICATION — Android-Framework instanziiert via Reflection
86+
# 5) ACTIVITIES & APPLICATION — Android-Framework instanziiert via Reflection
8387
-keep class dev.dettmer.simplenotes.SimpleNotesApplication { *; }
8488
-keep class dev.dettmer.simplenotes.** extends android.app.Activity { *; }
8589
-keep class dev.dettmer.simplenotes.** extends androidx.fragment.app.Fragment { *; }
@@ -94,8 +98,9 @@
9498

9599
# Glance Widget ActionCallbacks (instanziiert via Reflection durch actionRunCallback<T>())
96100
# Ohne diese Rule findet R8 die Klassen nicht zur Laufzeit → Widget-Crash
101+
# Interface-Regel ist robuster als *Action-Pattern (erfasst alle zukünftigen Callbacks)
97102
-keep class dev.dettmer.simplenotes.widget.*Action { *; }
98-
-keep class dev.dettmer.simplenotes.widget.*Receiver { *; }
103+
-keep class * implements androidx.glance.appwidget.action.ActionCallback { *; }
99104

100105
# Compose Text Layout: Verhindert dass R8 onTextLayout-Callbacks
101106
# als Side-Effect-Free optimiert (behebt Gradient-Regression)

0 commit comments

Comments
 (0)