[GUIDE] Release the Kraken! Rooting & Hacking Your Nexus 7

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
[INFO]Table of Contents
  1. Unlocking & Rooting: Foundations of Freedom
  2. Flashing? What? Is that legal?!
  3. Kernels: The Brains of the Beast
  4. Miscellaneous Questions, Thoughts, and Metaphysical Ponderings

I would like to thank all sources and persons linked or mentioned within this guide, may they be apps, developers, forum posts and posters, or whatever. Your work is amazing and without it the Android community would not be what it is--a vibrant, thriving community based upon open access to all and for all. - D[/INFO]

For many of you, the Nexus 7 (codename: grouper, which will be used throughout this guide, so get used to it!) is not only your first Android tablet, but your first exposure to the Android operating system--clean, pure, and true. See, a lot of phones out there run a form of Android, but not necessarily Android. Have a GSIII? You're TouchWiz, an Android-based operating system. Have an HTC One-series? Well, you're running Sense 4.0--yet another Android-based operating system. Alas, while these may be cool (probably not), these are not Android.

Jelly Bean 4.1.X is Android at its purest.

As great as stock Jelly Bean is, it has its shortcomings. For one, I personally find that "homescreen" with a boatload of media to be the most obnoxious use of space ever conceived by Andy Rubin and co. For another, while you have a lot of control--certainly more than any iOS/Apple product could claim--you don't have complete control. Think of it this way--running stock Jelly Bean is like having a manumatic. Sure, you can shift up, you can shift down, you can select sport mode, you can select grandma mode, but at the end of the day--where's the clutch?

Unlocking and rooting your device gives you that power. Let's break down some basic ideas before you get too excited. Remember, this is risky and can void your warranty. If you unlock, root, and flash roms on your device, you are performing these actions at your own peril. We are here to help, but the you bear the risk alone. That being said...

First, unlocking. If you're coming from Apple, you may think "unlocking" means carrier free, and while that may be a correct usage of the term, for our purposes, it means unlocking the bootloader. What's the bootloader? Well, think of it as the primary, core launching system for the software in your device. From there you can reboot your phone, reboot your phone into something called "recovery mode" (we'll get there), reset your device, and do all sorts of neat and semi-dangerous things. When you're "at" the bootloader, you're in something called fastboot mode. Fastboot is the key to life when rooting your Android devices. Generally, fastboot is an interface by which you can modify stuff--flash software images, boot software images, etc. If you're interested in taking your devices to the next level or simply wanting something to brag about at a 3 martini lunch, I highly suggest learning the ins and outs of adb (another interface) and fastboot. They are lifesavers.

[TIP]Manually Rebooting Into the Bootloader
  1. Power down the tablet.
  2. Plug the tablet into a computer; no need to set it up, just make sure that the USB cable is connected to a computer.
  3. Once completely off, hold down the "volume down" button and the power button simultaneously.
  4. You will see small lines of dialogue in the right--it should say "fastboot mode" in red at the top of the dialogue. This is the bootloader, congrats :).
[/TIP]

