From e9afc6ccbbb29507a9d1a99e15f8053eb4cd1c53 Mon Sep 17 00:00:00 2001 From: SuperMonster003 Date: Sun, 25 May 2025 20:36:47 +0800 Subject: [PATCH] =?UTF-8?q?6.6.3=20-=20Alpha5=20-=20=E4=BF=AE=E5=A4=8D=20d?= =?UTF-8?q?ialogs.input=20=E6=96=B9=E6=B3=95=E7=9A=84=E8=A1=A8=E8=BE=BE?= =?UTF-8?q?=E5=BC=8F=E5=8F=82=E6=95=B0=E5=8F=AF=E8=83=BD=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=8E=B7=E5=BE=97=E6=89=A7=E8=A1=8C=E7=BB=93=E6=9E=9C=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changelog/lang_zh-Hans.json | 3 ++- .../autojs/autojs/network/UpdateChecker.java | 2 +- .../org/autojs/autojs/runtime/api/Shell.java | 2 +- .../runtime/api/augment/dialogs/Dialogs.kt | 10 ++++++++-- .../runtime/api/augment/global/Classes.kt | 15 +++++++++++++++ .../runtime/api/augment/images/Images.kt | 18 +++++++++--------- .../runtime/api/augment/images/ObjectFrame.kt | 2 +- version.properties | 6 +++--- 8 files changed, 40 insertions(+), 18 deletions(-) diff --git a/.changelog/lang_zh-Hans.json b/.changelog/lang_zh-Hans.json index 3295c5d6..c5b782ae 100644 --- a/.changelog/lang_zh-Hans.json +++ b/.changelog/lang_zh-Hans.json @@ -1,7 +1,7 @@ { "$data": { "v6.6.3": { - "released_date": "2025/05/21", + "released_date": "2025/05/25", "feature": [ "版本历史功能, 可查看发行版本历史更新记录 (多语言) 与统计数据", "timers.keepAlive 方法 (已全局化), 用于保持脚本活跃状态", @@ -20,6 +20,7 @@ "APK 文件类型信息对话框可能无法获取应用名称及 SDK 信息的问题", "Android 15 部分页面状态栏背景颜色可能无法动态跟随主题色的问题", "dialogs 模块无法正常使用 customView 属性的问题 _[`issue #364`](http://issues.autojs6.com/364)_", + "dialogs.input 方法的表达式参数可能无法获得执行结果的问题", "使用 JavaAdapter 时导致 ClassLoader 调用栈溢出的问题 _[`issue #376`](http://issues.autojs6.com/376)_", "console.setContentTextColor 方法导致日志字体颜色丢失默认值的问题 _[`issue #346`](http://issues.autojs6.com/346)_", "console.setContentBackgroundColor 方法无法接受颜色名称参数的问题 _[`issue #384`](http://issues.autojs6.com/384)_", diff --git a/app/src/main/java/org/autojs/autojs/network/UpdateChecker.java b/app/src/main/java/org/autojs/autojs/network/UpdateChecker.java index 602b51e2..7db0f371 100644 --- a/app/src/main/java/org/autojs/autojs/network/UpdateChecker.java +++ b/app/src/main/java/org/autojs/autojs/network/UpdateChecker.java @@ -545,7 +545,7 @@ public class UpdateChecker { } private String assembleDependenciesInReleaseNotesListMarkdown(String fullReleaseNotes) { - // TODO by SuperMonster003 on Apr 24. 2025. + // TODO by SuperMonster003 on Apr 24, 2025. // ! Remove all dependency items and append a summary item as improvement. // ! Reference to `generate_markdown.py`. return fullReleaseNotes; diff --git a/app/src/main/java/org/autojs/autojs/runtime/api/Shell.java b/app/src/main/java/org/autojs/autojs/runtime/api/Shell.java index 88319219..99b973e1 100644 --- a/app/src/main/java/org/autojs/autojs/runtime/api/Shell.java +++ b/app/src/main/java/org/autojs/autojs/runtime/api/Shell.java @@ -248,7 +248,7 @@ public class Shell extends AbstractShell { } private void onOutput(String str) { - if (!str.isEmpty()) { + if (!str.isEmpty() && !str.contains("/dev/input/event")) { logDebug("onOutput: " + str); } if (!mInitialized) { diff --git a/app/src/main/java/org/autojs/autojs/runtime/api/augment/dialogs/Dialogs.kt b/app/src/main/java/org/autojs/autojs/runtime/api/augment/dialogs/Dialogs.kt index 864641d5..1fc99d1e 100644 --- a/app/src/main/java/org/autojs/autojs/runtime/api/augment/dialogs/Dialogs.kt +++ b/app/src/main/java/org/autojs/autojs/runtime/api/augment/dialogs/Dialogs.kt @@ -204,7 +204,8 @@ class Dialogs(scriptRuntime: ScriptRuntime) : Augmentable(scriptRuntime) { callback.isJsNullish() -> { val title = coerceString(titleArg, "") val prefill = coerceString(prefillArg, "") - scriptRuntime.dialogs.rawInput(title, prefill, null) + val result = scriptRuntime.dialogs.rawInput(title, prefill, null) + js_eval(scriptRuntime.topLevelScope, Context.toString(result)) } else -> { val title = coerceString(titleArg, "") @@ -212,7 +213,12 @@ class Dialogs(scriptRuntime: ScriptRuntime) : Augmentable(scriptRuntime) { require(callback is BaseFunction) { "Argument callback ${callback.jsBrief()} must be a JavaScript Function for dialogs.input" } - scriptRuntime.dialogs.rawInput(title, prefill, callback) + val newCallback = newBaseFunction("newCallback", { newCallbackArgs -> + val (str) = newCallbackArgs + val newStr = js_eval(scriptRuntime.topLevelScope, Context.toString(str)) + callFunction(callback, scriptRuntime.topLevelScope, null, arrayOf(newStr)) + }, NOT_CONSTRUCTABLE) + scriptRuntime.dialogs.rawInput(title, prefill, newCallback) } } } diff --git a/app/src/main/java/org/autojs/autojs/runtime/api/augment/global/Classes.kt b/app/src/main/java/org/autojs/autojs/runtime/api/augment/global/Classes.kt index 6b59e0d7..7108c423 100644 --- a/app/src/main/java/org/autojs/autojs/runtime/api/augment/global/Classes.kt +++ b/app/src/main/java/org/autojs/autojs/runtime/api/augment/global/Classes.kt @@ -80,6 +80,9 @@ class Classes { @JvmField val Log = android.util.Log::class + @JvmField + val TypedValue = android.util.TypedValue::class + @JvmField val ContextThemeWrapper = android.view.ContextThemeWrapper::class @@ -92,6 +95,12 @@ class Classes { @JvmField val MotionEvent = android.view.MotionEvent::class + @JvmField + val ScaleGestureDetector = android.view.ScaleGestureDetector::class + + @JvmField + val WindowManager = android.view.WindowManager::class + @JvmField val LayoutParams = android.view.WindowManager.LayoutParams::class @@ -125,6 +134,9 @@ class Classes { @JvmField val Snackbar = com.google.android.material.snackbar.Snackbar::class + @JvmField + val MaterialDialog = com.afollestad.materialdialogs.MaterialDialog::class + @JvmField val LogConfigurator = de.mindpipe.android.logging.log4j.LogConfigurator::class @@ -302,6 +314,9 @@ class Classes { @JvmField val DisplayUtils = org.autojs.autojs.util.DisplayUtils::class + @JvmField + val IntentUtils = org.autojs.autojs.util.IntentUtils::class + @JvmField val JavaUtils = org.autojs.autojs.util.JavaUtils::class diff --git a/app/src/main/java/org/autojs/autojs/runtime/api/augment/images/Images.kt b/app/src/main/java/org/autojs/autojs/runtime/api/augment/images/Images.kt index 60f57265..e7a7e800 100644 --- a/app/src/main/java/org/autojs/autojs/runtime/api/augment/images/Images.kt +++ b/app/src/main/java/org/autojs/autojs/runtime/api/augment/images/Images.kt @@ -258,7 +258,7 @@ class Images(scriptRuntime: ScriptRuntime) : Augmentable(scriptRuntime), AsEmitt } } - // @Reference to module __images__.js from Auto.js Pro 9.3.11 by SuperMonster003 on Dec 19. 2023. + // @Reference to module __images__.js from Auto.js Pro 9.3.11 by SuperMonster003 on Dec 19, 2023. @JvmStatic @RhinoRuntimeFunctionInterface fun requestScreenCapture(scriptRuntime: ScriptRuntime, args: Array): Boolean = ensureArgumentsAtMost(args, 2) { argList -> @@ -280,7 +280,7 @@ class Images(scriptRuntime: ScriptRuntime) : Augmentable(scriptRuntime), AsEmitt } } - // @Reference to module __images__.js from Auto.js Pro 9.3.11 by SuperMonster003 on Dec 19. 2023. + // @Reference to module __images__.js from Auto.js Pro 9.3.11 by SuperMonster003 on Dec 19, 2023. @JvmStatic @RhinoRuntimeFunctionInterface fun requestScreenCaptureAsync(scriptRuntime: ScriptRuntime, args: Array): NativeObject = ensureArgumentsAtMost(args, 2) { argList -> @@ -290,14 +290,14 @@ class Images(scriptRuntime: ScriptRuntime) : Augmentable(scriptRuntime), AsEmitt })) as NativeObject } - // @Reference to module __images__.js from Auto.js Pro 9.3.11 by SuperMonster003 on Dec 19. 2023. + // @Reference to module __images__.js from Auto.js Pro 9.3.11 by SuperMonster003 on Dec 19, 2023. @JvmStatic @RhinoRuntimeFunctionInterface fun stopScreenCapture(scriptRuntime: ScriptRuntime, args: Array) = ensureArgumentsIsEmpty(args) { scriptRuntime.images.stopScreenCapture() } - // @Reference to module __images__.js from Auto.js Pro 9.3.11 by SuperMonster003 on Dec 19. 2023. + // @Reference to module __images__.js from Auto.js Pro 9.3.11 by SuperMonster003 on Dec 19, 2023. @JvmStatic @RhinoRuntimeFunctionInterface fun getScreenCaptureOptions(scriptRuntime: ScriptRuntime, args: Array): ScreenCapturer.Options? = ensureArgumentsIsEmpty(args) { @@ -697,7 +697,7 @@ class Images(scriptRuntime: ScriptRuntime) : Augmentable(scriptRuntime), AsEmitt detectColor(scriptRuntime, it) } - // @Reference to module __images__.js from Auto.js Pro 9.3.11 by SuperMonster003 on May 10. 2025. + // @Reference to module __images__.js from Auto.js Pro 9.3.11 by SuperMonster003 on May 10, 2025. @JvmStatic @RhinoRuntimeFunctionInterface fun detectMultiColors(scriptRuntime: ScriptRuntime, args: Array): Boolean = ensureArgumentsLengthInRange(args, 5..6) { @@ -1007,7 +1007,7 @@ class Images(scriptRuntime: ScriptRuntime) : Augmentable(scriptRuntime), AsEmitt } } - // @Reference to module __images__.js from Auto.js Pro 9.3.11 by SuperMonster003 on Dec 19. 2023. + // @Reference to module __images__.js from Auto.js Pro 9.3.11 by SuperMonster003 on Dec 19, 2023. @JvmStatic @RhinoRuntimeFunctionInterface fun detectAndComputeFeatures(scriptRuntime: ScriptRuntime, args: Array): ImageFeatures = ensureArgumentsLengthInRange(args, 1..2) { @@ -1022,7 +1022,7 @@ class Images(scriptRuntime: ScriptRuntime) : Augmentable(scriptRuntime), AsEmitt ImageFeatures(result, opt.scale, rect) } - // @Reference to module __images__.js from Auto.js Pro 9.3.11 by SuperMonster003 on Dec 19. 2023. + // @Reference to module __images__.js from Auto.js Pro 9.3.11 by SuperMonster003 on Dec 19, 2023. @JvmStatic @RhinoRuntimeFunctionInterface fun matchFeatures(scriptRuntime: ScriptRuntime, args: Array): ObjectFrame? = ensureArgumentsLengthInRange(args, 2..3) { argList -> @@ -1508,7 +1508,7 @@ class Images(scriptRuntime: ScriptRuntime) : Augmentable(scriptRuntime), AsEmitt } } - // @Reference to module __images__.js from Auto.js Pro 9.3.11 by SuperMonster003 on Dec 19. 2023. + // @Reference to module __images__.js from Auto.js Pro 9.3.11 by SuperMonster003 on Dec 19, 2023. private fun getDetectFeatureMethod(method: Any?): Int = when (method) { is Number -> method.toInt() is String -> { @@ -1521,7 +1521,7 @@ class Images(scriptRuntime: ScriptRuntime) : Augmentable(scriptRuntime), AsEmitt else -> throw Error("Non-recognized method: $method") } - // @Reference to module __images__.js from Auto.js Pro 9.3.11 by SuperMonster003 on Dec 19. 2023. + // @Reference to module __images__.js from Auto.js Pro 9.3.11 by SuperMonster003 on Dec 19, 2023. private fun fillDetectAndComputeFeaturesOptions(rows: Int, cols: Int, options: NativeObject): DetectAndComputeFeaturesOptions { val scale = options.inquire("scale") { coerceFloatNumber(it) } ?: calcScale(rows, cols) val cvtColor = when { diff --git a/app/src/main/java/org/autojs/autojs/runtime/api/augment/images/ObjectFrame.kt b/app/src/main/java/org/autojs/autojs/runtime/api/augment/images/ObjectFrame.kt index fbe62680..37dbdfc1 100644 --- a/app/src/main/java/org/autojs/autojs/runtime/api/augment/images/ObjectFrame.kt +++ b/app/src/main/java/org/autojs/autojs/runtime/api/augment/images/ObjectFrame.kt @@ -3,7 +3,7 @@ package org.autojs.autojs.runtime.api.augment.images import org.autojs.autojs.util.StringUtils import org.opencv.core.Point -// @Reference to module __images__.js from Auto.js Pro 9.3.11 by SuperMonster003 on Dec 19. 2023. +// @Reference to module __images__.js from Auto.js Pro 9.3.11 by SuperMonster003 on Dec 19, 2023. /** * Created by SuperMonster003 on Aug 9, 2024. */ diff --git a/version.properties b/version.properties index 89d389ad..0f610966 100644 --- a/version.properties +++ b/version.properties @@ -1,5 +1,5 @@ -#Fri May 23 21:19:26 CST 2025 -BUILD_TIME=1748006366599 +#Sun May 25 20:32:48 CST 2025 +BUILD_TIME=1748176368036 COMPILE_SDK_VERSION=35 IMAGE_QUANT_CMAKE_VERSION=3.22.1 IMAGE_QUANT_NDK_VERSION=26.1.10909125 @@ -19,6 +19,6 @@ RAPID_OCR_OPENCV_MOBILE_LABEL_VERSION=13 RAPID_OCR_OPENCV_MOBILE_VERSION=4.5.3 TARGET_SDK_VERSION=35 TARGET_SDK_VERSION_INRT=29 -VERSION_BUILD=3245 +VERSION_BUILD=3254 VERSION_NAME=6.6.3 Alpha5 VSCODE_EXT_REQUIRED_VERSION=1.0.8