Without seeing the logs, I can't tell exactly what patching process was performed.I stumbled on another problem related to rooting. I tried to make it easy on myself so I did as much of the rooting as possible from the PF interface:
In step 2 a backup of boot.img is placed in the Downloads folder of my phone but I don't think Magisk Manager is aware of this backup because when I try to do Uninstall Magisk > Restore Images (so I can perform an OTA update) I get a toast notification with "Stock backup does not exists!".
- Installed Magisk Manager from PF.
- Patched boot.img from PF (which is actually invoking Magisk Manager on the phone to do the actual patching if I understand right).
- Flashed boot.img from PF.
When I manually rooted my phone (without the help of PF) I could run Restore Images just fine. Is this something that can be fixed on your end? Or is this a Magisk Manager issue?
There are many ways that PF can patch (patches) a boot image.
You can take a look at this, (which by the way is outdated) to get an idea.
boot.img file in Downloads is only there for transferring the stock boot to the phone so that it gets used by one of the methods.
If your phone is already rooted, /data/adb/magisk is used to create a patch (call it boot_patch). That process will create a stock-boot.img file which will be copied to backup on reboot (requires root) or if the Magisk manager app is launched and the phone is already rooted.
If you are not rooted, PF will use your existing Magisk Manager (if one is installed) binaries to run a process similar to boot_patch, this will run from /data/local/tmp which is the only place we can run executable without root.
The created stock_boot.img will be in a directory that Magisk will not pickup on next reboot, and it can't place it yet in the required directory (/data/adb/magisk) because the phone is not rooted yet.
By the way boot_patch method is the most robust way of patching.
PF has all the code to create a backup file based on a selected boot.img file, I just don't have the UI for it yet.
The other two patching methods are,
1- using UIAutomator to programmatically click on buttons to create a patch from Magisk UI, but UIAutomator is slow and does not necessarily work on all Android versions.
2- Launch the app, and guide the user to click on the buttons to create a patch file and then resume in PF.
Both of those methods will make Magisk create a backup on reboot, but are cumbersome.
To keep the program simple, PF right now does not take either of those two paths, the code is all there, and a UI can be added to let the user choose, but that makes the program usage for beginners even harder and more confusing.
I might add those with a flag enabled in Advanced mode.
However a better approach is add the backup manager UI, the backend code is all there and is just missing the UI, Backup manager would list all the backups on the phone and allow you to add / delete backups.