Sitemap

Complete Guide to Android Rooting: Everything You Need to Know

11 min readOct 7, 2023

--

If you’re just a regular smartphone user, you’re in for a surprise! Your phone can do way more than you might think. Imagine giving it superpowers like customizing your home screen, blocking annoying ads, and backing up your apps completely. All this magic happens when you “root” your phone; we’re here to show you how. Get ready to explore the fantastic things your smartphone can do once unleashed!

Photo by Guido Coppa on Unsplash

WHAT IS ROOTING?

Rooting is the process by which users of Android devices can attain privileged control (known as root access) over various subsystems of the device, usually smartphones.

Because Android is based on a modified version of the Linux kernel, rooting an Android device gives similar access to administrative (superuser) permissions as on Linux or any other Unix-like operating system such as FreeBSD or macOS.

HOW ROOTING WORKS

Rooting exploits vulnerabilities in the Android operating system to gain superuser access. Here’s a simplified explanation:

When you root your Android device, you’re removing the limitations imposed by the manufacturer and Android’s security mechanisms. Android is based on the Linux kernel, and like any Linux-based system, it has a root user with elevated privileges. This root user is locked by default, and regular users (apps and users) have limited permissions.

Rooting involves finding a way to unlock the root user’s permissions, giving you complete control over the system. This often requires exploiting security vulnerabilities in the Android OS. Once those vulnerabilities are exploited, root access is granted, allowing you to modify system files, install custom software, and make deep-level changes to the device.

In the past, SuperSU was mainly used to root Android devices. Developed by Chainfire, it was once the hallmark of Android rooting. It allowed users to grant or deny superuser permissions to apps, giving them complete control over their devices. The straightforward interface and reliable performance made it a favorite among Android modders and tinkerers.

In recent times, Magisk has been used for the same purpose. While SuperSU had a good run, the Android ecosystem continued to evolve. With each Android version release, new security mechanisms were implemented, and SuperSU struggled to keep up. This is where Magisk by developer Topjohnwu entered the scene.

Magisk takes a different approach to rooting. Instead of modifying the system partition directly, it creates a systemless interface. This systemless approach sets Magisk apart from SuperSU and is one of the reasons for its widespread popularity. Magisk offers several compelling advantages over SuperSU, including:

  1. Systemless Root: Magisk doesn’t alter the system partition, making it more resistant to system updates and SafetyNet checks.
  2. Magisk Modules: Users can easily install “Magisk Modules” to add features, tweaks, and mods to their rooted devices.
  3. Hide Root: Magisk Hide feature allows users to hide root from specific apps, including those that perform SafetyNet checks.
  4. Open Source: Magisk is open-source, fostering community development and constant improvements.

Recently, a new tool has emerged — KernelSU, which promises better root hiding than Magisk so users can use their devices seamlessly while enjoying the benefits of root.

There are numerous devices; therefore, different methods to root Android devices exist. We won’t be able to cover all in this article. We’ll only talk about the most common way.

  1. First, we have to enable developer options on our devices. This is done by going to the About device option in Android settings and tapping the build number several times. This will display the hidden developer option setting. Caution should be made when doing this, as this option is only for people who know what they’re doing.
Click on the About phone option in the settings
Tap on the build number a couple of times
Now click on developer options.

2. Next, we must turn on USB debugging through ADB (Android Debug Bridge). This enables an interface that allows our computer to talk to our device. Another option that needs to be turned on is OEM unlocking. This allows the bootloader to be opened.

Turn on USB debugging.

3. Now, we must plug our USB cord into our computer and connect it to our phone. This starts a connection between both devices.

A pop-up prompts us to give our computer permission to access our device.

Permit your computer to access our device.
# This is the command to start the adb server:
adb start-server

# Command to check to online adb devices:
adb devices

4. Also, we need to turn on the OEM unlock option.

5. To ensure a successful connection, we need the bootloader drivers for our operating system.

6. The next step is to switch off the device and boot into bootloader mode.

adb reboot bootloader

The bootloader is a fundamental piece of software that plays a crucial role in the startup process of an Android device. It is the first piece of software that runs when an Android device is powered on.

It initializes the hardware components and starts loading the Android operating system. It ensures device integrity by checking if the hardware and software are in a trusted state before it continues the boot progress. If anything is amiss, it prevents the device from booting, thereby ensuring security.

We will be unlocking the bootloader to bypass these restrictions to complete control over our device.

