DEV Community

Sampreeth Nataraj
Sampreeth Nataraj

Posted on

Root your android device

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.

  2. In order to enable developer options and OEM unlocking
    have a look at my other blog..

  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

  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 on your
    pc.

    7.2. Download Payload Dumper and
    Platform tools 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

    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

    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

    7.12. Copy the patched file to your pc.Image description

    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
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.

Top comments (1)

Collapse
 
pnatraj profile image
Nataraj

this was the most interesting part where we could recover using msmtool that was a brick saver