[Android General] gilbert32:
Hello, this is not a guide for noobs.

At this point, i assume your BlackShark 1 is running a custom ROM, or a modification, and not it cannot update over OTA.

This guide helps you restore your BS1 SKR-H0 to Stock ROM, hopefully you can update it when the next OTA comes out.

This guide sets one of your partitions at system update G66X1906170OS00MPX.

You agree that by performing these operation, you risk bricking your device. I will probably not be there to help you recover.

There are a few steps:

Flash the stock images

Re-encrypt storage

Re-flash the stock files

Flash the stock images

Download the full backup from here: https://mega.nz/#!IZFAEAoC!UMHJ0drlhoHyGtV-0KYrtteC1VMP8-eqFWWrMXLZikQ

Extract the backup

Enter fastboot mode on your phone

Check which slot you are on, and which slot is definitely working. Try this on a slot that is broken, or that is not 100% working (in my case, slot a)

Run the following command for every partition:

fastboot flash <partitionname>_<slotname> <filename>
example: fastboot flash boot_a boot_a (if the slot you are overwriting is slot a)
or fastboot flash boot_b boot_a (if the slot you are overwriting is slot b)

Once finished, boot twrp, flash disableforceencrypt and magisk, and reboot into the system.

Reencrypt storage

First of all, backup ALL YOUR INTERNAL STORAGE, as it WILL GET WIPED IN THIS STEP. i warned you.

Once the system boots with the new version, go into stock recovery (adb reboot recovery, or enter bootloader > select start recovery)

Then reboot into the system. once the system boots, go to settings, security, encryption, and enable encryption. The phone should encrypt now. Wait for it to start encryption, finish, and get stuck at boot animation. This is the end of step 2.

Re-flash the stock files

This is the final and easiest step. If previous steps were performed correctly, then all you have to do now it the following:

from the stuck bootanimation, reboot to bootloader.

Flash 1 more time system, boot and vendor partition. This time DO NOT flash disableforceencrypt and magisk.

reboot into stock recovery

perform a wipe 1 more time.

reboot the system.

If done correctly, your phone should go into first time setup, with the stock OS, no internal error on boot, and you should be able to accept OTAs when they come. If OTA fails, Follow step 4:

(Optional) OTA Shows up again after finishing, and keep failing

If you restored your BlackShark to stock, and OTA does not finish (keeps coming back up), do the following:

If your backup is from slot a, and you are on it right now, run the following commands:

Make sure you are on the correct slot, with the correct backup!

fastboot flash boot boot_a.img
fastboot flash system system_a.img
fastboot flash vendor vendor_a.img
fastboot flash dsp dsp_a.img
fastboot flash devcfg devcfg_a.img
fastboot flash bluetooth bluetooth_a.img
fastboot flash dtbo dtbo_a.img
fastboot flash modem modem_a.img
fastboot flash vbmeta vbmeta_a.img

For the partitions dtbo and devcfg, i'm not sure if they need reflashing, however i found out that the others might be changed indirectly, and cause OTA to fail.

So just reflash those partitions from backup (Make sure to use the correct version/slot!)

Finally, if update still fails, you can connect your phone to pc, run adb logcat, and watch the logs just after update download is finished. If it fails, you will find some lines about a failed partition, with the partition name.

Special thanks to [MENTION=9445468]leipnacht[/MENTION] who provided me with stock file, so that i could restore my phone.