ACTION_FOREGROUND_APP
Retrieves the foreground app's package name and activity class, falling back to shell dumpsys when accessibility is unavailable, and stores the result in workflow variables.
Instructions
获取前台应用包名/Activity(先无障碍,拿不到再走 shell dumpsys)(需无障碍或 Shizuku/root)。输出:foreground_package, foreground_success, foreground_activity, foreground_class。拿不到时写 unknown 且 foreground_success=false;foreground_class 为短类名。节点必须带 params(可为 {}),缺 params 字段时什么都不做。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| require | No | 执行后要求为 true 的变量名(如 click_success),不满足按出错处理 | |
| on_error | No | 节点出错时:skip=跳过继续(默认),stop=停止整个工作流 | |
| use_shell | No | true=跳过无障碍,直接用 shell(默认 false) | |
| output_var | No | 包名另存到的变量名(默认 foreground_package) | |
| activity_var | No | Activity 类名另存到的变量名(默认 foreground_activity) | |
| node_timeout_ms | No | 单节点超时毫秒,0=不限;默认 30 分钟 |