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 :-
- Build CM11 Rom
- Modify Android source code with Nethunter kernel patches
- Build rom with patches
- 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.
- HTC One X (endeavoru) with unlocked bootloader with S-on or S-off and TWRP Recovery 18.104.22.168
- Kali Linux 64 bit OS with terminal set for infinite scrolling
- Sun Java 22.214.171.124
- 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:-