[LeEco Le Max 2 ROMs, Kernels, Recoveries, & Other ] shivatejapeddi:
[TREBLE] Project Treble for LEECO MAX 2 (x2)​

#include "std_disclaimer.h"
/*
* 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.
*/

### What is Treble? ###

https://android-developers.googleblog.com/2017/05/here-comes-treble-modular-base-for.html?m=1

I'll keep the technical details about treble away from this thread as it has been covered by xda already.

If you want to know more about that visit here : https://source.android.com/devices/architecture/

Treble is everywhere, so why shouldn't x2 join it?

I'm proud to announce that Le Max2 will now fully support project treble and you can flash Generic System Images (GSI) and even Android P. Exciting right ?

You just need to follow the instructions mentioned and you're good to go.

## How we did it? ##

You might be wondering how I managed to get treble support...

NO, I didn't repartition the phone so you shouldn't worry about bricking the phone unless the directions were not followed properly.

There is an empty and unformatted partition in the phone called "last_parti" with a size of <589mb> and I converted that to our vendor partition, similar to how OnePlus devices were able to achieve teble support without the need to repartition.

You may doubt that that you will still be able to flash stock eui rom, but yes u can and we have tested it. If you encounter any error no 7 during eui flashing? Please switch to a non-treble build of TWRP or just delete block checking in update-script.

If you have any difficulties? You may join our telegram group for help :

https://t.me/joinchat/HFzBDlHXN-52-GZBg7725w

## Things you'll need to download (instructions are below):

New method :

1) Treble supported TWRP : New one by @GalaticStryder https://drive.google.com/open?id=1mx-uGryLXiIR7fDSDL4iBPdXhd7qLHjQ

2) Treble supported builds can be found here : https://www.androidfilehost.com/?fid=5862345805528055916

Previous method :

1) Partition creator zip : https://www.androidfilehost.com/?fid=5862345805528055960

2) Treble supported TWRP : https://www.androidfilehost.com/?fid=5862345805528055961

3) Treble supported builds can be found here : https://www.androidfilehost.com/?fid=5862345805528055916

Let's trebelize your x2 shall we?

**Important: Instructions are absolutly clear, so please carefully follow the steps as written below. I shall not be held responsible for any bricked devices. You do this on your own risk.

New method :

1) Flash the Treble supported TWRP. Again there are multiple ways to flash TWRP like

Use TWRP and flash the new recovery as an image in the recovery partition.

Use fastboot on the computer to flash the recovery image.

If you have root access then you can use an app like Flashify to flash the recovery.

2) Reboot to recovery to ensure the treble version is launched.

3) In the "Advanced" menu please click and swipe on "Treblelize"

4) Try to wipe vendor partition. If Treblelize worked? It should wipe without errors.

Optionally, you can also try to mount Vendor partition to see if it mounts without errors too.

4) After completing 1-4 your device will have vendor partition but it won't be ready to flash GSIs. For being able to do it goto step

5) Wipe system, cache, dalvik cache and data.

6) Flash the AEX Treble ROM which you downloaded earlier.

Previous Method :

1)Flash the Treble supported TWRP. Again there are multiple ways to flash TWRP like

Use TWRP and flash the new recovery as an image in the recovery partition.

Use fastboot on the computer to flash the recovery image.

If you have root access then you can use an app like Flashify to flash the recovery.

2) Reboot to recovery once flashed. (Even if u flashed through twrp ,you should reboot to recovery again)

3) Flash the partition creator zip now. After flashing it it might show an error about cannot mount /vendor, ignore it and go on to

the next step.

4) Click wipe on TWRP homepage, select vendor and uncheck all other partitions and swipe to wipe. Nice you have successfully

created vendor partition.

optional. You can check if you are able to mount /vendor partition from the recovery.

5) After completing 1-4 your device will have vendor partition but it won't be ready to flash GSIs. For being able to do it goto step

6) Wipe system, cache, dalvik cache and data.

7) Flash the AEX Treble ROM which you downloaded earlier.

Bingo! You have successfully trebelized your x2!

Time for some DO NOTs

1) NEVER wipe /vendor. If you do that your device won't work with any GSI. (u should wipe vendor only if u flash non treble rom )In case you accidentally wiped it you can flash AEX Treble rom to get it back. I might provide a vendor.img but don't think like doing it right now.

2) NEVER install A/B GSIs. Our device is treble enabled but doesn't have an A/B partition structure. Le Max2 support A only GSIs.

Instructions for flashing GSI of any Rom

1) Download a GSI from here : https://xdaforums.com/project-treble/trebleenabled-device-development

2) If it is in a zip archive, then please unpack it.

3) You can find instructions here : https://www.xda-developers.com/flash-generic-system-image-project-treble-device/

and reboot

Want to try more awesome things like installing Android P?

Instructions for flashing Android P GSI :

Complete credit for P image goes to : @erfanoabdi

Xda link for P GSI : https://xdaforums.com/project-treble/trebleenabled-device-development/rom-android-p-developer-preview-t3816659

Steps:

1) Download link for P gsi (DP4): https://androidfilehost.com/?w=files&flid=279295

2) Wipe all Paritions except : vendor, internal storage

3) Install P system image to system

4) Mount vendor in TWRP

5) Flash POST-sGSI zips from 1 to 3 in priority

6) Then flash my sensor fix zip here : https://drive.google.com/open?id=11l4p6NxwixMSQlTLhLM_8wuXpvmrNpJq

and reboot

Volte Fix for P : https://drive.google.com/file/d/1h-2qTwhUidU9gDBFzj86RMfZn-vwLOnG/view#

BUGS IN ANDROID P GSI

VOLTE-its fixed

U tell me

Ok, all the best to you!

It is not easy to make complete treble with Zero Bugs

and we tried our best in making that.

I want to include all the contributers so the list is quite large.

Credits and contributors :

@shivatejapeddi (yeah I myself worked very hard to achieve Treble for x2)

@davidevinavil (literally helped me in creating partition and helped in solving crucial bugs )

@ThE_MarD (our official lineage contributer and helped me in solving some bugs)

@Chityanj (helped me with server and testing)

@prajjwal.laad (tester)

@Abhishek4587Kumar (tester)

@yaser59527 (tester)

@Rk585(dunno)

@GalaticStryder (for his newer and easier method to "Treblelize" x2)

Please let us know if we missed anyone.

Donations :

We worked very hard for fixing things and making things work, and I finised all my free google credits and am now using a paid legacy server for building roms.

Want to donate me ?

You can Here : https://www.paypal.me/shivatejapeddi

XDA:DevDB Information

[TREBLE] Project Treble for LEECO MAX 2 (x2) (Complete), Tool/Utility for the LeEco Le Max 2

Contributors

shivatejapeddi, ThE_MarD, Chityanj

Source Code: https://github.com/Chityanj/treble_devicetree

Version Information

Status: Stable

Current Stable Version: 8.1.0

Stable Release Date: 2018-07-23

Created 2018-07-22

Last Updated 2018-09-01