[Miscellaneous Android Development] gilbert32:
BEFORE YOU PROCEED:

Please PM me or post in this thread if your Global Black Shark is unlocked, and not modified yet.

Hello Guys. In this thread, you can see learn how to flash the Chinese Black Shark ROM, on the global version of the phone.

Before you start, please make sure that:

You are rooted

You have decrypted the system storage

You have backed up system_{a,b}, vendor_{a,b}, boot_{a,b}, custom_{a,b}

Please double make sure you have backups of these partitions.

Also, There might be some bugs like:

After booting the screen will be upside down. This is fixed by locking then unlocking the phone. However it happens at every boot.

Lights settings does not work

Left is Recent Apps, Right is Back. A little annoying keymap but i can live with it There's a setting for that

So let's Begin!

The first step is downloading the files provided by [MENTION=4823946]JengaMasterG[/MENTION]:

system_b.img

boot_b.img

vendor_b.img

Again, please make sure you have a backup of your partitions, as well as the userdata.

Next, download TWRP for the phone.

Now, boot TWRP by running

adb reboot bootloader
fastboot boot twrp.img

Once TWRP is up, wipe, advanced, dalvik/art cache and data. Otherwise, when you boot the chinese rom, it will give you crashes.

Copy system_b.img, boot_b.img and vendor_b.img to your internal storage from pc.

Reboot to bootloader

fastboot getvar current-slot

Check on which slot you are. if it's A, we will flash to B. if it's B, we're gonna flash A.

fastboot set_active other

The command above will switch you to the corresponding slot, which we're gonna overwrite.

fastboot boot twrp.img

once twrp is booted, allow writing, and run an adb shell.

adb shell

cd /dev/block/bootdevice/by-name

This is the last step to make sure you have a backup.

For the following commands, replace of=partition_X where X is your new slot (if you were using slot A, X would be b and you would run the command as it is. If you were on slot B, you will use boot_a, system_a and vendor_a in end of the following commands)

dd if=/sdcard/boot_b.img of=boot_b
dd if=/sdcard/system_b.img of=system_b
dd if=/sdcard/vendor_b.img of=vendor_b

Once these commands have completed, flash DisableForceEncryption_Treble.zip and flash Magisk

Reboot without installing twrp app.

Now you will notice the bootanimation is upside down, as well as the system. No panic.

In the first time setup, you might have to go through it upside down (screen is upside down but touch is correct), so it's gonna be a bit tricky.

Once setup is finished, you can install google play store using the following link: miui forums (download zip file from here to avoid registering, for convenience)

Happy new Rom Global users!

Just don't install any update for the system, until you reflash your backup using the same procedure from twrp.

PS: This procedure should work on Chinese variant, to go to Global version. However i have not tested it as i only have the Global Black Shark. It works for switching between Chinese and Global too. Global version (not up to date): https://xdaforums.com/android/development/black-shark-global-stock-firmware-t3907789

Special Thanks:

mauronofio for TWRP

kanded for decrypt thread

JengaMasterG for chinese partition dumps