Repository navigation
fix: 防止无障碍事件源节点索引越界导致崩溃 - #573
Closed
DeanTMaxim wants to merge 1366 commits into
Closed
DeanTMaxim wants to merge 1366 commits into
DeanTMaxim wants to merge 1366 commits into
Conversation
… -> ui.(status/navigation)BarIconLight[By]
…Hex/ColorName 等颜色参数
…03#416); 移除 UiObject#hashCode/equals 覆写; 新增 UiObject#isShifted 方法
…er003#414, SuperMonster003#340); 修复错误报告页面复制详细信息功能失效的问题
适配 Android 12 及以上蓝牙权限模型变更
…yout, Expandable RecyclerView, Recyclerview Flexible Divider
Fix ConcatReader.close() to close all readers on failure
- 新增 LogBottomSheet 底部日志面板 - ConsoleView 支持堆栈帧点击跳转 - EditorView 添加 LogPanelCallback 接口 - EditActivity 集成日志面板与代码跳转 - 添加日志菜单项和图标资源
feat: 添加底部日志面板功能
SuperMonster003
force-pushed
the
master
branch
from
November 3, 2026 07:28
ed3eb10 to
c9e081f
Compare
SuperMonster003
added a commit
that referenced
this pull request
Nov 3, 2026
…nd the contributor table Add the fix entries of the ported PRs #571 (DeanTMaxim, reported in #570), #558 and #557 (djbclark) to the 6.8.0 notes in all ten languages, and add both contributors to the README contributor table by hand, sorted by the date of their latest pull request (2026/08/21 and 2026/07/14), with the counts of all their pull requests, including #556 and #573 whose fixes were already in place. Regenerate the changelog and README files, record the translation baseline, and set VERSION_BUILD to 4982.
Owner
|
感谢! 这个越界问题已在当前代码中以相同思路修复 (77602b9, Thanks! The same bounded lookup is already in the current code (77602b9) and ships with 6.8.0. This pull request was closed automatically after today's history rewrite (force push), so it is not merged separately; your contribution is counted in the README contributor table. #572 will be closed once 6.8.0 is released. |
SuperMonster003
added a commit
that referenced
this pull request
Nov 3, 2026
The contributor table scraper rebuilt the table from merged pull requests only, so it would have dropped the rows added by hand for the ported pull requests. Pull requests #556, #557, #558, #571 and #573 are now recorded with the author's commit count and latest commit time as they were in each pull request (their GitHub commit lists span the whole old history after the 2026-11-03 rewrite) and are counted like merged ones; authors with such pull requests link to all their pull requests instead of merged ones only. Running the scraper corrects the commit count of djbclark from 3 to 5 (#556 and #558 have two commits each).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #572
问题
脚本通过
auto.registerEvent注册窗口变化事件后,AccessibilityService会在调用脚本回调前构造AccessibilityEventWrapper。原
getIndexInParent()会持续递增索引,直到parent.getChild(index)等于事件源节点,但没有按parent.childCount限界。页面切换期间节点树可能变化,事件源节点可能已经从父节点移除;此时循环会访问越界索引,并由 Android 框架抛出ArrayIndexOutOfBoundsException,导致 AutoJs6 进程、无障碍服务和当前脚本一起退出。修改
0 until childCount范围内。RuntimeException时返回安全哨兵-1。findIndexInParent(),以便用本地单元测试稳定复现节点消失和节点失效场景。getDepth()不变:当前崩溃证据只指向getIndexInParent(),本次不加入任意深度上限或扩大重构范围。选择
-1是因为它与UiObject构造器的缺省indexInParent一致,用来表示没有可用的父级索引;本次不改变UiObject的其他导航行为。测试
新增
AccessibilityNodeIndexTest,覆盖:childCount = 1且目标节点已消失时,不读取索引 1,返回-1。RuntimeException时返回-1。TDD 证据:
IndexOutOfBoundsException: Index: 1, Size: 1失败。IllegalStateException: stale node失败。-1时,正常路径用例以expected:<1> but was:<-1>失败。OK (3 tests)。AccessibilityEventWrapper.kt、AccessibilityNodeIndex.kt连同 Android 36android.jar的窄化 Kotlin 编译通过。git diff --check无空白错误。提交前再次运行完整 Gradle 任务
:app:testAppDebugUnitTest --no-daemon --offline:当前
origin/master@ed3eb10e首先存在以下资源链接错误;测试时仅在本地临时补充了两个颜色资源别名:资源链接通过后暴露出同一上游日志面板变更中的第二组既存错误:
测试时仅在本地把其中的
AutoJs.getInstance()调整为项目现有的AutoJs.instance写法,随后完整 Gradle 目标测试通过。上述两项临时基线补丁均已删除,未包含在本 PR 中;本 PR 只包含事件包装修复及其回归测试。