豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit ff77dff

Browse files
authored
uplift(beta): fix(proguard): update rules to preserve enum constants and collection interfaces for Moshi (#10698) (#10699)
2 parents c864b85 + f661896 commit ff77dff

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

app-k9mail/proguard-rules.pro

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,13 @@
6262
-dontwarn org.slf4j.impl.StaticLoggerBinder
6363

6464
-keep,allowshrinking class com.tokenautocomplete.TokenCompleteTextView
65+
66+
# Moshi's EnumJsonAdapter uses Class.getField() to map JSON strings to enum constants.
67+
# R8's enum optimization rewrites switch statements to use ordinals, making enum fields
68+
# appear unused, which causes R8 to strip them. This rule preserves all enum constants
69+
# so Moshi can deserialize them at runtime (e.g. via PendingCommandSerializer).
70+
-keep class net.thunderbird.core.common.mail.Flag { *; }
71+
72+
# Moshi uses reflection to read field types. R8 can rewrite List/Map to ArrayList/HashMap,
73+
# which breaks Moshi's collection interface requirement.
74+
-keep class com.fsck.k9.controller.MessagingControllerCommands$* { *; }

app-thunderbird/proguard-rules.pro

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,13 @@
6262
-dontwarn org.slf4j.impl.StaticLoggerBinder
6363

6464
-keep,allowshrinking class com.tokenautocomplete.TokenCompleteTextView
65+
66+
# Moshi's EnumJsonAdapter uses Class.getField() to map JSON strings to enum constants.
67+
# R8's enum optimization rewrites switch statements to use ordinals, making enum fields
68+
# appear unused, which causes R8 to strip them. This rule preserves all enum constants
69+
# so Moshi can deserialize them at runtime (e.g. via PendingCommandSerializer).
70+
-keep class net.thunderbird.core.common.mail.Flag { *; }
71+
72+
# Moshi uses reflection to read field types. R8 can rewrite List/Map to ArrayList/HashMap,
73+
# which breaks Moshi's collection interface requirement.
74+
-keep class com.fsck.k9.controller.MessagingControllerCommands$* { *; }

0 commit comments

Comments
 (0)