** English ** | 简体中文
This guide explains how to cross-compile the required native libraries from the Nriver/termux-packages repository for Android JNI (arm64-v8a).
git clone https://github.com/Nriver/termux-packages.git
cd termux-packages./scripts/run-docker.shsudo -i
cd /home/builder/termux-packagesexport ANDROID_NDK_HOME=/home/builder/lib/android-ndk-r29
export NDK=/home/builder/lib/android-ndk-r29
export TERMUX_NDK=/home/builder/lib/android-ndk-r29If you have network issues, configure the proxy:
export ALL_PROXY=http://192.168.1.100:20809
export HTTP_PROXY=http://192.168.1.100:20809
export HTTPS_PROXY=http://192.168.1.100:20809
git config --global --replace-all http.proxy 'http://192.168.1.100:20809'
git config --global --replace-all https.proxy 'http://192.168.1.100:20809'# Comment out packages you don't need
sed -i '/pull_package virglrenderer-android/ s/^/#/' ./scripts/generate-bootstraps.sh./scripts/generate-bootstraps.shNote: The compilation may take a long time (10–30+ minutes). Please be patient.
After compilation, many .deb packages will be generated.
Extract the following .so files from the corresponding .deb packages and remove the version suffix (e.g., libpcre2-8.so.0 → libpcre2-8.so):
libacl.so
libandroid-selinux.so
libattr.so
libbusybox.so
libcharset.so
libexec_busybox.so
libexec_proot.so
libexec_tar.so
libiconv.so
libpcre2-8.so
libproot-loader.so
libtalloc.soPlace the files in:
src/main/jniLibs/arm64-v8a/
├── libacl.so
├── libandroid-selinux.so
├── libattr.so
├── libbusybox.so
├── libcharset.so
├── libexec_busybox.so
├── libexec_proot.so
├── libexec_tar.so
├── libiconv.so
├── libpcre2-8.so
├── libproot-loader.so
└── libtalloc.so