install or upgrade nodejs to verion 20 +
https://nodejs.org/en/download
# Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
# in lieu of restarting the shell
\. "$HOME/.nvm/nvm.sh"
# Download and install Node.js:
nvm install 22
# Verify the Node.js version:
node -v # Should print "v22.17.0".
nvm current # Should print "v22.17.0".
# Verify npm version:
npm -v # Should print "10.9.2".
reopen terminal to make it take effect.
to execute bash file in ubuntu:
chmod u+x ./xxx.sh
bash ./xxx.sh
clone related repo
git clone https://github.com/frida/frida-core.git
git clone https://github.com/Ylarod/Florida.git
make sure they are the same version. i use 16.5.2 in both frida-core and Florida
git checkout 16.5.2
create a new folder named patch in frida-core folder.
move Florida/patches/frida-core to frida-core/patch
to patch file:
git am patch/frida-core/*.patch
there shouldn’t have any error
start to build
./configure --host=android-arm64
if you encounter error
def load(mfile: Path) -> dict[str, Union[str, list[str]]]: TypeError: 'type' object is not subscriptable
upgrade your python to at least 3.9.
my ubuntu system version is 20.04 default python version is 3.8.
upgrade python(not necessary)
Crucial Warning: Do NOT uninstall Python 3.8 from Ubuntu 20.04 unless you absolutely know what you’re doing and are prepared for potential system instability.
Ubuntu 20.04 (Focal Fossa) relies heavily on Python 3.8 for many of its core system components, including the desktop environment, package manager (apt), and various utilities. Completely removing Python 3.8 can break your system and make it unusable.
Instead of uninstalling Python 3.8, the recommended and safer approach is to:
- Install Python 3.9 alongside Python 3.8.
- Use Python 3.9 for your specific projects by employing virtual environments.
- Adjust your
python3alias (if desired, with caution).
Here’s how to do it:
Step 1: Install Python 3.9 using the Deadsnakes PPA
The deadsnakes PPA (Personal Package Archive) is a well-maintained and common way to install newer Python versions on Ubuntu without interfering with the system’s default Python.
Update package lists and install prerequisites:
sudo apt update sudo apt install software-properties-commonAdd the
deadsnakesPPA:sudo add-apt-repository ppa:deadsnakes/ppaPress
Enterwhen prompted to confirm adding the PPA.Update package lists again to include the new PPA:
sudo apt updateInstall Python 3.9:
sudo apt install python3.9 python3.9-venv python3.9-devpython3.9: The Python 3.9 interpreter.python3.9-venv: Essential for creating isolated virtual environments.python3.9-dev: Includes header files and static libraries needed for compiling Python extensions.
Verify the installation:
python3.9 --versionYou should see
Python 3.9.x(wherexis the latest minor version available in the PPA).
Step 2: Set Python 3.9 as the default (Optional, Use with Caution)
By default, python3 will still point to Python 3.8. You can change this using update-alternatives, but be aware that this might affect system scripts that explicitly rely on the default Python 3.8 path.
If you want python3 to point to Python 3.9:
Configure alternatives for
python3:sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1 sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 2(The numbers
1and2are priorities. A higher number means higher priority. Here, 3.9 is given higher priority.)Select Python 3.9 as the default:
sudo update-alternatives --config python3You will see a list of available Python versions. Enter the number corresponding to
python3.9to select it as the default.Example output:
Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/bin/python3.8 1 auto mode 1 /usr/bin/python3.8 1 manual mode 2 /usr/bin/python3.9 2 manual mode Press <enter> to keep the current choice[*], or type selection number:Enter
2and press Enter.Verify the change:
python3 --versionIt should now show
Python 3.9.x.
Important Note on Default Python: Even if you change the python3 symlink, many system scripts still use absolute paths like /usr/bin/python3.8 to ensure they run with the expected version. This is a good thing for system stability.
Step 3: Use Virtual Environments (Recommended for Projects)
This is the safest and most recommended way to manage different Python versions for your projects. Virtual environments create isolated Python installations, so your project’s dependencies don’t conflict with other projects or with your system’s Python.
Navigate to your project directory:
cd /path/to/my/projectCreate a virtual environment using Python 3.9:
python3.9 -m venv .venvThis creates a folder named
.venv(you can choose any name) within your project directory, containing a Python 3.9 interpreter and its ownpip.Activate the virtual environment:
source .venv/bin/activateYour terminal prompt will change to indicate that the virtual environment is active (e.g.,
(.venv) user@host:~/my/project$).Now,
pythonandpipcommands will refer to Python 3.9 within this environment:python --version # Should show Python 3.9.x pip --version # Should show pip for Python 3.9.xInstall project dependencies:
pip install your-package-nameThese packages will be installed only in this virtual environment.
Deactivate the virtual environment when you’re done:
deactivate
By following these steps, you’ll have Python 3.9 available for your development needs without risking the stability of your Ubuntu 20.04 system. Always prefer virtual environments for project-specific Python versions.
ANDROID_NDK_ROOT must be set to the location of your r25 NDK
you may also encounter this error
Downloading toolchain 20240913...
Extracting toolchain...
Downloading SDK 20240913 for linux-x86_64...
Extracting SDK...
Downloading SDK 20240913 for android-arm64...
Extracting SDK...
ANDROID_NDK_ROOT must be set to the location of your r25 NDK
the downloaded SDK located at frida-core/dps.
go to here to download ndk munally
https://github.com/android/ndk/wiki/Unsupported-Downloads
Here’s how to set the ANDROID_NDK_ROOT environment variable on Ubuntu, both temporarily and persistently. Setting it persistently is generally recommended for development.
1. Identify Your Android NDK Path
First, you need to know the exact path where your Android NDK is installed.
- If you’ve downloaded and extracted it, it will be the top-level directory of the extracted NDK.
- Example Paths:
/home/yourusername/Android/Sdk/ndk/25.2.9519653(if installed via Android Studio’s SDK Manager)/home/yourusername/Android/ndk/android-ndk-r25b(if you manually downloaded and extracted it to~/Android/ndk/)/opt/android-ndk-r25b(if you put it in a system-wide location)
Crucial: Replace /path/to/your/android-ndk in the examples below with your actual NDK path.
2. Temporary Setting (for the current terminal session only)
This is useful for quick tests or if you only need the variable set for a single command. The variable will be gone when you close the terminal.
Open your terminal.
Type the
exportcommand followed by the variable name and its value:export ANDROID_NDK_ROOT="/path/to/your/android-ndk"Example:
export ANDROID_NDK_ROOT="/home/yourusername/Android/Sdk/ndk/25.2.9519653"Press Enter.
Verify it’s set:
echo $ANDROID_NDK_ROOTYou should see the path you just set printed.
3. Persistent Setting (Recommended for Development)
This method ensures that ANDROID_NDK_ROOT is automatically set every time you open a new terminal session. You’ll add the export command to your shell’s configuration file.
For most Ubuntu users, the shell is bash, and the primary configuration file is ~/.bashrc.
Open your
~/.bashrcfile in a text editor:nano ~/.bashrc # nano is a simple terminal text editor # OR gedit ~/.bashrc # gedit is a GUI text editor (if you have a desktop environment) # OR vim ~/.bashrc # vim is a powerful terminal editor (for experienced users)Add the
exportline to the end of the file: Scroll to the very bottom of the file and add the following line. Again, replace/path/to/your/android-ndkwith your actual NDK path.# Set Android NDK Root export ANDROID_NDK_ROOT="/path/to/your/android-ndk"It’s good practice to add a comment (starting with
#) to explain what the line does.Example (assuming your NDK is at
/home/yourusername/Android/Sdk/ndk/25.2.9519653):# Set Android NDK Root export ANDROID_NDK_ROOT="/home/yourusername/Android/Sdk/ndk/25.2.9519653"Save the file and exit the text editor:
- For
nano: PressCtrl + O(to write out/save), then Enter, thenCtrl + X(to exit). - For
gedit: Click “Save” or pressCtrl + S, then close the window. - For
vim: PressEsc, then type:wqand press Enter.
- For
Apply the changes to your current terminal session: The changes you made to
~/.bashrcwill automatically apply to any new terminal sessions you open. To apply them to your current session without closing and reopening the terminal, use thesourcecommand:source ~/.bashrcVerify it’s set persistently:
echo $ANDROID_NDK_ROOTYou should see the NDK path. Now, if you close this terminal and open a new one,
echo $ANDROID_NDK_ROOTshould still show the correct path.
Important Considerations:
- Android Studio’s NDK Location: If you installed the NDK via Android Studio’s SDK Manager, the path is typically within your Android SDK directory (e.g.,
~/Android/Sdk/ndk/<version_number>). - Permissions: Ensure the user you’re logged in as has read/execute permissions to the NDK directory and its contents.
- Other Shells: If you use a different shell (like
zsh), you would edit~/.zshrcinstead of~/.bashrc. ANDROID_HOME/ANDROID_SDK_ROOT: While not directly for NDK, you might also needANDROID_HOMEorANDROID_SDK_ROOTset for Android development, pointing to the parent Android SDK directory. This is separate fromANDROID_NDK_ROOT.
reopen terminal and continue to execute the last command.
make
make
frida-server is located in frida-core/build/server/
anti anti frida
go to frida-server folder move anti-anti-frida.py to it.
python anti-anti-frida.py frida-server
pixel6 android15 encounters error on this version
