[OFFICIAL][NETHUNTER][SUZURAN][LOS-NOUGAT] - Xperia Z5 Compact Android Development

##I DO NOT ACCEPT FOR BRICKED DEVICES, AND ILLEGAL WORKS##
!!!USE WITH CAUTION!!!
Device: Sony Xperia Z5 Compact
OS: LineageOS 14.1 / Android 7.1.2
Thanks for helps to: @Joeisgood99
1.Take a full backup or only Boot partition
2.Flash Nethunter zip
3. Reboot
4. Open FDroid Nethunter, Upgrade Nethunter apps
5. Open Nethunter app, give permissions
6. Open Nethunter Terminal, give permissions and: apt-get update
7. Open Nethunter app,Navigate to Chroot (metapackages) manager, select Nethunter and press install/upgrade
Unofficial Download Link: https://drive.google.com/file/d/1iFDtMelkcDjOgiNnS90GsHdaWTmeap6l/view
EDIT: Dear @Re4son built OFFICIAL NETHUNTER for Suzuran . It includes; patched wlan0 firmware, HID support and many RTL wlan1 drivers
INSTRUCTIONS FOR BUILD YOURSELF OFFICIALLY (RECOMMENDED):
1- clone this https://gitlab.com/kalilinux/nethunter/build-scripts/kali-nethunter-project
Code:
git clone https://gitlab.com/kalilinux/nethunter/build-scripts/kali-nethunter-project
2-
Code:
cd nethunter-installer
3-
Code:
./bootstrap.sh
4- press Y to download devices list.
5-
Code:
python build.py -d suzuran --nougat --rootfs full
(if you prefer lower storage usage, then change rootfs full to rootfs minimal.)
(press Y to download latest rootfs chroot.)
(This will create about 1,2GB of flashable ZIP file and after flash this, it will take 10 GB of internal storage)
6- connect your Z5 Compact to your PC and move zip to your internal storage.
(if you arent have PC, then flash my UNOFFICIAL zip and start KeX in Kali Nethunter menu (Desktop Enviroment) and run that commands in Nethunter)
(if your PC doesnt know your device, press this commands:
Code:
adb push CreatedNethunterFlashableZip /sdcard
7- after, go to TWRP and press backup your BOOT partition for any bootloop causes.
8- in TWRP, press install and choose created Nethunter Zip then press flash.
9- Reboot device and go to FDroid Nethunter version and upgrade Nethunter to latest apk.
10- go to Nethunter app and grant permissions.
11- press Kali chroot manager and then press Add metapackage. Select Kali-linux-nethunter
12- after install procces, go to KeX menu and press Setup local server and write custom password for Kex VNC login. after write, press n
13- In KeX menu, press start server and wait.
14- go to KeX app and write ip to your local ip ( in Nethunter app, go to Home menu and check wlan0 inet without /24 (example 192.168.1.101))
(if you arent connect wifi, press 127.0.0.1 in ip section.
15- write your preconfigured custom password
16- in front of ip section, press 5901 and hit connect.
INSTRUCTIONS FOR WLAN0 (INTERNAL WIFI) MONITOR MODE AND INJECTIONS TEST
INSTRUCTIONS FOR EASILY SET MONITOR MODE:
1. Download Prepatched Firmware:
nougat/suzuran/nexmon-fw/fw_bcmdhd.bin.nexmon · master · Kali Linux / NetHunter / build-scripts / kali-nethunter-devices · GitLab
Devices https://stats.nethunter.com/ https://nethunter.kali.org/
gitlab.com
(rename to fw_bcmdhd.bin)
2. Go to TWRP, select mount and system.
3. Go to main, file manager.
4. Navigate to /system/etc/firmware/wlan/bcmdhd/
5. Move fw_bcmdhd.bin file to your /sdcard/ (for backup)
6. Move into prepatched firmware
/system/etc/firmware/wlan/bcmdhd/
7. reboot system and done.
PATCH YOURSELF:
PART 1:
IN YOUR PC:
1. git clone https://github.com/seemoo-lab/nexmon.git
2. sudo apt-get install git gawk qpdf adb flex bison
3. sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
4. cd nexmon
5. source setup_env.sh
6. make (enter in terminal, like that up)
7. cd patches/bcm43455/7_45_59_16/nexmon
8. make
9. Generate a backup of your original firmware file: make backup-firmware
Install the patched firmware on your smartphone: make install-firmware (make sure your smartphone is connected to your machine beforehand)
https://github.com/seemoo-lab/nexmon...ster/README.md
PART 2 TEST WLAN0 MONITOR MODE:
IN YOUR PHONE:
1- open your wifi and go terminal app.
2-
Code:
. monstart-nh
3- and lets test monitor and injections:
Code:
airodump-ng wlan0
Code:
aireplay-ng -9 wlan0
4- if monitor mode shows any AP's, injection test says injections works, and some AP's reach %1 or upper, then monitor support works good, enjoy
thanks to @Re4son ..
Source Code: https://github.com/Re4son/android_kernel_sony_msm8994/tree/nethunter-14.1

NV modding
Are you able to modify Modem NV Registers with this kernel (assuming it's custom). Can you give it a try via vi or vim? I would prefer to do the modifications on device and simply update ramfs, if possible let me know.

nice
good job, do you know if encryption is working ?

No wlan 1
Thank you so much for making Nethunter for the Z5 compact.
Im on LOS 14.1 / Android 7.1.2 unoffical-suzuran.
I flash the zip from twrp, Restart and update Kali Chroot.
Everything works, Except kali can not find my wifi adapter.
I use the TP Link TL-WN722N-V1 have tried different otg cables,
But no Luck. "i also turn on usb otg"
I have tried many different wifi adapters, im not shore
what wifi drivers that this kernel suport.
im a newbie, So hope someone could help me make this work.
Thank you and regards from Michael.

@NetRoot bro. How to enable monitor mode?
Monstart-nh?

aggunawan said:
@NetRoot bro. How to enable monitor mode?
Monstart-nh?
Click to expand...
Click to collapse
yes bro
source monstart-nh

@NetRoot whats wrong bro with this?
And what is external wireless card support to the kernel? I use tp-link 722n v-1. Chipset atheros ath9k.

NetRoot said:
yes bro
source monstart-nh
Click to expand...
Click to collapse
What's wrong ?

@NetRoot and no module installed

@aggunawan Oops bro i forget.
You must patch wifi:https://github.com/seemoo-lab/nexmon
Our phone uses BCM43455 .

I added broadcom wifi and bluetooth modules but it isnt correctly installed.

NetRoot said:
@aggunawan Oops bro i forget.
You must patch wifi:https://github.com/seemoo-lab/nexmon
Our phone uses BCM43455 .
Click to expand...
Click to collapse
thanks bro @NetRoot. But I have tried compile nexmon https://github.com/seemoo-lab/nexmon many many time, but i always failure. Please help me to compile step by step? Please bro

aggunawan said:
@NetRoot bro. How to enable monitor mode?
Monstart-nh?
Click to expand...
Click to collapse
aggunawan said:
thanks bro @NetRoot. But I have tried compile nexmon https://github.com/seemoo-lab/nexmon many many time, but i always failure. Please help me to compile step by step? Please bro
Click to expand...
Click to collapse
1. git clone https://github.com/seemoo-lab/nexmon.git
2. sudo apt-get install git gawk qpdf adb flex bison
3. sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
4. cd nexmon
5. source setup_env.sh
6. make (enter in terminal, like that up)
7. cd patches/bcm43455/7_45_59_16/nexmon
8. make
9. Generate a backup of your original firmware file: make backup-firmware
Install the patched firmware on your smartphone: make install-firmware (make sure your smartphone is connected to your machine beforehand)
https://github.com/seemoo-lab/nexmon/blob/master/README.md
4.

NetRoot said:
1. git clone https://github.com/seemoo-lab/nexmon.git
2. sudo apt-get install git gawk qpdf adb flex bison
3. sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
4. cd nexmon
5. source setup_env.sh
6. make (enter in terminal, like that up)
7. cd patches/bcm43455/7_45_59_16/nexmon
8. make
9. Generate a backup of your original firmware file: make backup-firmware
Install the patched firmware on your smartphone: make install-firmware (make sure your smartphone is connected to your machine beforehand)
https://github.com/seemoo-lab/nexmon/blob/master/README.md
4.
Click to expand...
Click to collapse
Have you @NetRoot succesfully compiled it bro ?

@aggunawan yes bro.

NetRoot said:
@aggunawan yes bro.
Click to expand...
Click to collapse
@NetRoot. does it have to compile Android-NDK? How to compile it?

Failure to compile nexmon
Bro @NetRoot

@aggunawan bro use Kali amd (pc) not use compiling procces in nethunter.

NetRoot said:
@aggunawan bro use Kali amd (pc) not use compiling procces in nethunter.
Click to expand...
Click to collapse
Is there another way to compile it bro @NetRoot?
And please make kernel support external wireless adapter bro? Please

aggunawan said:
Is there another way to compile it bro @NetRoot?
And please make kernel support external wireless adapter bro? Please
Click to expand...
Click to collapse
No bro you must patch bcm43455 wifi.
Yeah that kernel already compiled for rtlwifi drivers.
You can see in: /system/etc/firmware/rtlwifi/

Related

[TUTORIAL] The Step-By-Step guide to build Cyanogenmod7 for the LG Optimus 2X

aMpeX proudly presents:
The Step-By-Step guide for building CM7
for the Optimus 2X​
Disclaimer:
I'm taking no responsibility for any damage that might occur to your phone or your PC
This guide illustrates how to setup an UBUNTU 11.04 equipped PC to build CM7 from source
It does not provide any support beyond that operating system, so if you insist on using other
Linux distributions, either adapt the guide yourself or look elsewhere.
Moreover I'm not providing any support for any problems that might occur during the course
of this guide, if they are not introduced by faults within the guide itself. I will only
troubleshoot the activities that this guide is based upon and won't be able to help with your
general linux problems. Feedback however is greatly appreciated.
Reposting this on other forums:
Feel free to post this guide on other forums. I'd like to be given credit though. Thanks
I am new to this myself, but I thought I'd share my findings after successfully building my first kang.
News & changelog:
v0.92 2011/06/01 Fix:
Added "change directory" before init repository (thanks to peewster)
v0.91 2011/05/31 Fix:
Fixed PATH exports (thanks to bhanvadia)
v0.9 2011/05/31 Initial release:
Still much formatting to be done, typos possible. Leave me some feedback if you encounter them.
Alright, so you want to build your own CM7 KANG's ?
Step 0: The starting point + info
When you start this guide, I assume that you just installed your Ubuntu 11.04 copy to your PC and set up all the drivers to your hearts content.
All commands are supplied, as they would be typed in from a USER ACCOUNT, if you operate from the root account, you will
have to add /home/<yourusername> to the most commands. I suggest, after performing the actions required by root, that you log out by typing
Code:
exit
What you need:
A working copy of Cyanogenmod7 installed on your phone
A PC with Ubuntu 11.04 installed (NOTE: If you're about to install Ubuntu from scratch, use the 64Bit version.
I can build CM7 on a 32Bit OS just fine. But AOSP for example won't build beyond Froyo on 32Bit.
At least 20GB of free space (including space required for the operating system itself)
A considerably fast internet connection (syncing the repo takes everal Gbs)
At least 3 hours of time.
All done? Then let's get started:
Step 1: Install the Java JDK
Go to System → Administration → Synaptics Package Manager
Here, we have to enable the partner repositories.
Go to Settings → Repositories → Other Software → Tick Canonical Partners and hit Close
Now push the „Reload“ button, and use the Search button to find the sun-java6-jdk package
tick the box in front of it and choose „Mark for installation“ and accept the following dialogue.
Click the „Apply“ button. Accept the dialogues, you now have the Java JDK installed.
Step 2: Install the Android SDK
Go here and download this.
Extract the archive to a directory of your choice.
Open a Terminal, navigate to the „tools“ subfolder and run the AVD Manager using ./android
In the new Window hit „Available Packages“ tick the „Android Repository“ and select „Install selected“
Once thats done, close everything up, time for step 3.
Step 3: Set up udev
The description from the CyanogenMod wiki struck me as being a slightly bit overkill, and, while it might be necessary for other devices, for LG phones this works just fine:
Create a new file on your desktop named
Code:
99-android.rules
and fill them with the following content:
Code:
SUBSYSTEM=="usb", SYSFS{idVendor}=="1004", MODE="0666"
This will enable the debugging for LG devices, if you have time, it won#t hurt to add the other vendors. Just add another line
like above and replace the „1004“ with the appropriate vendor ID from http://developer.android.com/guide/developing/device.html (scroll to the bottom)
Log in as root using
Code:
sudo su
and paste our file to
Code:
/etc/udev/rules.d
using the terminal (cp)
Set permissions for the file using
Code:
chmod a+r /etc/udev/rules.d/99-android.rules
Now would probably be a good time to check if adb is working correctly.
But first, lets update the PATH so we can type „adb“ anywhere on the file system.
Navigate to your user home directory, press CTRL+H to show hidden files and edit the
Code:
.bashrc
file by adding the following
Code:
export PATH="/home/<yourusername>/<path to the android SDK >/platform-tools/:${PATH}"
export PATH="/home/<yourusername>/bin/:${PATH}"
(The 2nd line is necessary for later)
NOTE:This only enable the use of adb everywhere when logged in with your username. When working as root, you'll have
to add a separate line with /home/<yourusername> in front of the path above.
You have to log out and in again for the changes to take effect.
Now check if you can see your phone with
Code:
adb devices
Alright, still awake? Good, because now it gets interesting
Step 4: Install build packages and create directories
Since we already installed the JDK this command differs a bit from the Cyanogen Wiki:
For 32 and 64 Bit
Code:
sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev pngcrush schedtool
For 64 Bit only
Code:
sudo apt-get install g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev gcc-4.4-multilib g++-4.4-multilib
Now we need 2 directories
Code:
mkdir -p ~/bin
mkdir -p ~/android/system
Almost there ….
Step 5: Install the repository
Now we need our repo binary:
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
(credits to p.valenta for notifying me of the adress change)
NOTE: You may need to reboot now
Change to your previously created directory:
Code:
cd ~/android/system/
Initialize the repository:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b gingerbread
Enter your Name, eMail adress and select if you want colors or not.
AND NOW THE FINALE
Code:
repo sync -j16
Get yourself a BIG coffee, because this is going to take MUCH MUCH time, because basically you are now checking out all there is to CyanogenMod.
But wait, we're not done yet. Hang on
Step 6: Getting proprietary files for the Optimus 2X
For this step, you need an O2X with a running Cyanogenmod build, so if you're still on stock, this is the time to flash Cyanogenmod for the first time.
Connect your phone to your PC via USB and
navigate to the device tree in your repo folder:
Code:
cd ~/android/system/device/lge/p990/
and run
Code:
./extract-files.sh
This will extract some libs from your device. But sadly, not all of them (build will still fail) but we will fix this now.
Go to
Code:
https://github.com/koush/proprietary_vendor_lge/tree/gingerbread/p990
and click the download button on the right.
Extract the „p990“ folder located in the subfolder
Code:
/koush-proprietary_vendor_lge-a43238f/
in the archive to
Code:
~/android/system/vendor/lge/
Step 7: Get latest ROMManager
I know I must be annoying the sh** out of you by now, but hang in there
Code:
~/android/system/vendor/cyanogen/get-rommanager
Step 8: BUILD F***ING EVERYTHING
Now this is what you've been waiting for huh?
Sync the repository again:
Code:
cd ~/android/system/
repo sync
Build the ROM
Code:
. build/envsetup.sh && brunch p990
Wait
When everything is finished, your KANG will be stored in
Code:
~/android/system/out/target/product/p990/
And THATS IT!
Congratulations, you have just built your own CM7 KANG, don't forget to share it to other nightly testers
Cheers aMpeX
Useful stuff and tools:
SH script by bhanvadia, tailored to the directories introduced by this tutorial:
Download here
Extract anywhere and make it executable by typing
Code:
chmod +x kang.sh
Create shortcut to the output directory of your KANGs
Type
Code:
ln -s ~/android/system/out/target/product/p990/ <your desired shortcut location>
nice guide, really liked it.
too bad there were none when I started making my kangs.
btw: I use mac it is bit different for mac. but nothing its missing.
Here is file you keep on you desktop to make it work without any typing of commands after you setup your computer working directory as per guide by aMpeX.
and check post #2 for making that file executable.....
kang.sh
bhanvadia said:
nice guide, really liked it.
too bad there were none when I started making my kangs.
btw: I use mac it is bit different for mac. but nothing its missing.
add "~/android/bin/" to path too so you can "repo sync" from anywhere.
just a suggestion... can upload build.sh file on here to make it easy.
something like
1. for clean and build
2. for repo sync
open file and press your options.
thats what I use...
Click to expand...
Click to collapse
That's why the guide states its for ubuntu. I found that even the Cyanogenmod Wiki entries don't work completely for the latest ubuntu (with g++ and gcc 4.3 not being available anymore, also hat huge problems with the java jdk at first)
I'll add the additional PATH variables as you suggested. Thank you.
aMpeX said:
That's why the guide states its for ubuntu. I found that even the Cyanogenmod Wiki entries don't work completely for the latest ubuntu (with g++ and gcc 4.3 not being available anymore, also hat huge problems with the java jdk at first)
I'll add the additional PATH variables as you suggested. Thank you.
Click to expand...
Click to collapse
Here is file you keep on you desktop to make it work without any typing of commands after you setup your computer working directory as per guide by aMpeX.
PS: aMpeX can you just test that file??? just repo sync or rom manager update options.
awesome guide !!! thanks aMpeX !
seems to be working, after you chmod+x the sh file that is. My Repo Sync is stuck at 1%, but I doubt its related to your file.
I'll add it to the 2nd post
aMpeX said:
seems to be working, after you chmod+x the sh file that is. My Repo Sync is stuck at 1%, but I doubt its related to your file.
I'll add it to the 2nd post
Click to expand...
Click to collapse
modified my mac file i use to fit to your setup of directories, just changed directories. ...
yeah then it would work, hope it make it more easy
GET the KANGs flowing...........
aMpeX said:
Useful stuff and tools:
SH script by bhanvadia, tailored to the directories introduced by this tutorial:
Download here
Extract anywhere and make it executable by typing
Code:
chmod +x kang.sh
Create shortcut to the output directory of your KANGs
Type
Code:
ln -s ~/android/system/out/target/product/p990/
Click to expand...
Click to collapse
Download link is sending to wrong post still....
now it should work like this....
http://forum.xda-developers.com/showpost.php?p=14310172&postcount=5
copy
http://forum.xda-developers.com/showpost.php?p=14310172&postcount=5
Can you please also state that it only works on 64bit builds of ubuntu and not 32bit...
Renegade_Rulez said:
Can you please also state that it only works on 64bit builds of ubuntu and not 32bit...
Click to expand...
Click to collapse
Aside from what you can read on the net, my KANGs build perfectly fine on Ubuntu 32Bit
No reason to not install 64Bit though. I'll add a remark in the first post.
Edit: After some asking and digging, read this:
http://twitter.com/#!/CM_arcee/status/75677847712309249
So while standard Gingerbread cannot be built by 32Bit, the CyanogenMod7 repository can.
is this meant to download a lot of stuff for different phones? mine is downloading a lot of stuff at step 5 and it's taking forever..
Imperticus said:
is this meant to download a lot of stuff for different phones? mine is downloading a lot of stuff at step 5 and it's taking forever..
Click to expand...
Click to collapse
It will download files for each and every phones supported by CyanogenMod, thats why its called cyanogen repo, not just P990 repo, but mostly you will use stuff thats required by your phone.
and its suggested to have 15 - 20 GB free, as it takes a lot....
3.5 GB is just "out" folder when it compiles for one device (P990)......
bit of a noob.. done everything..when I try to make the build using build/envsetup.sh i get permission denied
Any help please?
copy/paste the command from the tutorial
there is a leading dot and space before "build
Code:
. build/envsetup,sh && brunch p990
Thank's for the tutorial but i allways get no gsm function build
logcat -b radio
RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING error: com.android.internal.telephony.CommandException: RADIO_NOT_AVAILABLE
Click to expand...
Click to collapse
or
Couldn't find 'rild' socket; retrying after timeout
Click to expand...
Click to collapse
What baseband are you using? Make sure that the lge-ril.so is in your proprietary files
aMpeX said:
What baseband are you using? Make sure that the lge-ril.so is in your proprietary files
Click to expand...
Click to collapse
Thank's for repy.
lge-ril.so is in and generally i flash my build coming from cyano #31 (405) and mcr18 (405)
So...405
Possibly (if you synced the proprietary repository by koush AFTER you ran extract-files.sh) your ROM still includes the lge-ril for 0218.
Try reflashing the ril with the methods provided in this forum.
Other than that, I have no idea what might be causing your problems.
old ril file from koush files do work on 405 baseband too, but you feel better performance with new ril. with old ril you may loose signals sometime.
delete your vendor/lge/p990 folder, and download again from koush's files and put it back there. make sure your directories are in order
example: for lib-ril.so in as below
like ~/android/system/vendor/lge/p990/proprietery/lib/

[UBUNTU] How to install ubuntu dev preview on Nexus 7

Hi everybody, today Canonical has released dev preview of Ubuntu for Tablet, and this is a little guide to install it on our nexus 7!
First of all do a backup of all your files.
I have NO responsibility for damaging of your device or computer!!
What do you need:
-Ubuntu Desktop on your computer
-Unlocked bootloader
-Enough battery and time for downloading
Preparing computer:
-Open terminal and print:
Code:
sudo add-apt-repository ppa:phablet-team/tools
-Then print:
Code:
sudo apt-get update
sudo apt-get install phablet-tools android-tools-adb android-tools-fastboot
Installing:
-write on terminal:
Code:
phablet-flash -b
(answer yes when it requires)
-wait for downloading, size is about 600mb but it downloads really slow today.
-it will automatically reboot your device into bootloader, and after you confirm, it'll install it in few minutes.
How to return into Android
-Download the last factory image from here: https://dl.google.com/dl/android/aosp/nakasi-jdq39-factory-c317339e.tgz
-Extract the downloaded file and chdir to directory from terminal
-reboot tablet into bootloader
-install with
Code:
sudo run ./flash-all.sh
###This is just a developers preview, so it's not meant to be used daily!
VIDEO:
http://youtu.be/RxrxxjM5Nac
/*
* USB OTG works, tried with mouse and it's ok, just has no pointer on the screen :/
* USB sticks maybe work, but i can't find a file manager, and i have no signal when i put it in
* CAMERA doesn't work for me.
*
*/
do we really need another thread dedicated to this? there are already several that tell you the same thing, not to mention its publicly posted on Ubuntu's website
or you could just factory reset if you installed ubuntu using the fatser, simpler flashing method and then restore from a nandroid backup, like i just did, and everything works perfectly
The idea is appreciated, but redundant, so i will close it here..

Guide: How To Build AOSP 4.4.3 From Source With Linux Mint 16 - Nexus 5 KTU84M

Guide: How To Build AOSP 4.4.3 From Source With Linux Mint 16 - Nexus 5 KTU84M
Important Note: Do not use Linux Mint 16 KDE to do this guide. Removing the old Java will seriously mess up your desktop and programs menu. This guide has been tested with Linux Mint 16 Cinnamon and Linux Mint 16 Mate.
Link to PA Gapps: http://forum.xda-developers.com/showthread.php?t=2397942
Link To SuperSu: http://download.chainfire.eu/supersu
Link to zip of completely unaltered build of AOSP 4.4.3. https://drive.google.com/file/d/0ByOOg6Qw8gHZMXBWVDRyVmVuRWc/edit?usp=sharing
I started this guide as I could not find a step by step detailed guide to build a stock AOSP from source with Linux Mint 16.
All the steps should work in Ubuntu but I haven't tried so not 100% sure of that.
All this assumes your phone is already unlocked.
Here goes:
Important note: Anything that is bolded text other then section titles are command line entries that are done in Terminal in Linux Mint. I thought it would be simpler to do it this way then say 'in Terminal' for every entry.
First we need to remove Icedtea Java or OpenJDK.
In Terminal: sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
Then in Terminal: sudo add-apt-repository ppa:webupd8team/java
Next: sudo apt-get update && sudo apt-get install oracle-java6-installer
Be sure to accept the licence agreement to install java when it prompts you.
Next: sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python
Follow this with: sudo apt-get install -f
This should fix any dependency errors.
Now: sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Next download the SDK Tools For Linux x64 from this link. https://developer.android.com/sdk/index.html
Then: cd ~/Downloads
And: tar -xvf android-sdk_r22.6.2-linux.tgz
or tab the latest 'android-sdk_xxx.tgz file it they update it and it is a newer version then the one I downloaded to do this.
You can rename the android.sdk_xxx.tgz folder you extracted to SDK.
Then: cd ~/Downloads/SDK/tools
Next: ./android sdk
It will show you the tools that can be installed, just install the highest version API of 'Platform Tools' and 'Tools' for the latest android version '4.4.x' it shows.
Make sure you install the repo tool, in Terminal: mkdir ~/bin
Then: curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
And: curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
Now: sudo chmod a+x ~/bin/repo
Now sudo nano ~/.bashrc
Add this to the bottom of the text: export PATH=~/bin:$PATH
Then hit Ctrl-O and enter, it should say it saved the file followed by Ctrl-X to exit.
Then restart bash: source ~/.bashrc
Now lets Initialize the Repository for GIT configuration
First : git config --global user.name {Your Name}
Then: git config --global user.email {[email protected]}
If you have not registered with the GitHub website just doing these two steps works fine.
If you have registered with the GitHub website create a file called .netrc in your home directory, add your GitHub password to it with no spaces on the first line and change the permissions to '600' or you will have to continually authenticate when building the source.
In Terminal:nano ~/.netrc
Then add just your GitHub password (like I said you only need to do this if you have registered with GitHub).
Then 'Ctrl-O' and enter and it'll say it saved it, then 'Ctrl-X' to exit nano.
And: chmod 0600 ~/.netrc
Now: mkdir ~/AOSP
Then: cd ~/AOSP
Now you get the source code etc: repo init -u https://android.googlesource.com/platform/manifest -b android-4.4.3_r1.1
Followed by: repo sync -j12
Use repo sync -j12 for a quad core CPU or Intel I5 or if you have say an quad core I7 with 8 threads you can use repo sync -j24 to speed things up etc.
I have a I7 3930k with 12 threads so I used repo sync -j36. This gives you three threads per logical CPU and speeds things along quite well.
It may take several hours for the sync to finish.
After the sync finishes go to https://developers.google.com/android/nexus/drivers#hammerheadktu84m and download the KTU84Mdrivers (binaries) for the Nexus 5.
If you have closed the Terminal after the sync remember to first do this when you reopen it: cd ~/AOSP
when you open Terminal again before doing the cp and tar commands.
In Terminal: cp ~/Downloads/broadcom-hammerhead-ktu84m-175c1204.tgz ~/AOSP
Then: cp ~/Downloads/lge-hammerhead-ktu84m-716c9c42.tgz ~/AOSP
And: cp ~/Downloads/qcom-hammerhead-ktu84m-06019566.tgz ~/AOSP
In Terminal: tar -xvf broadcom-hammerhead-ktu84m-175c1204.tgz
And: tar -xvf lge-hammerhead-ktu84m-716c9c42.tgz
then: tar -xvf qcom-hammerhead-ktu84m-06019566.tgz
They should be the file names of the binaries for KTU84M that you are extracting but if for any reason the file names are different use the Tab key and tab the correct names in after 'tar -xvf'.
If the names ARE different I'd really check to make sure you downloaded the correct hammerhead binaries.
Now also in Terminal: ./extract-broadcom-hammerhead.sh
Then: ./extract-lge-hammerhead.sh
And: ./extract-qcom-hammerhead.sh
Hint: It will show you a really long licence agreement for each binary that you scroll by hitting the Enter key that takes forever to scroll one line at a time, it has 8 sections and several subsections. Hold the Enter key until you just get past Part 8, section D of the licence and stop there. Now hit enter a few more time one key stroke at a time until you finish Part 8 section E and see the 'Type 'I ACCEPT' to agree to the licence.' and type I ACCEPT If you just scroll by holding the Enter key all the way to the bottom of the licence you'll get an error you never accepted the licence. Then close Terminal.
Building the Sources
Now open Terminal: cd ~/AOSP
Then: . ./build/envsetup.sh
Now to select the type of device we give the following command: lunch
Choose: 9. aosp_hammerhead-userdebug
by entering '9' or whatever number aosp_hammerhead is after your enter the 'lunch' command (it was number 9 on mine).
Now: make -j12 for a quad core cpu or I5 or make -j24 for an I7 etc.
With your phone connected to your USB cable and the PC: adb root
Then: adb reboot bootloader
And: cd out/target/product/hammerhead
Lastly: fastboot -w flashall
If you get an error on the 'adb' and 'fastboot' commands do these first:
sudo apt-get install android-tools-adb
And: sudo apt-get install android-tools-fastboot
If you get an error when you fastboot -w flashall to do with a '-p' flag needed or 'android-info.txt' is missing it means you forgot to to the 'lunch' command before building the source. Go back to the 'Building The Sources' section.
If you already have a custom recovery installed like TWRP and would rather build a zip file to install with the recovery rather Then flash it in adb instead of make -j12 do: make -j12 otapackage
In the /home/"yourusername"/AOSP/out/target/product/hammerhead you have an aosp_hammerhead-ota-eng.___.zip file to flash in your custom recovery.
You will need to wipe/reset data in recovery before flashing it and re-install all your apps etc.
Installing Custom Recovery, Rooting and Google Apps
If you want to install a custom recovery download TWRP http://techerrata.com/browse/twrp2/hammerhead
Rename the file in Downloads to recovery.img
Then in Terminal with your phone connected by USB to your PC: adb root
And: adb reboot bootloader
Then: cd ~/Downloads
And: fastboot flash recovery recovery.img
Use the volume buttons on your phone to scroll onto "Restart Bootloader" and hit the powerbutton to select it. After the bootloader reloads, use the volume buttons to scroll to "Recovery Mode" and hit power button again to select it. You should then be in your custom recovery.
If for any reason you get a red android and no recovery just boot into fastboot mode again and reinstall the recovery.img.
And finally, to root your phone download SuperSu http://download.chainfire.eu/supersu and install the supersu.zip in recovery mode.
Download PA GAPPS from here http://forum.xda-developers.com/showthread.php?t=2397942 if you want the zip to install Google Apps in recovery.
You now have your own rooted vanilla AOSP you compiled yourself, congrats!
P.S. Very likely a good idea wipe/reset data in recovery and start with a clean install, you'll need to install all your programs and stuff anyways I'm sure.
P.P.S. I also installed the Xposed Framwork apk from this link http://forum.xda-developers.com/xposed/framework-xposed-rom-modding-modifying-t1574401/post24267797 so I could install the Advanced Reboot Menu and some other useful mods.
Hi man great tutorial.
I followed your tutorial exactly and it compiles very good and everything works great with flashing it to device to.
I start the rom and everything is working but then if i reboot i get wrong date and time for 20sec and it goes back to current time and date.
but i get like 10 notifications from all my google apps and it very anoying. and google now dont work till it gets synced.
i thougt it was my build that had issues but i flashed your rom that you had compiled and it has the same issues.
Did y have that issue?
bariz143 said:
Hi man great tutorial.
I followed your tutorial exactly and it compiles very good and everything works great with flashing it to device to.
I start the rom and everything is working but then if i reboot i get wrong date and time for 20sec and it goes back to current time and date.
but i get like 10 notifications from all my google apps and it very anoying. and google now dont work till it gets synced.
i thougt it was my build that had issues but i flashed your rom that you had compiled and it has the same issues.
Did y have that issue?
Click to expand...
Click to collapse
No, I've never had that issue. Did you wipe/reset data in recovery. If you never you need to do that. If you did I would try and do it again, it might fix the issue. You'll have to re-install all your apps etc. when you do though.
Also you can try to flash the zip I have to download in the OP, it is a completely unaltered stock AOSP build. DO wipe/reset in recovery before you do and you'll have to install the recovery in the guide to flash the zip.
https://docs.google.com/file/d/0ByOOg6Qw8gHZZjZXTmRXU05Ed1E/edit
If you want to install a custom recovery download TWRP http://techerrata.com/browse/twrp2/hammerhead
Rename the file in Downloads to recovery.img
Then in Terminal with your phone connected by USB to your PC: adb root
And: adb reboot bootloader
Then: cd ~/Downloads
And: fastboot flash recovery recovery.img
Use the volume buttons on your phone to scroll onto "Restart Bootloader" and hit the powerbutton to select it. After the bootloader reloads, use the volume buttons to scroll to "Recovery Mode" and hit power button again to select it. You should then be in your custom recovery.
If for any reason you get a red android and no recovery just boot into fastboot mode again and reinstall the recovery.img.
Edit: Sorry, just now saw you flashed my ROM. The wipe data should fix it though.
KedarWolf said:
No, I've never had that issue. Did you wipe/reset data in recovery. If you never you need to do that. If you did I would try and do it again, it might fix the issue. You'll have to re-install all your apps etc. when you do though.
Also you can try to flash the zip I have to download in the OP, it is a completely unaltered stock AOSP build. DO wipe/reset in recovery before you do and you'll have to install the recovery in the guide to flash the zip.
https://docs.google.com/file/d/0ByOOg6Qw8gHZZjZXTmRXU05Ed1E/edit
If you want to install a custom recovery download TWRP http://techerrata.com/browse/twrp2/hammerhead
Rename the file in Downloads to recovery.img
Then in Terminal with your phone connected by USB to your PC: adb root
And: adb reboot bootloader
Then: cd ~/Downloads
And: fastboot flash recovery recovery.img
Use the volume buttons on your phone to scroll onto "Restart Bootloader" and hit the powerbutton to select it. After the bootloader reloads, use the volume buttons to scroll to "Recovery Mode" and hit power button again to select it. You should then be in your custom recovery.
If for any reason you get a red android and no recovery just boot into fastboot mode again and reinstall the recovery.img.
Edit: Sorry, just now saw you flashed my ROM. The wipe data should fix it though.
Click to expand...
Click to collapse
Of course i wiped before flashing. The thing is it works on first boot. time and everything no notifications from google apps but as soon as i reboot time and date resets and i get 10 notifications from my google apps sayin time and date error and syncing problem.
I decided to make a clean repo sync again by removing everything and start from the begining. Let ypu know how it goes.
bariz143 said:
Of course i wiped before flashing. The thing is it works on first boot. time and everything no notifications from google apps but as soon as i reboot time and date resets and i get 10 notifications from my google apps sayin time and date error and syncing problem.
I decided to make a clean repo sync again by removing everything and start from the begining. Let ypu know how it goes.
Click to expand...
Click to collapse
I'd try wipe data again and I checked the Date/Time settings, I have 'Automatic date & time' and 'Automatic time zone' enabled. If it does it with my zip and your sync I doubt it is the build that is the trouble. You also might want to try disabling the auto time and date and setting it manually, it might be it is taking a minute to sync with your cell provider, hence the errors. Manually setting the auto time zone as well.
Also you might want to try a different Google Apps package from the link I provided. I use the micro one then if I have to add anything I just do it by Google Play.
Found this link, I'd try the flashable zip a few posts down or manually editing like one guy suggests.
http://forum.xda-developers.com/showthread.php?t=2580974
KedarWolf said:
I'd try wipe data again and I checked the Date/Time settings, I have 'Automatic date & time' and 'Automatic time zone' enabled. If it does it with my zip and your sync I doubt it is the build that is the trouble. You also might want to try disabling the auto time and date and setting it manually, it might be it is taking a minute to sync with your cell provider, hence the errors. Manually setting the auto time zone as well.
Also you might want to try a different Google Apps package from the link I provided. I use the micro one then if I have to add anything I just do it by Google Play.
Found this link, I'd try the flashable zip a few posts down or manually editing like one guy suggests.
http://forum.xda-developers.com/showthread.php?t=2580974
Click to expand...
Click to collapse
Thank you for that. But its just a patch to fix. How come its broken if it comes from google repo ? :S
i compiled CM11 and no time issues there.
This is a perfect guide. Thank you VERY much.
The Nexus 5 advocate (Team Inferno)
TheLastSidekick said:
This is a perfect guide. Thank you VERY much.
The Nexus 5 advocate (Team Inferno)
Click to expand...
Click to collapse
Have you the time issue there phone resets to year 1970 upon reboot?
Really nice great tutorial
bariz143 said:
Thank you for that. But its just a patch to fix. How come its broken if it comes from google repo ? :S
i compiled CM11 and no time issues there.
Click to expand...
Click to collapse
Not sure, I've had no trouble that way.
Guide Updated
bariz143 said:
Hi man great tutorial.
I followed your tutorial exactly and it compiles very good and everything works great with flashing it to device to.
I start the rom and everything is working but then if i reboot i get wrong date and time for 20sec and it goes back to current time and date.
but i get like 10 notifications from all my google apps and it very anoying. and google now dont work till it gets synced.
i thougt it was my build that had issues but i flashed your rom that you had compiled and it has the same issues.
Did y have that issue?
Click to expand...
Click to collapse
The guide has been updated to the KTV49L build which has several bug fixes from the old build. I'm not sure if the date issue has been fixed but if you want to try to build AOSP again just letting you know it is an option.
KedarWolf said:
The guide has been updated to the KTV49L build which has several bug fixes from the old build. I'm not sure if the date issue has been fixed but if you want to try to build AOSP again just letting you know it is an option.
Click to expand...
Click to collapse
Great news so if I followed your guide before the KVT update where do I start. Do I have to do all again from scratch?
KedarWolf said:
The guide has been updated to the KTV49L build which has several bug fixes from the old build. I'm not sure if the date issue has been fixed but if you want to try to build AOSP again just letting you know it is an option.
Click to expand...
Click to collapse
You need to delete your /home/yourusername/AOSP and /home/yourusername/bin folders you made.
So do: rm -rf ~/AOSP
And: rm -rf ~/bin
Then just:
Make sure you install the repo tool, in Terminal: mkdir ~/bin
Then: curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
And: curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
Now: sudo chmod a+x ~/bin/repo
Now: mkdir ~/AOSP
Then: cd ~/AOSP
Now you get the source code etc: repo init -u https://android.googlesource.com/platform/manifest -b android-4.4.2_r2
Followed by: repo sync -j12
Use repo sync -j12 for a quad core CPU or Intel I5 or if you have say an quad core I7 with 8 threads you can use repo sync -j24 to speed things up etc.
I have a I7 3930k with 12 threads so I used repo sync -j36. This gives you three threads per logical CPU and speeds things along quite well.
And the rest following that. You do not need to do the other steps though, but the recompiling and build you do so it takes some time.
KedarWolf said:
You need to delete your /home/yourusername/AOSP and /home/yourusername/bin folders you made.
So do: rm -rf ~/AOSP
And: rm -rf ~/bin
Then just:
Make sure you install the repo tool, in Terminal: mkdir ~/bin
Then: curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
And: curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
Now: sudo chmod a+x ~/bin/repo
Now: mkdir ~/AOSP
Then: cd ~/AOSP
Now you get the source code etc: repo init -u https://android.googlesource.com/platform/manifest -b android-4.4.2_r2
Followed by: repo sync -j12
Use repo sync -j12 for a quad core CPU or Intel I5 or if you have say an quad core I7 with 8 threads you can use repo sync -j24 to speed things up etc.
I have a I7 3930k with 12 threads so I used repo sync -j36. This gives you three threads per logical CPU and speeds things along quite well.
And the rest following that. You do not need to do the other steps though, but the recompiling and build you do so it takes some time.
Click to expand...
Click to collapse
Thanks alot my friend. Just did as you said. And i can see in settings that it KVT build but the time issue is still there. I dont get it at all.
im pissed.
its like building a car and the wipers don't work.
bariz143 said:
Thanks alot my friend. Just did as you said. And i can see in settings that it KVT build but the time issue is still there. I dont get it at all.
im pissed.
its like building a car and the wipers don't work.
Click to expand...
Click to collapse
Sorry, only fix I know is the patch in the link I provided earlier. I have read of other people with the AOSP build have that issue, it's in that link. I don't why it never affected me, might be the settings I use for Time/Date but I've had zero issues that way.
KedarWolf said:
Sorry, only fix I know is the patch in the link I provided earlier. I have read of other people with the AOSP build have that issue, it's in that link. I don't why it never affected me, might be the settings I use for Time/Date but I've had zero issues that way.
Click to expand...
Click to collapse
Yeah i would like to share the rom with friend and it would not be nice if the time resets and getting those notifications error all the time.
Thx alot
i've downloaded this(http://forum.xda-developers.com/showthread.php?t=2585828) build environment from xda so i can start building a rom for my phone and, if i'm not mistaken, i can start your tutorial from the github part right?
thanks
jv.batista said:
i've downloaded this(http://forum.xda-developers.com/showthread.php?t=2585828) build environment from xda so i can start building a rom for my phone and, if i'm not mistaken, i can start your tutorial from the github part right?
thanks
Click to expand...
Click to collapse
I'm not 100% sure t'll work in Xubuntu. I know when I removed the old java in Linux Mint KDE it really messed up the programs menu, even Terminal itself was removed from it. But if it doesn't mess anything up it should work I believe. or just install Linux Mint 16 Cinnamon or MATE in the virtual box instead of Xubuntu, then it'll work I'm sure. Might build much slower though running in a virtual box. You'd have to do everything from the start of the guide, the linux installed in a virtual box is just a clean fresh install of any linux just like a regular new install on any PC.
Hope that helps.
KedarWolf said:
I'm not 100% sure t'll work in Xubuntu. I know when I removed the old java in Linux Mint KDE it really messed up the programs menu, even Terminal itself was removed from it. But if it doesn't mess anything up it should work I believe. or just install Linux Mint 16 Cinnamon or MATE in the virtual box instead of Xubuntu, then it'll work I'm sure. Might build much slower though running in a virtual box. You'd have to do everything from the start of the guide, the linux installed in a virtual box is just a clean fresh install of any linux just like a regular new install on any PC.
Hope that helps.
Click to expand...
Click to collapse
when I had the galaxy s I tried to create a buildmachine but even following every step, there was always something missing, that's why i gave the vm sugestion.
i'll try with the vm but if it doesn't work i'll start from scratch...
thanks
ps: it's a virtual machine but it is running in a i7 with 4 cores and 8gb of ram dedicated to it(if needed i can go for 10gb)
jv.batista said:
when I had the galaxy s I tried to create a buildmachine but even following every step, there was always something missing, that's why i gave the vm sugestion.
i'll try with the vm but if it doesn't work i'll start from scratch...
thanks
ps: it's a virtual machine but it is running in a i7 with 4 cores and 8gb of ram dedicated to it(if needed i can go for 10gb)
Click to expand...
Click to collapse
By start from scratch I mean you just do all the steps in the guide on the fresh virtual machine install. The only time you don't need to do all the steps is if you've done a build and need to do a second build like I did for my Nexus 7 after my Nexus 5 or when the repos update to a new version after you've done a build already. In post #13 it says what to do if you're doing a second build. If it's your first build or a new install of linux or a new virtual box install of linux do all the steps right from the beginning of the guide. Hope that clarifies things.
P.S. Should be pretty fast with your virtual machine but it takes me close to an hour to download the source from the repo then another hour to actually build AOSP with a 6 core 12 thread I7 3930k and 32 gigs of ram.
P.P.S. Sorry for the late night responses, I get home from work around 11 p.m. EST and like to game and stuff a bit before I do other things. Really busy at work, not much time to check here very often.

[Tutorial][ROM][5.1.1][Pure AOSP] Kali Nethunter with 5.1.1 AOSP

Hello all today I will be showing you how to flash Kali Nethunter 2.0 onto your Nexus 5 device running AOSP 5.1.1_r13.
Prerequisites:
Custom recovery, I recommend TWRP 2.8.7.1 (I used it for this tutorial)
Updated bootloader which can be found here: Bootloader & Radio update
Supersu v2.46 Download
First let's setup our build environment.
Java Development Kit 7:
Code:
sudo apt-get install openjdk-7-jdk
The build tools:
Code:
sudo apt-get install git gnupg flex bison gperf build-essential
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386
libgl1-mesa-dev g++-multilib mingw32 tofrodos
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
The repo command:
Code:
mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
Let's add bin to our path, the first step here is for Ubuntu 14.04 (Not sure if later distro's are the same) and the second step is for Linux Mint 17+
Step 1 (Ubuntu):
Code:
sudo gedit .bashrc
export PATH=~/bin:$PATH <-(add to end of bashrc)
Step 2 (Mint):
Code:
sudo gedit /etc/bash.bashrc
export PATH=~/bin:$PATH <-(add to end of bashrc)
Identify yourself to the repo:
Code:
git config --global user.email "[email protected]"
git config --global user.name "yourpreferredusername"
Sync the Repo (This may take awhile):
Code:
mkdir ~/Source
cd ~/Source
repo init -u https://android.googlesource.com/platform/manifest -b android-5.1.1_r13
repo sync
After the repo has synced fully you must install the Nexus 5 binaries which are below into the root of the Source (or whatever you called it) folder.
Binaries:
NFC, Bluetooth & Wifi (Broadcom) for 5.1.1 - Download
Camera, Sensors & Audio (LG) for 5.1.1 - Download
Graphics, GSM, Camera, GPS, Sensors, Media, DSP & USB (Qualcom) for 5.1.1 - Download
Jump into ~/Source (Your folder) and run envsetup:
Code:
cd ~/Source && source build/envsetup.sh
Choose the device (It should be number 8)
Code:
lunch
Let's build our rom:
Code:
make -j4 otapackage
the -j flag can be specified depending on your CPU on mine I get a good rate at -j8 (HexaCore 3.5GHz)
GAPPS:
I used the PICO modular package due to wanting the smallest Google fingerprint from here http://forum.xda-developers.com/android/software/tk-gapps-t3116347
After copying everything to your sdcard you can now perform a full wipe (After a backup of course) and flash the newly built rom from ~/Source/out/target/product/hammerhead/ and then flash gapps (Not required) & SuperSU and then reboot into your pure AOSP rom.
Flash SuperSU before rebooting your phone as it's required for the next step
After a full reboot of the system update busybox to the latest release and the download Kali Nethunter from here and flash in recovery
I Take no responsibility if your device becomes bricked I made this tutorial for educational purposes as I had no problem flashing my device with the above steps.
EDIT Optional Step:
I Also flashed the ElementalX Kernel BEFORE flashing Kali Nethunter, this is not a requirement but this may help with battery drain ElementalX.org
CREDITS:
@osm0sis For the GAPPS (Awesome guy)
Offensive Security For Kali Nethunter (Thanks guys)
@scrosler For his tutorial on how to build AOSP from source (Taught me alot)
@Chainfire For the most excellent SuperSU
TeamWin For their awesome recovery
@flar2 for a wicked kernel
If i've forgotten anyone then let me know I'll add you
Or you can just download zip from their website and flash it.
Tazerick said:
Or you can just download zip from their website and flash it.
Click to expand...
Click to collapse
Well actually yes you can but thanks for your vibrant input, this is just to help people learn how to do it themselves completely from source.
How much about the source code takes?The source folders has taken up to 7GB and seems to grow endless, And what does mingw32 do in compiling?Sorry for the questions but I'm just a Linux beginner interested in this and it‘s a little bit hard for me to access Google for some reasons. Tks in advance
I want to thank the OP for sticking his neck out with this thread. I found it very helpful as I was having a lot of trouble getting Nethunter to install until I found this thread.
Things to know about Nethunter (that I didn't know when I started)
- it is not a complete rom, but if you flash it into a rom slot using multirom, it will get partway through booting and may confuse you.
- it does replace the boot.img file with its own
- it is very sensitive to the particular combination of ROM and NH release you're attempting to install.
So, things I tried that did not work:
- flash just NH 2.0. Whoops. Nope, not a complete ROM, as I could see after poking around in the zip file.
- flash the N5 KitKat nethunter 2.0 release over cm-11-20141008-SNAPSHOT-M11-hammerhead.zip
This just failed to boot, black screen.
- flash the N5 Lollipop Nethunter 2.0 release over cm-12.1-20150901-SNAPSHOT-YOG4PAO237-hammerhead.zip
Again, black screen. This one I did after doing a complete device wipe and fastboot flash of the 5.1 bootloader and boot.img, as well as one attempt in multirom as a secondary.
The key takehome for me in this post was that someone had successfully gotten NH 2.0 lollipop to install on an AOSP rom based on 5.1.1 R13.
So I grabbed the ROM from this thread:
http://forum.xda-developers.com/goo...nt/rom-aosp-userdebug-stagefright-ii-t3178947
reinstalled multirom after redoing my phone, and installed the flashable zip file aosp_hammerhead-ota-eng.soilandwater.zip
Rooted that, installed busybox, rebooted and used the multirom TWRP to flash Nethunter over the AOSP.
It lives! It boots!
If that had failed, I was looking at potentially installing the pwnkernel for 5.1.1 into the multirom secondary slot. My impression is that the Nethunter included kernel and boot.img are pretty sensitive about the exact lollipop build they can play nicely with, and that the pwnkernel project is less sensitive to that.
One other tip: when you start flashing nethunter, put your phone either in the fridge or on an icepack from the freezer, covered with a thin towel.
The nethunter flash process is very, very processor intensive and the CPU will heat well past the stock thermal throttling if you let it.
My end result is that I have Marshmallow in my default slot and Nethunter as my secondary. Both are booting happily.
Later today my USB antenna and OTG cables should arrive.
roustabout said:
One other tip: when you start flashing nethunter, put your phone either in the fridge or on an icepack from the freezer, covered with a thin towel.
The nethunter flash process is very, very processor intensive and the CPU will heat well past the stock thermal throttling if you let it..
Click to expand...
Click to collapse
This was amusing. Beware of condensation! Anyway, there's also this beta that needs some volunteers. I actually heard from Binkybear that there will be a new incarnation coming soon... but the idea is to make NetHunter basically an update.zip with a kernel+an app and the app does the actual installation of the Kali 2.0 chroot.
"beware of condensation" - yep, hence the towel to sop up most of it.
I like the idea of flashing a kernel and an APK and letting the rest of the process get handled more visibly.
I'm seeing some interesting stuff in the NH 2 release. If I ssh into my phone and invoke the menu, everything that requires wlan1mon works fine.
If I launch the console menu option from the Kali launcher, almost none of the things that require access to a monitoring interface work.
If I remember it correctly, that stuff was working before I enabled login via ssh. I may well have to redo the install, though, I've just tried to set tethering on my phone and am discovering that marshmallow takes a very dim view of fiddling with the N5 build.prop.

Kali Nethunter on Asus Zenfone Max Pro M1

Installing Nethunter
1. Download and install magisk module called KaliNethunter
2. Go to offensive security website and download generic arm64 nethunter image
3. Extract and install following apps from downloaded archive: NetHunter.apk, NetHunterTerminal.apk.
4. Extract kalifs-arm64-full.tar.xz on your phone.
5. Open NetHunter app and grant permissions and root permission
6. Open hamburger menu, select Kali Chroot Manager, select location where you had extracted kalifs-arm64-full.tar.xz and start installing chroot
7. Wait some time (~10 minutes)
8. Start chroot. Now you can use nethunter app and nethunter terminal app.
Enabling monitor mode on built-in wifi module
0. I could not enable it on custom roms. On stock 082 it worked, but there are some problems. Contact me if you have any info about enabling monitor mode on roms except stock.
1. Open nethunter app, go to custom commands
2. Click run on "Start wlan0 in monitor mode"
3. Now wlan0 is in monitor mode. I've tried capturing handshakes using airodump-ng, it worked. However, when I tried deauth attack using aireplay-ng, wlan0 was stuck on channel 0.
4. Note that if you turn wifi on/off or try to disable monitor mode, your phone will turn off.
5. Alternative way: you can enable monitor mode using other apps, like penmon. However, your phone will still turn off if you do anything to wlan0 while it is in monitor mode.
Using external wifi adapter
0. Your wifi adapter must support monitor mode. External adapter won't work without a kernel that supports it. I've built one based on darkonah (many thaks to @travarilo ). Atheros HTC based adpaters are not supported!
1. Flash the attached kernel (the latest version is NH_kernel_v2.zip).
2. Now you can use your exernal adapter.
Enabling monitor mode on external adapter
0. I only tested it with Alfa AWUS036NH (chipset ralink3070), but the instruction may be similar for other adapters
1. First, let's install firmware for your wireless adapter
Code:
apt update
apt upgrade
apt install firmware-ralink
2. Execute command iwconfig and check if your adapter is present there. For me it was displayed as wlan1
3. Turn your adapter off and put it into monitor mode
Code:
ifconfig wlan1 down
airmon-ng start wlan1
4. Check airmon-ng output. It will say you that your adapter is now in monitor mode and will give you new adapter's name (for me it was wlan1mon)
5. Now you can use monitor mode on your adapter (for example, to run airodump-ng)
P.S.: Do it at your own risk and don't use this info in illegal purposes. Only you are responsible for your actions.
Thank you very much sir! Really appreciate your work time and efforts!
Just one small query about what rom and firmware are you using?
Heven11 said:
Thank you very much sir! Really appreciate your work time and efforts!
Just one small query about what rom and firmware are you using?
Click to expand...
Click to collapse
Right now I'm using stock rom 082 (and fw 082, respectively), but it would be great if you tested this guide on any custom rom (if you are not going to use built-in wifi module. If you are, I recommend you to use stock rom)
Ok thank you!
tutaf said:
Installing Nethunter
1. Download and install magisk module called KaliNethunter
2. Go to offensive security website and download generic arm64 nethunter image
3. Extract and install following apps from downloaded archive: NetHunter.apk, NetHunterTerminal.apk.
4. Extract kalifs-arm64-full.tar.xz on your phone.
5. Open NetHunter app and grant permissions and root permission
6. Open hamburger menu, select Kali Chroot Manager, select location where you had extracted kalifs-arm64-full.tar.xz and start installing chroot
7. Wait some time (~10 minutes)
8. Start chroot. Now you can use nethunter app and nethunter terminal app.
Enabling monitor mode on built-in wifi module
0. I could not enable it on custom roms. On stock 082 it worked, but there are some problems. Contact me if you have any info about enabling monitor mode on roms except stock.
1. Open nethunter app, go to custom commands
2. Click run on "Start wlan0 in monitor mode"
3. Now wlan0 is in monitor mode. I've tried capturing handshakes using airodump-ng, it worked. However, when I tried deauth attack using aireplay-ng, wlan0 was stuck on channel 0.
4. Note that if you turn wifi on/off or try to disable monitor mode, your phone will turn off.
5. Alternative way: you can enable monitor mode using other apps, like penmon. However, your phone will still turn off if you do anything to wlan0 while it is in monitor mode.
Using external wifi adapter
0. Your wifi adapter must support monitor mode. External adapter won't work without a kernel that supports it. I've built one based on darkonah (many thaks to @travarilo ). Later I'll update this post to list adapters that should be supported by tis kernel.
1. Flash the attached kernel.
2. Now you can use your exernal adapter.
Enabling monitor mode on external adapter
0. I only tested it with Alfa AWUS036NH (chipset ralink3070), but the instruction may be similar for other adapters
1. First, let's install firmware for your wireless adapter
Code:
apt update
apt upgrade
apt install firmware-ralink
2. Execute command iwconfig and check if your adapter is present there. For me it was displayed as wlan1
3. Turn your adapter off and put it into monitor mode
Code:
ifconfig wlan1 down
airmon-ng start wlan1
4. Check airmon-ng output. It will say you that your adapter is now in monitor mode and will give you new adapter's name (for me it was wlan1mon)
5. Now you can use monitor mode on your adapter (for example, to run airodump-ng)
P.S.: Do it at your own risk and don't use this info in illegal purposes. Only you are responsible for your actions.
Click to expand...
Click to collapse
I love it when you put 0 first instead of 1. A true caffeine blooded being. Btw im on .087 fw ver (X00TDB var.). Gonna try the image out and see if internal wifi module works. Im running BT5 on my xp era machine.
ImperialNuggets said:
I love it when you put 0 first instead of 1. A true caffeine blooded being. Btw im on .087 fw ver (X00TDB var.). Gonna try the image out and see if internal wifi module works. Im running BT5 on my xp era machine.
Click to expand...
Click to collapse
What is BT5? I got it
does the kernel support atheros chipset: TL-WN722N v1?
ive done everything i could but my device still dont detect my adapter
...
apt update
apt upgrade
apt install firmware-atheros
airmon-ng... nothing..
xda_u$er said:
does the kernel support atheros chipset: TL-WN722N v1?
ive done everything i could but my device still dont detect my adapter
...
apt update
apt upgrade
apt install firmware-atheros
airmon-ng... nothing..
Click to expand...
Click to collapse
I had some problems building kernel, so I had to disable support for Atheros HTC based cards. You can try to add it as a loadable kernel module.
0. Flash the attached kernel, download and extract module file (ath9k_htc.ko) from zip
1. Go to NetHunter Terminal app and start androidsu shell
2. Go to the folder where you had extracted ath9k_htc.ko. For example:
Code:
cd /storage/emulated/0/Download
3. Install the module
Code:
insmod ath9k_htc.ko
If it throws error like "no such file or directory", check dmesg
4. Check if the module is installed
Code:
lsmod
You should see the name of the module (ath9k_htc) and its size (check attached screenshot)
5. Now try executing airmon-ng in kali terminal.
Module doesn't persist between reboots. Let me know if it works for you, I'll try to automate module installation process.
Throws me error..
xda_u$er said:
Throws me error..
Click to expand...
Click to collapse
Could you please execute dmesg command right after getting this error and show me the output?
its huge, so I put it in notepad
xda_u$er said:
its huge, so I put it in notepad
Click to expand...
Click to collapse
Sorry, my bad, I gave you the module for the previous kernel build (it has different name, that is why insmod throws error). Please try installing the attached module. If anything goes wrong, send me dmesg again.
@xda_u$er did it work?
Well, the installation went ok, but the external adapter its not working, it is not recognized by the device.
xda_u$er said:
Well, the installation went ok, but the external adapter its not working, it is not recognized by the device.
Click to expand...
Click to collapse
Sorry, I don't know what to do with that. You may try to find an old version (~2019) of TRB kernel, I've heard that its developer tried to enable Atheros HTC based adapters support.
Hii again! Your kernel is working amazingly good!and thanks to your guidance nethunter is working fine for me!
But I am unable to perform hid attacks are you able to do them? Like using our phone as a bad usb ! Does this also need kernel modification?
Heven11 said:
Hii again! Your kernel is working amazingly good!and thanks to your guidance nethunter is working fine for me!
But I am unable to perform hid attacks are you able to do them? Like using our phone as a bad usb ! Does this also need kernel modification?
Click to expand...
Click to collapse
As far as I know, it does. I haven't tried any usb attacks, but I'm going to.
Heven11 said:
Hii again! Your kernel is working amazingly good!and thanks to your guidance nethunter is working fine for me!
But I am unable to perform hid attacks are you able to do them? Like using our phone as a bad usb ! Does this also need kernel modification?
Click to expand...
Click to collapse
I've enabled everything that should be enabled to make bluetooth attacks work, but they don't. The adapter is recognized by the system, but nethunter app doesn't see it. I would be very thankful if you tested bluetooth with new kernel. Btw, usb attacks work with new kernel too. I've tried launching firefox on my PC, it worked. This is a really cool thing
Firstly sorry for late reply! I had to reset my device since I was testing some android 11 rom and Thank you sooooo much for V2 of this kernel,usb/hid is working like a charm but I haven't tried bluetooth yet but will definitely try it soon since I don't know how to do it!
Please continue the development of this kerneland remember you are a legend!
Thank you again!
Hii! I want to try Kali nethunter on my device but there are many bugs that I am facing my internet is not working in Kali not monitor mode is working!
Can you please make a nethunter ROM!please
Or give me a backup of your ROM KERNEL AND FIRMWARE THAT I can flash through TWRP !
Please!
PS. Currently I am using Android 10 corvus os and nethunter is not working!

Categories

Resources