what is root and how to root android

Quick Links

  • What is root?
  • How to tát root a popular Android điện thoại thông minh
  • How to tát root any Android device
  • One Click Root Methods in 2023: KingRoot, Kingo Root, and others

If you can't imagine using Android without root access, you've come to tát the right place. Here, you can find root tutorials for most devices on the XDA forums. Learn how to tát root any Android device, including the best Android phones! If you don’t see your device listed, or you see a misplaced liên kết, send a message to tát the author (SkandaH on the forums) with the device details.

What is root?

For those new to tát the world of rooting, acquiring root access essentially grants you elevated permissions. With root access, you can alter or replace system applications and settings, run rẩy specialized apps that require administrator-level permissions, or perform other operations that are otherwise inaccessible to tát a normal Android user. And by proxy, you may also be able to tát access certain "hidden" device features or use existing features in new ways, e.g. via Xposed modules or Magisk modules.

Bạn đang xem: what is root and how to root android

Rooting a điện thoại thông minh may void the warranty on the device. It may also make the device unstable or completely brick the hardware if not done properly. XDA and the author does not take any responsibility for your device. Root at your own risk and only if you understand what you are doing!

We can go on about the virtues of root access ad infinitum, but we’ll stop for now because we can sense you're salivating at the prospect of root access and what you can bởi with your device once root is achieved. Head to tát the following section to tát begin the journey. You should find device-specific root guides for the latest flagship models from every major OEM below.

Asus

For other Hãng Asus devices, kindly kiểm tra out the Hãng Asus section of our forums. You should be able to tát find similar fine-tuned guides for your device under the device sub-forums. You can also follow the generic rooting guide from this tutorial.

Fairphone

Sr. No.

Device

Codename and device forum

Root guide

1.

Fairphone 4

fp4

Click here

For other Fairphone devices, kindly kiểm tra out the Fairphone section of our forums. You should be able to tát find similar fine-tuned guides for your device under the device sub-forums. You can also follow the generic rooting guide from this tutorial.

F(x)tec

Sr. No.

Device

Codename and device forum

Root guide

1.

F(x)tec Pro1-X

pro1x

Click here

For other F(x)tec devices, kindly kiểm tra out the F(x)tec section of our forums. You should be able to tát find similar fine-tuned guides for your device under the device sub-forums. You can also follow the generic rooting guide from this tutorial.

Google

For other Google devices, kindly kiểm tra out the Google section of our forums. You should be able to tát find similar fine-tuned guides for your device under the device sub-forums. You can also follow the generic rooting guide from this tutorial.

LG

For other LG devices, kindly kiểm tra out the LG section of our forums. You should be able to tát find similar fine-tuned guides for your device under the device sub-forums. You can also follow the generic rooting guide from this tutorial.

Microsoft

For other Microsoft Surface devices, kindly kiểm tra out the Microsoft section of our forums. You should be able to tát find similar fine-tuned guides for your device under the device sub-forums. You can also follow the generic rooting guide from this tutorial.

Motorola

For other Motorola devices, kindly kiểm tra out the Motorola section of our forums. You should be able to tát find similar fine-tuned guides for your device under the device sub-forums. You can also follow the generic rooting guide from this tutorial.

Nokia

For other Hãng Nokia devices, kindly kiểm tra out the Hãng Nokia section of our forums. You should be able to tát find similar fine-tuned guides for your device under the device sub-forums. You can also follow the generic rooting guide from this tutorial.

Nothing

You can also follow the generic rooting guide from this tutorial.

Nvidia

Sr. No.

Device

Codename and device forum

Root guide

1.

Nvidia Shield TV & Shield TV Pro 2019

Xem thêm: lịch thi tuyển sinh lớp 10 năm 2023 2024

mdarcy

Click here

For other Nvidia devices, kindly kiểm tra out the Nvidia section of our forums. You should be able to tát find similar fine-tuned guides for your device under the device sub-forums. You can also follow the generic rooting guide from this tutorial.

OnePlus

For other OnePlus devices, kindly kiểm tra out the OnePlus section of our forums. You should be able to tát find similar fine-tuned guides for your device under the device sub-forums. You can also follow the generic rooting guide from this tutorial.

Realme

For other Realme devices, kindly kiểm tra out the Realme section of our forums. You should be able to tát find similar fine-tuned guides for your device under the device sub-forums. You can also follow the generic rooting guide from this tutorial.

Samsung

For other Samsung devices, kiểm tra out the Samsung section of our forums. You should be able to tát find similar fine-tuned guides for your device under the device sub-forums. You can also follow the generic rooting guide from this tutorial.

Sony

