Modern Apps git

← Modern-Apps.git

openassistant stop shrinking resources

Commit
331cca2197eb50d402d61d2a74af8b60f871da49
Author
Vayun Mathur <[email protected]>
When
2026-07-19 21:13 UTC (4 months ago)
Parents
449021f

Diff

openassistant/build.gradle.kts
diff --git a/openassistant/build.gradle.kts b/openassistant/build.gradle.ktsindex 1a12d72c05..f284648334 100644--- a/openassistant/build.gradle.kts+++ b/openassistant/build.gradle.kts@@ -13,13 +13,6 @@ android {         applicationId = "com.vayunmathur.openassistant"     } -    buildTypes {-        release {-            isMinifyEnabled = false-            isShrinkResources = false-        }-    }-     androidResources {         // SigLIP2 .onnx encoders are downloaded to external files at runtime,         // but the SentencePiece tokenizer.model is downloaded too; keep .onnx
proguard-rules.pro
diff --git a/proguard-rules.pro b/proguard-rules.proindex e555b6ccca..64ebd02db6 100644--- a/proguard-rules.pro+++ b/proguard-rules.pro@@ -16,6 +16,19 @@ # LiteRT LM / Gemma 4 -keep class com.google.ai.edge.litertlm.** { *; } +# OpenAssistant tools: the @Tool/@ToolParam-annotated methods in the ToolSet are+# never called from Kotlin directly — litertlm discovers and invokes them via+# reflection (using method + parameter names to build the function schema). R8's+# shrinker would treat them as unused and remove them, silently breaking every+# assistant tool. Keep the ToolSet implementation (all members + names) and any+# @Tool method, plus the attributes reflection relies on.+-keepattributes RuntimeVisibleAnnotations,RuntimeVisibleParameterAnnotations,AnnotationDefault,MethodParameters,Signature+-keep class com.vayunmathur.openassistant.util.AssistantToolSet { *; }+-keep class * implements com.google.ai.edge.litertlm.ToolSet { *; }+-keepclassmembers class * {+    @com.google.ai.edge.litertlm.Tool <methods>;+}+ # LiteRT Core - prevent R8 from deleting LiteRT classes used via reflection -keep class com.google.ai.edge.litert.** { *; } @@ -54,6 +67,18 @@ -keep interface ai.onnxruntime.** { *; } -dontwarn ai.onnxruntime.** +# Stockfish (com.github.vayun-mathur:Stockfish-Library, used by :games:chess) — the+# native libstockfish.so calls back into Kotlin via JNI. nativeSetOutputCallback looks+# up Stockfish$OutputCallback.onOutput(String) by name via GetMethodID, and the lambda+# passed to Stockfish.init { } is compiled to a Stockfish$init$1 OutputCallback SAM.+# R8 optimization (horizontal class merging) reroutes that SAM into an unrelated class,+# so the JNI lookup fails with "NoSuchMethodError: no non-static method+# Lkotlin/time/Duration$Companion;.onOutput(Ljava/lang/String;)V". Keep the whole+# Stockfish API + callback interface so the JNI callback resolves.+-keep class com.vayunmathur.stockfish.** { *; }+-keep interface com.vayunmathur.stockfish.** { *; }+-dontwarn com.vayunmathur.stockfish.**+ # BouncyCastle (post-quantum crypto for Office): keep providers/algorithms found via reflection. -keep class org.bouncycastle.** { *; } -dontwarn org.bouncycastle.**