Showing posts with label rooted. Show all posts
Showing posts with label rooted. Show all posts

2014-09-26

Unlocking and Rooting Your Nexus Under Kali Linux

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 google-nexus-tools package on your Kali Linux system:


1
root@kali:~# apt-get update && apt-get -y install google-nexus-tools

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.


1
2
3
root@kali:~# nexus-adb devices
List of devices attached
0a6088af        device

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.


1
2
3
root@kali:~# wget -q -O twrp-recovery.img http://techerrata.com/file/twrp2/deb/openrecovery-twrp-2.8.0.1-deb.img
root@kali:~# wget -q -O cf-auto-root.zip http://download.chainfire.eu/361/CF-Root1/CF-Auto-Root-deb-razorg-nexus7.zip?retrieve_file=1
root@kali:~# unzip cf-auto-root.zip

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:


1
root@kali:~# nexus-adb reboot 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.


1
2
3
4
5
6
7
8
9
root@kali:~# nexus-fastboot oem unlock
(bootloader) Unlocking bootloader...
(bootloader) erasing userdata...
(bootloader) erasing userdata done
(bootloader) erasing cache...
(bootloader) erasing cache done
(bootloader) Unlocking bootloader done!
OKAY [ 80.961s]
finished. total time: 80.961s

With the Nexus still in bootloader mode, we can flash the TWRP recovery downloaded previously:


1
2
3
4
5
6
root@kali:~# nexus-fastboot flash recovery openrecovery-twrp-2.8.0.1-deb.img
sending 'recovery' (7878 KB)...
OKAY [  0.673s]
writing 'recovery'...
OKAY [  0.302s]
finished. total time: 0.975s

The final step is to actually root the Nexus by making the ‘root-linux.sh’ script executable and then running it:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
root@kali:~# chmod 755 root-linux.sh
root@kali:~# ./root-linux.sh

----- CF-Auto-Root-deb-razorg-nexus7 -----

Please make sure your device is in bootloader/fastboot mode before continuing.

***WARNING*** ALL YOUR DATA *MAY* BE WIPED ! ***WARNING***

We are going to run the OEM UNLOCK command on your device. If your device
was not previously unlocked, this will wipe all your data !

After the unlock, CF-Auto-Root will boot. You should see a big red Android
on your device's screen.

You may need to enter your administrator password to continue.

Press Ctrl+C to cancel !

Press ENTER to continue

... INFOThe bootloader is already unlocked!
OKAY
downloading 'boot.img'... OKAY
booting... OKAY

It may take a minute or so for the red Android to appear. If it doesn't show up
at all, there may be a problem.

Press ENTER to continue

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, 

Unlocking and Rooting Your Nexus Under Windows

Unlocking and Rooting Your Nexus Under Windows

CREDITS: This whole post was lifted from nethunter.com (a.k.a. Kali NetHunter)

  1. On a Windows machine, download and install the Nexus Root Toolkit, which can be found at http://www.wugfresh.com/nrt/.
  2. Ensure the model type is set correctly for your device. You can find your build number by going to Settings, “About Phone/Tablet” and then scroll to the bottom.
  1. In the NRT app, click on the “Full driver installation guide” button, and read steps 1-3. Click on the Step 3 tab, then download and install Windows drivers for your Nexus device. The “Google drivers” worked for us. Click on Step 4 and confirm the drivers were installed successfully. This process will reboot your Nexus as part of the check.
  2. Once the check completes successfully, proceed to click the “Unlock” button on the Nexus Root Toolkit interface, to unlock your boot loader. Again, be aware this will completely wipe your device. Ensure you have backups of your data as needed. Follow the Nexus Toolkit prompts carefully. On the next boot, you should see an open padlock together with the Google logo.

Rooting Your Nexus Device

Once unlocked, you can now proceed to root your device and install a custom recovery using the Nexus Root Toolkit. To begin the rooting process, follow these steps:
  1. As the device has been wiped, you must re-do the process of Enabling Developer mode and Disabling Storage MTP instructions from previous. You will need to accept the computer RSA fingerprint once again.
  2. Still in the Nexus Root Toolkit, click the Root button, ensuring the Custom Recovery checkbox is checked.
Once the device has rebooted, and the rooting process complete, we need to install some core Android Applications for the NetHunter image to work properly.

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.

Now your Nexus device is successfully unlocked and rooted.

2014-08-24

Rooted Nexus 7 - Kali Pwn Pad (IN PROGRESS)

after keeping the nexus 7 stock and slave to google, on a hot California summer, I finally decided to void it's warranty by attempting to root, multi boot rom and run Kali Linux on it.  These are my notes and google search results. 

IMPORTANT: Read each Phase (more than once if necessary) completely before you take any action.  Take note of the GREEN updates, they are the ones that actually worked. Each Phase is a work in progress, and are my notes to remind me where I left off.  So please pardon the mess. 

