In this guide, we will show you the steps to root your LineageOS 20 ROM based on Android 13 via Magisk. If there’s one tweak that is forever here to stay, then it ought to be the customized firmware. With Samsung’s One UI packing in tons of unnecessary features, OnePlus incorporating elements of bloated ColorOS, and Xiaomi, well the name is enough, all these users generally prefer to get their hands on their device, even before it reaches the EOL stage.
And out of the plethora of custom ROMs to choose from, LineageOS is without a shadow of a doubt the best player in town. Maintaining an equilibrium between features and overall device stability, there’s not much to ask for. However, some users are of the opinion that it doesn’t have much to offer in terms of tweaks and modifications. If you are also having the same opinion, then your best course of action is to root your LineageOS 20 ROM based on Android 13 via Magisk. And in this guide, we will show you how to do just that. Follow along.
Table of Contents
How to Root LineageOS ROM via Magisk Boot.img
The below instructions are listed under separate sections for ease of understanding. Make sure to follow in the exact same sequence as mentioned. 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.
Method 1: Root LineageOS via LineageOS Recovery
If your LineageOS ROM comes with a built-in LineageOS Recovery, then this should be your go-to method to root the ROM via Magisk. So proceed ahead with the below steps to give it a try right away.
STEP 1: Install Android SDK
First and foremost, you will have to install the Android SDK Platform Tools on your PC. This is the official ADB and Fastboot binary provided by Google and is the only recommended one. So download it and then extract it to any convenient location on your PC. Doing so will give you the platform tools folder, which will be used throughout this guide.
STEP 2: Enable USB Debugging
Next up, you will have to enable USB Debugging so as to make your device recognizable by the PC in ADB mode. So head over to Settings > About Phone > Tap on Build Number 7 times > Go back to Settings > System > Advanced > Developer Options > Enable USB Debugging.
STEP 3: Download Magisk
- Download the latest Magisk APK and transfer it to your device as well as the platform-tools folder.
- Then rename the Magisk.apk inside the platform-tools folder to Magisk.zip.
STEP 4: Boot to LineageOS Recovery
- Connect your device to the PC via a USB cable. Make sure USB Debugging is enabled.
- Then head over to the platform-tools folder, type in CMD in the address bar, and hit Enter. This will launch the Command Prompt.
- After that, type in the following command in the CMD window to boot your device to Pixel Experience Recovery
adb reboot recovery
STEP 5: Sideload Magisk via LineageOS Recovery
- From Recovery, go to Apply Update > Apply from ADB.
- Then type in the below command in the CMD window to sideload the Magisk ZIP
adb sideload Magisk.zip
- Wait for the process to complete.
- Once done, select Reboot System now.
STEP 6: Install Magisk
- Even though you have flashed Magisk ZIP via sideload, it might still not be available in the app drawer.
- So go ahead and install the Magisk APK file that you have transferred in STEP 3. Once installed, launch it.
- As of now, Magisk will show NA next to Installed. So restart your device once again. Once it boots up, launch Magisk again.
- It will now ask to complete additional setup, tap OK. Your device will now automatically reboot.
- Once it boots up, the Magisk will be successfully installed and your device stands rooted via Magisk.
That’s it. These were the steps to root the LineageOS ROM via Magisk using LineageOS Recovery. If you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest.
Method 2: Root LineageOS ROM using Payload.bin
If your LineageOS ROM didn’t come with a built-inLineageOS Recovery, then you will have to take the traditional route of flashing the Magisk patched boot.img to root your device. So proceed with the below steps to root the ROM using the patched boot method.
STEP 1: Install Android SDK
First and foremost, you will have to install the Android SDK Platform Tools on your PC. This is the official ADB and Fastboot binary provided by Google and is the only recommended one. So download it and then extract it to any convenient location on your PC. Doing so will give you the platform tools folder, which will be used throughout this guide.
STEP 2: Download LineageOS ROM
First and foremost, you will have to download the LineageOS ROM. It should correspond to your device and region and should also have the same version that is currently installed on your device. Once you have downloaded the ROM, it will be in a ZIP format.
Extract it to any convenient location on your PC. Doing so will give you around 4-5 files, including the most important payload.bin. We will now use this file to proceed ahead.
STEP 3: Extract LineageOS Payload.bin File
Just by simply extracting the ROM, you wouldn’t get the partition files (such as system.img, vendor.img, boot.img, etc). All these files are packed inside the payload.bin file, so you need to extract that.
For that, please refer to our detailed guide on How to Extract payload.bin and get the stock boot image file. Once you do so, you shall get a few partition files in the Output folder. The boot.img file is all that is needed to root the LineageOS ROM using Magisk.
STEP 4: Patch LineageOS ROM Stock Boot Image via Magisk
- To begin with, transfer the LineageOS boot.img file (that you had just extracted) to your device.
- Then download and install the Magisk App onto your device.
- Launch it and 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.
STEP 5: Boot Device to Fastboot Mode
- Connect your device to the PC via USB cable. Make sure USB Debugging is enabled.
- Then head over to the platform-tools folder, type in CMD in the address bar, and hit Enter. This will launch the Command Prompt.
- Type in the following command in the CMD window to boot your device to Fastboot Mode
adb reboot bootloader
STEP 6: Flash LineageOS Magisk Patched Boot.img via Fastboot
- First off, transfer the magisk_patched.img file from your device to the platform-tools folder on your PC.
- Then head over to this folder’s address bar, type in CMD, and hit Enter. This will launch the Command Prompt.
- Type in the below command in this CMD window to flash the patched boot.img file:
fastboot flash boot magisk_patched.img
- Once done, you may now reboot the device to the OS via the following command:
fastboot reboot
That’s it. Launch the Magisk App and you may now verify that the device is indeed rooted. So on that note, we conclude the guide on how to root the LineageOS ROM using Magisk patched boot.img but without using TWRP Recovery. If you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest.
How to Pass SafetyNet on Rooted LineageOS ROM
Right out of the box, LineageOS does not pass the Play Integrity Test. As a result of which, you will not be able to use any banking and payment apps on your device. Fortunately, we have got you covered! Just refer to the below guide and choose the desired method of your choice to pass this test right away:
online translate
Great guide! I was able to successfully root my device using the steps outlined in this video. Thanks for sharing!
Victor
Thank you friend
Don
Hi @SADIQUE HASSAN could i use my stock boot.img already patched with magisk??
at the moment i’m using it to run my rooted stock rom but i want to change to lineageOS 17.1 android 10
mll
Hi, when you said “fastboot flash boot magisk_patched.img”, the command failed for me.
Instead, “fastboot flash boot_a magisk_patched.img” worked.
tbst
It was very helpful, thanks!
Sadique Hassan
Thanks for the appreciation.
Abhishek Shah
thanks…worked..