This article is a mirror article of machine translation, please click here to jump to the original article.

View: 87|Reply: 0

[Safety Tutorial] Compile apatch

[Copy link]
Posted on 1/13/2026 9:24:43 PM | | |
Environment:
Environment: ubuntu

Download or update to the latest Android studio

Download source code:

git clone --recurse-submoduleshttps://github.com/bmax121/APatch.git

git submodule update --init --recursive



Preparing the Rust environment:

# 0.Install Rust
curl --proto '=https' --tlsv1.2 -sSfhttps://sh.rustup.rs| sh

# Run after installation is complete:
source $HOME/.cargo/env

# 1. Install the target platform
rustup target add aarch64-linux-android

Restart your computer

2. Complete compilation process (steps that can be directly reused)
1. Complete the basic environment (required dependencies)
bash
Run
# 1. Install the base compilation toolchain
sudo apt update && sudo apt install -y build-essential ninja-build gcc-aarch64-linux-gnu

# 2. Installing CMake with Adaptation Architecture (x86_64 as an example)
wgethttps://github.com/Kitware/CMake ... linux-x86_64.tar.gz
sudo tar -zxvf cmake-3.28.0-linux-x86_64.tar.gz -C /usr/local/
sudo ln -s /usr/local/cmake-3.28.0-linux-x86_64/bin/cmake /usr/bin/cmake

# 3. Install the Rust plugin cargo-ndk
source $HOME/.cargo/env
cargo install cargo-ndk
2. Network environment configuration (to solve dependent downloads)
bash
Run
# 1. Configure public DNS
sudo tee /etc/resolv.conf << EOF
nameserver 223.5.5.5
nameserver 8.8.8.8
EOF

# 2. Configure the Gradle domestic image
mkdir -p ~/.gradle
tee ~/.gradle/init.gradle << EOF
allprojects {
    repositories {
        maven { url 'https://maven.aliyun.com/repository/public/' }
        maven { url 'https://maven.aliyun.com/repository/google/' }
        google()
        mavenCentral()
    }
}
EOF
3. Compile the APatch core product
bash
Run
# 1. Configure the NDK environment (replace with your NDK path)
export ANDROID_NDK_HOME=/home/frida/Android/Sdk/ndk/29.0.14206865
export PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH

# 2. Go to the APatch root directory and clean up the old cache + compile
cd ~/Desktop/apatch/APatch
./gradlew clean && ./gradlew app:assembleRelease

# 3. Compile kernel modules (optional, if not auto-compiled)
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- CC=clang KERNEL_SRC=~/Desktop/apatch/kernel -C kernelpatch








Previous:Windows Defender Credential Guard doesn't allow the use of saved credentials
Next:NetEase 163 Enterprise Mailbox Related Questions
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com