Google Search: "root nexus 7" - Root your Nexus 7
Google Search: "kali nexus 7" - forum.xda-developers.com post by droidshadow

My number 1 advice on following the instructions: Read each step a few times, every letter and every word - including the pop-up windows from the tools when running the actual steps.

Note: be thankful to the guys who already did the leg work to deliver you the step-by-step instructions. the very least you can do is read everything they wrote down, plus you'll be doing yourself a favor by doing so.

PHASE 1: Root your Nexus

The text only instructions are below. The original post/link above has screenshots included. Remember to read the instructions carefully. 
Step 1: Enable USB Debugging
You need to allow the toolkit to make a connection to your Nexus, so you'll need to enable USB Debugging. Simply go into Settings -> Developer Options -> USB Debugging.
If you don't see Developer Options, don't worry. Go into Settings -> About Device and tap on Build Number about 7 times. You'll see a toast notification pop up letting you know that you're a developer. Then simply go back and you'll see "Developer options."
Step 2: Download & Install the WugFresh Nexus Toolkit
If you don't know, this kit is a Godsend—it literally does all of the heavy lifting for us. Head over to the WugFresh website and grab the latest version of the Nexus Root ToolKit, which has been updated with KitKat 4.4.2. compatibility.
You can also grab the direct download here. Whenever you run the app, make sure to right-click on the icon and select "Run as administrator".
Step 3: Back Up Your Nexus
The first step to rooting is unlocking the bootloader, which I'll get into a little later. Unfortunately, that process means that you'll need to wipe the data on your device. If you're not interested in starting fresh, the WugFresh toolkit has you covered.
Select "Backup" from the left-most panel, then select the items you want to back up. In general, I only backup SMS and call logs because apps and contacts are restored once you sign in with your Google account.
Unfortunately, app data is not restored automatically, so if you've got a great high score in Flappy Birds that you'd be sad to lose, you may want to back up your apps using the toolkit. Just select "Create Android Backup File," either under "Backup All Apps" or "Backup Single App."
Alternatively, you can back up your Nexus 7 without root or a custom recovery using various other backup tools.
Step 4: Set Up the Toolkit
When you initially launch the toolkit, you'll need to provide some basic information. Choose the specific Nexus device and build you have. If you're not sure what you input here, just select Auto Detect Device + Build.
Next, you'll need to install the proper drivers for your device, if you didn't already do so through the backup process. All you do is select Full Driver Installation Guide and follow the simple instructions.
After going through the driver installation, Unlock your device to make rooting possible.
Unlocking will wipe the device.
Step 5: Root Your Nexus 7
Finally, you're ready to root. Check the Custom Recovery option to also apply TWRP custom recovery to your device, then click Root to initiate the process.
With the custom recovery, you will have an extra step that includes tapping your screen a few times, but it's easy to follow with WugFresh. After the program runs its course, your device will be unlocked and rooted and will reboot.
Step 6: Make Sure You're Rooted

An easy way to make sure the WugFresh toolkit worked and your Nexus 7 is rooted is to download the free Root Checker app from Google Play. Just open the app, select Verify Root, and wait for the results.

PHASE 2: Install MultiRom Manager & Quickboot 

Now that your tablet is rooted you need to install MultiRom Manager. What this does is it allows you to put multiple roms on your tablet without ever harming your stock (internal) android rom. This is a great tool and all of us who use it really owe the developer a lot of credit...

There is a very easy way to install MultiRom Manager. The developer of this program has created an app that you can download from the Google Play Store to install it easily and successfully. 

Open up the Google Play store and do a search for "multirom manager". Download it, open it up, grant it root permission and run the app. The app will do all of the hard work for you and it will install MultiRom for you. Once it is done reboot your tablet. Since your stock rom won't have the reboot option i recommend downloading "quickboot" from the Google Play Store. This app requires root access but it will allow you to quickly reboot your tablet, boot into recovery, or boot into the bootloader. 

When you are booting up after installing multirom you need to click on your tablet as MultiRom is counting down. The only Rom that will be listed is "internal" (because you haven't installed any other roms) go ahead and boot into "internal" by clicking on the boot button. 

IMPORTANT NOTE: it is very important to boot your internal (stock rom) at least one time before you flash/add another ROM with multirom manager. MAKE SURE YOU DO THIS!


PHASE 3: Install a custom additional Roms  

Use the Quick Boot app that WugFresh loaded during the Phase 1 to boot into "Recovery Mode". Now in recovery manager which works hand in hand with MultiRom you are going to want follow these steps:

1. Hit the Advanced button
2. Hit the MultiRom button 
3. Add Rom
4. Select "Add Zip". Choose the cm-11-20131213-bruce2728-odexed-flo.zip file to flashed.
5. Once that is done flash the zip by sliding the bottom button from left to right. 

Okay now after you flash the zip you should see "ZIP FLASHED SUCCESSFULLY". 
Now what you want to do is hit the back button till you get to the main recovery page.

08/24/2014 UPDATE: NOTE: I have not successfully installed a rom on my device - it keeps FAILING.  Research and testing is currently in progress. Stay tuned.

08/25/2014 Update: upon reading the FAIL message closely, it said that the CM11 version I was trying to load was for a FLO (Nexus 7 2013 - 2 cameras) device while my Nexus 7 was a GROUPER (Nexus 7 2013 - 1 camera). I'm going to try and load the latest GROUPER CM11 I can find and cross my finger. Here's the CyanogenMod 11 Grouper Link - 

https://download.cyanogenmod.org/?device=grouper&type=stable


09/06/2014 Update: Sorry for the long delay on updates. The Grouper ROM works for my Nexus 7 (with 1 camera). I've since also flashed the ROM with the PA-Google Apps.  You will need this to be able to get to Google Play.


PA-GOOGLE APPS

https://www.androidfilehost.com/?w=files&flid=15800
http://forum.xda-developers.com/showthread.php?t=2397942

Next step adding Google Apps from TWRP recovery manager:

1. advanced
2. multirom
3. list rom
4. now that you have flashed CM11 you should see a ROM under "internal". Remember "internal" is your stock rooted nexus 7 rom.  click on the new rom you just installed.
5. click flash zip.
6. navigate to where you downloaded the pa-gapps.zip file, and pick it.
7. slide the button to flash the zip.

HIT THE BUTTON TO REBOOT YOUR SYSTEM. 

Okay so now that your Nexus 7 is rebooting you need to tap on your device to stop the countdown from MultiRom. There will be 2 choices on the list 'internal' and the ROM you just added. You want to select your newly added rom and tap it again to boot it.  


NOTE: The 'internal' rom is your clean stock factory rooted rom.  To go back to it, you'll need to reboot again and choose it at the multiboot screen.

SET UP YOUR DEVICE and make sure GOOGLE PLAY STORE IS RUNNING CORRECTLY:

IMPORTANT TIP: if the google play store stops working try rebooting your system. If that does not work and your google play store is giving you an error 920 code then you need to close the google play store. go to settings -> apps -> all apps. Click on Google Play and wipe data and cache. After that you need to click on GMAIL and wipe data and cache.

WIPING THE CACHE and DATA on GMAIL will fix problems with the GOOGLE PLAY STORE especially error code 920.



PHASE 4: Install Kali Linux

As always: MAKE SURE YOUR TABLET IS PLUGGED IN TO POWER ESPECIALLY FOR THIS STEP!

1. Download the KaliPwnPad: Go to http://w11.zetaboards.com/Pwnie_Express/topic/8951376/1/ and spend some time to search for the latest and greatest version available.  The actual version I used is from this download link - https://mega.co.nz/#!aZ5THSxL!PFuyV1Z7Vb-QgmhYF5a7CgMukI1JAGIUkEo972KEgiE

2. After you get the file, boot back up into recovery. Pick the your new rom and basically perform the same "flashing" steps you did as installing the PA-Google Apps.

In Recovery go to -> ADVANCED -> MULTIROM -> LIST ROMS -> SELECT your ROM -> ADD ZIP.

Navigate and select the kali pwn pad file that you downloaded earlier.

WARNING: this file will take about 30 minutes to flash. you are going to want to keep and eye on this file. if at all possible do not let TWRP time out and turn off the screen. You can avoid TWRP turning off your screen from an idle timeout by clicking on your tablet's screen once a minute. I know it may seem like a lot but it is best and easier to avoid the screen from turning off from an idle timeout. If your tablet does turn off from an idle time out if you are on POWER you should be able to turn the screen back on by just clicking on the power button and swiping the bottom of your tablet from left to right to unlock it. 

Okay now that KaliPwnPadv0.5 is flashing you will just have to wait for it to finish...

It does take about 30 minutes for this big file to flash. Now you will see the progress bar filling up. When the progress bar is full don't worry that the zip isn't done flashing. It may take 5-7 minutes after the progress bar is full for the zip file to finish flashing.

Caveats:
-The error  "unable to load ramdisk" and the top screen which said "Error: unable to flash zip". Don't worry this will not affect your system. 
-Once the file finished regardless if you got "zip file flashed successfully" or "unable to load ramdisk" error you will need to reboot your tablet.

3. Let's light this candle!

- Boot into the ROM you flashed KALI in
- Start your Terminal Emulator
- On the prompt, type "SU"
- Get the party started by typing "bootkali"


PHASE 5: USB Drivers and ALFA

09/06/2014 Update: I have recently ordered the cables I need to get the external Wifi connected to the Nexus.  I also have not really flashed the kernel to add the drivers.  I'll continue this project when the required materials arrive.