Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bitrot-alpha/feb1b1ef025593f2ec30302703b43a17 to your computer and use it in GitHub Desktop.
Save bitrot-alpha/feb1b1ef025593f2ec30302703b43a17 to your computer and use it in GitHub Desktop.
Tutorial from Reddit user e4732 - [Tutorial] My workaround for the "stock backup does not exist" error while trying to install OTA

[Tutorial] My workaround for the "stock backup does not exist" error while trying to install OTA

tutorial by Reddit user e4732

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)

  1. Enable USB debugging and open a power shell window.

  2. adb shell

  3. su

  4. cd /data/adb/magisk

  5. . ./util_functions.sh

  6. get_flags

  7. find_block boot_a (or b if your active slot is b).

    1. to know your active boot slot: /bin/getprop ro.boot.slot_suffix
  8. flash_image <your stock boot.img's path.img> <output from the previous command>

  9. install the OTA as usual. do not reboot.

  10. find_block boot_b (the opposite of the previous command if your active slot is A use B and vice-versa).

  11. dd if=<output from the previous command> > <path to save new stock boot image.img>

  12. Go to Magisk and patch the new stock boot image.

  13. Send the patched boot image to the PC.

  14. Reboot into fastboot. adb reboot fastboot

  15. Change the active slot with fastboot --set-active=b or a, depending on your active slot.

  16. Flash the patched img to your new boot slot. with fastboot flash boot_b <path of patched boot.img on pc> or a

  17. Reboot into the system and you are done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment