Skip to content

Instantly share code, notes, and snippets.

@Chityanj
Created July 22, 2018 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chityanj/0100ba8cc388b452bbc833b30a8f0a9e to your computer and use it in GitHub Desktop.
Save Chityanj/0100ba8cc388b452bbc833b30a8f0a9e to your computer and use it in GitHub Desktop.
*Credits:shivatejapeddi,ThE_MarD,dmd79,prajjwallaad
###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 <google-link-here>
It is all treble trouble everywhere so why shouldn't x2 join it?
I'm proud to announce that Le Max2 will now support project treble and you can flash Generic system images and even Android P. Exciting right?
You just need to follow the instructions mentioned and you're good to go.
##How we did?
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 you mess up badly.
There is an empty unusable partition in the phone called last_parti of <589mb> and I converted that to our vendor partition.
##Things you'll need:
1) Partition creator zip. https://drive.google.com/file/d/1TsHI-IrlA13cenIguLDBlhbt8mMPmtJK/view?usp=drivesdk
2) Treble supported TWRP.https://drive.google.com/open?id=1ay56n4yBAJ_wAfZb_nSr_RRfr8zRXZTq
3) AEX with Treble support. https://drive.google.com/open?id=1O2cfU2YDZElUy9Q8Drmha7os3jDHUngS
#Let's trebelize your x2 shall we?
Important: Carefully follow the steps as written below. I shall not be held responsible for any bricked devices. You do it on your own risk.
1) Flash the Treble supported TWRP. Again there are multiple ways to flash TWRP like
1.a)Use TWRP and flash the new recovery as an image in the recovery partition.
1.b) Use fastboot on the computer to flash the recovery image.
1.c) If you have root access then you can use an app like Flashify to flash the recovery.
2) Boot to recovery once flashed. 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.
3) Click wipe on TWRP homepage, select vendor and uncheck all other partitions and swipe to wipe. Nice you have successfully created vendor partition.
4)--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.
6) Wipe system, cache, dalvik cache and data. Flash the AEX Treble ROM which you downloaded earlier.
Bingo. You have successfully trebelized your x2.
Now start testing some GSIs right? Before you do that make sure you follow the below steps.
Keep in mind GSIs are not optimised for the device, as their name says Generic so expect bugs and not all the bugs can be resolved which come with them. A only GSIs are supported by Le Max 2 so don't flash A/B GSIs.
Procedure to flash GSIs.
1) Wipe system, data, cache and dalvik cache.
2) Install the GSI in System using TWRP -> Install -> Install image.
3) Reboot to system.
Time for some NOT TO DOs
1) Never wipe /vendor. If you do that your device won't work with any GSI. In case you accidentally wiped it you can flash AEX Treble rom to get it back. I might provide a vendor.img but I 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.
FAQs
Q.1 Will my device support normal roms after I enable treble?
A. Yes you can install and use any rom even after treble is enabled
###Tf you guys have any problems Just ask Us
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment