Skip to content

Instantly share code, notes, and snippets.

@Tydus
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tydus/11103273 to your computer and use it in GitHub Desktop.
Save Tydus/11103273 to your computer and use it in GitHub Desktop.
How to root nexus 7

How to root Nexus 7

What is Rooting

Android has a "jail" that limits user apps to claim its own user and group (one Linux user for one app). The default '/bin/su' program denies the access from these user apps. Thus we need to replace the default su by some 3rd party ones to get root access from apps(as well as adb). That is 'rooting'.

What is unlock

Many manufacturers don't like user to change their system (/, /system, etc.), so they employed a technique called 'BootLoader Lock' which will deny any unauthorized changes to the system partitions. Literally, the "Unlock" procedure will nullify the lock (by some means, be it official or exploiting). As we want to replace the 'su', we first need to unlock the machine.

What is recovery

Recovery is a small, in-memory Linux, which is designed for 'emergency' use (e.g. the main Android system broke down and cannot boot up). Many developers try to make use of the Recovery system, mainly for flashing custom roms, backing up and debugging. Therefore, we need a Recovery to flash the 'su' into the machine.

How to

Preparations

  1. sudo apt-get install android-tools-* (since 13.04 Saucy)
    • or manually install from SDK.
  2. Download su from http://goo.gl/A2hfJ
  3. Download CWM Recovery from http://www.clockworkmod.com/rommanager.
  • Use LTE version.
  1. (optional) Backup all the data from Nexus 7.

Let's Go

  1. Turn off the phone.
  2. Hold Vol- and Press Power.
  3. Plugin the USB cable.
  4. Issue the following command on PC terminal.
    fastboot oem unlock
  5. Choose "Yes" on the Nexus 7.
    WARNING: ALL DATA WILL BE DISCARDED AFTER UNLOCKING THE PHONE
  6. Flash Recovery
    fastboot flash recovery path/to/CWM-grouper-recovery.img
  7. Boot into recovery
    Use vol- to select "Recovery mode" and press power to enter.
  8. Install su
  • install zip
  • install zip from sideload
  • issue adb sideload path/to/UPDATE-SuperSU-v1.94.zip on PC
  1. Reboot
  2. Test it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment