A Magisk module that injects into target Android apps via Zygisk to directly read the native View tree and serve UI node information over a TCP loopback port without using AccessibilityService.

Stars

8

7-day growth

No data

Forks

4

Open issues

0

License

MIT

Last updated

2026-07-27

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It offers a stealthy, real-time way to extract UI structure (text, resource IDs, coordinates, clickability) from any app, bypassing AccessibilityService detection and system focus limitations, making it ideal for root-automation scenarios where concealment and performance matter.

Who it is for

  • Root users seeking covert UI automation
  • Developers building accessibility-agnostic testing tools
  • Reverse engineers analyzing app UI layouts
  • Security researchers exploring app behavior without leaving traces

Use cases

  • Automated scripts to interact with app UI elements without enabling accessibility
  • Live UI monitoring for game or social media auto-play/auto-like tasks
  • Data extraction from apps that block AccessibilityService
  • Cross-app UI state inspection for debugging or automation frameworks

Strengths

  • No AccessibilityService dependency – target app cannot detect the injection
  • Direct in-process View tree traversal provides real-time and complete node data
  • Zero overhead when idle – only connects on demand via TCP pull
  • Simple configuration (package name and port) without recompilation

Considerations

  • Requires root access and Zygisk (Magisk or Zygisk Next)
  • Only covers native Android views; WebView, Flutter, and other custom-rendered content are not visible
  • Read-only – does not perform clicks or input; user must implement actions separately

README quick start

Zygisk NodeInfo

用 Zygisk 注入目标 App,在其进程内直接遍历原生 View 树,通过一个 TCP loopback 端口按需把当前前台页面的节点信息(文字 / 资源 id / 类名 / 屏幕坐标 / 可点击等)以 JSON 返回。不使用无障碍服务

一句话:给自动化脚本一个「不开无障碍、也能拿到控件树」的取数通道。


特性

  • 不依赖无障碍(AccessibilityService):目标 App 检测不到你开了无障碍,也不占用系统唯一的无障碍焦点通道。
  • 进程内直读 View 树:数据源就是 App 自己的 WindowManagerGlobal.mViews,比无障碍事件更实时、更完整(含 Dialog / Popup)。
  • 只回当前焦点窗口:自动过滤被覆盖但未销毁的旧 Activity,避免拿到上一个页面的“幽灵节点”。
  • 按需拉取(pull):客户端每次需要时连一次端口取一帧,agent 平时不做任何事,开销低、footprint 小。
  • TCP loopback,无需 root 读取:客户端(另一个普通 App / 电脑 adb)直接连 127.0.0.1:,绕开 unix socket 的 SELinux MLS 限制与「每-App 挂载命名空间」文件隔离。
  • 目标包名 / 端口运行时可配:改 config.prop 即可,无需重编。

工作原理

┌───────────────────────── 目标 App 进程 (untrusted_app) ─────────────────────────┐
│  Zygisk (native module.cpp)                                                     │
│    preAppSpecialize : 读 config.prop 判断是否目标;是→把 agent dex 读进内存      │
│    postAppSpecialize: InMemoryDexClassLoader 加载 agent → NodeAgent.start()      │
│                                                                                 │
│  agent (dex, 反射)                                                              │
│    ServerSocket 127.0.0.1:  ← accept 一次                                 │
│    → 主线程遍历「当前有窗口焦点」的 View 树 → JSON → 写回 socket → close          │
└─────────────────────────────────────────────────────────────────────────────┘
                    ▲  连接一次取一帧
                    │  TCP loopback(untrusted_app 间标准放行)
┌───────────────────┴───────────────────┐
│  你的客户端:另一个 App / 电脑 adb      │
└───────────────────────────────────────┘

要点:

  • Zygisk 在 preAppSpecialize 判断进程;非目标进程立刻 DLCLOSE,零残留。
  • getModuleDir() 的 fd 只在 specialize 前有效,所以 config 与 dex 都在 preAppSpecialize 读入内存postAppSpecialize(ART 就绪)再加载。
  • postAppSpecialize 时宿主 Application 尚未创建,用系统类加载器作父加载器即可(agent 只依赖框架类 + 反射)。
  • View 访问必须在主线程,agent 用主线程 Handler.post + 超时取回结果。

依赖

  • 已 root 且启用 Zygisk 的设备(Magisk 内置 Zygisk,或 APatch/KernelSU 配 Zygisk Next)。
  • 构建机:Android NDK(含 CMake 工具链)+ Android SDKd8android.jar)。

构建

export ANDROID_NDK=~/Library/Android/sdk/ndk/27.0.12077973
export ANDROID_SDK=~/Library/Android/sdk
./build.sh
# 产物:dist/zygisk_nodeinfo.zip

build.sh 会自动拉取官方 zygisk.hpp、用 d8 编 agent dex、用 CMake 编 .so、打包成 Magisk 模块 zip。默认只编 arm64-v8a,需要 32 位在脚本里加 armeabi-v7a


配置

编辑 `mo

Description

不开无障碍:用 Zygisk 从目标进程内部直读 View 树的自动化取数方案

Related repositories

Similar projects matched by category, topics, and programming language.

oversecured
oversecured GitHub avatar

Samsung_Vulnerabilities

Oversecured discloses a report of 176 vulnerabilities discovered in Samsung preinstalled apps between 2022 and 2025, with 140 detailed, all fixed in collaboration with Samsung.

Java
310
wxxsfxyzm
wxxsfxyzm GitHub avatar

MiuiBackGestureHook

An LSPosed module that hooks MIUI SystemUI back gestures using modern Xposed API 102 for research and customization.

Java
86
SangLuoCN
SangLuoCN GitHub avatar

OneStep4

OneStep4.0 is a multi-window desktop container for Android that requires root or system-level privileges, enabling a main window with several side windows for efficient app multitasking.

Java
84