Compile reference articles
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.
-
delete
frida/releng/frida.mk
the last 3 lines of the filebuild/frida-version.h: releng/generate-version-header.py .git/refs/heads/master @$(PYTHON3) releng/generate-version-header.py > [email protected] @mv [email protected] $@
-
Create a new file frida-version.h in the frida/build directory, you need to change the version number yourself, here I take 15.1.4 as an example, the content is as follows:
#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
When patching, a trailing space error occurs, as follows:
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
I used Visual Studio Code's extension Trailing Spaces to find and remove extra spaces
Specific deletion content: Delete the spaces in lines 57, 97, and 108 in the 0005-strongR-frida-symbol_frida_agent_main.patch file. Note that spaces are deleted instead of lines.
reboot
After compiling native frida, running frida-server is normal, but after patching and running frida-server, the phone restarts. This is because the relevant libraries are not installed completely during compilation. Follow the following statement to reinstall
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