Digit Geek
Digit Geek > Recent Articles > Technology > A complete guide to rooting your Android smartphone

A complete guide to rooting your Android smartphone

Not all manufacturers make perfect devices. This guide will make you an expert in rooting Android phones so that you can customise it to suit your needs

The following rooting guide is divided into two sections: backing up and rooting. Once you are done with this guide, you should be fairly ready to root your phone when you need to. As the process is quite complex and can lead to bricking your phone, we would advise you to pay a lot of attention to each step. Remember, not every manufacturer allows rooting, so you might be voiding the warranty of your brand new device with just one wrong step forever. On the flip side, thanks to the active community of developers and supporters for Android, almost every popular phone has a verified rooting method out there on the internet and it is always better to start off with those rather than a universal how-to. On the other hand, if you’re willing to risk it, this method can prove to be fairly simple and save you a tonne of time when it works. And even though you’ve had your fair share of rooting the traditional way, you can still try this method out to update your methods to the latest tools available. Just remember, if you have any doubts that you aren’t prepared for this – technically, or otherwise – it is best to hold the thought of rooting for a while and doing some research.

Firmware

So, first things first, you need to look for the correct firmware to flash. This is a very important step due to the complications involved – there might be different firmware versions for even slight hardware changes between two models. In that situation, you would need to know the exact firmware version for your particular model, as you will need the phone drivers, Google ADB drivers and custom recovery corresponding to that. There have been cases where an older version was found to be compatible whereas newer versions didn’t work with particular stock ROMs. In such a situation, do not panic, try older versions.

P.S Some manufacturers do keep the option of cross flash open – so if you do want to use a different firmware than the one originally intended for your phone, do your research first.

Downloads

Now, it is really important that you have everything with you before you get started. While rooting your phone, you might be concentrating on the process too much to notice that, say, the custom recovery that you are using won’t work with your phone. If you continue this way, you might end up bricking your phone and rendering it unusable. In such a situation, head over to the Un-bricking section in this article.

So in that case, make sure you go through the verified XDA threads for rooting your phone and gather the following:

  • Phone drivers
  • Google ADB drivers
  • Custom Recovery
  • Recovery tool, in case you brick your phone

An exhaustive collection of links to such threads can be found here.

Backup!

Before you dive into the world of rooted Android you have to backup everything, just in case. It’s the smart move, even though nothing will probably go wrong if you follow this rooting guide to the letter. Take physical backups – copy all your data onto a desktop or a laptop with simple copy paste.

Android has a good inbuilt mechanism to assist you in backing up anything vital on your smartphone. Using cloud services is probably the best way to backup everything, and most of us are probably already doing so. You can also always copy your pictures, music, etc., to your PC, but let Google handle all your contacts and SMSes. That way you just need to sign in with your account and import everything back automatically.

While there are 3rd party tools available for better backup options than the ones mentioned above, you should also check out manufacturer specific backup options. Samsung’s Smart Switch is a desktop backup tool for, well, Samsung phones. If you don’t already know, Samsung sells a LOT of phones. Hence, for a lot of people, their local backup tool is important. It essentially functions similar to iTunes by backing up and syncing all your data each time you connect to your desktop. For LG, the same tool is LG Backup, which is part of the bigger LG Bridge package. It is a really simple to use and is highly recommended as the backup option for LG phones.

Bonus: Backup after rooting

It’s backing up your rooted phone that really matters, really, and even though we haven’t even got there yet, we’re just lumping all the backing up guides together. The thing with custom ROMs is that they’re addictive, and fiddling with them often results in crashed OSes that need to be reinstalled, or worse, phones with void warranties that no one is willing to touch. No one said being a geek was easy! This is why you need more powerful backup tools:

  • Titanium Backup
    This app lets you backup apps, data and market links. By backing up apps, we do mean all your installed apps along with the system apps on your phone and their data. The app also lets you schedule backups and do one-click batch backups. The paid Pro version unlocks a few more handy features such as integrating app updates to ROM, encryption, restoring individual apps+data from non-root ADB, CWM and TWRP backups and more.
Android customisation
Use Titanium backup once you’ve rooted
  • Helium Backup
    Helium Backup is an app that will let you backup apps and their data even before rooting. You will need the Helium desktop client installed. With USB debugging enabled on your phone, start the Helium Desktop app as well as the Helium app on your phone. Then connect your phone to the PC and wait for it to be detected. Once it does get detected, you can unplug the phone. Going to the Helium app will now show you the option of backing up your apps to a location of your preference – internal memory, SD card or the cloud. This backup can be restored by the ‘Restore and Sync’ functionality.

Android customisation

Un-secure your phone

