> For the complete documentation index, see [llms.txt](https://riteshs4hu.gitbook.io/infosec-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://riteshs4hu.gitbook.io/infosec-notes/android-appsec/rooting.md).

# Rooting

**Rooting** is the process of gaining **superuser (root) access** to an Android device. It allows you to **bypass the default security restrictions** and have **full control over the operating system**, similar to an administrator on a computer.

### Advantage

* Customize \[custom ROMs]
* Performance \[remove bloatware(pre-install apps) optimize system settings]
* Battery and Hardware Optimization
* Advanced Apps: Some apps require root permissions to function fully

### Disadvantage

* Mobile Brick \[Soft Brick/Hard Brick]
* Some apps may not work correctly on rooted devices
* Open the backdoors

***

### **How Rooting Works**

Rooting an Android device typically involves **gaining superuser (root) privileges** by exploiting system vulnerabilities or modifying the system. The most common methods include:

**1. Unlocking the Bootloader & Flashing a Custom Recovery**

* Many manufacturers provide an option to **unlock the bootloader**, which is the first step toward rooting.
* Once unlocked, a **custom recovery** (like **OrangeFox and TWRP**) can be installed.
* This recovery allows users to **flash root tools** and custom software safely.

**2. Magisk (Systemless Rooting)**

* **Magisk** is one of the most popular modern rooting methods.
* It modifies the **boot image** rather than the system partition.
* Advantages of systemless rooting:
  * Preserves the **system partition**
  * Makes it easier to **pass root detection** in apps like Google Pay or banking apps
  * Supports modular additions without breaking OTA updates