For other Sony Xperia devices, kindly kiểm tra out the Sony section of our forums. You should be able to tát find similar fine-tuned guides for your device under the device sub-forums. You can also follow the generic rooting guide from this tutorial.

Xiaomi

For other Mi, Redmi, and Poco branded devices, kindly kiểm tra out the Xiaomi MI section of our forums. You should be able to tát find similar fine-tuned guides for your device under the device sub-forums. You can also follow the generic rooting guide from this tutorial.

How to tát root any Android device

Nowadays, Magisk is the de-facto rooting solution that lets you have root access by leaving the system partition untouched and modifying the boot partition. This is why it’s referred to tát as a “systemless” root method.

Before getting started with Magisk, make sure that:

  • You have access to tát a PC/Mac with ADB and Fastboot installed.
    • In case you're running Windows, make sure to tát install the latest OEM USB drivers for your device.
  • The bootloader of the target Android device is unlocked.
    • For Samsung devices, unlocking the bootloader will trip the Knox warranty bit. There is no way to tát revert it other kêu ca installing a new motherboard. You'll also lose access to tát OTA and a number of software features on an unlocked bootloader.

Step 1: Identifying the type of the boot image

Download the latest version of the Magisk tiện ích from the project’s GitHub repository. Since the APK of Magisk is hosted outside the Google Play Store, you may need to tát allow sideloading apps from unknown sources first and then manually install the downloaded package.

After installing, open the Magisk tiện ích. You should see a screen lượt thích this:

Magisk main tiện ích window

Now, we need to tát note down the values of the following parameters:

  1. Ramdisk
  2. A/B
  3. SAR

Step 2: Locating the boot image

To patch the boot image for your device, you need to tát extract it from the official firmware packages. In case you're using a custom ROM lượt thích LineageOS, then the flashable ZIP tệp tin contains the boot image.

Case 1: You have access to tát the recovery-flashable ZIP file

If you have a device that still uses the A-only partition scheme, then you can find the boot.img right inside the recovery-flashable ZIP tệp tin. Just extract it using a suitable archiver program.

POCO M3 boot.img inside recovery ZIP

However, if your device utilizes the A/B partition scheme, then the boot image and other partition images are further packed inside a tệp tin named payload.bin as shown below.

Google Pixel 5 payload.bin inside recovery ZIP

In that case, you have to tát extract the payload.bin tệp tin first, then use one of the community-developed payload.bin unpackers to tát get the boot.img out of it. We strongly suggest you opt for the extractor written in Go, as it is cross-platform and has been actively developed.

Known as "payload-dumper-go," this fork even allows end-users to tát extract a single partition image without unpacking the whole payload.bin, which is particularly useful for this usage scenario.

  1. First, use the -l parameter to tát list the partition images inside the payload.bin.
     payload-dumper-go -l payload.bin 
  2. Then use the -p parameter with the name of the boot image (commonly stored as "boot") to tát extract it.
     payload-dumper-go -p boot payload.bin 
ASUS ROG Phone 5 boot.img from payload.bin

Case 2: You have access to tát the Fastboot-flashable image

A handful of OEMs lượt thích Google and Xiaomi MI provide Fastboot-flashable factory images for their devices. If you managed to tát grab such a package, then the raw boot.img can easily be extracted from the archive.

Google Pixel 5 boot.img from Fastboot package

Special Case: Samsung

Samsung Galaxy devices don't use a traditional Fastboot interface; hence their factory images are packed differently.

  1. Download the factory image for your model. To know more, take a look at our Samsung Galaxy device manual update tutorial.
  2. Unzip the decrypted package and locate the AP tar tệp tin on your device. It is normally named AP_[device_model_sw_ver].tar.md5.

Step 3: Patching the boot image

Now that we have the boot image in hand, we should proceed with the patching part.

Case 1: The value of the "Ramdisk" parameter is "Yes"

  1. Copy the boot image to tát your device. In fact, you can patch it on a different Android device kêu ca the target one, but you need to tát install the Magisk tiện ích on the secondary device as well.
  2. Press the Install button in the Magisk thẻ.
  3. Choose Select and Patch a File in Method, and select the stock boot image.
    Magisk select and patch image
  4. The Magisk tiện ích will patch the image to tát [Internal Storage]/Download/magisk_patched_[random_strings].img.
  5. Magisk is patching a boot image
    Copy the patched image to tát your PC with ADB:
     adb pull /sdcard/Download/magisk_patched_[random_strings].img 
  6. Flash the patched boot image to tát your device. For most devices, reboot into Fastboot mode and flash with the following command:
     fastboot flash boot /path/to/magisk_patched.img 
  7. Reboot and enjoy root access!

