[Xiaomi Redmi Note 4 Guides, News, & Discussion] ohwarumbloss:
[GUIDE] How-to install and setup a Treble Rom (LOS & AOSP) on MIDO [Update 22.03.18]

After following the Treble Progress for a while I have noticed that there are often the same Questions so I thought I set up this little Guide to center the Information to one Point and keep the Development Threads a little more clean. I will try to explain an easy setup for [MENTION=6070905]abhishek987[/MENTION] LineageOS and also for [MENTION=1915408]phhusson[/MENTION] AOSP Images.

Please remember, I am just a User, all Credits go to the Developers & this Community for helping, creating & beeing!

Do this on your own risk!

What is Treble?

You can find a an Article about it here or read on, I will try to explain it in simple & short words.

Imagine your Device is running an older Android Version, in our case (Mido) it is still Android 7. Before Treble, Developers had to fight with a lot of closed source Hardware like i.e. Qualcomm, Samsung Sensors and and and.. so to get it up to date there was a lot of work to "port" this to a newer Version. In many times it had to be "worked around" in different ways so that a lot of Bugs had their Chance to poppup.

With Treble the Developers managed to put all needed Hardware related Stuff into the Vendor Partition (don´t ask how, I don´t know). But here is how I understand it : Everything that´s needed for our Camera, Display, FP etc is placed in the Vendor. Now the Developers are able to take the updated Android, make some (still high level) modifications to the System so that it comunicates with our Vendor and we´re good to go. Don´t get me wrong, this is not done by normal Users but by knowing, brained Developers!

For us, the Users, it means that we will get updated Android Versions way faster than in the Past. An example, I am running a Android 8.1 Image with March Security Patch that provides all needed Functions. Everything works for me, thanks to the Devs, out of the Box.

Like I wrote before, of course it´s way more complicated and if you want to go deeper you will need to read this.

Why do we have Treble?

Because they managed to use our unused or obsolete /cust Partition as the /Vendor Partition. Tho our Device isn´t officially supported and maybe never will be, by this we got the Chance to use Treble. You may also read this Article, it will explain it better.

Okay, I will add a FaQ in the next days, for now it´s "´nuff said" let´s go!

A) How to set up a running treblelized Lineage OS

1. Download Files:

- Lineage OS unofficial Treble Build and modified TWRP from here : [ROM][UNOFFICIAL][8.1.0][treble][mido] LineageOS 15.1 [18/02/2018]. Don´t forget to thank [MENTION=6070905]abhishek987[/MENTION] for that, I can not stress that enough!

- (optional) download GApps 8.1 ARM64 from http://opengapps.org/

- (optional) download modified Magisk 16.0 from here, don´t forget to thank [MENTION=4857012]feherneoh[/MENTION] for this.

2. Let the Magic begin

If your Device is encrypted you will need to format Data

- reboot your Mido into your TWRP recovery

- install the modified TWRP you downloaded and reboot into it (now you will see the mounted Vendor Partition)

- do a full Backup (optional but this can never be wrong)

- wipe /Dalvik Cache, /System, /Data, /Cache

- install the downloaded LOS unofficial Build

- (optional) install your downloaded GApps and Magisk

- reboot into System

- done!

Easy, isn´t it?

B) How to set up a running treblelized AOSP

You will need the modified TWRP and the unofficial Treble LOS from above installed on your Phone!

UPDATE 22.03.

Thanks to [MENTION=5839502]Zile995[/MENTION] you will not need the Treble LOS for this. Just go here and download the Vendor/Boot.img zip (Don´t forget to press the Thanks Button)

- now go to [MENTION=1915408]phhusson[/MENTION] Thread here and download the latest Image (actually it is V12) A-Only to your Phone. He provides a vanilla AOSP Image and a rooted one with GApps included. For this Guide please download the one with GApps and SU! Don´t forget to thank [MENTION=1915408]phhusson[/MENTION], I can not stress that enough!

Updated How-to thanks to [MENTION=5839502]Zile995[/MENTION]

- reboot into TWRP

- wipe /System, /Data, /Dalvik cache, /Cache, /Vendor

- select "Install" and flash mido-gsi-vendor+kernel.zip

- tap on right "Install Image" button

- navigate to your Image file, Tap on it and select "System" -> "OK"

- when finished, reboot, done!

To use root you can simply download phh's Superuser from Play store.

Easy, isn´t it?

If you like Vanilla AOSP (this is a clean Android with almost nothing, no extras, no Playstore etc.) you can install it the same way. You can even install GApps over it but this needs a little Trick:

- install the mido-gsi-vendor+kernel.zip and the AOSP Image (as above)

- reboot into TWRP (important)

- install your selected GApps

- reboot & done

If you try to install GApps right after the Image you will get an Error from Installer, at least that happened to me. But you can try it, of course.

Now, I hope there are some Questions cleared and also some new popped up, let´s do it here so we can leave the Developers alone. I will try to update this from time to time or simply put links to helpful Messages here.

Good luck and have Fun :)