How To Guide [GUIDE] Magisk on LineageOS

Search This thread

sburry

Member
Oct 10, 2021
11
3
Xiaomi Poco F3
I found the steps to install magisk when using a custom recovery a bit confusing (I extracted boot.img from the stock image and then bootlooped my device after I flashed the patched boot.img...), so I thought I'd write this after having recently done it myself to help anyone else running into trouble. I did this on a Poco F3 global version with 12.5.4 firmware.

Prerequisites:
- LineageOS recovery + LOS already installed (so you can use Magisk app to patch recovery.img)
- working adb, fastboot, and so on
- download Magisk-v23.0.apk from https://github.com/topjohnwu/Magisk/releases/tag/v23.0
- download lineage-18.1-*-recovery-alioth.img from https://download.lineageos.org/alioth

Basing steps on https://topjohnwu.github.io/Magisk/install.html

1. Copy recovery-alioth.img to phone; I used 'adb push lineage-18.1-20211127-recovery-alioth.img /sdcard/Download/alioth.img' to do this
2. Open Magisk app and select Install for Magisk near the top
3. Use 'Select and Patch a File' method, finding and selecting the alioth.img file
4. Click LET'S GO and let it finish.
5. Retrieve the image from the phone; I used 'adb pull /sdcard/Download/magisk_patched-[random-strings].img ~/patchedboot.img'
6. Reboot phone to bootloader by running 'adb reboot bootloader'
7. Flash patched image via 'fastboot flash boot ~/patchedboot.img'
8. Reboot into system via 'fastboot reboot'
9. Proceed to installing modules.

I was able to install Magisk hide and props config and set device fingerprint to OnePlus 6T on Android 11, hiding root from almost all apps, and then pass safetynet. Any questions or input is appreciated, I hope this helps someone!
 

Ludoboii

Member
Oct 12, 2015
43
19
HTC One (m7)
LG G5
I just flashed Lineage, rebooted, set up the phone, rebooted into recovery and then flashed Magisk.apk after renaming it to Magisk.zip. After a reboot I opened the Magisk app (which was automatically installed when flashing Magisk) for the first time and it prompted me to do some additional operations. It survived an OTA update so it should keep working in the future.
 

ldm21

New member
Oct 3, 2022
2
0
I found the steps to install magisk when using a custom recovery a bit confusing (I extracted boot.img from the stock image and then bootlooped my device after I flashed the patched boot.img...), so I thought I'd write this after having recently done it myself to help anyone else running into trouble. I did this on a Poco F3 global version with 12.5.4 firmware.

Prerequisites:
- LineageOS recovery + LOS already installed (so you can use Magisk app to patch recovery.img)
- working adb, fastboot, and so on
- download Magisk-v23.0.apk from https://github.com/topjohnwu/Magisk/releases/tag/v23.0
- download lineage-18.1-*-recovery-alioth.img from https://download.lineageos.org/alioth

Basing steps on https://topjohnwu.github.io/Magisk/install.html

1. Copy recovery-alioth.img to phone; I used 'adb push lineage-18.1-20211127-recovery-alioth.img /sdcard/Download/alioth.img' to do this
2. Open Magisk app and select Install for Magisk near the top
3. Use 'Select and Patch a File' method, finding and selecting the alioth.img file
4. Click LET'S GO and let it finish.
5. Retrieve the image from the phone; I used 'adb pull /sdcard/Download/magisk_patched-[random-strings].img ~/patchedboot.img'
6. Reboot phone to bootloader by running 'adb reboot bootloader'
7. Flash patched image via 'fastboot flash boot ~/patchedboot.img'
8. Reboot into system via 'fastboot reboot'
9. Proceed to installing modules.

I was able to install Magisk hide and props config and set device fingerprint to OnePlus 6T on Android 11, hiding root from almost all apps, and then pass safetynet. Any questions or input is appreciated, I hope this helps someone!
Has anyone had issues with this? Some days ago this worked fine, but now Magisk does not let me access the "Modules" tab and Zygisk is not in the options in Settings anymore. I have a POCO F3 on Android 12, set the Fingerprint to a Redmi Note 10 to pass the CTS test (which worked and still works)
Any help would be much appreciated!
 

Rstment ^m^

