[SOLVED] Magisk patched boot.img for Android 11?

Search This thread

mulperi

Senior Member
  • Apr 25, 2010
    132
    29
    Hi there,

    I managed to patch the boot.img with Magisk 20.4 (20400).
    Then I replaced the patched boot.img and updated to Android 11 with "flash_all.bat" method.
    However, the phone did not boot until I flashed stock original boot.img from Android 11 system image.

    Should I have used some beta "canary" version of Magisk?

    Thank you for your help!

    *** Solution
    Install app-debug.apk from here https://github.com/topjohnwu/magisk_files/tree/canary
    Enter new Magisk Manager and change to Canary channel in settings
    Ensure you are using version 11f254e5 (20424), not the 20.4 (20400)
    Patch your stock boot.img and transfer magisk_patched.img (33 734 656 bytes) to computer

    adb reboot bootloader
    fastboot getvar current-slot
    //in my case slot b
    fastboot flash boot_b magisk_patched.img
    fastboot reboot
     
    Last edited:

    Drakax

    Senior Member
    Dec 2, 2010
    156
    14
    Hi there,
    *** Solution
    Install app-debug.apk from here https://github.com/topjohnwu/magisk_files/tree/canary
    Enter new Magisk Manager and change to Canary channel in settings
    Ensure you are using version 11f254e5 (20424), not the 20.4 (20400)
    Patch your stock boot.img and transfer magisk_patched.img (33 734 656 bytes) to computer

    adb reboot bootloader
    fastboot getvar current-slot
    //in my case slot b
    fastboot flash boot_b magisk_patched.img
    fastboot reboot

    It worked! :highfive:
    After the third try... :eek:
    Don't ask me why... :confused:
     
    Last edited:

    2LoT

    Senior Member
    Aug 21, 2012
    364
    73
    Toronto
    Confirmed working (2020-10-06)
    • Pixel3 factory image Oct 2020
    • Magisk Manager, canary channel, version 8dc62a02 (305) (11)

    Summary of operations:
    • Extracted boot.img
    • copy it to the phone by `adb push ./boot.img /sdcard/Download/
    • Use Magisk Manager, Install, Select and Patch File (NOTE: the phone doesn't need to be rooted yet, I just install Magisk Manager and select Canary channel in settings)
    • after Magisk Manager has patched the boot.img, send it to the laptop by `adb pull /sdcard/Download/magisk_patched.img ~/Downloads/`
    • flash magisk_patched.img using fastboot as shown in 1st post
     

    captain sideways

    Senior Member
    Jul 27, 2019
    103
    22
    Confirmed working (2020-10-06)
    • Pixel3 factory image Oct 2020
    • Magisk Manager, canary channel, version 8dc62a02 (305) (11)

    Summary of operations:
    • Extracted boot.img
    • copy it to the phone by `adb push ./boot.img /sdcard/Download/
    • Use Magisk Manager, Install, Select and Patch File (NOTE: the phone doesn't need to be rooted yet, I just install Magisk Manager and select Canary channel in settings)
    • after Magisk Manager has patched the boot.img, send it to the laptop by `adb pull /sdcard/Download/magisk_patched.img ~/Downloads/`
    • flash magisk_patched.img using fastboot as shown in 1st post

    Interesting to see it done oldschool with adb push/pull when it can be done in explorer ? still though, nice to see more evidence that it works fine on October update with Manager (305). I did it today and I worked first time - there's a poster in another thread who is having a bit of bother trying to get theirs rooted and it's keeping me awake at night as to why it hasn't worked for them ?

    Good post ?
     

    willydewi

    New member
    Jul 21, 2008
    0
    0
    i using this method too for my android 9 but failed ..like this :
    - Device platform: armeabi-v7a
    - Copying image to cache
    2026+0 records in
    2026+0 records out
    2074624 bytes transferred in 0.050 secs (41492480 bytes/sec)
    1381+1 records in
    1381+1 records out
    1415016 bytes transferred in 0.034 secs (41618117 bytes/sec)
    - Unpacking boot image
    - Checking ramdisk status
    - Stock boot image detected
    Parsing boot image: [/data/user_de/0/com.topjohnwu.magisk/install/boot.img]
    PXA_BOOT_HDR
    HEADER_VER [0]
    KERNEL_SZ [11688867]
    RAMDISK_SZ [3704362]
    SECOND_SZ [2164261120]
    EXTRA_SZ [134250976]
    PAGESIZE [1347572498]
    NAME [QC10A002KU]
    CMDLINE [l androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3?���
    ]
    CHECKSUM [e10f5c29e9fbffff8a066049e006d08de05e0100ebc4004fe2060080e000f0a0]
    Segmentation fault
    - Patching ramdisk
    Add entry [init] (0750)
    Patch with flag KEEPVERITY=[false] KEEPFORCEENCRYPT=[true]
    Create directory [.backup] (0000)
    Add entry [.backup/.magisk] (0000)
    Dump cpio: [ramdisk.cpio]
    Parsing boot image: [/data/user_de/0/com.topjohnwu.magisk/install/boot.img]
    PXA_BOOT_HDR
    HEADER_VER [0]
    KERNEL_SZ [11688867]
    RAMDISK_SZ [3704362]
    SECOND_SZ [2164261120]
    EXTRA_SZ [134250976]
    PAGESIZE [1347572498]
    NAME [QC10A002KU]
    CMDLINE [l androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3?���
    ]
    CHECKSUM [e10f5c29e9fbffff8a066049e006d08de05e0100ebc4004fe2060080e000f0a0]
    Segmentation fault
    - Repacking boot image
    ! Unable to repack boot image!
    ! Installation failed

    please guide to solve this problem..thanks
     

    lebigmac

    Senior Member
    Jan 31, 2017
    711
    364
    Hi I get this error:
    Code:
    fastboot getvar current-slot
    getvar:current-slot FAILED (remote: GetVar Variable Not found)
    finished. total time: 0.002s
     

    dunderball

    Senior Member
    Jul 7, 2012
    359
    73
    Is anyone able to get root to work on the Feb 2021 factory image? Flashing the patched boot image doesn't take any effect in Magisk at all, and I do not have root access. I've tried both official and canary builds.
     

    weissbierdood

    Member
    Dec 26, 2015
    12
    2
    Is anyone able to get root to work on the Feb 2021 factory image? Flashing the patched boot image doesn't take any effect in Magisk at all, and I do not have root access. I've tried both official and canary builds.
    Yes, works perfectly as with every other monthly update. I'm on 21.4 Magisk and 8.0.7 Manager.
     

    RedTonight

    Member
    Oct 31, 2018
    10
    5
    Hi All,
    Just wanted to tell that CANARY version will patch boot image fine for ANDROID 11.
    For ANDROID 11 , STABLE version caused me the bootloop on LG device. But CANARY version patched image worked great.
    Have a great time.!!
     

    4L3xN3t

    Senior Member
    Jan 12, 2009
    185
    8
    37
    Rome
    does this should work on april update? I've a pixel3aXL, I had to flash manually the last factory image, everything works but can't make magisk to work anymore. tryed the canary channel, Magisk-9c0e1897(22007).apk but any time I try to patch the boot.img, then I got stuck on the no bootable slot message and have to reflash the stock one.
     

    mulperi

    Senior Member
  • Apr 25, 2010
    132
    29
    This is how I do it now every month, April included.

    1. Download latest image (not just OTA) for your phone from here, about 1,7 Gbytes

    2. Extract boot.img from the zip inside the big zip.

    3. Transfer the boot.img to phone and patch it using Magisk app. (=old Magisk Manager). After patch is done in phone, copy magisk-patched-boot.img back to PC.

    4. Edit on PC the flash-all.bat file and remove the -w flag from the end command. This prevents your device from being wiped. Save the edited bat file.

    5. Now remove all Magisk addons. Systemless may stay. Also turn off Magisk hide, because new Magisk app recommends that.

    6. Connect phone and put it in fastboot mode. Flash the new image with modified batch file. Flashing takes about 2 minutes and after reboot the G logo will be going on for at least 3 minutes, be patient.
    c:\...\adb reboot fastboot
    c:\...\flash-all.bat

    7. After phone is updated and root is lost, flash the magisk_patched_boot.img in correct slot. In my case it was slot "b".
    c:\...\adb reboot bootloader
    c:\...\fastboot getvar current-slot
    c:\...\fastboot flash boot_b magisk_patched_boot.img
    c:\...\fastboot reboot

    DONE.

    If for some strange reason your phone would bootloop
    - hold down power to reboot
    - press power to pause
    - volume up + power to get to bootloader mode
    - flash stock boot.img
     

    drcarlox

    Member
    Apr 16, 2021
    8
    2
    im getting this pls help
    Screenshot_20210415-191242.jpg
     

    Top Liked Posts

    • There are no posts matching your filters.
    • 2
      Hi there,

      I managed to patch the boot.img with Magisk 20.4 (20400).
      Then I replaced the patched boot.img and updated to Android 11 with "flash_all.bat" method.
      However, the phone did not boot until I flashed stock original boot.img from Android 11 system image.

      Should I have used some beta "canary" version of Magisk?

      Thank you for your help!

      *** Solution
      Install app-debug.apk from here https://github.com/topjohnwu/magisk_files/tree/canary
      Enter new Magisk Manager and change to Canary channel in settings
      Ensure you are using version 11f254e5 (20424), not the 20.4 (20400)
      Patch your stock boot.img and transfer magisk_patched.img (33 734 656 bytes) to computer

      adb reboot bootloader
      fastboot getvar current-slot
      //in my case slot b
      fastboot flash boot_b magisk_patched.img
      fastboot reboot
    Our Apps
    Get our official app!
    The best way to access XDA on your phone
    Nav Gestures
    Add swipe gestures to any Android
    One Handed Mode
    Eases uses one hand with your phone