Keep in mind that it is possible to tát patch the boot image on the fly on legacy devices having boot ramdisk through a custom recovery lượt thích TWRP, but the method is no longer recommended on modern devices. Having said that, if you have an old phone and want to tát stick with the custom recovery route, the steps are as follows:

  1. Download the Magisk APK.
  2. Rename the .APK tệp tin extension to tát .ZIP (e.g. Magisk-vx.y.APK → Magisk-vx.y.ZIP).
  3. Flash the ZIP tệp tin just lượt thích any other ordinary flashable ZIP.
    • Note that the sepolicy.rule tệp tin of modules may be stored in the cache partition, so sánh don't clear it.
      Magisk flashing via TWRP
  4. Check whether the Magisk tiện ích is installed. If it isn’t installed automatically, manually install the APK.

Case 2: The value of the "Ramdisk" parameter is "No"

In this case, you need to tát locate the recovery.img tệp tin from the factory image of your device instead of boot.img tệp tin. This is because Magisk needs to tát be installed in the recovery partition, which means you will have to tát reboot to tát the recovery mode every time you want root access.

  1. Copy the recovery image to tát your device (or a secondary device with the Magisk tiện ích installed).
  2. Press the Install button on the Magisk thẻ.
  3. Choose Select and Patch a File in Method, and select the stock recovery image.
  4. The Magisk tiện ích will patch the image to tát [Internal Storage]/Download/magisk_patched_[random_strings].img.
  5. Copy the patched image to tát your PC with ADB:
     adb pull /sdcard/Download/magisk_patched_[random_strings].img 
  6. Flash the patched recovery image to tát your device. For most devices, reboot into Fastboot mode and flash with the following command:
     fastboot flash recovery /path/to/magisk_patched.img 
  7. Reboot.

At this stage, there are three possible scenarios:

  • Power up normally: You'll kết thúc up with no Magisk, i.e. no root access.
  • Recovery Key Combo → Splash screen → Release all buttons: The system should boot with Magisk and full root access.
  • Recovery Key Combo → Splash screen → Keep pressing volume up: To access the stock recovery mode.

Special Case: Samsung

  1. Copy the extracted AP tar tệp tin to tát your device.
  2. Press the Install button on the Magisk thẻ.
  3. If your device doesn't have boot ramdisk, make sure Recovery Mode is checked in the options.
  4. Choose Select and Patch a File in Method, and select the AP tar tệp tin.
  5. The Magisk tiện ích will patch the whole firmware tệp tin to tát [Internal Storage]/Download/magisk_patched_[random_strings].tar
  6. Copy the patched tar tệp tin to tát your PC with ADB:
     adb pull /sdcard/Download/magisk_patched_[random_strings].tar 
    • Don't try to tát copy over the MTP interface, as it is known to tát corrupt large files.
  7. Reboot to tát tải về mode. Open Odin on your PC, and flash magisk_patched.tar as AP, together with BL, CP, and CSC from the original firmware.
    • Don't choose HOME_CSC, because we want to tát wipe data.
  8. Your device should reboot automatically once Odin finished flashing. Agree to tát bởi a factory reset if asked.
  9. If your device doesn't have boot ramdisk, reboot to tát recovery now to tát enable Magisk.
  10. Install the latest Magisk tiện ích and launch the tiện ích. It should show a dialog asking for additional setup. Let it bởi its job, and the tiện ích will automatically reboot your device.
  11. Reboot and enjoy root access!

Step 4: Verification

The last step is to tát verify that everything is working properly. Locate the newly installed Magisk tiện ích and open it. We want to tát see a version number beside the "Installed" parameter. This means you have successfully obtained root. Great job!

Xem thêm: công dụng của hoa đu đủ đực

A successful installation of Magisk

One Click Root Methods in 2023: KingRoot, Kingo Root, and others

A few years back, several generic root methods lượt thích KingRoot, Kingo Root, and others gained popularity as "one-click root" methods that promised root and related benefits with minimal steps and knowledge. However, as Android has matured, these one-click root methods are no longer valid for modern smartphones and Android devices in 2023.

We strongly dissuade the use of these generic root methods since they're either ineffective or, worse, pack in malware that can greatly compromise your device. Practically all of these methods are no longer recommended and were made possible by exploiting security vulnerabilities. You should follow the steps listed above for an effective root solution for most Android devices.

Final thoughts

We hope this guide not only points you to tát the right threads for rooting your device but also provides general rooting instructions that can be applied for a large majority of Android devices generally. We'll be updating this tutorial with links to tát further guides for specific phones, so sánh kiểm tra back again in the future. Also, make sure to tát kiểm tra out some more of our Android-focused guides, including the best apps for rooted Android devices and how to tát back up and restore data on Android.