From f51a83e8e3f404512f3ce550cadbbae972acf329 Mon Sep 17 00:00:00 2001 From: SuperMonster003 Date: Fri, 28 Mar 2025 11:21:25 +0800 Subject: [PATCH] =?UTF-8?q?6.6.2=20-=20Alpha5=20-=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=88=86=E6=9E=90=E9=A1=B5=E9=9D=A2=E7=94=9F?= =?UTF-8?q?=E6=88=90=E4=BB=A3=E7=A0=81=E6=97=B6=E5=8F=AF=E8=83=BD=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E5=BA=94=E7=94=A8=E5=B4=A9=E6=BA=83=20(issue?= =?UTF-8?q?=20#288)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changelog/lang_zh-Hans.json | 4 +++- .../java/org/autojs/autojs/apkbuilder/ApkBuilder.kt | 2 +- .../org/autojs/autojs/core/automator/UiObject.kt | 13 +++++++++---- .../theme/preference/MaterialDialogPreference.kt | 9 +++++++++ version.properties | 6 +++--- 5 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.changelog/lang_zh-Hans.json b/.changelog/lang_zh-Hans.json index a8d69542..591d972c 100644 --- a/.changelog/lang_zh-Hans.json +++ b/.changelog/lang_zh-Hans.json @@ -17,7 +17,9 @@ "engines.execScript/execScriptFile 等方法执行脚本时默认工作路径异常", "floaty.window/floaty.rawWindow 无法在子线程执行的问题", "ui.inflate 返回值丢失 attr/on/click 等原型方法的问题", - "代码编辑器跳转到行尾时可能跳转到下一行起始位置的问题" + "布局分析页面生成代码时可能导致应用崩溃的问题 _[`issue #288`](http://issues.autojs6.com/288)_", + "代码编辑器跳转到行尾时可能跳转到下一行起始位置的问题", + "设置页面连续快速点击对话框类型项目时可能导致应用崩溃的问题" ], "improvement": [ "精简打包应用模板 APK 文件大小", diff --git a/app/src/main/java/org/autojs/autojs/apkbuilder/ApkBuilder.kt b/app/src/main/java/org/autojs/autojs/apkbuilder/ApkBuilder.kt index 0d4726ae..b8e1d04b 100644 --- a/app/src/main/java/org/autojs/autojs/apkbuilder/ApkBuilder.kt +++ b/app/src/main/java/org/autojs/autojs/apkbuilder/ApkBuilder.kt @@ -416,7 +416,7 @@ open class ApkBuilder(apkInputStream: InputStream?, private val outApkFile: File private fun copyLibrariesByAbi(abiSrcName: String, abiDestName: String) { // @Reference to LZX284 (https://github.com/LZX284) by SuperMonster003 on Dec 11, 2023. - // ! https://github.com/SuperMonster003/AutoJs6/pull/187/files#diff-d932ac49867d4610f8eeb21b59306e8e923d016cbca192b254caebd829198856R61 + // ! http://pr.autojs6.com/187/files#diff-d932ac49867d4610f8eeb21b59306e8e923d016cbca192b254caebd829198856R61 val srcLibDir = File(appApkFile.parent, LIBRARY_DIR).path mLibsIncludes.distinct().forEach { libName -> diff --git a/app/src/main/java/org/autojs/autojs/core/automator/UiObject.kt b/app/src/main/java/org/autojs/autojs/core/automator/UiObject.kt index 4af333af..b29e4378 100644 --- a/app/src/main/java/org/autojs/autojs/core/automator/UiObject.kt +++ b/app/src/main/java/org/autojs/autojs/core/automator/UiObject.kt @@ -533,7 +533,12 @@ open class UiObject( if (this === other) return true if (other !is UiObject) return false - return packageName() == other.packageName() && + // @Reference to Hunter1023 (https://github.com/Hunter1023) by SuperMonster003 on Mar 28, 2025. + // ! http://issues.autojs6.com/288#issuecomment-2692248348 + val info = unwrap() ?: return false + + return info == other.unwrap() && + packageName() == other.packageName() && parent == other.parent && id() == other.id() && fullId() == other.fullId() && @@ -730,7 +735,7 @@ open class UiObject( } in RESULT_GROUP_EXISTENCE -> when (compass) { - null, COMPASS_PASS_ON -> selector?.exists() ?: false + null, COMPASS_PASS_ON -> selector?.exists() == true else -> getUiObject() != null } @@ -863,7 +868,7 @@ open class UiObject( private val cString = String::class.java private val cBoolean = Boolean::class.java - internal val interceptedMap: Map by lazy { + val interceptedMap: Map by lazy { val numberClassMap: Map>, Array> = mapOf( arrayOf(cIntPrim) to arrayOf( "child", "getChild", "performAction", "setDrawingOrder", "setInputType", @@ -918,7 +923,7 @@ open class UiObject( }.flatten().associateBy { it.name } } - internal fun has(name: String) = interceptedMap.containsKey(name) + fun has(name: String) = interceptedMap.containsKey(name) } diff --git a/app/src/main/java/org/autojs/autojs/theme/preference/MaterialDialogPreference.kt b/app/src/main/java/org/autojs/autojs/theme/preference/MaterialDialogPreference.kt index 24c15d87..2993c196 100644 --- a/app/src/main/java/org/autojs/autojs/theme/preference/MaterialDialogPreference.kt +++ b/app/src/main/java/org/autojs/autojs/theme/preference/MaterialDialogPreference.kt @@ -52,6 +52,15 @@ open class MaterialDialogPreference : MaterialPreference { } override fun onClick() { + + // @Hint by SuperMonster003 on Mar 27, 2025. + // ! Avoid rapid consecutive clicks to prevent the app from crashing. + // ! zh-CN: 避免连续快速点击可能导致应用崩溃. + // # java.lang.IllegalArgumentException: + // # LayoutManager androidx.recyclerview.widget.LinearLayoutManager@xxx + // # is already attached to a RecyclerView: androidx.recyclerview.widget.RecyclerView{...} + if (::mDialog.isInitialized && mDialog.isShowing) return + getBuilder().build().also { mDialog = it }.show() super.onClick() } diff --git a/version.properties b/version.properties index 33a2fd4f..04b7e509 100644 --- a/version.properties +++ b/version.properties @@ -1,5 +1,5 @@ -#Thu Mar 27 19:59:19 CST 2025 -BUILD_TIME=1743076759401 +#Fri Mar 28 10:17:08 CST 2025 +BUILD_TIME=1743128228067 COMPILE_SDK_VERSION=35 JAVA_VERSION=23 JAVA_VERSION_MIN_RADICAL=0 @@ -17,6 +17,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=3065 +VERSION_BUILD=3066 VERSION_NAME=6.6.2 Alpha5 VSCODE_EXT_REQUIRED_VERSION=1.0.8