6.6.2 - Alpha5 - 修复布局分析页面生成代码时可能导致的应用崩溃 (issue #288)

This commit is contained in:
SuperMonster003
2025-03-28 11:21:25 +08:00
parent 1cae3820f9
commit f51a83e8e3
5 changed files with 25 additions and 9 deletions

View File

@@ -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 ->

View File

@@ -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<String, Intercepted> by lazy {
val interceptedMap: Map<String, Intercepted> by lazy {
val numberClassMap: Map<Array<out Class<*>>, Array<String>> = 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)
}

View File

@@ -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()
}