7. In the bootloader mode with our phone connected, let’s type these commands:

# try this to unlock the bootloader (for older devices):
fastboot flashing unlock

# if the above doesn't work, try this:
fastboot oem unlock

It is possible that these commands didn’t work. Don’t fret, as it is now common for OEMs (original equipment manufacturers) to not allow this type of method. Companies like Xiaomi, Oppo, and Samsung have specific unlock tools.

8. We’ve now done the first part. To root our phone, we have two options:

  • Through ADB sideload
  • Through a custom recovery

THROUGH ADB SIDELOAD

We’re going to use Magisk to root our phone. It is the most stable rooting tool out there. It can be downloaded here. The apk file downloaded has to be renamed into a zip file, as Magisk can only be flashed in zip format in recovery.

ADB sideload is a powerful and versatile feature that Android developers and enthusiasts often use to interact with Android devices uniquely. It allows us to install packages to our device when turned on or in recovery mode. Unlike traditional installation methods, sideloading doesn’t require direct access to the device’s storage or user interaction on the device itself. It just takes advantage of the ADB protocol.

We need to put our phone in recovery mode to use the sideload method. We can do this on most phones by holding the power button and the Volume Down-Up key for a few moments. By navigating the recovery mode with the volume keys, select advanced options, then go to ADB sideload.

# Use this command to sideload Magisk 
adb sideload [filename].zip

We can see the progress bar on the screen. When it is done, we can restart our phone. Congratulations, our phone is now rooted!

THROUGH CUSTOM RECOVERY

A custom recovery is a specialized software environment installed on an Android device that provides advanced features and capabilities beyond stock recovery.

It is mainly used to flash custom ROMs, Install ZIP files (such as the one we’ll use to root our phone), take Nandroid backups, wipe partitions, and perform advanced system maintenance. Many custom recoveries exist that are made by various groups. The most popular ones are TWRP and OFox. To root our phone with a custom recovery, we need to install it first:

  1. Boot into the bootloader mode, as mentioned above. Power button + Volume down can also be used.
  2. Get the custom recovery image. This can be obtained from the website of the custom recovery.
  3. Flash the custom recovery (connect your phone to the computer).
# for older devices: 
fastboot flash [filename].zip

# for devices with A/B partitions:
fastboot boot [filename].zip

Well done! We’ve installed a custom recovery on your device.

Now to root our device:

  • Boot into recovery mode and click Install on the screen
  • Now, navigate to the Magisk zip you downloaded and click on it. The installation will begin
  • Now reboot your device

Congratulations on rooting your device.

CUSTOM EVERYTHING

Android is open-source. This means that different people can modify various components of the OS to suit their tastes. This openness has led to a wide array of customized Android components. Kernels, ROMs, recoveries, and much more have been developed to enhance the Android experience beyond what stock Android offers. In the Android world, “custom” isn’t just a word; it’s an ethos that empowers users to mold their devices to match their unique preferences.

Custom Kernels: Enhancing Performance and Battery Life

Often considered the heart of an Android device, it governs core functions, including CPU management, power usage, and hardware interactions. Custom kernels take this further by allowing users to fine-tune these aspects:

  • Performance Tweaks: Custom kernels can optimize CPU frequencies, manage thermal thresholds, and enable overclocking or underclocking, resulting in improved performance or better battery life, depending on user preferences.
  • Governors and Schedulers: Users can switch between different governors and schedulers to control how the CPU behaves, prioritizing performance, power efficiency, or balancing the two.

Custom ROMs: Tailoring the Android Experience

Custom ROMs are custom-built versions of the Android operating system. They offer many features and customizations beyond what’s available in the stock Android experience.

  • Features Galore: Custom ROMs can introduce features like system-wide theming, enhanced privacy controls, gesture navigation, and more, allowing users to personalize their devices extensively.
  • Frequent Updates: Custom ROM communities often provide regular updates and support for older devices, ensuring users can enjoy the latest Android features long after official support.

Custom Recoveries: Your Device’s Safe Haven

Custom recoveries like TWRP (Team Win Recovery Project) or OFox (Orange Fox Recovery) are indispensable tools for Android enthusiasts.

  • Nandroid Backups: These recoveries enable the creation of Nandroid backups, complete snapshots of the device’s system, apps, and data. This feature is a lifesaver when trying out new ROMs or mods.
  • ZIP Installation: Custom recoveries make it effortless to flash ZIP files containing mods, updates, or additional software, expanding the device’s capabilities.