[WARN]Notice that second instruction? That's very important. Apparently there's a bug when manually booting into the bootloader. If you follow the above method and try to go to "Recovery Mode," you may end up with an android on its back with a startling red exclamation point. Why? Well, it's not reading a USB connection--at least that's my guess. There are alternative methods to get to recovery (using a widget/app to reboot directly there, using Android Terminal Emulator, using a power menu mod, etc. If you do not have access to one of those alternative methods, please please please plug your device in. If you forget to, do not panic. Shut it down, plug her in, and get back to it.[/WARN]

So when you "unlock" your grouper, you allow the bootloader to have access to and to "flash" (flash = install) unsigned packages. At the superficial level, this doesn't matter. But for flashing stuff like roms, kernels, etc., it absolutely matters. In essence, unlocking the bootloader enables you to drastically change the software and operating system on your device quickly and painlessly.

Secondly, let's talk about rooting. A lot of people have many misconceptions about rooting--it does this, it does that, it means you're an uberawesomegeek, etc. etc. But let's be real--all rooting does is give you access to the very very beginning of your file system: the "root" of your files. That's it. Many folks over-exagerrate the process of rooting. Well, what is it, really? It's a binary that is controlled by an application--nothing more. This gives you "root permission," and you may give an application root permission (i.e. the ability to store stuff at the root/beginning of your file system) or you may deny an application root permissions. Thus, in essence, "rooting" is the process of installing two files--the binary and the application--that allow you to grant extensive file permissions.

[NOTE]These two files are placed in two specific areas. The apk/application (either "Superuser" with the familiar pirate droid face thing or "SuperSU" with a nondescript pound sign icon) is a system application, stored in the /system/app directory. The binary is stored in /system/xbin.[/NOTE]

[INFO]Guides for Unlocking/Rooting The Nexus 7
One of the great benefits of being a member at Android Central is the tremendous support and guidance you receive when hacking your device--support/guidance that, IMO, is second to none. Two examples of this work follows. First, for the visual learners, is a terrific video put together by our own ragnarokx. He'll walk you through unlocking, rooting, and putting a custom recovery on your grouper. Second, for those who prefer written instruction (and for those with all 3 computer OS's--Mac, Linux, and Windows), there is zero neck's fantastically written guide. Either guide will get you to where you need to be, and I highly recommend meandering over to those threads for step by step instruction.


[/INFO]
 
Last edited:

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
Re: [GUIDE] Unleash the Beast: Rooting & Hacking Your Nexus 7

[TIP]Once the grouper has been unlocked (and rooted), you can start down the path of flashing roms and toying with the software at an extensive, deep, and semi-neurotic level.[/TIP]

First things first, what the hell am I talking about when I throw around such terms? Well, for starters, a rom is essentially a zip file/package that contains a bunch of other files. You with me, so far? These files change your operating system and the features your operating system may have. Think of it like going to a car auction. You're sitting in the hot summer sun and there you see the apple of your eye--a 1965 Chevy Nova. Of course, it is rusted, dilapitated, and its engine has 4 cylinders (give or take) running at less than optimal levels. Your John Deere rider mower would probably beat it in a race, no doubt. You buy this Nova and instantly you want it to be a source of pride and passion. So what do you do? Scrap the engine, retool the bodywork, and drop a blown 454 cubic inch monster into its bowels. Well, a rom is sorta like that 454" beast. You "take out" (replace) the old engine--and while ours is fine, it's no fire-breathing hell spawn--with something that gives you so much joy, happiness, speed, and power that you are beside yourself when you first boot in and take a look around. Essentially, roms breathe new life into your device, replacing the old with the new and ensuring you have the (relatively) best possible operating system at any given moment.

[NOTE]You install a rom with a tool called a recovery, which is accessible via that little old bootloader discussed in the first post. However, the stock recovery simply won't do--you'll need a custom one. Custom recoveries come in two flavors (so far)--Clockwork Mod Recovery ("CWM"; long the industry standard) and snappy upstart Team Win Recovery Project ("TWRP"). I prefer TWRP, mainly because it's fast, reliable, easy, and powerful. Ultimately, the choice is yours. Regardless, make sure you have a custom recovery installed and ready to rock before you enter the abyss of rom flashing![/NOTE]

So now that you have your recovery and perhaps a rom picked out, what's next? Well, here's how I (and you should) generally flash a rom.

First ==> download the rom, and if it has a "gapps" file (Google Applications, like gmail, play store, etc., which are separated due to legal rights), that as well, and place these files on your internal storage--the "faux sdcard." (And, for the love of all that is sacred, remember where you put them!) Be sure to check the md5's of the downloads to ensure that they match up with the given md5. If an md5 is not given, politely ask for one :).

Second ==> reboot into your recovery, either by selecting recovery mode at the bootloader (remember--be plugged into a computer) or by using the option in something like ROM Manager (which you should never use past a certain point) or GooManager Beta (see Manager, ROM).

Third ==> make a backup. Backups are known as nandroids; they are little images of your device as it stands at that given moment in space and time. Every time you do something crazy, ya know, like flashing a new operating system, you should make a nandroid. You should have at least one nandroid on your device at any given moment, or at the very least have a nandroid on your computer that can be easily "pushed" over via adb or through however you access your files on said computer.

