Once upon a time everyone who bought a Nexus device rooted it for the purpose of installing a custom ROM. Fast forward to now [December 2014] and there are many people who buy a Nexus just for stock Android and feel there is no need to root your device any more. I am not one of them.
There are many reasons I like to have root access on my devices. The first reason I come across when purchasing a new phone is restoring apps and data. Until Google manage to come up with a decent solution for this I will continue to root my device and use Titanium Backup to restore all of my apps and data.
Nearly twelve months on and my thoughts have not changed. I do not use root for a lot of things; I might tweak the kernel a bit, run a few Tasker tasks, but most of all to use Titanium Backup to backup and restore apps from one device to another. Google have introduced backup of app data to Google Drive with Marshmallow, but it needs some time to be implemented by all app developers. For now, this feature remains in its infancy and isn’t a solution just yet. Some of my apps have not been updated in years.
Root was — once upon a time — simple to obtain on a Nexus device. Not any more. As Google improve the security on Android each year, obtaining root, although not impossible, becomes increasingly difficult. This year was decidedly harder than last year, mostly because of reasons I will explain further on. This year, after shelling out a Nexus record $994 to Harvey Norman (yes I was too impatient to wait for JB Hi-Fi on Tuesday and far too impatient to wait for the Play Store to get their act together), I carefully tested the device before rooting it.
Some advice before continuing
Piece of advice number one, do not go installing your device fully, including all your apps if you plan on rooting the phone because as soon as you unlock the bootloader you will lose everything and have to start again.
The second pearl of wisdom is to check and double check the display for inaccuracies, touch issues etc. I use Display Tester with the additional Pro Unlocker to add in some extra features. Do this first, because if the display has issues, you’ll want a nice smooth exchange process.
My third piece of sage advice is to read, read, and then read some more. Not some random websites but reputable ones, specifically XDA Developers. Make sure the process you’re going to follow has been successful for other users.
The process for the Nexus 6P
Last year it took me 24 hours to get around to rooting my phone. This year it was all of 3 hours, by the time I had tested the 6P, backed up my Nexus 6 and transferred that all to my Chromebook. I’d like to say that it was done within a few minutes, but unfortunately, as is often the case I am a bit of a kamikaze/guinea pig, I jumped in and after a few bootloops and semi-anxious moments it wasn’t finished until a few hours later. The issue is Google’s monthly security update. Sure it’s great in theory but each time they release an update there is usually an accompanying kernel change. Each time there is a kernel change the kernel/boot image required for rooting changes.
A piece of software called “dm-verity” is the issue. This process is where the system checks it is running the correct software before it boots (in a very simplified fashion). An old patched kernel will not boot. My problem was that I received an update as soon as I turned the 6P on. This meant that I needed a different kernel to obtain root access. There are two options with rooting in this case- flash a full custom rom that will hopefully be updated with the new security changes as they occur or to flash a custom kernel with this dm-verity check turned off for the new update.
At this stage, there are already four versions of Android 6.0.0 on the Nexus factory images webpage. Only MDB08K has a boot image that can be used to root the device (at the time of writing this). There are two newer versions after this. They will come, as will other custom kernels but at this stage there aren’t many options.
You can try Chainfire’s new SuperSU system-less root method but reports are that it only works for certain root functions, not all.
My advice is to root it while on the aforementioned version before it updates, and then update it as the kernels become available (they will be very soon without a doubt). To do this use the following steps:
- Firstly I would recommend you download the Nexus 6P factory image just in case something goes wrong.
- Download TWRP recovery via their website.
- At this point I’ll assume you have set up your developer environment on your PC/Mac/Linux computer. I’m not going to link you nor tell you how to do it. Research. Google is your friend, and we’ve written about it on Ausdroid before here and here for example.
- Go into the Settings on your Nexus 6P and scroll down to “About Phone”. Tap on “build number” in here 7 times to unlock “Developer Options”.
- Back out of “About Phone” and open the “Developer Options” now just about the last option. Inside here you will need to check “OEM ulocking” as well as the “USB debugging” box.
- From here you need to boot into the bootloader. Two ways to do that:
- Turn phone off and boot it up while holding the volume down button, or
- Connect your phone while it is on to your PC and type the following command into a terminal:
adb reboot bootloader
- After connecting your phone to your computer check that it is recognised by typing into a command window (terminal)
- Your device should be listed underneath. If not try and reinstall your drivers etc.
- To unlock the bootloader I prefer the manual method:
fastboot flashing unlock
(yes you read that correctly, the good old fastboot OEM unlock has changed this year)
- You will then have to accept this command on your phone. After selecting YES your phone will unlock and reboot. If it doesn’t reboot type in the command
- Reboot back into the bootloader which is now unlocked.
- Fastboot over the modified boot image- there are couple to try at this stage. Firstly try the new one from Chainfire (which did not work for me but has since been updated. You will find the one for the Nexus 6P (Angler) over at the XDA thread. Second choice, and the boot image that ultimately worked for me was one by a kernel developer called DespairFactor, once again over at XDA. The advantage of this kernel is that it turns encryption off too.
- Flash the boot image by using the command:
fastboot flash boot name-of-boot-image.img
- After this you will need to reboot the bootloader using the menu keys in the bootloader.
- To be able to alter the system partition for any mods you will need to erase all user data for full encryption disabling. To do this you can enter the commands in the bootloader:
fastboot format userdata
- It is a good idea to install a custom recovery to backup your system before you tinker with it. Download the latest TWRP recovery from their website and install it using the usual instructions:
fastboot flash recovery name_of_recovery_TWRP.img
- I always like to reboot the bootloader again here before using the bootloader menu to boot into recovery. Once you are in recovery push across the latest SuperSU which can be used by either drag and dropping it using the MTP function of recovery (mount->enable MTP) or using adb in the PC terminal:
adb push SuperSU.zip /sdcard
- Flash this using the install menu in TWRP.
- Reboot system from TWRP and wait those nervous 5-10minutes until it hopefully boots up into an unencrypted, rooted Nexus 6P.
Yes, that was difficult but hopefully as the device matures it will become easier (and try not to use toolkits, they don’t help you learn, they do not help you if something goes wrong). Maybe next year will be even harder given Google’s push for a more secure Android ecosystem.
As always we here at Ausdroid do not take any responsibility to what you do to your phone. It is your own responsibility and you undertake the above instructions at your own risk. In saying that, if you do have any issues feel free to contact us and we will endeavour to help you fix it- ask over on our Google+ Community Page.