feat: 增加 Native Hook 应用 Trace 采集 - #166
Closed
qiqingzhixin wants to merge 8 commits into
Closed
Conversation
qiqingzhixin
force-pushed
the
codex/issue-152-trace-capture
branch
from
July 20, 2026 03:44
c9ae6fc to
0bbbd25
Compare
2 tasks
This was referenced Jul 20, 2026
Collaborator
Author
|
Branch was pushed to the upstream repository by mistake. Replaced by fork-based PR #171. |
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.
变更
prepare和exercise。ApplicationScenariointerface,以及CalculatorScenario、NoteScenario两个 adapter;后续应用通过新增并注册 adapter 扩展。--scenario {calculator,note}参数,默认仍为calculator,保持原有命令兼容。calculator场景在采集前校验100 * 100 = 10000,采集期间动态发现按钮并持续随机点击。note场景启动com.ohos.note/MainAbility,确认pages/MyNoteHome,在采集前从搜索框边界计算并缓存左、中、右三个安全点,采集期间持续随机点击。使用
脚本只使用 Python 标准库,无需安装额外 Python 依赖:
省略
--scenario时默认使用calculator。多设备或工具不在PATH时:成功产物位于
target/trace/YYYYMMDD-HHMMSS/,包含native_heap.htrace、trace.db、hiprofiler.log、uitest.log和trace-streamer.log。核心产物是 htrace;数据库是当前串联验证产物。验证
7001005458323933328a521c3c503800,API 26,uitest 7.0.0.1。calculator:前置结果10000,动态发现 18 个按钮。note:动态发现三个搜索框安全点,30 秒采集期间随机点击 14 次,未修改笔记数据。native_hook记录全部关联process.name=com.ohos.note。py -m py_compile tools/native_hook_capture.py tools/test_native_hook_capture.pypy tools/test_native_hook_capture.py:27 passed。git diff --checkcalculator10000calculator10000calculator10000note四次均完成 trace_streamer 转换。
符号转换由 #167 独立交付。
Closes #168
Refs #152