[Xiaomi Mi 5 Questions & Answers] Lazer Bear:
Hey guys,

I recently purchased a Mi5 in China and had a hellish experience trying to get a working rooted international ROM on it even though I am definitely not a noob at android. I found out that most issues I had were result of small/stupid mistakes that can be easily avoided with the proper knowledge, so I decided to write a super quick how to on the process for anyone that might need it in the future. There are similar guides out there, and I will refer to some (all credit goes to original posters) but I found that most are incomplete/not updated/plain wrong. Please also note that this guide is updated to June 20th, newer ROM versions might require different steps.

This how to assumes you are familiar with the standard ROM flashing process, in case anyone needs a more detailed explaination of some of the steps, you can reply or search XDA elsewhere, most of the stuff has been mentioned here and there before.

1. Check that your hardware is ok (dial *#*#64663#*#* in dialer, you will enter hardware test mode, check every single item carefully)

2. Request a bootloader unlock from Xiaomi, unlock the bootloader: follow instructions here http://xdaforums.com/mi-5/how-to/unlocking-xiaomi-mi-5-bootloader-t3336243

3. Now that Your bootloader is unlocked, you have 3 main options for working ROMs: Xiaomi's Global Stable, Xiaomi's Global Dev, Xiaomi.eu's unofficial Stable. If you want to play it safe, I suggest to go with the Xiaomi's Global Stable, otherwise choose Xiaomi.eu's unofficial Stable. I did not test extensively all three, so this is just a general recommendation.

4. In any case, you will need to use the official Xiaomi's flashing tool (Miflash) to do your first ROM flash. Just follow the process here: http://en.miui.com/a-234.html and you'll have flashed your new ROM. In case you want to flash Xiaomi.eu's unofficial Stable, follow the same process but get the flashable ROM here: https://xiaomi.eu/community/threads/xiaomi-eu-multilang-rom-for-xiaomi-mi5-unlocked-bl-only-released.31231/

5. Boot into your newly flashed ROM, check once again that hardware is ok (see step 1.). Please also see step 10b for a tidbit of additional info if You're in China.

6. Reboot into bootloader, boot (only boot, no need to install) TWRP, which you can find here as part of Xiaomi.eu's thread above in step 4. inside a zip packaged with a modded bootloader image.

do NOT install the modded bootloader image

. Also,

this is the only version of TWRP that I found working

for my device. There are a couple more versions from chinese developers (cofface, ganfan), but booting either resulted in blank screen.

7. Once you are in TWRP, the recovery will ask you for a decryption password, just press cancel, then "Swipe to allow modifications"

8. Sideload (you cannot install from internal storage since you will not be able to access it at the moment) the latest SuperSU stable, which you can find here: http://xdaforums.com/showthread.php?t=1538053. Please note that

you WILL need the latest version

, anything earlier might just get you a bootloop. And please

do NOT format /Data to make it accessible to TWRP

as that will also likely result in bootloop. Just sideload whatever you need.

9. Do NOT wipe Dalvik or Cache, reboot into System.

10. Congrats, You're done. Have a beer/coffee/tea and pat yourself on the back.

10b. In case You're in China, and this is Your first Android 5.0+ ROM, you will happen into a "bug" (it's not really a bug, but a result of China's Great Firewall), where whenever you connect to a Wifi, the phone will think you have no internet access and that will cause a whole host of issues (won't reconnect automatically, will try to default to 4G etc.). If so, just enable ADB Debugging and type adb shell "settings put global captive_portal_server httpstat.us/204" . That will mostly solve it (you might still get some weird result with some APs, but toggling Wifi should solve the problem for that AP forever.