From cde8b3be3109537831f9c5ec3e9d1228bd17f52c Mon Sep 17 00:00:00 2001 From: vtrayy <80831707+vtrayy@users.noreply.github.com> Date: Fri, 22 Aug 2025 08:31:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Djava=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=98=A0=E5=B0=84=E5=88=B0js=E5=8F=98?= =?UTF-8?q?=E4=B8=BA=E5=8C=85=E8=A3=85=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 参考 [aiselp/AutoX](https://github.com/aiselp/AutoX/commit/8777e89b1427fa663f6c7de006659adf9b5645a7#diff-6606e9e3326aaaaef7cad85bd7db48f9f85e4e819b1ecb2ebffeb15a1217758b) --- .../java/com/stardust/autojs/engine/RhinoJavaScriptEngine.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autojs/src/main/java/com/stardust/autojs/engine/RhinoJavaScriptEngine.kt b/autojs/src/main/java/com/stardust/autojs/engine/RhinoJavaScriptEngine.kt index 3396166d..e2250f89 100644 --- a/autojs/src/main/java/com/stardust/autojs/engine/RhinoJavaScriptEngine.kt +++ b/autojs/src/main/java/com/stardust/autojs/engine/RhinoJavaScriptEngine.kt @@ -205,10 +205,12 @@ open class RhinoJavaScriptEngine(private val mAndroidContext: android.content.Co } private inner class WrapFactory : org.mozilla.javascript.WrapFactory() { + init { + isJavaPrimitiveWrap = false + } override fun wrap(cx: Context, scope: Scriptable, obj: Any?, staticType: Class<*>?): Any? { return when { - obj is String -> runtime.bridges.toString(obj.toString()) staticType == UiObjectCollection::class.java -> runtime.bridges.asArray(obj) else -> { if (scope is TopLevelScope) {