[OREO][MI5s]Project Treble for capricorn

Search This thread

MZO

Senior Member
Jan 5, 2015
1,879
2,185
Hello guys! You know I've been out of development for capricorn for a bit! I've been working on this port for a bit, this is for all xiaomi/msm8996-common devices. Project Treble for our phone is here!

Before anything, let's get into it!

/* *** Disclaimer
* 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/KERNEL
* before flashing it! YOU are choosing to make these modifications, and if
* you point your finger at me for messing up your device, I will laugh at you.
* BOOM! goes the dynamite
*/



What is Project Treble:
Project Treble basically partitions your device into two separate partitions, a system and a vendor: system contains your generic system image, while vendor partition has your device specific files required for booting and running your phone. This way we can easily change the system image and be able to run our device on different system images with the same kernel and vendor partition
Read more about Project Treble]

HOW TO:
Download the zip provided here: AndroidFileHost
Extract the zip on your system
Run the script based on your system (sh for linux, bat for windows)
Flash the GSI system image you wish to use

What's Working:
RIL (both SIMs)
Data
Camera
Video
Text
Audio
Bluetooth
Torch
WiFi
Hotspot
Vibrator
Fingerprint
240fps slowmo
GPS
Calls (Mic and Sound)
Camcorder
Fingerprint to wake
Double tap to wake
Display color calibration (KCAL)
Hardware buttons lights

What's NOT Working:
I've tried my best to ensure that everything is working (been testing for about a week)
SELinux status is permissive
Let me know

How to report bugs:
Logcat, a simple description of the bug, kmsg or dmseg depending on the bug

What's Packaged in the zip:
A boot image (kernel)
A vendor image (cust partition)

What's a GSI?
A GSI literally means Generic System Image. It is the a general system image meant for no specific device. Treble enabled devices have the capability to run a GSI. You can find a GSI here: Phh-Treble

Our device's config:
Treble-aonly system image. Our phone only has one system image so it is A-only

Source Code:
Kernel
Vendor blobs
MSM8996-COMMON configuration
capricorn configuration


XDA:DevDB Information
Treble, Tool/Utility for the Xiaomi Mi 5s

Contributors
MZO, LineageOS Maintainers (for Oreo)
Source Code: https://github.com/MZO9400


Version Information
Status: Stable
Current Stable Version: 1.0
Stable Release Date: 2018-03-12
Current Beta Version: 1.5 Beta
Beta Release Date: 2018-02-28

Created 2018-02-27
Last Updated 2018-03-12
 

MZO

Senior Member
Jan 5, 2015
1,879
2,185
Screenshots!

Hey guys, humble request. Please don't bug lineage maintainers over Treble. As our HALs are built for non treble device, and treble requires a different structure of HALs which must connect to system only through hwbinder, I bypassed this right now by putting the system on permissive selinux and removing those policies. But LineageOS doesn't allow that. So unless we get binderized HALs from Xiaomi! Don't complain on Lineage thread. And don't ask them to merge in my changes lol.


As for unofficial guys who want treble. Yes you can use my device and vendor trees on any msm8996-common device (natrium, gemini, capricorn, etc etc) and boot full treble builds on it with ease. Thanks!
 

Attachments

  • Screenshot_20180226-132415.jpg
    Screenshot_20180226-132415.jpg
    142.7 KB · Views: 10,866
  • Screenshot_20180226-185246.png
    Screenshot_20180226-185246.png
    122.7 KB · Views: 10,470
  • Screenshot_20180226-190028.png
    Screenshot_20180226-190028.png
    212.1 KB · Views: 10,627
  • Screenshot_20180226-190106.png
    Screenshot_20180226-190106.png
    127.8 KB · Views: 9,908
  • Screenshot_20180227-142516.png
    Screenshot_20180227-142516.png
    122.2 KB · Views: 9,584
  • Screenshot_20180227-143554.png
    Screenshot_20180227-143554.png
    218.3 KB · Views: 9,368
  • Screenshot_20180227-150046.jpg
    Screenshot_20180227-150046.jpg
    84.9 KB · Views: 9,243
  • Screenshot_20180227-150131.png
    Screenshot_20180227-150131.png
    70.5 KB · Views: 8,876
