Guide to Rooting Your Android Device Using QFIL and Magisk
Disclaimer: This guide involves advanced procedures that can potentially brick your device if not performed correctly. Proceed at your own risk. This guide is based on user-submitted instructions and is provided for informational purposes only. The software versions mentioned (e.g., Magisk 26.1) may be outdated. Always use the latest stable versions available.
Prerequisites:
- Qualcomm Flash Image Loader (QFIL) tool installed on your computer.
- The correct device drivers (Qualcomm QDLoader) for your phone installed on your computer.
- ADB (Android Debug Bridge) and Fastboot tools installed and configured on your computer.
- Magisk Manager APK (download the latest stable version).
- FX File Explorer APK.
- An APK file of the application you wish to modify (in this guide, we’ll use “Your_app.apk” as a placeholder).
- A USB cable to connect your phone to your computer.
Step 1: Accessing EDL Mode and Backing Up Your Boot Partition
- Power off your phone completely.
- Press and hold both the Power and Volume Down buttons simultaneously.
- While holding the buttons, connect your phone to your computer via the USB cable. Your phone should boot into Emergency Download (EDL) mode, which will be detected by QFIL.
- Open the QFIL tool on your computer.
- Navigate to the Tools menu and select Partition Manager.
- In the Partition Manager window, locate and right-click on the
bootpartition. - Select Manage Partition Data.
- Choose the Read Data option. The tool will save a copy of your
bootpartition to your computer. The exact save location will be displayed in the status bar of the QFIL tool (e.g.,C:\Users\[Your_Username]\AppData\Roaming\...).
Step 2: Transferring the Boot Image to Your Phone
- Locate the saved
bootpartition file on your computer. - Transfer this file to your phone’s internal storage. You can do this by using ADB or simply by connecting your phone in MTP (Media Transfer Protocol) mode and copying the file.
Step 3: Rooting the Boot Image with Magisk
- Use ADB to install the Magisk Manager APK and FX File Explorer APK onto your phone:
adb install magisk-manager.apk
adb install fx-file-explorer.apk
- Open the Magisk app on your phone.
- Tap on the Install button next to “Magisk.”
- Select the “Select and Patch a File” option.
- Navigate to and select the
bootpartition file that you transferred to your phone’s internal storage. - Magisk will patch the file and save the new, rooted boot image to your phone’s
Downloadsfolder (e.g.,magisk_patched_[random_letters_and_numbers].img).
Step 4: Flashing the Rooted Boot Image
- Connect your phone to your computer and transfer the newly created, patched boot image from your phone’s
Downloadsfolder to your computer. - Re-enter EDL mode on your phone by powering it off and holding down both the Power and Volume Down buttons while plugging it into your computer.
- In the QFIL tool, go back to Tools > Partition Manager.
- Right-click on the
bootpartition and select Manage Partition Data. - Choose the Load Image option.
- A file explorer window will open. Navigate to and select the rooted boot image (
magisk_patched_...img) that you transferred to your computer. - Crucial: Ensure that the “Flat Build” option is selected in QFIL.
- Wait for the flashing process to complete.
Step 5: Installing and Using Lucky Patcher with Root Access
- Use ADB to install Lucky Patcher onto your phone:
adb install lucky-patcher.apk
- Open the Lucky Patcher app on your phone.
- Lucky Patcher should automatically request Superuser (SU) privileges. Grant them when prompted.
- In the top-right corner of the Lucky Patcher app, there should be an option to “Rebuild & Install.” Tap on it.
- Navigate to your phone’s internal storage and select the APK file of the app you want to install.