fix(train): keep what WorkManager and Polar's firmware service need from R8

v0.1.0 crashed on every start: R8's full mode (AGP 9) took Room 2.6.1's
`-keep class * extends RoomDatabase` to keep no constructor, and WorkManager
creates its database by reflection (NoSuchMethodException
WorkDatabase_Impl.<init>). Checking the Loop's firmware failed too: Polar's
SDK asks through Retrofit 2.9.0, whose rules predate the full mode, and
Retrofit lost the generic signatures of its suspend functions ("Class cannot
be cast to ParameterizedType").

Train's own proguard-rules.pro keeps the database's constructor, adds
Retrofit 2.11's three rules and keeps the firmware service's requests and
replies, which Gson fills. Debug builds don't shrink, so neither showed
before the release; checked on a Pixel 9a with a release build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-11-01 00:37:47 +01:00
commit 58f9b3a472
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -51,6 +51,8 @@ android {
release {
signingConfig =
signingConfigs.findByName("release") ?: signingConfigs.getByName("debug")
// Train's keep rules for R8, beside the libraries' and Flutter's.
proguardFiles("proguard-rules.pro")
}
}