DEV Community

Vitor Mattos
Vitor Mattos

Posted on • Updated on

Install Magisk

Every when I need to update my LineageOS, I lost my root access with Magisk and need to do a list of steps to solve the problem.

Install Magisk apk: https://github.com/topjohnwu/Magisk/releases/latest
More details: https://www.xda-developers.com/how-to-install-magisk/

Follow the list:

  • Download the recovery.img of your room.

    Example: https://download.lineage.microg.org/alioth/

  • Copy recovery-alioth.img to phone;

    I used the follow commant to do this:

    adb push lineage-18.1-20211127-recovery-alioth.img \
             /sdcard/Download/alioth.img
    
  • Open Magisk app and select Install for Magisk near the top

  • Use 'Select and Patch a File' method, finding and selecting the alioth.img file

  • Click LET'S GO and let it finish.

  • Retrieve the image from the phone; I used:

   adb pull /sdcard/Download/magisk_patched-[random-strings].img \
            ~/patchedboot.img'
Enter fullscreen mode Exit fullscreen mode
  • Reboot phone to bootloader by running:

    adb reboot bootloader
    
  • Flash patched image via:

    fastboot flash boot ~/patchedboot.img
    
  • Reboot into system via:

    fastboot reboot
    

Top comments (0)