Root your android device
Tags: android11, nethunter, rooting, superuser
Published: 2024-04-13 19:21:00

## What Is Rooting?

Rooting is a process of giving the device user the superuser permissions or the privilege to access the device system files

## Why Is It Needed ? 

1. Rooting allows elevated system access. 
 
2. It enhances the engineering control over your phone.

3. You can decide what your phone can do .

4. The appearance of your device will be in your hands 
   (ultimately customisable).

5. All aspects of the operating system can be customised with 
   the only real limitation being the level of coding 
   expertise.

6. Rooting also gives you access to the device's system files.

7. It is done to remove the restrictions that the device 
   hardware manufacturer and the carriers have put on the 
   device


## How To Root An Android Device?

1. If you are running android 12 or greater there is a 
   possibility that you are prevented to unlock the OEM so 
   follow the guide to [downgrade your device.](https://dev.to/sampreeth/downgrade-your-android-device-to-android-10-o6c)

2. In order to enable developer options and OEM unlocking 
   [have a look at my other blog.](https://dev.to/sampreeth/downgrade-your-android-device-to-android-10-o6c).

3. Put your device into fastboot mode 
code : adb reboot bootloader

4. Connect your device to your pc through a usb cable and OEM  
   unlock. 
code : fastboot oem unlock

5. You should get a message that looks similar to this
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j613y94apbs0skixwks6.jpeg)

6. Press the volume down button once to select the 'yes' 
   option and then press the power button to unlock the oem.

7. To root your device you need to follow a few steps.

     7.1. Download the device firmware either from their 
       community or from [xda forums](xdaforums.com) on your 
       pc.
     
     7.2. Download [Payload Dumper](http://bit.ly/3O38nbz) and
       [Platform tools](https://bit.ly/3z9ddft) on your pc
     
     7.3. Extract and open the device firmware folder and copy 
       the payload.bin file for my oneplus device it looks 
       like this
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aynnpq0duf2ryiuyu8ho.png)
      
     7.4. Next extract the payload dumper folder and paste 
          the payload.bin file that we copied earlier in the 
          payload_input folder

   
     7.5. Run the payload dumper application(as administrator) 
      this step will take some time wait for the application 
      to close itself.
   
     7.6. In the payload_output folder copy the boot.img file 
       paste it to the suitable directory and type cmd and 
       hit enter in the text-box above.
    
     7.7. Connect your phone to the pc through a USB cable . 
   
     7.8.  Execute the following command:
code: adb push boot.img storage/self/primary/

     7.9. On your phone search for magisk in your browser and 
         download and install the latest version. Or install 
         magisk 
   code : adb install magisk-ver.apk
   
     7.10. Open the magisk application and click on install
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ojd6a3hae8345yihti79.jpg)
  
     7.11. Next click on select and patch a file then 
           navigate to the boot.img file on your phone and 
           select it.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dq066yq4zyahgq7uw59n.jpg)


     7.12. Copy the patched file to your pc.![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xa3rgx3krua3bwhmfsqi.jpg)

     7.13. Enter fastboot mode on your phone and type the 
           following in your pc

``` fastboot flash boot patchedfile.img ```

Note: Remember to replace the patchedfile.img by the file you copied to your computer.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dhhduyljfr9pww0y5oo4.jpg)
     7.14. Boot your phone by pressing the power button and 
           you are good to go.
     7.15. In order to verify if you are rooted or not , 
           install the rootchecker app and hit on verify 
           root. 

That's it folks happy rooting, dont brick your phone.