Installing NetHunter on the Xiaomi Mi A2

Table of Contents

From unpacking to running NetHunter in 5 steps:

  1. Installing adb and fastboot
  2. Unlock Bootloader
  3. Flash PixelExperience Recovery and setup for LineageOS
  4. Flash LineageOS 22.1 and Magisk 27
  5. Install NetHunter

1. Installing adb and fastboot

kali@kali:~$ sudo apt update
[...]
kali@kali:~$ sudo apt install adb fastboot
[...]
kali@kali:~$

2. Unlock Bootloader

  1. Go to Settings -> About Phone then tap 7 times on “Build number” to enable “Developer options”
  2. Go to Settings -> System -> Developer options and tap “OEM unlocking” then turn off device
  3. Hold Volume Down and Power Buttons till you see “FASTBOOT” screen now plug device to PC
  4. Open terminal and run fastboot flashing unlock and hold Volume Down then wait until “FASTBOOT” come back now run fastboot flashing unlock_critical if FASTBOOT screen will not appear after first command just repeat Step 3 after phone boot and use fastboot flashing unlock_critical
  5. After reboot u should see “Unlocked” on boot screen

3. Flash PixelExperience Recovery and setup for LineageOS

  1. Download PixelExperience_jasmine_sprout-13.0-20231128-0727-OFFICIAL.img
  2. Reboot device holding Volume Down till “FASTBOOT” screen appear and connect it to PC
  3. Now open terminal and cd to directory where you downloaded PixelExperience_jasmine_sprout-13.0-20231128-0727-OFFICIAL.img and flash recovery like below
kali@kali:~$ cd Downloads/
[...]
kali@kali:~/Downloads$ fastboot flash boot_a PixelExperience_jasmine_sprout-13.0-20231128-0727-OFFICIAL.img
[...]
kali@kali:~/Downloads$ fastboot flash boot_b PixelExperience_jasmine_sprout-13.0-20231128-0727-OFFICIAL.img
[...]
kali@kali:~/Downloads$
  1. To reboot device to flashed recovery run fastboot reboot and hold Volume Up button until you see “RECOVERY” screen
  2. Download the copy-partitions-20210323_1922.zip
  3. On the device, select “Apply Update”, then “Apply from ADB” to begin sideload.
  4. Now use adb sideload copy-partitions-20210323_1922.zip
  5. Then reboot to recovery by tapping “Advanced”, then “Reboot to recovery”
  6. Go to “Advanced” -> “Enter fastboot”
  7. Download super_empty.img
  8. And then in fastbootd [NOT FASTBOOT/BOOTLOADER] use fastboot wipe-super super_empty.img on pc
  9. Now again reboot to recovery by tapping “Advanced”, then “Reboot to recovery”

4. Flash LineageOS 22.1 and Magisk 27

  1. Tap “Apply update” then tap “Apply from ADB”
  2. Download LineageOS-22.1-jasmine-sprout.zip
  3. Flash LineageOS 22.1
kali@kali:~/Downloads$ adb devices
* daemon not running; starting now at tcp:5037
* daemon started successfully
List of devices attached
dea044c9    sideload

kali@kali:~/Downloads$ adb sideload LineageOS-22.1-jasmine-sprout.zip
[...]
kali@kali:~/Downloads$
  1. Now wait for LineageOS to install if some error appear just tap “Yes”
  2. When it is installed tap “Reboot system now”
  3. Now setup your device like any android phone
  4. When you finished setting up your device reboot it and hold Volume Up
  5. If you see “RECOVERY” screen tap “Apply update” -> “Apply from ADB”
  6. Download Magisk-v27.apk
  7. Flash Magisk
kali@kali:~/Downloads$ adb devices
dea044c9    sideload

kali@kali:~/Downloads$ adb sideload Magisk-v27.apk
[...]
kali@kali:~/Downloads$
  1. Reboot Device and open newly installed app “Magisk” and setup it with instructions on screen

5. Install NetHunter

  1. Download kali-nethunter-2026.1-jasmine-sprout-los-fifteen-full.zip
  2. Copy it from PC to device
  3. Open Magisk app, Modules -> Install from storage and select “kali-nethunter-2026.1-jasmine-sprout-los-fifteen-full.zip”
  4. Then wait for installation to end, now tap “Reboot System”
  5. When phone starts you will see Kali Bootanimation

Enjoy Kali NetHunter on the Xiaomi Mi A2

Please help with the development by submitting issues and pull requests. We much appreciate it.

Troubleshooting

Broken SSH

  • Use ssh-keygen -A in nethunter terminal

Broken APT

  1. Use echo 'APT::Sandbox::User "root";' > /etc/apt/apt.conf.d/01-android-nosandbox in nethunter terminal
  2. Use groupadd -g 3003 aid_inet && usermod -G nogroup -g aid_inet _apt in nethunter terminal Credit: yesimxev

Broken Ctrl+C

Happens on newer Magisk Version so use 27


Updated on: 2026-Jan-20
Author: mr00k3