In case you use services like Google Authenticator to enable 2-step verification on your account, it is advisable to remove this authentication process before commencing anything herein. An account secured by 2-step verification is exceptionally difficult to recover. In fact, it is a good idea to disable all security measures that could be potential roadblocks to you getting back into your own account once the rooting is done. Additionally, it is also recommended that you disable the antivirus and firewall on your PC until the rooting process is complete. And before you start off, at this point, do a full factory reset of your phone.

Unlock bootloader

The next step is the unlocking of your bootloader. The bootloader is basically the program that controls your device’s startup process. It has control over what applications run during that process. Hence, unlocking it is a key to rooting your device.

This is where things get manufacturer specific. Some manufacturers require you to get a key to unlock the bootloader – something that they allow only registered developer accounts to do. Usually, for this, you have to put your device into fastboot mode – something that again differs depending on the manufacturer. The most common way to do this is to reboot and hold the power and volume down buttons for 10 seconds, but it could differ for your phone. Do check out the actual way to enter fastboot mode on your Android device.

Once in fastboot, open your computer’s command prompt. If your device requires a code this is the stage where you’ll see a long string of characters, that you will need to provide on the manufacturer’s website to get a key and further instructions on unlocking the bootloader. Otherwise, this is the process you need to follow.

  • Connect it to your computer and bring it into fastboot again.
  • Bring up the command prompt.

For Google Nexus and Pixel devices, the commands are easy:

  • Nexus phones: Type “fastboot oem unlock” (without quotes) and hit Enter
  • Pixel phones: Type “fastboot flashing unlock” (without quotes) and hit Enter

Motorola’s command is a little different:

  • Type “oem unlock UNIQUE_KEY” (without quotes), replacing “UNIQUE_KEY” with the code you received

So is HTC’s:

  • Type “unlocktoken Unlock_code.bin” (without quotes), replacing “Unlock_code.bin” with the file you received.

LG also supports bootloader unlocking on many of their devices starting 2015, as recent as last year’s LG G5.

For other devices, there is definitely a solution available even if your manufacturer does not sanction bootloader unlocking. Although, only go for reliable sources like the XDA Forums, or official posts on your manufacturer’s forum for the process for your phone. Complete the process, and you’re another step closer to rooting your Android device.

Custom Recovery

Creating a manual backup for your phone is a good idea as well if you’re sure about the recovery process. A custom recovery is essentially a third party recovery environment which replaces your stock recovery environment when flashed onto your device. These third party alternatives offer a lot of features like rooting as well custom backups. While there are popular alternatives that offer a one-tool-for-everything approach to the process, it is best to check reliable sources for a custom recovery that has been verified to work with your phone. For instance, this thread on the official OnePlus forums confirms (check comments from the post creator in the comments section) that TWRP works with the OnePlus 3. Similarly, it would be best if you check the specific recovery functional with your phone. For TWRP availability, check out the list of devices here.

The two popular options for custom recovery are Clockworkmod Recovery (CWM) and Team Win Recovery Project (TWRP)

  • Clockworkmod Recovery (CWM): This recovery can create and restore NANDroid backups – backups of an Android device’s entire file system. It also has other advanced features that will be useful if you install and deal with custom ROMs frequently.

Android customisation

  • Team Win Recovery Project (TWRP): This is a touch-based recovery environment – all other recoveries are controlled by a device’s volume and power button. TWRP even supports themes. It is also used to make backups and flash ROMs on your Android devices.
Android customisation
The TWRP recovery interface

Essentially, to carry out a TWRP recovery, you need to follow these steps:

  • Enable USB debugging.
  • Download the TWRP recovery image for your phone and place it in C:\
  • Boot into your phone’s bootloader and connect it to PC.
  • Wait until you see ‘fastboot USB’ on your screen.
  • Launch the command prompt on your computer and run this command:
    fastboot flash recovery c:\<name of image>.img
  • After the process is finished, go to bootloader again – you should see the TWRP custom recovery.
  • Select Backup option and choose the relevant categories before starting the process
  • Once successfully completed, you should have a TWRP custom recovery image on your storage
  • The ‘Restore’ option on the first menu takes you through the recovery process
Android customisation
There was a time when the process was quite complex

Rooting your phone – Let’s get started

Now it’s time for the real deal – rooting your phone. There are several ways to do this and you will need to decide which one’s best for you. Before you begin, make sure your device is fully charged – you do not want your device dying on you mid-root, trust us!

You need to have both USB Debugging and OEM Unlocking enabled on your device – both of which are available under Developer options and something we’ve covered.

Install Android SDK Tools

  • Get the SDK tools from http://dgit.in/AndrdSDK and install them. Remember the installed directory.
  • Launch the SDK tools and uncheck everything except Android SDK Platform-tools at the top.
  • Click on Install 2 packages at the bottom right. Check Accept license and click Install.
Android customisation
Make sure you install the two packages mentioned earlier

Check compatibility