Senior Member
Aug 19, 2018
362
110
Xiaomi Poco F3
Has anyone had issues with this? Some days ago this worked fine, but now Magisk does not let me access the "Modules" tab and Zygisk is not in the options in Settings anymore. I have a POCO F3 on Android 12, set the Fingerprint to a Redmi Note 10 to pass the CTS test (which worked and still works)
Any help would be much appreciated!
You had update yesterday I think. Your magisk is no longer there - boot image is overwritten after ota update.

Open magisk and check, it'll likely say not installed
 

ldm21

New member
Oct 3, 2022
2
0
You had update yesterday I think. Your magisk is no longer there - boot image is overwritten after ota update.

Open magisk and check, it'll likely say not installed
Thanks for your reply. I'm quite new at this so I'm not sure what's going on: the latest Magisk release is still v25.2 and after following again these instructions but for v25.2, I still have the same issue. What should I do to fix this?
EDIT: you're right that it does say that it's not installed, but I followed the procedure from some days ago and it doesn't seem to fix it.

Many thanks again!
 

Rstment ^m^

Senior Member
Aug 19, 2018
362
110
Xiaomi Poco F3
Thanks for your reply. I'm quite new at this so I'm not sure what's going on: the latest Magisk release is still v25.2 and after following again these instructions but for v25.2, I still have the same issue. What should I do to fix this?
EDIT: you're right that it does say that it's not installed, but I followed the procedure from some days ago and it doesn't seem to fix it.

Many thanks again!
Simplest option is to reboot phone to recovery , select adb update , connect to pc and do "adb sideload magisk.apk"

It will patch image for you, don't rename it to .zip or anything
 
Last edited:

barturblits

Senior Member
Jul 4, 2014
332
79
Simplest option is to reboot phone to recovery , select adb update , connect to pc and do "adb sideload magisk.apk"

It will patch image for you, don't rename it to .zip or anything
I think this is the equivalent of flashing the apk as zip in custom recovery, which is deprecated.
I compared the official one with the first post and I think the following is missing in the first post:

  • (Optional) If your device has a separate vbmeta partition, you can patch the vbmeta partition with command:
    fastboot flash vbmeta --disable-verity --disable-verification vbmeta.img

From:

Poco has a vbmeta but i never executed this step. The instructions say that it is optional but they don't specify it.

I used the first post since LOS18.1 and no problems. Since LOS19.1 updates give me bootloops so after some repair tries (and failed twrp restore) I did a fresh install and did not take the updates anymore. No idea if it has something to do with magisk or patching vbmeta. Soon gonna try to update LOS with magisk disabled.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    I found the steps to install magisk when using a custom recovery a bit confusing (I extracted boot.img from the stock image and then bootlooped my device after I flashed the patched boot.img...), so I thought I'd write this after having recently done it myself to help anyone else running into trouble. I did this on a Poco F3 global version with 12.5.4 firmware.

    Prerequisites:
    - LineageOS recovery + LOS already installed (so you can use Magisk app to patch recovery.img)
    - working adb, fastboot, and so on
    - download Magisk-v23.0.apk from https://github.com/topjohnwu/Magisk/releases/tag/v23.0
    - download lineage-18.1-*-recovery-alioth.img from https://download.lineageos.org/alioth

    Basing steps on https://topjohnwu.github.io/Magisk/install.html

    1. Copy recovery-alioth.img to phone; I used 'adb push lineage-18.1-20211127-recovery-alioth.img /sdcard/Download/alioth.img' to do this
    2. Open Magisk app and select Install for Magisk near the top
    3. Use 'Select and Patch a File' method, finding and selecting the alioth.img file
    4. Click LET'S GO and let it finish.
    5. Retrieve the image from the phone; I used 'adb pull /sdcard/Download/magisk_patched-[random-strings].img ~/patchedboot.img'
    6. Reboot phone to bootloader by running 'adb reboot bootloader'
    7. Flash patched image via 'fastboot flash boot ~/patchedboot.img'
    8. Reboot into system via 'fastboot reboot'
    9. Proceed to installing modules.

    I was able to install Magisk hide and props config and set device fingerprint to OnePlus 6T on Android 11, hiding root from almost all apps, and then pass safetynet. Any questions or input is appreciated, I hope this helps someone!
    3
    I just flashed Lineage, rebooted, set up the phone, rebooted into recovery and then flashed Magisk.apk after renaming it to Magisk.zip. After a reboot I opened the Magisk app (which was automatically installed when flashing Magisk) for the first time and it prompted me to do some additional operations. It survived an OTA update so it should keep working in the future.