官方教程
https://frida.re/docs/building/#gnulinux

这里我们也使用Ubuntu20.04进行编译.
开始编译
安装一些辅助工具
1
2
3
4
5
6
7
8
9
10
11
12
|
//设置root密码
sudo passwd root
//更新
apt update
//安装net工具,可以使用ifconfig
apt install net-tools
//文本编辑工具
apt install gedit
//代理工具,科学上网
apt install proxychains
//设置socks5代理
gedit /etc/proxychains.conf
|
安装官方推荐环境
1
2
|
proxychains apt-get install build-essential curl git lib32stdc++-9-dev \
libc6-dev-i386 nodejs npm python3-dev python3-pip
|
1
2
|
//编译check-core-linux-x86_64的时候需要
proxychains apt-get install gcc-multilib g++-multilib
|
拉Frida源码
1
2
|
proxychains git clone --recurse-submodules https://github.com/frida/frida
cd frida
|
官方toolchain和sdk下载链接如下:
其中20220318是frida中releng/deps.mk中的frida_deps_version,后面部分则是toolchain-{平台+架构}.tar.bz2

1
2
3
4
|
https://build.frida.re/deps/20220318/toolchain-linux-x86_64.tar.bz2
https://build.frida.re/deps/20220318/sdk-linux-x86_64.tar.bz2
https://build.frida.re/deps/20220318/sdk-android-arm.tar.bz2
https://build.frida.re/deps/20220318/sdk-android-arm64.tar.bz2
|
在frida文件夹下面新建build文件夹,使用wget将上述链接文件放进去.
接下来在frida文件夹下,执行下述命令.
配置NDK
在frida文件夹下,执行下述命令,就会报需要的NDK版本.
1
|
make core-android-arm64
|

- 去官网下载NDK.
https://developer.android.google.cn/ndk/downloads/
1
2
|
//这里我们下载r24的Linux NDK
https://dl.google.com/android/repository/android-ndk-r24-linux.zip
|
- 解压上述下载的文件.
1
|
unzip android-ndk-r24-linux.zip
|
- 配置环境变量.
1
2
3
4
5
6
7
8
|
gedit ~/.bashrc
//将下述内容添加到上述文件的末尾
export ANDROID_NDK_ROOT=/home/luohun/Desktop/android-ndk-r24
export PATH=$ANDROID_NDK_ROOT:$PATH
//检查是否配置成功
source ~/.bashrc
ndk-build --v
|
编译
在frida目录下执行make,会让你选择编译的平台,这里我们编译arm64平台的.
1
|
make core-android-arm64
|
最终产物在 frida/build/frida-android-arm64/bin目录下.
