The Quest For Kali Nethunter – Part 1

This post is the first in a series that will detail my attempt to port Kali Nethunter to the HTC One X. For more information on Kali Nethunter see here.

The stages involved are :-

  1. Build CM11 Rom
  2. Modify Android source code with Nethunter kernel patches
  3. Build rom with patches
  4. Install Nethunter

WARNING: You should be comfortable with flashing roms/ recovery images  to your phone as well as using adb, fastboot and recovery. I am not responsible if you brick your phone.

Pre-requesites:-

  • HTC One X (endeavoru) with unlocked bootloader with S-on or S-off and TWRP Recovery 2.7.0.0
  • Kali Linux 64 bit OS with terminal set for infinite scrolling
  • Sun Java 1.7.0.17
  • Working Android SDK in your path

First we install dependancies.


sudo apt-get install bison build-essential curl flex git gnupg gperf libesd0-dev libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop openjdk-6-jdk openjdk-6-jre pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

Next we set up the Android Build system.


$ mkdir -p ~/bin
$ mkdir -p ~/android/system
$ export PATH=/root/bin:$PATH
$ cd ~/android/system/
$ repo init -u https://github.com/CyanogenMod/android.git -b cm-11.0

This will take some time to pull the Android source code tree.Once finished the next stages are to get the prebuilt stuff and the proprietary binaries from your phone. If you do not extract the correct files into the build system then the rom will not function correctly. You should make sure that all files are copied.

$ cd ~/android/system/vendor/cm
$ ./get-prebuilts
<pre>

Connect your phone via usb and check the phone is recognised via ADB before downloading proprietary binaries.

$ adb start-server
$ adb devices
$ cd ~/android/system/device/htc/endeavoru
$ ./extract-files.sh

Now ,we change to the build directory and set up the compiler cache to speed up the build process. The cache is set to 50 Gigabytes.

$ cd ~/android/system/
$ export USE_CCACHE=1
$ prebuilts/misc/linux-x86/ccache/ccache -M 50G
$ breakfast - choose option 25 - cm_endeavoru_userdebug
$ brunch - choose option 25 - cm_endeavoru_userdebug

If all goes well you will have a successful compile as shown by the image below:-

CM11 compiled successully

2 responses to “The Quest For Kali Nethunter – Part 1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s