From f5735956c8224ac02f678c9b4f169f03f7650b39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=81=E5=86=9C=E9=98=BF=E6=A5=A0?= Date: Wed, 14 Oct 2026 14:04:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20R8=20=E8=A3=81=E5=89=AA=20?= =?UTF-8?q?Room=20=E6=9E=84=E9=80=A0=E5=99=A8=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?=20release=20=E5=90=AF=E5=8A=A8=E9=97=AA=E9=80=80=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E4=BF=9D=E7=95=99=20Gson=20=E5=A4=87=E4=BB=BD?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/proguard-rules.pro | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 3ced2aa..45f0965 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -21,13 +21,21 @@ #-renamesourcefileattribute SourceFile # Room --keep class * extends androidx.room.RoomDatabase +# Room instantiates its generated *_Impl classes reflectively; R8 full mode +# (AGP 9 default) strips the no-arg constructor unless explicitly kept. +-keep class * extends androidx.room.RoomDatabase { (); } -dontwarn androidx.room.paging.** -keep @androidx.room.Entity class * -keep class * { @androidx.room.PrimaryKey ; } +# Gson reflection: BackupManager serializes these models and the field names +# are the on-disk JSON schema of backup files. Without keeps R8 renames the +# fields and backups silently change format between build types. +-keep class cn.airnan.a2fair.data.entity.Token { ; } +-keep class cn.airnan.a2fair.core.backup.BackupData { ; } + # JNI -keepclasseswithmembernames class * { native ;