Last edited:

MZO

Senior Member
Jan 5, 2015
1,879
2,185
What works on Treble?
Any GSI
My AOSiP builds (since I build vendor images on that build)
Any builds using my source code. (yes their system.img will work)

Why doesn't MIUI work on Treble?
Because it wasn't shipped on a treble enabled device

Will custom kernels work on Treble?
Yes, as long as they are updated with source code on my github

LineageOS? No it won't work, explained in the post above.

How does Treble affect custom ROMs?
Peeps over XDA portal summed it up perfectly: Read here

How to fix Google Camera FC?
Flash PHH-TREBLE Vanilla build (latest)
Flash GApps zip
//Currently build with su and gapps causes gcam crash//

GApps won't flash? Not enough space in system
Flash this zip https://goo.gl/MSbGK5
 
Last edited:

BajinganTengik

Senior Member
Jan 12, 2017
232
87
What works on Treble?
Any GSI
My AOSiP builds (since I build vendor images on that build)
Any builds using my source code. (yes their system.img will work)

Why doesn't MIUI work on Treble?
Because it wasn't shipped on a treble enabled device

Will custom kernels work on Treble?
Yes, as long as they are updated with source code on my github

LineageOS? No it won't work, explained in the post above.

How does Treble affect custom ROMs?
Peeps over XDA portal summed it up perfectly: Read here
Did you build AOSiP for Mi5s? Where can i get it? I look at your AFH folder and found nothing.
 

Dark Stranger

Senior Member
Apr 20, 2008
323
79
You can extract the zip and flash .img files through TWRP. But I wouldn't recommend.

Then clarify some things.
I just need to run the script contained in the file to have the basic system or need to install anything else?
And then flash the system GSI image?
I am currently using the Lineage 15.1 rom, is there any problem in running this script on top of it ??
 

_m4yd4y_

Member
Sep 2, 2017
35
6
Moscow
Nice.
Faster ROM than LOS. IMHO.
But I have a bug to ask the manufacturer. But it does not affect the further functioning. Also I need a double tap to sleep, because I have problems with the power button. And also the point of swap buttons is necessary for me.
Standart apps are very ugly eg music and SMS.
My phone have strange name.
In connection with these problems, I will return to LOS.
It would be good if smb told me where I can find some information how I can change img system as I want...
Thank you for work.
 
Last edited:

MZO