Fourth ==> wipe your phone. There are two forms of wiping. They are full/clean and dirty (hence "dirty flashing"). Clean wiping should occur whenever you have issues with your device or are switching from one rom (e.g. Euroskank's CM10) to another rom (e.g. AOKP). Dirty flashing should occur when going from one "build" (e.g. AOKP's August 10th build) to another build of the same rom (e.g. AOKP's August 13th build).

[INFO]Clean/Full Wiping
  • Wipe data/factory reset (this also wipes the cache)
  • Wipe cache (just do it lol, it's good to make it habitual)
  • Wipe dalvik cache (in advanced)
  • Wipe system (i.e. format system in mounts/storage)

Dirty Wiping
  • Wipe cache
  • Wipe dalvik cache (in advanced)
  • Wipe system (i.e. format system in mounts/storage)
[/INFO]

Fifth ==> install the rom (and gapps, if applicable). This is the easiest part. Look for "install from sdcard" in recovery, find the zip file that you placed on your device in step 1, then flash/install that zip file. If you have a gapps file, do the same with that immediately after the rom has finished installing.

Sixth ==> reboot the "system" (it's a normal reboot), setup your device, and if you used Titanium Backup, go from there.

[WARN]Remember, this is risky. You're changing stuff at the very core of the grouper, and you assume all of the risk involved in this process. However, if something goes awry and you "soft brick" your tablet, please be aware that you may have to flash the stock images in order to get your device back into working order. Luckily, we have an absolutely fantastic guide on just that, written by our own 2defmouze.[/WARN]
 
Last edited:

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
Re: [GUIDE] Unleash the Beast: Rooting & Hacking Your Nexus 7

[TIP]While flashing roms is cool and all that, there's still more to flash! Namely, kernels.[/TIP]

What's a kernel you say? Well, it's the grouper's brain. Think of it like this--you have your hardware, ya know, the ridiculously awesome Tegra 3, that sicknasty GPU, the screen, the battery, etc., and then you have the software--the rom. Well, the rom can't just "speak" to the hardware, that'd be ridiculous! Instead, it goes "through" the kernel. The kernel, in essence, is the main interaction point between your software, your applications, etc., and the actual hardware.

In fact, here's a little history lesson for you. You know that operating system, Linux? Yeah, that one. The one that Android is generally based on, the one that powers the most powerful computers in the world including the Large Hadron Collider? Well, Linux is the work of one Linus Torvalds. What did he do? He created the Linux kernel (and maintains it to this day). So kinda cool, eh? That kernel's kind of a big deal, and so is the kernel in our device.

[INFO]
Linus_Torvalds.jpeg

This guy.​
[/INFO]

Any who, as development gets going on the Nexus 7 the kernels will start a-flowin'. So, here are some general things to think about when looking for and flashing kernels.

Battery Life

Battery life is one of the big advantages of a kernel. Many kernels are geared towards efficiency--slightly undervolting the processor, underclocking the processor, and massaging the general processes of the device in order to maximize how long your battery can stay afloat. Beware, though, that manually undervolting your tab is risky, risky business. Going too far under could result in the dreaded SOD (sleep/screen of death, depending on who you talk to and at one distinct point of panic that person is at). So unless you've read up on it or are following "expert" advice, don't do it!

Further, battery life cannot be judged 10 minutes after you flash a new kernel. So when you go through kernel threads and see "OMG THIS KERNEL IS THE BOMB" 15 minutes after a new release is posted, you know the poster is (1) a liar, and (2) full of shenanigans. For me, I follow the general rule--wait a day. Let the kernel "settle." Make sure to use your device as you would normally. Then, at the end of the day, at the end of that period of normal usage, if you find yourself having better battery life--keep it! If not, try another (or try another regardless, which is what I do because I get so bored with kernels I make junkies look like Tibetan monks).

CPU Control - Underclocking & Overclocking

Another neat feature of a kernel is maximizing (or minimizing) how fast that Tegra 3 functions. For some, 1300MHz is simply not enough. NEED MOAR POWER you say. Well, a kernel can do just that--increasing the "clock" (the processing speed) of that four-cored beast of slight-to-insignificant burden. Again, like with undervolting, be careful. Too low or too high could result in freezes, reboots, or an SOD. Follow recommendations and only do it if you're comfortable with doing a hard reset.

Miscellaneous Awesomeness - Color Controls (Hopefully Soon!)

Lastly, there are other advantages to having a custom kernel. Color controls tweak the color settings, allowing you to mess with the contrast, gamma, multipliers, stuff way above my knowledge and pay grade. All I know is that one color control kernel--trinity--looks absolutely awesome on the Galaxy Nexus. I presume we'll get color control sooner than later, so until then, buy a toro/maguro/toroplus and get tweaking!

Another neat (and random) feature includes fast charging. When you plug your device into a computer, it charges at a lesser rate than if you're plugged into a wall socket. Fast charge screws all that up, allowing you to draw more power and thus charge your device quicker. Before using a fast charge toggle (if your rom has one), be sure your kernel supports it.

Now, flashing a kernel is fraught with myth and misinformation. Here's how I do it, because I'm neurotic. But I'm thorough. So that counts, right?

[TIP]
Dylan's Kernel Installation Method
  1. Download the kernel and place it on your SDcard.
  2. Reboot into recovery.
  3. Wipe cache and dalvik; some say it's not necessary, but hell, just do it. Wiping is fun, you'll see!
  4. Install the kernel from the SDcard.
  5. Reboot system.
[/TIP]
 
Last edited:

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
Re: [GUIDE] Unleash the Beast: Rooting & Hacking Your Nexus 7

[NOTE]This space is for common questions, comments, and troubles encountered when one falls into the addiction known as flashing. If you have a question regarding anything contained within this guide, please comment in this thread or, if it concerns another linked guide, in that specific thread. I and/or one of our exceptional advisors or moderators will be along to help you :).[/NOTE]

Where do I find the best roms?

The first place to start is this very forum. We'll have rom threads set up with download links, instructions, and any miscellaneous information necessary to install the rom on your tablet. Other sources are the internet generally and alternative Android resources. Further, most of us will have rom and kernel information in our postbit (the stuff under our usernames). For example, I have both a toro (Verizon Galaxy Nexus) and a grouper (the Nexus 7, obviously :)). For the toro, I'm currently running AOKP--a/k/a "unicorn." For the grouper, I'm currently running CM10. Others will post their information in their signatures as well. Regardless, just ask and I'm sure we will chime in. At the end of the day, however, the best rom is the rom that you like--not the rom that I run or the rom that the King of Lithuania may be running. Good luck and happy hunting :).

Why do you dislike ROM Manager?

This is a complicated question. It is my belief that if you want to do a job the right way you make sure you learn it thoroughly--in and out. Using an application like ROM Manager skips several steps and lets you flash stuff willy nilly, which is never good when it comes to such pricey luxury items. Further, think of it this way--it puts yet another step, yet another wall, between recovery and you, the end user. If you want control, take it. Trust me on this--flashing and wiping stuff in recovery is a piece of cake once you do it a couple times. Once you learn how to do it you'll know how to bail yourself out, particularly by restoring a backup or using the adb interface to push a fresh, clean, life-saving rom to your SDcard. Learn how to do it :).

I flashed a rom and stuff keeps force closing, my phone is showing only Ancient Greek text, and I'm 90% sure I screwed up. What now?

Before you begin--don't panic and take a nice, long deep breath. Even with a process as simple as this mistakes can happen. The first thing you want to do is troubleshoot the error. Did you install a new app, and then everything started flipping out? If so, uninstall it and see what happens. Did you do a "dirty" flash and not a full wipe? Perhaps a clean install will cure all your ills. If that does not work, try restoring your backup. And finally, if your device is so borked that it's been on the Google splash screen for the past 72 hours, try performing a factory restore. For those instructions, see 2defmouze's guide referenced above.

This portion of the guide will be constantly updated. Check back for new details!
 
Last edited:

PsYcHoNeWb

Well-known member
Feb 17, 2011
1,363
476
0
Visit site
Amazing work again my friend. This should be a huge help to all grouper groupies :D.

Sent from my Galaxy Nexus using Xparent SkyBlue Tapatalk 2
 
  • Like
Reactions: dmmarck

anon(2729369)

New member
Jul 1, 2012
4
0
0
Visit site
Hmmm.... I know you're trying to dumb it down, but being root is much more than having access to the root of the filesystem. It gives you access to a whole new sets of binaries and much more.

Also, anybody who is unlocking their bootloader should be aware that all their data can be stolen by anybody with access to the device.
 

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
Hmmm.... I know you're trying to dumb it down, but being root is much more than having access to the root of the filesystem. It gives you access to a whole new sets of binaries and much more.

Also, anybody who is unlocking their bootloader should be aware that all their data can be stolen by anybody with access to the device.

While both points are true, granting root permission starts and can be widdled down to those two things. Binaries that can be used after root permission can be granted are a different topic than the one encountered here, IMHO. (It's also more advanced than the scope of this guide--I wanted to demystify the process.) However, point well taken, thank you :).

Regarding security, that goes without saying, unfortunately. :(

(Although, apps like Cerberus give you a powerful tool to counteract such thievery.)

Sent from my Galaxy Nexus using Xparent Cyan Tapatalk 2
 
Last edited:

budwizer

Member
Nov 16, 2009
24
2
0
Visit site
Excellent thread.

Still running stock with root and unlocked bootloader.

Wondering what is the best and most stable rom for me.

I've been running ParanoidAndroid rom and love that it enables the Tablet UI. Been running quite stable along with Trinity kernel. I've also been testing out Liquid beta 2 however like the Tablet UI that PA brings.
 

sicario666

Well-known member
Dec 27, 2009
2,928
365
83
Visit site
Amazing work again my friend. This should be a huge help to all grouper groupies :D.

Sent from my Galaxy Nexus using Xparent SkyBlue Tapatalk 2

Count me in as a groupie. Hopefully I'll be grabbing a nexus7 tonight or later this week.

D...your guides...amazing. I have no idea how. I know I love em.

Fission Mailed from GalaxyS3
 
  • Like
Reactions: dmmarck

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
I've been running ParanoidAndroid rom and love that it enables the Tablet UI. Been running quite stable along with Trinity kernel. I've also been testing out Liquid beta 2 however like the Tablet UI that PA brings.

PA is next up on my list, but for now I'm too paranoid (get it?!) to leave CM10 ;).
 

sicario666

Well-known member
Dec 27, 2009
2,928
365
83
Visit site
PA is next up on my list, but for now I'm too paranoid (get it?!) to leave CM10 ;).

Hmmmm. I wonder which one to go with. I know D will recommend CM10. On the other hand. I did like PA on my nexus. Decisions decisions. :D

Fission Mailed from GalaxyS3
 

1966cah

Active member
Sep 24, 2010
43
1
0
Visit site
Excellent write-up! Since this is geared towards the first-time flasher, I would suggest only one addition, whcih would be advice on using md5 hashes to verify clean downloads. The number of times I've seen people over on RootzWiki bork their flashes becasue they didn't verify file integrity is just sad...
 

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
Excellent write-up! Since this is geared towards the first-time flasher, I would suggest only one addition, whcih would be advice on using md5 hashes to verify clean downloads. The number of times I've seen people over on RootzWiki bork their flashes becasue they didn't verify file integrity is just sad...

This. I'll add this in a bit later. I myself get a bit lazy with this; if I'm downloading from a "trusted" source (like GooManager or something), I usually let it slip. But any time a random mirror is thrown up, checking the md5 is crucial.

Thank you!
 
  • Like
Reactions: kendallc123

kendallc123

Well-known member
Oct 5, 2011
54
1
0
Visit site
This. I'll add this in a bit later. I myself get a bit lazy with this; if I'm downloading from a "trusted" source (like GooManager or something), I usually let it slip. But any time a random mirror is thrown up, checking the md5 is crucial.

Thank you!

Excellent write-up! Since this is geared towards the first-time flasher, I would suggest only one addition, whcih would be advice on using md5 hashes to verify clean downloads. The number of times I've seen people over on RootzWiki bork their flashes becasue they didn't verify file integrity is just sad...

I agree. I'm a big fan of checking the md5 on ANY site I download from.. just to be safe!

Kendall