FORUMS
Remove All Ads from XDA

[JDCTeam][TREBLE][v6 RC2][Gemini] The Full Treble support project

4,410 posts
Thanks Meter: 11,041
 
By smeroni68, Recognized Contributor on 10th March 2018, 12:15 PM
Post Reply Email Thread
Announcement from smeroni68: Gemini Full Treble support


The Full Treble Project for MI5 Gemini
Brought to you by Jflte DevConnection Team


Code:
#include <std_disclaimer.h>

/*
 * Your warranty is now void.
 *
 * We're 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 TREBLE
 * SUPPORT before flashing it! YOU are choosing to make these modifications, and if
 * you point the finger at us for messing up your device, we will laugh at you.
 *
 */

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


Gemini hardware vs Treble implementation:
Gemini is an ARM64 and A-ONLY device. This means that regarding the GSI images (GSI = Generic System Image) to be used, you need to get ARM64 and A-ONLY system images.


Available GSI downloads:
Up today, thanks to @phhusson and other devs, are available a bunch of Android 9.0 system images that can be flashed on Gemini.
You can find these Gsi at the following links:

- ANDROID Q (Gsi)... Is just a preview... but it works on our Mi5!!
- Phh AOSP 9.0 (Gsi).
- Resurrection Remix v7.0 (Gsi).
- LineageOS 16.0 (Gsi).
- HavocOS v2.0 (Gsi) (Use A only).
- ViperOS v6.0 (Gsi) (Use A only).
- JDC AOSP 9.0 (PURE AOSP Gsi, built from sources, just for testing purpose, no gapps support for this preview version).

- GSI & sGSI List page


Treble implementation and download:
JDCTeam is working from latest months of 2017 to implement on Gemini (un-supported from producer) the full support of Treble.
Thanks to @sir mordred, we reached on MI5 the full working status... from v5 we moved to full versioned vndk v28 (aka PIE support... and Q ready!).
NOTE: just to be clear, it's a work in progress development...
We tested with some available Gsi and we put over here some links to these images.
We are sharing a TWRP flashable zip that include vendor and boot images (flash only through TWRP 3.2.3-0 Official).
NOTE: ONLY with TWRP 3.2.3-0 version is possible to handle the treble flash!
How to use:
  • Download the TREBLE zip provided here: Mediafire
  • Download a GSI image (Remember: ARM64 and A-ONLY version)
  • Reboot to recovery (TWRP 3.3.1-0 REQUIRED)
  • Clean the device (wipe Dalvik/Cache/System/Data partitions)
  • Flash Treble gemini zip
  • Flash the GSI system image you wish to use
  • Reboot
---> Video on How to install <---

Screenshots:



Youtube review: (To Be Updated when new links available)

- ANDROID Q Gsi on MI5 (How to Install) ---> Click here to play the video

- ANDROID Q Gsi on MI5 ---> Click here to play the video

- RR v7.0.0 Gsi on MI5 ---> Click here to play the video

- PHH AOSP 8.1 Gsi on MI5 ---> Click here to play the video

- AEX 8.1 Gsi on MI5 ---> Click here to play the video



What's working (... and not working):
The development is now @ an RC status (this is not a rom)... you have the possibility to have a look and test the phone with a GSI rom... let us know what does not work (not related to the GSI itself)!!

Issue reporting:
We already say that this is not the place to report issues or bugs ROM related... but in any case a bug encountered can be linked to the treble support not perfect or missing supported features... be free to post about issues you encountered, and please provide logs with the description of the issue. We will check the logs to understand the reason, and in case of fixes to be done, we will update on post#3 (MISCELLANEA) a kind of todo list for us and for users as a "bug list"... but the meaning is "what has to be checked/fixed to get a better treble support for future".

Any question?
If you have any question about, please check first on the post#2 (FAQ) to see if your question has already an answer... if not, post in the thread and we will give you informations.

Sources
GitHub

Social
YouTube: JDCTeam TV
XDA News: Read article

Credits
  • JDCTeam
  • LinageOS
  • Google
  • MI5Devs

Special thanks:
  • @sir mordred (developer)
  • @musabcel (for his test support)
  • Team Codefire - JDCTeam-Build03


