Introduction
If you are familiar with the world of Android, you may have already heard the term ‘rooting’. On the other end of the spectrum, the equivalence of this in iOS-based devices is called ‘Jailbreaking’. Rooting an Android in 2018 is fairly an easy task. What it basically does is giving the user the required permissions to gain full access to the smartphone. You might have the question, “Can’t we do that now?”. The answer is a yes and no. Compared to a device that is running on iOS, a device that runs Android has the flexibility to customize most of it. But, still it is not fully customizable and there are many restrictions and limitations within an unrooted device.
(Image source: Quora)
Advantages and Disadvantages of Rooting
Android is running on top of a Linux kernel similar to the one that your Linux based PC is running. Similar to a superuser in a Linux PC, Root is its equivalent for Android. Root is also a user. The main difference between the root and a normal user is that the root has the full privileges to access and do anything within the system. The advantages of rooting smartphones are a bit limited in 2018 compared to the same few years ago. Nowadays, most of the Android-powered devices have better specifications and equipped with many functions and features. But, earlier most of the Android smartphones lacked basic functions (now we take them for granted) like the ability to use the flash as a torch. Still, in 2018 there are many advantages to rooting. One very obvious reason for rooting is to remove the bloatware (the unnecessary software that was pre-installed by the manufacturer). A few other advantages will be described in a future blog post. One of the disadvantages of rooting your smartphone is that it might void your warranty (in most devices, there are exceptions like OnePlus devices). In the worst case scenario, there is a possibility that you may brick your expensive Android. A bricked device means there is nothing you can do to turn it on and it’s useless as a smartphone and can be useful as a mere paperweight.
How to root?
In theory, rooting an Android adds a standard Linux function which was removed from it (Due to security reasons and liability issues for the manufacturers). A file called ‘su’ (which stands for Switch User) is placed in the system and then making it accessible for the user is how it is done. Placing the ‘su’ file in /system/xbin/ and giving the user the ownership to the ‘/system/xbin/su’ will do the trick (when adb root is enabled).
In practice, there are a couple of ways to root your smartphone. Before rooting your Android, you need to have the Android SDK installed on your PC. Fastboot is a protocol that is used to re-flash partitions in a device. It is a tool that comes with the Android SDK and it is an alternative to recovery mode found in a smartphone. Installing the entire Android SDK for a simple task like this is a waste of time and resources. As a solution, software that contain only the necessary ADB (this is a versatile command-line tool that lets you communicate with a device) and Fastboot parts are available.
According to Google, there are about 18 000 different types of Android devices. Rooting mechanism of those devices are also different from each other. From here onwards, I’ll mainly focus on the steps that I followed to root my OnePlus 5T device and try to generalize the procedure. First of all, few definitions have to be clarified in case if someone is not familiar with the terminology. A bootloader is a program that loads an Operating System (OS) when a computer (the smartphone) is turned on. The meaning of flashing a ROM stands for installing a system image into a device’s internal flash memory
Three main steps can be identified in the rooting process. Note that, these procedures should be followed in a sequential order.
- Unlocking the Bootloader – This is like opening the gates to the smartphone’s internal memory to be written on to. This will allow you to flash images onto the main partition of the device. There are different ways of doing this and the way of doing it differs with the OEM (Original Equipment Manufacturer. Example for OEMs: Samsung, Sony, etc.). Doing this step will most probably void the warranty. As an example, in order to unlock the bootloader in my previous Sony device I had to obtain an unlock code from Sony, and unlocking the bootloader voided my warranty.
- Installing a Custom Recovery – The custom recovery will replace the stock recovery that existed by default. This will be flashed on to the recovery partition of the device. This will give you the ability to perform wipes, install custom ROMs (flashable Zips), create full backups (Nandroid backup), etc. Step 1 is a prerequisite in order to do this step. Most popular custom recoveries are ClockworkMod (CWM) and Team Win Recovery Project (TWRP).
(Image Source: https://oneplus.gadgethacks.com)
- Gaining Root Access – There are a few ways of doing this. One popular method is to flash a pre-rooted custom ROM via recovery. Some example ROMs are Resurrection Remix and LineageOS (LOS) ROMs which are both pre-rooted custom ROMs. Another method is flashing a zip that contains the SuperSU binaries. Recently, flashing a Magsik Zip for a system-less root is also becoming popular. (I followed this mechanisms to root my OnePlus 5T. In a system-less root modifications are done in the boot image {bootloader} to provide root privileges.). But, for all those methods following the step 2 is a must.
When it comes to rooting your Android; using a commercially available rooting app like Kingo Root and One Click Root is the easiest way to go. However, there are reasonable doubts that these applications could contain malware. I personally have used Kingo Root and all you need to do is connect the phone to a PC click a button and wait till it succeeds. If the required drivers are not found within your PC, these applications are even capable enough to download and install them for you. Kingo Root can even be used without a computer. As it is already mentioned earlier, there are so many different types of Android devices and these apps can’t root each and every smartphone.
Confirming the root
(Image Source: https://oneplus.gadgethacks.com)
After rooting your device successfully, an application like Root Checker can be used to determine whether your device is rooted or not.
Sources:
https://www.androidcentral.com/root
https://forum.xda-developers.com/oneplus-5t/how-to/oneplus-5t-unlock-bootloader-flash-twrp-t3704592
Featured Image: https://www.videezy.com/free-video/jail