[Xiaomi Mi 5 Guides, News, & Discussion] Captain_Obviyus:
Disclaimer

I haven't made or contributed to any of the tools/ROMs/Kernels here. All the respective authors have been linked in the credits section at the bottom of the post. Also, the version of Cyanogenmod used in this thread is a nightly build and can be unstable. User bgcngm has done some really excellent work to make this ROM near perfect. I won't make unnecessary guides. If I find a guide anywhere that's good enough, I'll simply post a link to it rather than make another one. I've tried to make this guide as noob friendly as I can. If you have any questions, just post them and I'll be happy to answer them.

/*
* Your warranty is now void.
*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.

Each step of the guide REQUIRES you to have completed the step prior to that one for it to work. For example, you can't go installing TWRP on your device without unlocking the bootloader first.

Prerequisites:

Xiaomi Mi5

TWRP for Mi5 by Cofface

Latest Cyanogenmod 13 Nightly Build

You can follow this guide to see how to install ADB on your system.

OpenGApps. I suggest you download the micro package.

Let's get started:

Unlocking the Bootloader:

The first thing any Mi5 owner NEEDS to do is to unlock their bootloader.Here is a great guide for unlocking the bootloader of the Mi5 (or any Xiaomi device for that matter) by TheUltrametricSpace. It's much better than anything I can make. So before you do anything go here and unlock the bootloader.

Installing TWRP:

When I use the Official TWRP from here, my touchscreen doesn't work. I haven't a found a solution yet. If any of you know how to fix this then please post it down below. If it works out I'll put it up in this guide. For now, we'll use TWRP by Cofface for Mi5. So far this is the only TWRP that seems to work for me.

You're most likely coming from MIUI 8 and thus, running Marshmallow. I'm not sure but there is some sort of encryption that Google has put in so you cannot use TWRP to flash your .zips from Internal Storage. So before you go any further, backup your files/apps or anything you might need.

Go to the platform-tools folder and extract the .rar file that you downloaded earlier containing TWRP there.

Rename the .img file extarcted from the TWRP .rar to twrp.img

Run the CMD shortcut you pasted in the ADB folder from the guide above as an administrator.

Connect you Mi5 to your computer. Hold both the Power and Volume Down button to boot into the bootloader. You should see this image.

[At this point, you MUST have fastboot.exe and twrp.img inside the platform-tools folder.

Now go back to the CMD window you opened. Type in the follwoing:

adb devices

Press enter. You should see your device in the window after typing this.

fastboot flash recovery twrp.img

Press enter. On the command window you should see a few lines popup and at the end it will show time taken to complete operation. So far so good.

adb reboot recovery

Press enter. You should now see the TWRP flash screen.
​

If TWRP is in Chinese, worry not.

Tap on the second box to select language. Scroll down and select English.
​

Swipe to allow modifications.

You should be in TWRP now.

DO NOT BOOT OUT OF TWRP RIGHT NOW.

Installing Cyanogenmod 13:

Of all the ROMs that I have used, I find that CM13 is far better. It's mostly personal preference. If you want to install any other ROM, the process is more or less exactly the same. Follow the instructions below:

Tap on Wipe.

Tap on Advanced Wipe.

Select everything except USB-OTG.

Swipe to Wipe.

Go back to the main TWRP screen.

Tap on Mount.

Tap on Enable MTP.

Connect your phone to your computer via USB.

Copy cm-13.0-20161022-NIGHTLY-gemini.zip and open_gapps-arm64-6.0-micro-20161025.zip from your computer to the Internal Storage folder inside Mi5 in My Computer.

Come back to TWRP.

Tap on Install.

Scroll down and find the cm-13.0-20161022-NIGHTLY-gemini.zip file and tap on it. Installation will start and will take about a minute and a half.

Now come back and flash the open_gapps-arm64-6.0-micro-20161025.zip file. This should be much faster.

Now go back to the

Wipe

section and select

only the Dalvik & cache.

Now press Reboot System.

And that's it. The first boot will take quite some time. You're running Cyanogenmod 13 now!

Optional:

You can also install Falcon Kernel by Harrynowl to get a few more extra features. Install it like you would Cyanogenmod by flashing the .zip.

Credits:

Cyanogenmod 13

bgcngm

Mi5 Developers

Cyanogenmod Developers

TWRP by Cofface

User TheUltrametricSpace for his excellent Bootloader Unlocking Guide.

User iamareebjamal for the awesome ADB Guide.

User Harrynowl for the Falcon Kernel.