#!/usr/bin/env bash # 无线主控:设备端 Termux Agent + 本机 Frida,无需 Mac ADB # 用法: bash ensure_ws_agent_wireless.sh [SDK_HOST:PORT] [device_id] set -euo pipefail SDK_HOST="${1:-127.0.0.1:8899}" DEVICE_ID="${2:-xgfe65eimrrofyws}" WS_URL="ws://${SDK_HOST}/ws/device/${DEVICE_ID}" echo "================================================================" echo " 工作手机 · 无线主控(WebSocket + 设备本机 Frida)" echo " 不需要 Mac USB ADB;execute/probe 全走 WS" echo "================================================================" echo "" echo "【请在红米 Termux 执行】" echo "" FRIDA_PORT="$(python3 -c "import json; print(json.load(open('$(dirname "$0")/anti_detect/phantom_frida_config.json'))['listen_port'])" 2>/dev/null || echo 17263)" cat </dev/null || true curl -s "http://${SDK_HOST}/api/v3/connection/status" | python3 -m json.tool 2>/dev/null | head -20 || true