Custom Apps and Modules: Fine-Tuning Android

Beyond the core components, custom apps, modules, and tweaks allow users to personalize their Android experience further.

  • Xposed Framework: This framework facilitates the installation of modules that can modify the behavior of the Android system and individual apps. You can find out more here.
  • Custom Launchers and Widgets: Users can choose from many third-party launchers and widgets to revamp their home screens and app drawers.

This comprehensive ecosystem of customizations sets Android apart, allowing users to make their devices their own. It’s a testament to the creativity and innovation in the Android community. So, whether you’re a performance enthusiast, a design lover, or simply looking for ways to make your device stand out, Android’s open-source nature and customizability make it possible. Dive in, explore, and unleash the full potential of your Android device.

A lot of things need to be clarified about rooting Android devices. Let’s look at the pros and cons to compare:

Advantages of Rooting:

Rooting can significantly enhance your Android experience by unlocking various benefits, including but not limited to:

  1. Customization: Rooting allows for extensive device customization, from installing custom ROMs and themes to tweaking system settings for a personalized experience.
  2. Performance Optimization: Users can optimize their device’s performance by removing bloatware, adjusting CPU settings, and improving memory management.
  3. Access to Root-Only Apps: Some powerful apps and utilities are only accessible on rooted devices, providing enhanced functionality and control.
  4. Full Data Backups: With root access, you can create complete system backups (Nandroid backups), ensuring you can restore your device to a previous state if something goes wrong.
  5. Ad-blocking: Utilizing the power of root, you can forget ads exist on the internet. By modifying our hosts file, we can block every kind of ad.

Disadvantages of Rooting:

Rooting is not without its risks and drawbacks, including:

  1. Voiding Warranty: Rooting may void your device’s warranty, as it involves making modifications outside the manufacturer’s specifications.
  2. Security Risks: Rooting can expose our device to security risks, as it grants superuser access, which can be exploited by malicious apps or actions if not managed carefully.
  3. Software Instabilities: Incorrect or poorly developed mods, ROMs, or kernels can lead to software instabilities, crashes, or boot loops.
  4. Bricking: In rare cases, improper root procedures or flashing incompatible files can render your device unusable, referred to as “bricking.”

Safety Precautions for Rooting:

To minimize the risks associated with rooting and protect your device:

  1. Research: Educate yourself about the rooting process for your specific device model. Consult online forums, guides, and reputable sources for information and instructions.
  2. Backup: Always create backups of your data before rooting. Nandroid backups are handy for complete system restoration.
  3. Use Reputable Tools: Utilize well-established rooting tools and custom recoveries like Magisk and TWRP, known for their reliability and safety.
  4. Avoid Pirated Apps: Only install apps and mods from trusted sources, as pirated or modified apps can pose security risks.
  5. Stay Informed: Keep your device and mods up-to-date, and stay informed about security updates and developments in the Android rooting community.
  6. Understand the Risks: Be aware of the potential consequences of rooting, including warranty voidance and security vulnerabilities.

CONCLUSION

In conclusion, rooting can offer significant advantages but also carries potential risks. By taking proper precautions, doing thorough research, and staying informed, users can maximize the benefits of root access while minimizing the chances of damaging their phones or compromising their security.

In a world where Android devices can do much more than meets the eye, rooting opens the door to limitless possibilities. It’s a journey that grants you superpowers over your device, enabling you to customize, optimize, and experiment like never before. But with great power comes great responsibility.

Rooting carries risks, from voided warranties to security vulnerabilities. So, before you embark on this adventure, arm yourself with knowledge, take precautions, and tread carefully. When done right, rooting can transform your smartphone into a personalized masterpiece, a device that truly reflects your unique style and needs.

Now, it’s your turn! Take the first step on this exciting journey and unlock the full potential of your Android device. Dive into the world of rooting, discover custom ROMs, kernels, and recoveries, and make your device truly yours. Don’t be afraid to explore, but always stay informed and cautious. Your smartphone will become more powerful and versatile than you ever imagined. Happy rooting!

Part 2 of this article will discuss specific methods to root various OEM devices like Samsung, Xiaomi, etc.

See you soon 😃

--

--

Ameen Shokoya
Ameen Shokoya

Written by Ameen Shokoya

App developer and IT professional. Loves computers. Skilled in technical support and currently building Android apps with Jetpack Compose.

Responses (2)