Senior Member
Jan 5, 2015
1,879
2,185
Then clarify some things.
I just need to run the script contained in the file to have the basic system or need to install anything else?
And then flash the system GSI image?
I am currently using the Lineage 15.1 rom, is there any problem in running this script on top of it ??
You're correct. You can flash the script but not sure if it will boot.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 59
    Hello guys! You know I've been out of development for capricorn for a bit! I've been working on this port for a bit, this is for all xiaomi/msm8996-common devices. Project Treble for our phone is here!

    Before anything, let's get into it!

    /* *** Disclaimer
    * 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/KERNEL
    * before flashing it! YOU are choosing to make these modifications, and if
    * you point your finger at me for messing up your device, I will laugh at you.
    * BOOM! goes the dynamite
    */



    What is Project Treble:
    Project Treble basically partitions your device into two separate partitions, a system and a vendor: system contains your generic system image, while vendor partition has your device specific files required for booting and running your phone. This way we can easily change the system image and be able to run our device on different system images with the same kernel and vendor partition
    Read more about Project Treble]

    HOW TO:
    Download the zip provided here: AndroidFileHost
    Extract the zip on your system
    Run the script based on your system (sh for linux, bat for windows)
    Flash the GSI system image you wish to use

    What's Working:
    RIL (both SIMs)
    Data
    Camera
    Video
    Text
    Audio
    Bluetooth
    Torch
    WiFi
    Hotspot
    Vibrator
    Fingerprint
    240fps slowmo
    GPS
    Calls (Mic and Sound)
    Camcorder
    Fingerprint to wake
    Double tap to wake
    Display color calibration (KCAL)
    Hardware buttons lights

    What's NOT Working:
    I've tried my best to ensure that everything is working (been testing for about a week)
    SELinux status is permissive
    Let me know

    How to report bugs:
    Logcat, a simple description of the bug, kmsg or dmseg depending on the bug

    What's Packaged in the zip:
    A boot image (kernel)
    A vendor image (cust partition)

    What's a GSI?
    A GSI literally means Generic System Image. It is the a general system image meant for no specific device. Treble enabled devices have the capability to run a GSI. You can find a GSI here: Phh-Treble

    Our device's config:
    Treble-aonly system image. Our phone only has one system image so it is A-only

    Source Code:
    Kernel
    Vendor blobs
    MSM8996-COMMON configuration
    capricorn configuration


    XDA:DevDB Information
    Treble, Tool/Utility for the Xiaomi Mi 5s

    Contributors
    MZO, LineageOS Maintainers (for Oreo)
    Source Code: https://github.com/MZO9400


    Version Information
    Status: Stable
    Current Stable Version: 1.0
    Stable Release Date: 2018-03-12
    Current Beta Version: 1.5 Beta
    Beta Release Date: 2018-02-28

    Created 2018-02-27
    Last Updated 2018-03-12
    26
    Info about how to fix Google Camera ports has been updated on the initial posts. Now we can consider this project Treble fully stable. Everything works! The only bug is VoLTE which is not device related. It's related to the system.img (I don't work on that) so yea we're as stable as anything else on full Treble! SEPolicies have been fixed too and I'll update the build with enforced policies after extensive testing.
    25
    Screenshots!

    Hey guys, humble request. Please don't bug lineage maintainers over Treble. As our HALs are built for non treble device, and treble requires a different structure of HALs which must connect to system only through hwbinder, I bypassed this right now by putting the system on permissive selinux and removing those policies. But LineageOS doesn't allow that. So unless we get binderized HALs from Xiaomi! Don't complain on Lineage thread. And don't ask them to merge in my changes lol.


    As for unofficial guys who want treble. Yes you can use my device and vendor trees on any msm8996-common device (natrium, gemini, capricorn, etc etc) and boot full treble builds on it with ease. Thanks!
    18
    Just for information, @MZO is a JDCTeam developer from last year... it was really a nice surprise for us to get from him the news of his new device on MI5 family...

    Dear Dev....do you have any intentions....can we expect More Treble based roms?....including your development....installed AOSIP....thanks for your hard work anyway....

    One of the next rom we would like to prepare is for sure the Official JDC AOSP with full treble support... and most probably we will prepare also a GSI of it to be used as the phh image we used and are using to test and fix the treble support on MI5 and in near future also MI5S Plus... the idea is to port the complete MI5 family through the treble support and maintain a single rom system image for all (but let's see if we success on this direction).

    I feel like a fool, but I have a message from ANDROID SYSTEMS: your vendor image does not match the system. Please flash the MXB48T vendor image for your device...
    Should it be so?

    After installing aosip and on first boot and every boot, its error msg. Ignore it (click OK).

    Yes guys, this message is not an error... is a simple warning to advise that the vendor image that the rom has detected is of an older version... but due to the fact that the vendor image is the first one for this device, it can't be so older!!! ;)
    In future updates, we will align the vendor image properties to appear as a perfectly aligned OREO image! :D
    16
    Okay. We've been testing a newer version of this! So far: managed to switch to how Google wants our HALs to be (so now we can expect future support)! Added KCal, fixed fingerprint 2 wake, double tap to wake, moved everything to vendor, fixed LEDs etc. Let's see if it is a true daily driver this time.