Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(mobile): 修复 Android 声纹录入的 ONNX 混淆闪退
DavidShen68d83f2a0da3
diff --git a/apps/mobile/modules/cindy-speaker-onnx/android/build.gradle b/apps/mobile/modules/cindy-speaker-onnx/android/build.gradleindex 2b11d8a03c..d397cfc5a8 100644--- a/apps/mobile/modules/cindy-speaker-onnx/android/build.gradle+++ b/apps/mobile/modules/cindy-speaker-onnx/android/build.gradle@@ -15,6 +15,7 @@ android {defaultConfig {minSdkVersion 23+ consumerProguardFiles 'consumer-rules.pro'}}diff --git a/apps/mobile/modules/cindy-speaker-onnx/android/consumer-rules.pro b/apps/mobile/modules/cindy-speaker-onnx/android/consumer-rules.pronew file mode 100644index 0000000000..d14145cb56--- /dev/null+++ b/apps/mobile/modules/cindy-speaker-onnx/android/consumer-rules.pro@@ -0,0 +1,4 @@+# ONNX Runtime JNI looks up Java classes, constructors and members by name.+# Keep the whole Java bridge, including TensorInfo and the map/sequence types,+# so R8 cannot rename or remove entry points used only from native code (#6190).+-keep class ai.onnxruntime.** { *; }diff --git a/docs/dev-rules/mobile-development.md b/docs/dev-rules/mobile-development.mdindex 10343b4eb9..66cf0c10fd 100644--- a/docs/dev-rules/mobile-development.md+++ b/docs/dev-rules/mobile-development.md@@ -225,6 +225,7 @@ SDK 规则随依赖一起进入应用的最终 R8 配置,不在应用侧重复| Expo 原生模块 | 使用 `expo-modules-core` 的 consumer rules,保留模块构造与 `definition()`、Record、视图等动态入口。自定义模块的函数名通过 `ModuleDefinition` 字符串注册。 || 微信 OpenSDK 6.8.38 | Maven AAR 自带 `com.tencent.mm.opensdk` / `com.tencent.wxop` 规则;微信回调 Activity 由 config plugin 写入 manifest,由 Android 构建规则保留。 || TapSDK 4.10.5 | `modules/xdt-tapdb/android/consumer-rules.pro` 按[官方接入要求](https://developer.taptap.io/docs/sdk/access/quickstart/#android-code-obfuscation)保留 `com.taptap` / `com.tapsdk`,覆盖服务发现及反射调用。 |+| ONNX Runtime Android 1.30.0 | `modules/cindy-speaker-onnx/android/consumer-rules.pro` 保留 `ai.onnxruntime` 的类与成员,覆盖 JNI 按原名查找的 `TensorInfo` 等类型及构造方法。声纹录入与过滤须用开启 R8 的 release 包验证,mock 原生桥的 JS 单测不能替代。 || Nimbus JOSE JWT 10.9.1 | 远控凭证模块直接调用 JOSE API,协议 JSON 使用显式键名的 `JSONObject` / Map,不依赖业务类字段名反射序列化。`cindy-remote-credentials/android/consumer-rules.pro` 仅忽略未启用的 XC20P 算法所需的可选 Tink 类;当前协议创建和接收均限制为 `ECDH-ES + A256GCM`。若扩展算法,须重新核对可选依赖。 |升级 SDK 时核对其 AAR/JAR 的 consumer rules、应用的最终 `configuration.txt` 和 release