Friday, December 30, 2016

Porting Kali NetHunter to LG G3 US990 with Cyanogenmod 13 Oct-OS-M ROM Android 6.0.1 Marshmallow

My latest project is trying to port Kali NetHunter to the LG G3 Running the latest OCT-OS-M CM13-based ROM (Android 6.0.1 Marshmallow).
I have yet to get the custom kernel to boot without the secure boot error, and am almost out of ideas, so if you can help, please drop me a line.
On your Android device:
Step 1. Root your phone.
Step 2. Unlock your bootloader and install TWRP.
Step 3. Install latest OCT-OS-M ROM.
On your Linux machine:
Step 4. Install Android toolchain as per kali wiki: here. (Note: An x86-64 machine is needed)
Step 5. Clone the OCT-OS kernel source github project named: platform_kernel_lge_us990
Step 6. Make kernel modifications and apply patches as per kali wiki: here. (Note: I had to disable Bluetooth USB HCI in order for the kernel to compile).
Step 7. Clone Kali NetHunter Source: here.
Step 8. Clone cbump source and cross-compile: here.
Step 9. Add cbump binary to kali-nethunter/nethunter-installer/boot-patcher/arch/armhf/tools/cbump
Step 10. Add
"$bin/cbump" boot-new.img || abort "Bumping boot image failed"
to kali-nethunter/nethunter-installer/boot-patcher/boot-patcher.sh (last line of build_boot() function.
Step 11. Add your device and build your zip as per wiki: here, and the README.md file in kali-nethunter/nethunter-installer/devices
In kali-nethunter/nethunter-installer/devices/devices.cfg add:
# LG G3 us990 for Cyanogenmod 13
[us990cm]
author = "mcraze123"
version = "1.0"
devicenames = us990
Copy your compiled and patched kernel image zImage to kali-nethunter/nethunter-installer/devices/marshmallow/us990cm
mkdir -p kali-nethunter/nethunter-installer/devices/marshmallow/us990cm
cp platform_kernel_lge_us990/kImage kali-nethunter/nethunter-install/devices/marshmallow/us990cm/
To get the lates apk's run:
python build.py -f
Then to build the zip, run:
python build.py -d us990cm -m
On Android:
boot into twrp, mount as mtp, copy zip to device, install zip

UPDATE:
I have managed to get past the secure boot error by flashing this zip, and removing the cross compiled version of cbump and modifications to boot-patcher.sh. Now the device recognizes on my mac as a keyboard but goes into a boot loop. I'm going to start with a known working kernel, then add features one by one in order to find what is causing the issues. Nethunter should be coming to the LG G3 US990 soon!

No comments:

Post a Comment