这个 Kali NetHunter 安装程序本质上只是一个由 build.py 根据此处包含的文件夹结构生成的 zip 文件。
请按照以下说明创建 Kali NetHunter 安装程序 zip。
你只需通过 Recovery/TWRP(或 Magisk)刷入它,即可在设备上获得完整的 Kali NetHunter 环境和 chroot。
引导镜像修补脚本基于 AnyKernel3。
更多信息请参阅文档页面。
在构建任何内容之前,你需要初始化内核仓库。
整个搭建过程已实现自动化。由于 Kali NetHunter 内核拥有庞大的二进制 Git 历史,我们建议在出现提示时使用浅克隆 (--depth 1),而不是完整历史:
$ ./bootstrap.sh
这会将 Kali NetHunter Kernels 克隆到 ./kernels/ 中
以 Nexus 5 (hammerhead) 为例进行构建:
$ ./build.py --kernel hammerhead --marshmallow
# OR
$ ./build.py -k hammerhead -6
构建内核安装程序 (用于测试内核是否正常工作):
$ ./build.py --kernel hammerhead --marshmallow --installer
构建不含内核安装程序的版本 (仅用于更新应用):
$ ./build.py --kernel hammerhead --marshmallow --no-installer
构建时添加完整的 rootfs/chroot (使用预先创建(默认)或自行生成,然后添加到 ./rootfs/kalifs-full-[arch].tar.xz):
$ ./build.py --kernel hammerhead --marshmallow --rootfs full
创建发布版本:
$ ./build.py --kernel hammerhead --marshmallow --rootfs full --release 2024.3
$ ./build.py --kernel hammerhead --marshmallow --rootfs minimal --release daily
强制下载所有外部资源:
$ ./build.py --kernel hammerhead --marshmallow --force-download
或者,无需构建任何内容即可进行“缓存”:
$ ./build.py --force-download
构建卸载程序:
$ ./build.py --kernel hammerhead --marshmallow --uninstaller
显示帮助:
$ ./build.py -h
[i] Reading: kernels/devices.yml
usage: build.py [-h] [--generic ARCH] [--kernel KERNEL] [--kitkat] [--lollipop] [--marshmallow] [--nougat] [--oreo] [--pie] [--ten] [--eleven] [--twelve] [--thirteen] [--fourteen] [--fifteen] [--wearos]
[--rootfs SIZE] [--force-download] [--uninstaller] [--installer] [--no-installer] [--no-branding] [--no-freespace-check] [--supersu] [--release VERSION]
Kali NetHunter Installer (Recovery flashable ZIP script builder)
options:
-h, --help show this help message and exit
--generic ARCH, -g ARCH
Build a generic installer (modify ramdisk only)
--kernel KERNEL, -k KERNEL
Allowed kernel IDs: a37-los a5ulte-cm a5ulte-tw a5xelte-tw a7xelte-los ailsa-ii alioth-los-ksu angler angler-los armani beryllium beryllium-los blueline bramble bullhead cancro-cm
cedric-los crosshatch davinci-miui dogo-cm dragon drg-los es2 eva-emui eva-los flo flo-cm flounder gemini4g-p1 gemini4g-p2 gemini4g-p3 gracelte graceltekor grouper gts4llte gts4lwifi
h830 h850 h918 h990 h990-los hammerhead hammerhead-los hammerhead-caf-los hero2lte-tw hero2lte-los hero2lte-oui hero2lte-kor-tw herolte-tw herolte-los herolte-oui herolte-kor-tw
hlte-can-cm hlte-can-tw hlte-dcm-tw hlte-eur-cm hlte-eur-tw hlte-eur-los hlte-kdi-tw hlte-kor-cm hlte-kor-tw hlte-spr-cm hlte-spr-tw hlte-vzw-tw honami-los htc-pmewl ido-los j53g-los
j5lte-los j5nlte-los j7y17lte-oui jalebi-los jfltexx-cm jiayus3a kiwi-cm klte-los klte-tw klte-chn-los klte-chnduo-los klte-duos-los klte-duos-tw klte-kdi-los klte-kdi-tw klte-kor-
los klte-skt-tw klte-spr-los klte-spr-tw klte-usc-tw klte-vzw-tw kminilte-los laurel-sprout-los lv517-los mako mako-cm manning manta markw-los mocha-cm on7xlte-oui onem7gpe onem8gpe
oneplus-nord-oos oneplus1-cm oneplus1-los oneplus2-oos oneplus2-cm oneplus2-los oneplus3-3t-oos oneplus3-3t-los oneplus3-oos oneplus3-v2-oos oneplus3-los oneplus3t-los oneplus3t-oos
oneplus5-oos oneplus5-cm oneplus5-los oneplus5-pa oneplus5-los-ksu oneplus5-pa-ksu oneplus6-oos oneplus6-los oneplus7-oos oneplus7-v2-oos oneplus8-oos oneplusx-cm osprey-los payton-
los pdx201-los pl2-los potter-los pyxis-los r8q-oui rmx1911-cos rmx1971 rmx2185-los rmx3031 s2-cm sakura-los santoni-miui mido-pe11 shamu shamu-los shieldtablet spacewar star2lte-los
sunfish surya-los suzuran-los ticwatchpro ticwatchpro3 us996 vayu victara-cm vienna yuga-cm z00e-los zeroflte-los zeroflte-tw zerolte-los zerolte-tw
--kitkat, -4 Android 4.4
--lollipop, -5 Android 5
--marshmallow, -6 Android 6
--nougat, -7 Android 7
--oreo, -8 Android 8
--pie, -9 Android 9
--ten, -10 Android 10
--eleven, -11 Android 11
--twelve, -12 Android 12
--thirteen, -13 Android 13
--fourteen, -14 Android 14
--fifteen, -15 Android 15
--wearos, -w Wear OS
--rootfs SIZE, -fs SIZE
Build with Kali rootfs (full, minimal or nano)
--force-download, -f Force re-downloading external resources
--uninstaller, -u Create an uninstaller
--installer, -i Build only the kernel installer (boot-patcher)
--no-installer Build without the kernel installer (boot-patcher)
--no-branding Build without wallpaper or boot animation
--no-freespace-check Build without free space check
--supersu, -su Build with SuperSU installer included
--release VERSION, -r VERSION
Specify NetHunter release version
更多示例请参阅文档页面。
请参阅 Kali NetHunter Kernels 仓库中的 README.md:https://gitlab.com/kalilinux/nethunter/build-scripts/kali-nethunter-kernels
可以从查看以下内容入手:
./kernels/devices.yml(此处)