Before starting the process, make sure your desktop/laptop detects the phone correctly when connected via USB. If not, just do a quick Google search for the drivers from your manufacturer and install them.

Finally, Root it

Now, there was a time when you would have to put a Custom recovery into your device and then grant superuser privileges to root your device. But now, things are much easier with quite a few third party applications available that take care of the rooting process for you. Some of the good ones are:

  • CFRoot – Executable script in BAT file
  • Towelroot – Dedicated app via APK
  • Kingo Root – Dedicated app via APK as well as desktop app
  • Kingroot – Dedicated app via APK as well as desktop app

There is a lot of concern over these ‘1-step Rooting’ tools supposedly syphoning off data unknown to the user. Thanks to the folks over at XDA, it is pretty easy to understand which ones are safe and which ones are not.  Now let’s look at the individual tools mentioned to allay any concerns you might have about them.

Out of these, CF-Root, Towelroot and KingRoot are endorsed by the XDA admins as can be seen here: http://dgit.in/RootXDA. Given that the XDA admins are a better authority than us in the domain of rooting Android devices, we put our trust in their word. We understand that the individual developers might change things up and use advertising APIs that attempt to install bloatware or syphon off user data. This is true for any app on the App store actually.  As for Kingo Root: As you can see on the XDA forums (http://dgit.in/XDAForm) where similar concerns were addressed by the developers behind Kingo Root. They have provided a well-rounded explanation as to what all data is obtained by the app for the root process and for what reason. They even admitted that acquiring IMEI was an unnecessary process and promised to remove the same. This was back in 2013, and they lived up to that promise. Moreover, they have a Privacy Policy (https://www.kingoapp. com/privacy.htm) highlighting what all data is collected and if they sell any user data to third-parties.

Now what?

Android customisation
Root Checker is a good way to check if your phone has been successfully rooted

If you’re done with the rooting process, you’re not done entirely yet. Due to the experimental nature of this process, it is best to verify that you’ve done everything correctly and you’ve still got a fully functional device with you. Root Checker is an application that will tell you immediately if you have Superuser permissions – which is a good indicator that your device is successfully rooted. Also, a root manager like SuperSU will be really helpful to control permissions in a rooted environment.

Just in case

Now, if you aren’t exactly happy with the way your rooted device is working or needed to go back to the unrooted state for any other reason, there are ways to do that too. Once again, make sure you backup everything first. Refer to the Backup section of this article to know methods applicable to a rooted device.

Once that is done, you can use apps like SuperSU or the third party rooting app that you used for the root process in the first place (most of the apps do have an un-rooting option). The most thorough method of doing this, however, is by flashing the stock firmware back onto the device. And just as you expected, this is not exactly an easy method.

  • First, download the stock image and extract it.
  • Then follow the same steps as the rooting process up to the point of OEM Unlocking.
  • Copy boot.img and place it into ADB folder.
  • Connect your phone to your computer, open command prompt and enter these commands:
    adb reboot bootloader
    fastboot flash boot boot.img
    fastboot reboot

Pro-Tip: There are a few other methods to unroot as well, like deleting the files which grant the root in the first place or unrooting with an OTA update, but these may not work for all devices. Flashing the stock firmware is the most likely to succeed.

Did you brick it?

If the answer is yes, don’t give up hope yet. Just like there is a method for almost everything in the Android developer ecosystem, there are ways to recover your bricked phone as well, which mostly involves flashing a recovery onto your phone. Essentially, there are two types of bricks that your phone could have suffered:

  • Soft Brick – in this case, you’re most likely stuck in a boot loop or able to extract some reaction from your device. For instance, it is frozen on boot screen; gets a white or black screen of death or boots directly into Recovery mode. If you are able to go to the recovery, which is possible from boot loop and directly booting into recovery, you can still use a previously made Nandroid backup to recover your phone.
  • Hard Brick – you’re not even able to boot. Even here, you might have a software cause behind the hard brick, which is recoverable to some extent. In another case, there might be a hardware issue. For instance, an overclocked phone might have resulted in damaged internal components. In this case, it is an actual brick and it is pretty hopeless to try and recover it.

In either case, there are tools specific to the make of your phone that can help you recover from a soft as well as hard brick. For example, for the OnePlus One, this thread on the official forum specifies the tools you can use to recover it from a bricked situation. Do check XDA and the official forums for your phone to find the tools needed to recover your bricked phone.

This article was first published in the May 2017 issue of Digit magazine. To read Digit’s articles first, subscribe here or download the Digit app for Android and iOS. You could also buy Digit’s previous issues here.

Arnab Mukherjee

Arnab Mukherjee

A former tech-support desk jockey, you can find this individual delving deep into all things tech, fiction and food. Calling his sense of humour merely terrible would be a much better joke than what he usually makes.