XDA:DevDB Information
GEMINI Full Treble support project, ROM for the Xiaomi Mi 5

Contributors
smeroni68, sir mordred, mzo, ktulu84
Source Code: https://github.com/Project-Treble-Mi5

ROM OS Version: 9.x Pie
ROM Kernel: Linux 3.x
ROM Firmware Required: Latest available
Based On: AOSP

Version Information
Status: Stable
Current Stable Version: v6
Stable Release Date: 2019-03-16

Created 2018-03-10
Last Updated 2019-06-27
The Following 77 Users Say Thank You to smeroni68 For This Useful Post: [ View ] Gift smeroni68 Ad-Free
 
 
10th March 2018, 12:15 PM |#2  
smeroni68's Avatar
OP Recognized Contributor
Flag Milano
Thanks Meter: 11,041
 
Donate to Me
More
FAQ Section...
This is the FAQ (Frequently Asked Questions).
Have a look here before asking in the thread... in the worst case you will not find the answer you are searching!
If this section is useful for most users needs, I'll be glad to continue investing time to update this Q/A list!!
Q1:Fingerprint wake/home button works?
A: Yes, now we have the complete support and this feature is available on standard GSI roms (treble support is ready for it)

Q2: How can I revert back from treble to custom ROM whenever required?
A: Just flash the custom rom you like from TWRP and that's all. Custom rom flash will overwrite the boot.img,system and vendor partitions.

Q3: If I revert to a Custom rom, what I need to do to restore treble support?
A: Just flash the Treble zip through TWRP as the first time. Treble support need boot.img and vendor.img to be installed into the phone... nothing more... nothing less...

Q4: Phh GSI rom is quite poor in functionality. Why?
A: The purpose of Phh GSI AOSP rom is not to be a custom/featured rom. It is an experimental project that is born to have a common rom (better to say the same system.img) usable on many devices with treble support.
This support can be native, acquired after an Oreo original update or as we have done a custom integration on an "unsupported" device.
The meaning today of using a GSI rom is not to be a perfect rom for dayly use... or let's say, it can be a dayly rom only for users that like pure vanilla code.
In future we hope that many others custom roms will move to be a GSI (as JDC will try to do), so we will have the treble base to use these new project also on our devices.

Q5: If a new version of treble support is out, did I need to flash it or not?
A: Our project is on the way. This means that if is available a new update from us, it is for sure an enhancement with more support of feature or fixes.
In case you will need to install a GSI rom, check always here if there is any new version and get it.
In case you are running a custom rom without treble support, DO NOT update with treble flash, because most probably you will break your current installation.
Treble flash is 100% safe from the phone point of view... isn't safe for your current installation!! Why? Mainly because your current boot.img will be overwritten with treble support... 99% you will get a bootloop with a not treble rom!

Q6: How to get ROOT on phh gsi?
A: Firstly download the phh-gapps-su image. After installation, go to the market and install "phh superuser" app to manage the su access for the apps that need it. In the other cases, you can flash from TWRP the correct Magisk zip to gain root.

Q7: Where I can find the GSI images available?
A: Have a look in the OP post over here... there you can find the available ones. In any case here the LINK to the Treble Enabled Device Development section on XDA or here on GSI & sGSI List page

Q8: Everytime I entered the password, it says Decryption Unsuccessful!
A: You have internal SD encrypted. If after MIUI stock, you haven't FORMATTED the internal SD (FORMAT is not WIPE... Format will erase all data and files from the phone, so you must know what you are doing before formatting), the phone result as encrypted, so the rom is asking the password to decrypt the datas... Decryption Unsuccesful clearly states that the decryption procedure is not working. Post about the issue on the GSI rom you are using and provide logs to the developer to help digging the problem... if Developer will answer that encryption is not supported, you can only do one thing: backup all your data, files and pictures on an external storage (eg. a PC) and procede with a FORMAT DATA from TWRP to "destroy" the encryption and "free your phone from it"!

Q9: Is Google Camera working on Gsi?
A: Yes. But remember you need to install gapps package to let gcam works as it should.
We tested Gcam up to v6.1.021 on AOSiP Gsi. If you have greenish selfies pics, go in the Settings -> Fix ->and enable the fix for Front Camera and reboot. For SlowMotion, set 120fps.

