Skip to content

Commit e267e15

Browse files
AnatolyJacobsJingMatrix
authored andcommitted
Fix Picocli ProGuard rules to prevent runtime crashes
Updates the ProGuard configuration to explicitly keep reflection annotations, Kotlin companion objects, Picocli subcommands/help mixins, and IPC data classes that were being aggressively stripped by R8.
1 parent 0b0d740 commit e267e15

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

daemon/proguard-rules.pro

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@
77
-keepclasseswithmembers class org.matrix.vector.daemon.Cli {
88
public static void main(java.lang.String[]);
99
}
10+
-keep class org.matrix.vector.daemon.Cli { *; }
11+
-keep class org.matrix.vector.daemon.Cli$Companion { *; }
12+
-keep class org.matrix.vector.daemon.*Command { *; }
13+
-keep class org.matrix.vector.daemon.CliRequest { *; }
14+
-keep class org.matrix.vector.daemon.CliResponse { *; }
15+
16+
-keep class picocli.CommandLine$AutoHelpMixin { *; }
17+
-keep class picocli.CommandLine$HelpCommand { *; }
18+
-keep @picocli.CommandLine$Command class picocli.** { *; }
19+
20+
# MUST keep annotations for Picocli to function via reflection
21+
-keepattributes *Annotation*,Signature,InnerClasses,EnclosingMethod
22+
1023
-keepclasseswithmembers class org.matrix.vector.daemon.env.LogcatMonitor {
1124
private int refreshFd(boolean);
1225
}

0 commit comments

Comments
 (0)