Magisk is a powerful tool that allows Android users to gain root access and customize their devices. However, rooted users may encounter issues when attempting to install OTA updates, as the stock boot or init_boot has been replaced with a patched version. One common problem is the “Stock backup does not exist” error message when using the Magisk Restore Images feature.
To overcome this obstacle and ensure a smooth OTA update process, follow these steps:
Step 1: Download the stock firmware for your device.
Step 2: It should be of the same version which is currently installed.
Step 3: Extract it and get hold of the boot/init_boot.img file.
Step 4: For extraction, you may use the Fastboot Enhance Tool (GitHub [direct link]).
Step 5: Transfer this file to your device, but not inside any folder.
Step 6: Enable USB Debugging and connect your device to a PC.
Step 7: Download and extract Android SDK Platform Tools.
Step 8: Open the Command Prompt inside the platform tools.
Step 9: Type in the below two commands, one after another:
adb shell su
Step 10: You might get a SuperUser request, tap on Grant/Allow.
Step 11: Type in the below command to bring the partition table
ls -la /dev/block/bootdevice/by-name
Step 12: Note down the block address of boot_a/boot_b or init_boot_a/init_boot_b.
Step 13: In our case, they are:
init_boot_a -> /dev/block/sde32 init_boot_b -> /dev/block/sde63
Step 14: Type in the below command and replace “address” with the block address of your boot_a/boot_b or init_boot_a/init_boot_b
dd if=/sdcard/boot.img of=/dev/block/address --> for boot_a dd if=/sdcard/boot.img of=/dev/block/address --> for boot_b dd if=/sdcard/init_boot.img of=/dev/block/address --> for init_boot_a dd if=/sdcard/init_boot.img of=/dev/block/address --> for init_boot_b
Step 15: In our case [init_boot_a and b], the above commands will transform to:
dd if=/sdcard/init_boot.img of=/dev/block/sde32 dd if=/sdcard/init_boot.img of=/dev/block/sde63
Step 16: The above command will flash the boot/init_boot to their respective slots.
Step 17: Launch Magisk, tap on Install, and select Direct Install. Once done, hit Reboot.
Step 18: Upon reboot, you should still be rooted and have the stock init_boot installed.
Step 19: Moreover, now that you have the Restore Images option up and working, you can use it to install OTA updates on your rooted device.
By following these steps, you can restore the stock boot or init_boot images, fixing the “Stock backup does not exist” error in Magisk Restore Images. This process will allow you to install OTA updates on your rooted device seamlessly. Remember to backup your data before proceeding, and if you encounter any issues, don’t hesitate to seek assistance from the community.