Just like a Nexus device from Google, a big benefit to owning a OnePlus One is the device’s unlockable bootloader. In fact, taking full control of your OPO is just as easy as on a Nexus—no shady exploits required, you just need a few tools installed on your computer.
Today I’ll walk you through what I think are the best practices for rooting your OPO. This will be skewed towards the Linux user, but the same basic procedure applies to Mac and Windows PCs as well.
As I wrote yesterday the OnePlus One has CyanogenMod’s excellent Privacy Guard out of the box, so why would you need root as well? I can think of at least three reasons:
- Banish ads from your OPO with AdAway;
- Migrate game saves and other app data from another device with TitaniumBackup;
- Go down the deep, dark rabbit hole of customization otherwise known as the Xposed Framework.
I myself have rooted every single Android device I’ve ever owned; I wouldn’t have it any other way. And now that I’ve convinced you, let’s get started. 😀
What You’ll Need
Your desktop computer will need to support two protocols to fully communicate with your OPO: adb, or the Android debug bridge and fastboot. On Mac and Windows this means downloading and installing the Android Software Development Kit, available from Google here. If you’re an Ubuntu/Linux Mint user like me it’s even easier; all you have to do is launch your built-in software manager and install the following packages:
Whether you use Linux or not you’ll need one additional download, a custom recovery image for your OPO. I prefer TWRP, which you can find here.
Prepping Your Device
Now we will activate adb on your OPO. To do this we’ll first enable developer options. In the main settings panel, scroll down to the bottom where you’ll see “About Phone”. Tap through and scroll down to “Build Number”, the second last entry. Tap that seven times and congrats, you’re now an Android developer! Go back to the main settings pane where you’ll now see “Developer options” near the bottom.
In developer options check “Android debugging” (adb) and, while we’re at it, “Advanced reboot” near the top of that list. The second step isn’t entirely necessary, but gives you an easy way to boot into either the recovery or bootloader on your device.
So from this point onwards commands and such will be specifically for Linux computers, but again the basic procedure is the same on all desktop computers. For instructions specific to your OS, Google is your friend… and probably XDA.
On your computer, navigate to the folder where you downloaded TWRP and open a terminal window there. In Linux Mint it’s as easy as right-clicking on the folder and selecting “Open Terminal Here”.
Now you could boot your OPO into fastboot mode by using the advanced reboot menu (hold down your power button to see what I mean), but this is about best practices—so let’s instead verify that your phone and computer can talk to each other via adb. Connect the two with a USB cable and in your open terminal window type the following:
sudo adb devices
I use the sudo (“super do”) command because I was too lazy to bother with special permissions for adb or fastboot on my computer. If you’ve installed adb correctly, you should see “list of devices attached” with a numbered entry below it. Congrats!
To put your OPO into fastboot mode, type the following Into that same open terminal:
sudo adb reboot bootloader
Confirm that your computer and phone can talk to each other via fastboot with this terminal command:
sudo fastboot devices
And when you’re ready, unlocking the bootloader on your OPO is as simple as typing this:
sudo fastboot oem unlock
Remember again that this will wipe your device!
One difference between the bootloader on the OnePlus One and a Nexus device is that a Nexus will show you the unlock state on your phone’s screen. The OPO, as I remember, will simply reboot back into its OS. If it doesn’t, it’s probably not a bad idea to reboot it manually:
sudo fastboot reboot
At this point you can re-enter to your Google and/or Cynaogen deets, or skip through the prompts and do it later. And I already told you twice that your OPO would be wiped, so don’t complain!
So your OPO’s bootloader is unlocked but you don’t yet have root. You’ll now need Chainfire’s SuperSU binary, which you can get right here. You can download it to your computer and then transfer it to your phone, or simply use your OPO’s browser and download it directly onto your device.
To flash the supersu.zip we’ll now need that TWRP custom recovery. There are two ways to proceed. Ordinarily I would put the device back in fastboot mode and flash the custom recovery, then use that recovery to flash the super user zip. Unfortunately, there are two issues with going this route:
- Over the air system updates from Cyanogen probably won’t work. You would have to use your custom recovery to manually flash the new system image as it become available.
- Cyanogen may not offer updated factory images at all. As GizChina reports, there are users in Europe and Asia who are buying up Chinese versions of the OPO and flashing CM on it. I personally don’t see any problem with this, but for whatever reason CM has obfuscated the factory images on their web site. You can still get the latest image if you follow GizChina’s instructions, and I highly recommend that you do.
Thanks to this thread on the OnePlus forums, I learned something new and fairly amazing about fastboot, which I will now share with you. Let’s go back to your terminal window, opened at the directory you’ve saved your TWRP recovery to. Put your OPO back in fastboot mode (try it from the power button menu if you like) and connect it to your computer. Type this command:
sudo fastboot boot recovery.img
… replacing “recovery. img” with the actual file name of your TWRP recovery. In less than a minute your OPO will boot into TWRP—from your computer!!! You can now flash your supersu.zip by using TWRP’s install command, without having to actually flash TWRP on your device.
The advantage of not flashing TWRP is that the OPO’s default recovery stays in place, to be used when system updates become available. And best of all, after the update you’ll still have root!
I prefer this more hands-on procedure to the one-click toolkits available on XDA, as it allows for a better understanding of how adb, fastboot and the various partitions of an Android system work. You may want to corroborate what I’ve written here with another how-to guide for your computer OS of choice. And fear not: once you get the hang of this it will be second nature to take control of an Android device and truly make it your own.