编译参考文章
https://bbs.pediy.com/thread-269889.htm
make[1
]: *
**` `No rule to make target
‘.git/refs/heads/master’, needed by
‘build/frida-version.h’``. Stop.
-
删除
frida/releng/frida.mk
文件的最后3行build/frida-version.h: releng/generate-version-header.py .git/refs/heads/master @$(PYTHON3) releng/generate-version-header.py > [email protected] @mv [email protected] $@
-
在frida/build目录下新建文件frida-version.h,需要自己改动版本号,这里我以15.1.4为例,内容如下:
#ifndef __FRIDA_VERSION_H__ #define __FRIDA_VERSION_H__ #define FRIDA_VERSION "15.1.4" #define FRIDA_MAJOR_VERSION 15 #define FRIDA_MINOR_VERSION 1 #define FRIDA_MICRO_VERSION 4 #define FRIDA_NANO_VERSION 0 #endif
trailing whitespace
在打patch的时候出现尾随空格的报错,如下:
git am ../../Patchs/strongR-frida/frida-core/*.patch
Applying: strongR-frida: string_frida_rpc
Applying: strongR-frida: io_re_frida_server
Applying: strongR-frida: pipe_linjector
Applying: strongR-frida: io_frida_agent_so
Applying: strongR-frida: symbol_frida_agent_main
/home/mdcg/Desktop/frida_compile/frida_15_0_14_three/.git/modules/frida-core/rebase-apply/patch:52: trailing whitespace.
/home/mdcg/Desktop/frida_compile/frida_15_0_14_three/.git/modules/frida-core/rebase-apply/patch:92: trailing whitespace.
/home/mdcg/Desktop/frida_compile/frida_15_0_14_three/.git/modules/frida-core/rebase-apply/patch:103: trailing whitespace.
warning: 3 lines add whitespace errors.
Applying: strongR-frida: thread_gum_js_loop
Applying: strongR-frida: thread_gmain
我借助了Visual Studio Code 的扩展Trailing Spaces查找并删除的多余的空格
具体删除内容:删除0005-strongR-frida-symbol_frida_agent_main.patch文件中第57、97、108行的空格,注意是删除空格而不是行。
重启
编译原生的frida之后运行frida-server正常,但打了patch后运行frida-server手机重启,这是因为在编译的时候相关库没有安装完整,按照下面的语句重新安装一下
sudo apt update
sudo apt-get install build-essential tree ninja-build gcc-multilib g++-multilib lib32stdc++-9-dev flex bison xz-utils ruby ruby-dev python3-requests python3-setuptools python3-dev python3-pip libc6-dev libc6-dev-i386 -y
sudo gem install fpm -v 1.11.0 --no-document
python3 -m pip install lief