Q10: Why can't flash a micro gapps and only pico is flashable?
A: If you get an error of Insufficent space on system partition, you need to resize the partition. Do in this way:
  • Flash the SYSTEM.IMG you wanna use (select a Vanilla based one)
  • Reboot to RECOVERY
  • MOUNT the SYSTEM partition
  • Go in WIPE menu -> ADVANCED WIPE -> select SYSTEM from the list and press the button REPAIR OR CHANGE FILE SYSTEM
  • select RESIZE FILE SYSTEM
  • than SWIPE to execute the command...
  • in case of error (you will see in red), repeat the RESIZE until it goes completed (Resizing... Done)
  • After this operation, the system partition will be resized to his maximum dimension (on Mi5 is around 2992MB)
  • before the installation of gapps package, do a REBOOT to recovery and after MOUNT the SYSTEM partition (check that it is really mounted)
  • Now you can flash the micro gapps without problem.

Q11: Is there any Magisk version working on Treble gsi?
A: Yes, you need to get v18.1 version or newer with treble support (check around).

Q12: VoLTE is working[/B]?
A: Yes. Install this ims.apk to use it!

Q13: ADB Logs are needed in case of Issue reporting...
A: In case you need help and want report an issue (eg. a boot problem), we need logcat of the phone. Just as sample, we report here what to do (but you must able to do by yourself... we are not giving help on how to do...)
  • prepare a PC (with adb package to support debug via usb connection)
  • flash on the phone our treble and the GSI image (just these 2 files, not any patch or other stuff)
  • reboot the phone
  • connect the usb cable
  • after the Mi logo screen, wait to hear from PC a sound that means the usb periferial has been recognised
  • go in a command window and type:
    --> adb devices (if the phone is connected, you will see the code written after the command executed)
    --> adb shell logcat > bootlog.txt (this will start real time recording of logs into the pc in the bootlog.txt file)
    --> when the phone has completed boot/reboot (eg. a boot loop or fastboot), you need to press Ctrl+C from keyboard to stop log recording.
  • send attached to the issue description post the bootlog.txt
  • ...let's dev check what's happening by reading the logcat.


... list will be updated...
The Following 37 Users Say Thank You to smeroni68 For This Useful Post: [ View ] Gift smeroni68 Ad-Free
10th March 2018, 12:15 PM |#3  
smeroni68's Avatar
OP Recognized Contributor
Flag Milano
Thanks Meter: 11,041
 
Donate to Me
More
Miscellanea...
Download (public versions history)

Here you can find the shared folder with all the version released of Treble support: GEMINI-TREBLE


Changelog's

v6 (20190316) - Release Candidate 2 full versioned_vndk v28
- VERSİONED_VNDK support is fully implemented
- FIXED NFC support
- FIXED Ambient Display main icon size and settings menu icons style... Thanks to Subezhj for helping fixing.
- FIXED ConfigPanel - Fingerprint settings menu icons style

v5 (20190308) - Release Candidate full versioned_vndk v28
- VERSİONED_VNDK support is fully implemented
- Mostly all library dependencies between system/vendor which are called as violations against treble's rule are succesfully eliminated
- Updated kernel as per treble's kernel docs (enforced)
- Vendor image's version is now 28
- Misc updates and fixes
- GSI Pie roms support (check in OP for some links)
- JDC PIE GSI rom given just as a preview for testing (JDC PIE GSI is build from sources without ANY hack!!)... It's pure AOSP as Google bring to their devices... NOTE: No support for gapps... they do not complete setup... you are advised.

v4 (20180409) - Beta partially versioned_vndk with the following updates:
- VERSİONED_VNDK support is partially implemented
- Lots of library dependencies between system/vendor which are called as violations against treble's rule are succesfully eliminated, only small number of lib dependencies which needs to be resolved are left
- Updated kernel as per treble's kernel docs
- Vendor image is now using google's stock vndk-sp, ll-ndk libs which are called as treble layer libs
- Vendor image's version is now 27.1.0
- Misc updates and fixes

