已 Root 的真机或模拟器(推荐 Genymotion / Android Studio AVD)
☐ ADB
Android Debug Bridge
☐ Python
版本 3.8+
☐ 测试 App
本指南使用系统自带的设置应用
检查清单
1
2
3
4
5
6
7
8
9
# 1. Check if ADB is installedadb version
# 2. Check if Python is installedpython3 --version
# 3. Check device connectionadb devices
# Should display your device
操作步骤
第 1 步: 安装 Frida (2 分钟)
在电脑上安装 Frida 工具:
1
pip install frida-tools
在 Android 设备上安装 frida-server:
1
2
3
4
5
6
7
8
9
# Visit https://github.com/frida/frida/releases# Download frida-server matching your Python frida version# View your frida versionfrida --version
# View device architectureadb shell getprop ro.product.cpu.abi
# Common output: arm64-v8a, armeabi-v7a, x86_64
1
2
3
4
5
6
7
# Decompress and push to deviceunzip frida-server-*.zip
adb push frida-server-*-android-* /data/local/tmp/frida-server
# Grant execute permission and runadb shell "chmod 755 /data/local/tmp/frida-server"adb shell "/data/local/tmp/frida-server &"
验证安装:
1
2
3
4
5
6
7
frida-ps -U
# Should see output like:# PID Name# ---- ---------------# 1234 com.android.settings# 5678 com.android.systemui# ...
// If method has multiple overloads, need to specify parameter class type
YourClass.yourMethod.overload("java.lang.String").implementation=function(arg){// your code here
};