-- 纯进程选择脚本(无悬浮窗,提取自简洁UI) local vibra = context:getSystemService(Context.VIBRATOR_SERVICE) function toast(msg) gg.toast("[进程选择] " .. msg) vibra:vibrate(8) end -- 核心进程选择(无悬浮窗,仅唤起进程列表) function selectProcess() toast("加载进程列表...") local process = gg.setProcessX() -- 仅调用进程选择接口,不创建悬浮窗 if process then local pkgName = process.packageName local appName = process.appName local pid = process.pid toast("选中:" .. appName) -- 进程信息保存到本地(供其他脚本读取) file.write("/sdcard/长安/选中进程.txt", string.format("pkg=%s\nname=%s\npid=%d", pkgName, appName, pid)) return process else toast("取消选择") return nil end end -- 主执行(去掉 gg.setVisible(true),不显示RLGG悬浮窗) pcall(selectProcess, function(err) toast("出错:" .. err) end)