Skip to content

安装与环境准备 ​

🛠️ 从零搭建 r0capture 抓包环境。

前置条件 ​

项要求
Android 设备已 root(或模拟器)
Android 版本5.0+(推荐 8-12)
架构arm64/arm/x86/x64(看设备)
PCPython 3.7+
USB 线 / 网络连接设备

步骤 ​

1. PC 端装 frida ​

bash
pip install frida-tools frida
# 验证
frida --version

详见 pip-install-fail 若失败。

2. 设备端装 frida-server ​

bash
# 查架构
adb shell getprop ro.product.cpu.abi
# 假设 arm64-v8a

# 下载对应 frida-server(版本要和 PC 的 frida 一致)
# https://github.com/frida/frida/releases

# push 并运行
adb push frida-server-xx-android-arm64 /data/local/tmp/frida-server
adb shell "su -c 'chmod +x /data/local/tmp/frida-server'"
adb shell "su -c '/data/local/tmp/frida-server &'"

3. 验证连接 ​

bash
frida-ps -U   # 列出设备进程
# 看到进程列表 = 连接成功

若失败见 device-offline / frida-server-not-running。

4. 装 r0capture ​

bash
git clone https://github.com/r0ysue/r0capture.git
cd r0capture
# r0capture.py 直接用,无需安装
python r0capture.py --help

5. 跑一次 ​

bash
# spawn 模式抓包
python r0capture.py -U -f com.example.app -p out.pcap

版本匹配 ​

PC frida 与设备 frida-server 主版本必须一致,否则报错。见 frida-version-mismatch。

相关文档 ​

基于 VitePress 构建 · 教学用途