[Android Q&A, Help & Troubleshooting] ThiviG:
Root Android Devices without TWRP Recovery​

To root your device without TWRP Recovery, you need to perform two steps. Firstly, the device needs to be booted using the patched boot image file. In the next step, this boot image file will be permanently flashed using the Magisk Manager app. Don’t forget to have a look at the ‘Prerequisites’ section below, before beginning with the process. Droidwin and its members wouldn’t be held responsible in case of a thermonuclear war, your alarm doesn’t wake you up, or if anything happens to your device and data by performing the below steps.

Prerequisites​

Download and install the Magisk Manager APK file on your device: Magisk App [from version 22 onwards, it is known as Magisk App and has both the Magisk ZIP and Manager APK file bundled together].

Next up, check if your device has ramdisk or not. For that, launch the Magisk app and refer to the section under Magisk, if it says YES, then you are good to proceed ahead (see below image). On the other hand, if it says NO, then you will have to head over to our alternative guide: Install Magisk in Recovery and Root Android [No Ramdisk].

The bootloader of your device should be unlocked. Have a look at our guide on how to do so.

Enable the ‘USB Debugging’ option. Go to ‘Settings’ -> ‘About Phone -> Tap on Build Number 7 times -> Go back to Settings -> Developer Options -> Toggle on the USB Debugging’ switch.

Although rooting is going to wipe your data, still, it is recommended to make a complete backup of all your data.

Keep your device appropriately charged, at least to a minimum recommended level of 50%

Install ADB and Fastboot Tool for entering Fastboot commands.

Also, download and install the USB Drivers for your device. This helps in successfully connecting your device to the PC.

STEP 1: Get Stock Boot.img File from Stock ROM​

To begin with, you will have to extract the stock boot.img file. And as opposed to earlier times, the process is a little bit more complicated nowadays. You cannot simply extract the firmware and get the required partition files (such as vbmeta.img, system.img, boot.img, etc). The reason is that many OEMs packs the ROM’s IMG files inside an encrypted package. For example, OnePlus has these files inside payload.bin, Realme, and Oppo have their files inside the OZIP format, and so on. In that case, you may refer to our below guides to get the stock boot.img file:

Now that you have got hold of the stock boot image file, it’s time to patch it via Magisk and flash it via Fastboot Commands. We have listed the steps for both the older as well as the newer build of Magisk Manager. As far as the difference between them goes, it’s just some UI tweaks here and there, the underlying functionality remains the same. The below update is only for devices running Android 11. If your device isn’t running that version, then you may directly head on to STEP 2A/2B.

UPDATE 1 [FOR ANDROID 11 USERS ONLY]: Quite a few Android 11 users are facing issues while patching the stock boot.img file via Magisk manager. Well, I have found the fix to this issue, please refer to our detailed guide on the same: Fix Magisk patched boot.img issue while Rooting Android 11. If you wish to save a click, then here’s the explanation in short:

You have to install the Magisk Canary build instead of the stable and then change the update channel to Canary from within the app itself. Once you have done the said change, you may then proceed with the below steps to patch the stock boot image file using Magisk and flash it via Fastboot commands. [END OF UPDATE 1]

STEP 2A- Patch the Stock Boot Image File using Older Magisk​

Download the stock firmware for your device.

Extract the boot.img file from it.

Transfer it to the device’s internal storage.

Install the Magisk Manager App on your device.

Open it. Tap on the first ‘Install‘ button, next to Magisk status.

In the next menu, again chose ‘Install‘.

Now select ‘Select and Patch a File‘.

Navigate to internal storage and select the stock boot.img file that you extracted earlier.

Let Magisk do the patching process. When it’s done, copy this patched boot.img file, named as magisk_patched.img, from your device (will be present under Internal Storage > Downloads) to PC where you have installed the ADB and Fastboot Tools (inside the platform-tools folder).

How to Update Magisk ZIP and Magisk Manager (without TWRP)

Disable DM-Verity or Android Verified Boot without TWRP

Fix Magisk Module Bootloop without TWRP Recovery

How to Root Android Devices Without TWRP Recovery

STEP 2B: Patch Stock Boot Image File using Newer Magisk​

Launch the Magisk Manager app on your Pixel device.

Then tap on the Install button situated next to Magisk.

From the Method section, choose Select and Patch a file.

Browse to the extracted boot.img file and select it.

Then tap on the Let’s Go option situated at the top right.

Magisk will now load the boot.img file and will patch it accordingly. Once that is done, you would get the Download Complete message.

The patched boot image file will be saved in Internal Storage > Downloads. The name of the file will be magisk_patched.img.

Now that you have patched the stock boot.img file, it’s time to flash it onto your device and hence obtain root without TWRP. There are two different methods through which you could do this. This patched boot.img file could either be flashed via Fastboot or through Magisk. It is highly recommended that you proceed with the Fastboot Method. Only in case, if you face any issues, then you should proceed with the Magisk Method. The reason being the fact via the Magisk method, we will be using the DIrect Install feature, which seems to be absent in most devices. Hence to avoid any confusion, you should try the Fastboot Method. If you face any error, then only proceed with the Magisk method to root your Android device without TWRP.

STEP 3A- Install the Patched Boot Image using Fastboot​

Connect the device to the PC via USB Cable.

Now transfer the patched boot file from your device to the platform-tools folder on your PC.

Inside the same folder, right-click on an empty area while pressing the ‘Shift’ key.

Select the option ‘Open PowerShell window here’.

Or you could also head over to the platform-tools folder on your PC, type in CMD in the address bar, and hit Enter. This will launch the Command Prompt.

Type in the below code to make sure the device is successfully connected (an alpha-numeric code suggests successful connection):adb devices

Now type in the below code to boot your device to fastboot/bootloader mode:adb reboot bootloader

Next, type the below code to flash the patched boot image file:fastboot flash boot magisk_patched.img

If you get the fastboot: error: Couldn’t parse partition size ‘0x’ issue, as some users have mentioned in the comments, then please refer to our detailed guide: How to Fix fastboot: error: Couldn’t parse partition size ‘0x’.

For devices with an A/B partition, you need to flash the patched boot file to both partitions. Type the below code for the same:fastboot flash boot_a magisk_patched.img

fastboot flash boot_b magisk_patched.img

Now you may Reboot the device by typing the below code:fastboot reboot

If your device is rooted, then you should stop here only. However, if the Fastboot Command method didn’t work out in your case, then only proceed with the next method to install patched boot.img.

If this post is good please thumbs up.😉🙄