I have the stock boot img backup but somehow Magisk doesn't want to detect that. So I found a workaround. You need your stock boot img. If you have a backup in /data/magisk_backup_<hash>
like me just use that (decompress first)
-
Enable USB debugging and open a power shell window.
-
adb shell
-
su
-
cd /data/adb/magisk
-
. ./util_functions.sh
-
get_flags
-
find_block boot_a
(or b if your active slot is b).- to know your active boot slot:
/bin/getprop ro.boot.slot_suffix
- to know your active boot slot:
-
flash_image <your stock boot.img's path.img> <output from the previous command>
-
install the OTA as usual. do not reboot.
-
find_block boot_b
(the opposite of the previous command if your active slot is A use B and vice-versa). -
dd if=<output from the previous command> > <path to save new stock boot image.img>
-
Go to Magisk and patch the new stock boot image.
-
Send the patched boot image to the PC.
-
Reboot into fastboot.
adb reboot fastboot
-
Change the active slot with
fastboot --set-active=b
or a, depending on your active slot. -
Flash the patched img to your new boot slot. with
fastboot flash boot_b <path of patched boot.img on pc>
or a -
Reboot into the system and you are done.