v3 (20180329) - Beta status with the following updates:
- Updated camera Hal from latest qualcomm 8996 repo
- Hexedited more libs and removed more vendor system dependency (better treble and preparation for versioned vndk)
- Updated wifi configs from lates CAF

v2 (20180318) - Still alpha build with the following updates:
- Upstreamed kernel
- Hexedited blobs to correct path (for treble)
- Linker issues fixed
- Vendor overlays
- Latest device tree updates from CAF and miui oreo beta
- Disabled non-working apps (custom xiaomi doze package and configpanel app which were designed to work with LOS APIs)
- Disabled userspace thermal hal initialization which we dont have in cameraHal (faster cam launch)
- Increased jpeg quality parameters
- other misc. dev tree updates

v1 (20180310) - Initial release (Alpha)


Reported/Known Issues

- Camera works perfectly, but on some apk after a shot is taken with Flash active, the camera do not get more pictures... Close the app will clear the issue and you can get other pictures! Suggestion: do not use the flash with this camera apk if you have the issue! ... or use a working camera apk (is a better solution)!

to be updated...
The Following 29 Users Say Thank You to smeroni68 For This Useful Post: [ View ] Gift smeroni68 Ad-Free
10th March 2018, 12:23 PM |#4  
Senior Member
Flag mmcblk0p15
Thanks Meter: 1,120
 
Donate to Me
More
Big thanx and credits also goes to @smeroni68

All of the story is started with the identifying unused CUST partition which xiaomi left on our device Mi5 https://forum.xda-developers.com/sho...&postcount=300

And after we determined that the /cust partiton is unused on AOSP roms, we used it as /vendor partition as per the requirement of Full-Treble https://github.com/sirmordred/androi...1c384931b1ac0c nearly 3 month ago

And that is also the reason of nearly all devices which get Full-Treble support via custom implementation, are Xiaomi devices (Redmi Note 4, Mi5S and our Mi5)

Thanx also to my teammates who contributed this project

Our goal is now separating/isolating all vendor <=> system interactions (which will be enforced on future android releases for treble devices) and stabilizing vendor.img while getting closer to pure AOSP sources

Enjoy
The Following 32 Users Say Thank You to sir mordred For This Useful Post: [ View ] Gift sir mordred Ad-Free
10th March 2018, 12:23 PM |#5  
Senior Member
Flag mmcblk0p15
Thanks Meter: 1,120
 
Donate to Me
More
...
The Following User Says Thank You to sir mordred For This Useful Post: [ View ] Gift sir mordred Ad-Free
10th March 2018, 01:07 PM |#6  
Senior Member
Flag mmcblk0p15
Thanks Meter: 1,120
 
Donate to Me
More
...
The Following 2 Users Say Thank You to sir mordred For This Useful Post: [ View ] Gift sir mordred Ad-Free
10th March 2018, 01:22 PM |#7  
smeroni68's Avatar
OP Recognized Contributor
Flag Milano
Thanks Meter: 11,041
 
Donate to Me
More
Finally we are out for both MI5 and MI5S... yeah... now let's go ahead...
The Following 8 Users Say Thank You to smeroni68 For This Useful Post: [ View ] Gift smeroni68 Ad-Free
10th March 2018, 02:19 PM |#8  
Member
Thanks Meter: 18
 
More
Thanks for all JDCTeam
The Following 2 Users Say Thank You to danielbeltejar For This Useful Post: [ View ] Gift danielbeltejar Ad-Free
10th March 2018, 03:29 PM |#9  
MichaelPan01's Avatar
Member
Thanks Meter: 6
 
More
Great Job dude! Finally we got treble. Downloading now. Can't wait flashing.

通过我的 MI 5 上的 Tapatalk发言
10th March 2018, 05:28 PM |#10  
hans william's Avatar
Senior Member
Jakata
Thanks Meter: 459
 
More
Thank you Sir, downloading now
The Following User Says Thank You to hans william For This Useful Post: [ View ] Gift hans william Ad-Free
10th March 2018, 05:40 PM |#11  
Senior Member
Thanks Meter: 29
 
More
Great news ..only one query .. How can I revert back from treble to custom ROM whenever required?
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes