Unlocking and Rooting Your Nexus Under Kali Linux
CREDITS: This whole post was lifted from nethunter.com (a.k.a. Kali NetHunter)
Before flashing the Kali NetHunter image to your Nexus device, it must first be unlocked and rooted. Note that unlocking your device will result in all of your data being deleted so ensure you have made a backup. Begin by installing the
Before flashing the Kali NetHunter image to your Nexus device, it must first be unlocked and rooted. Note that unlocking your device will result in all of your data being deleted so ensure you have made a backup. Begin by installing the
google-nexus-tools
package on your Kali Linux system:
Connect your Nexus to Kali with a USB cable. You will be prompted to allow USB debugging from the computer as shown below. Tap ‘OK’ to allow the connection.
On your Kali system, use the
nexus-adb
command to verify that your Nexus has been successfully attached.
Download the correct TWRP recovery image for your Nexus device:
Next, we require the correct files needed to root the device:
In this example, we are flashing a Nexus 7 2013 LTE device so we download the necessary files for our device and unzip the CF-Auto-Root archive.
With everything in place, we can now proceed to unlock the Nexus, install a new recovery, and root the device. First, reboot to the bootloader:
Once the device has booted to the bootloader, we can unlock it with the command below. You will be prompted to confirm the unlock on the Nexus device itself. Use the volume button to select Yes and press the Power button to confirm the unlock.
With the Nexus still in bootloader mode, we can flash the TWRP recovery downloaded previously:
The final step is to actually root the Nexus by making the ‘root-linux.sh’ script executable and then running it:
After your Nexus reboots, re-enable developer mode as shown above in order to proceed.
Install BusyBox Free Stephen (Stericson)
The first application to install once rooted is Busybox Free (Stephen Sericson). The NetHunter image will fail to function without a proper installation of this app. Once downloaded from the App store, open up BusyBox and grant it root privileges. Wait until the “gathering information” stage completes, and press “install”. Exit the Busybox app.
Install the TWRP Boot Manager Application
To ease the process of booting your Nexus into fastboot and recovery mode (normally done by powering down the Nexus, then booting it by pressing both the power button and volume down), we can install the TWRP boot manager application through the Google play store. This will allow us to boot into recovery mode with a single press of the touchscreen. Your Nexus device is now successfully unlocked and rooted,