Files
clockula/app/proguard-rules.pro
T
makiolaj fe64521707 fix(widgets): keep GlanceAppWidget classes distinct under R8
R8 merged the near-identical widget classes (timer, quick timer,
stopwatch, digital clock) into the analog clock's class. Glance finds a
widget's placed instances by its GlanceAppWidget's class name, so every
updateAll hit every widget: starting a quick timer redrew the timer
widgets' content into the analog and digital clocks until their config
screen re-rendered them. Debug builds were unaffected.
2026-10-02 22:33:20 +02:00

34 lines
1.8 KiB
Prolog

# Keep Hilt-generated classes
-keep class dagger.hilt.** { *; }
-keep @dagger.hilt.android.HiltAndroidApp class *
# Room instantiates its generated <Database>_Impl reflectively through a no-arg
# constructor. R8 under AGP 9 keeps the class but prunes that constructor, since
# nothing calls it directly — Room then throws InstantiationException, reported
# as "Failed to create an instance of ...". We pull Room in transitively via
# Glance -> WorkManager, whose WorkDatabase is built by WorkManagerInitializer
# at startup, so the app died on launch in every minified build (issue #1).
-keep class * extends androidx.room.RoomDatabase { <init>(); }
# WorkManager likewise looks its workers up by name and calls this constructor
# reflectively — same pruning, but it only bites once a worker actually runs
# (Glance's widget updates), so keep it explicitly rather than wait for it.
-keep class * extends androidx.work.ListenableWorker {
<init>(android.content.Context, androidx.work.WorkerParameters);
}
# Before a worker runs, WorkManager also instantiates its InputMerger by name
# through the no-arg constructor. With that pruned, every Glance session
# worker fails ("Could not create Input Merger"), no RemoteViews ever reach
# the host, and every widget shows "Can't load widget".
-keep class * extends androidx.work.InputMerger { <init>(); }
# Glance finds a widget's placed instances by its GlanceAppWidget's class name
# (`updateAll`, `getGlanceIds`). R8 merged the near-identical widget classes
# into one, so every widget shared a name: starting a quick timer redrew the
# timer widgets' content into the analog clock's slots, too.
-keep class * extends androidx.glance.appwidget.GlanceAppWidget
# Compose Compiler may keep its own; defaults are fine
-dontwarn org.jetbrains.annotations.**