[OFFICIAL&TESTS]TWRP for the LeEco Le Max 2

Search This thread

mjoach

Senior Member
Dec 9, 2012
464
164
Kyoto
Heyyo, new test build up! "twrp-x2-3.2.3-unofficial-pstore-fde-vendorwipe" has a kernel update for pstore support, the pending Full Disk Encryption fixes
Awesome, thanks for looking into FDE! Just to better understand implications for existing ROMs, when Android does initial encryption or boots, does it rely on TWRP in any way or it's just ROM side code there? Basically, are these fixes to decrypting data inside TWRP or they actually enable LOS16 and others to work with FDE?
 
Last edited:

ThE_MarD

Recognized Developer
Dec 10, 2014
3,848
4,605
Grande Prairie
LeEco Le Max 2
Moto X4
Heyyo, new test build is up! (link to my unofficial test builds in the first post) twrp-x2-3.3.0-unofficial-encryptionfooterfix is synced to the latest TWRP sources (I'm guessing the TWRP team is gearing up for a new version, hence it built as 3.3.0). This version contains the merged commit for fixing the bugged format data function for devices with encryption footers (which LeEco devices use).
 

zloy_74

Member
Feb 14, 2009
47
4
Heyyo, new test build is up! (link to my unofficial test builds in the first post) twrp-x2-3.3.0-unofficial-encryptionfooterfix is synced to the latest TWRP sources (I'm guessing the TWRP team is gearing up for a new version, hence it built as 3.3.0). This version contains the merged commit for fixing the bugged format data function for devices with encryption footers (which LeEco devices use).
Hi Mark! Looks like in latest test build we has a little bug, when I try to update ROM it didn't updates at all(I mean automatically) in 3.2.3.0 all works properly
 

ThE_MarD

Recognized Developer
Dec 10, 2014
3,848
4,605
Grande Prairie
LeEco Le Max 2
Moto X4
Awesome, thanks for looking into FDE! Just to better understand implications for existing ROMs, when Android does initial encryption or boots, does it rely on TWRP in any way or it's just ROM side code there? Basically, are these fixes to decrypting data inside TWRP or they actually enable LOS16 and others to work with FDE?
Heyyo mjoach, sorry I missed your question! Yes with this build encryption works perfectly fine as long as your data partition properly has an encryption footer. TWRP will properly decrypt data partition and can also install updates automatically (I tested with LineageOS 16.0. LOS updater checks for encryption and then copies the update file to /tmp directory and uses that to update system).

Hi Mark! Looks like in latest test build we has a little bug, when I try to update ROM it didn't updates at all(I mean automatically) in 3.2.3.0 all works properly
Yeah, it seems 3.3.0 is still a WIP, so I deleted that build. I'll wait a while I guess for TWRP to get updated a little more.
 
  • Like
Reactions: zloy_74 and mjoach

ThE_MarD

Recognized Developer
Dec 10, 2014
3,848
4,605
Grande Prairie
LeEco Le Max 2
Moto X4
Heyyo, I guess official TWRP 3.3.0-0 is out meow for x2! That's cool. :)

I'm slow by a few hours haha as I managed to get TWRP 3.3.0 based on Android 9.0 Pie working great with OnePlus3 9.0 pie decryption blobs... so unofficial test build twrp-3.3.0-x2-pieblobs-9.0 has that and link is in the first post under test build. It also has a fix for the real-time clock so that it's using the proper values from our persist partition. :good:
 

Zayatoshi

Senior Member
Aug 25, 2014
318
73
FRANCE
Hi. I tested the latest version of test on my x2 (backup restore / flash wipe) everything seems to work with rom pie. Great job [emoji106][emoji106]

Envoyé de mon LEX820 en utilisant Tapatalk
 
  • Like
Reactions: ThE_MarD

Neutralite

Senior Member
Jan 13, 2019
166
27
İstanbul
LeEco Le Max 2
Heyyo, new test build is up! (link to my unofficial test builds in the first post) twrp-x2-3.3.0-unofficial-encryptionfooterfix is synced to the latest TWRP sources (I'm guessing the TWRP team is gearing up for a new version, hence it built as 3.3.0). This version contains the merged commit for fixing the bugged format data function for devices with encryption footers (which LeEco devices use).

Need to format data to load TWRP-3.3.0-0-x2?
 
  • Like
Reactions: ThE_MarD

ThE_MarD

Recognized Developer
Dec 10, 2014
3,848
4,605
Grande Prairie
LeEco Le Max 2
Moto X4
Heyyo, as @bilausdaniel mentioned just install image of TWRP to recovery partition and then reboot to recovery and it will be good to go! :)

@min1968 I know for certain that my test build of TWRP 3.3.0 based on pie with op3 pie decryption blobs works perfectly for decrypting LineageOS 16.0 and 15.1 with either op3 oreo or pie qseecomd/keystore blobs.

I haven't tested the official 3.3.0-0 build but it should also work. I know for certain that 3.2.3-1 does work.

I have asked the TWRP team to create a new production build of TWRP 3.3.0 with the changes for rebased on pie with op3 pie decryption blobs and also a fix for the real-time clock so that TWRP clock shows the correct time, so hopefully, soon we shall see official TWRP 3.3.0-1 for x2 on their website. :good:

UPDATE: TWRP 3.3.0-1 official for x2 is live! :)
 
Last edited:

superedit86

Member
Jan 21, 2017
35
1
my phone is not treblized.
I am not yet very familiar with the topic, but can you include the treblize option in this twrp?
or is it not not necessary anymore?
from what i understand i just need to wipe vendor partition, mount it, and install a treble rom afterwards
thanks
 

Reetesh54

Senior Member
Sep 10, 2017
170
27
LeEco Le Max 2
Lenovo ZUK Z2 (Plus)
my phone is not treblized.
I am not yet very familiar with the topic, but can you include the treblize option in this twrp?
or is it not not necessary anymore?
from what i understand i just need to wipe vendor partition, mount it, and install a treble rom afterwards
thanks
Install latest twrp by @ThE_MarD
Flash lineage Os (or any other rom which is based on lineage) and gapps package.
You Are Ready To Rock :cowboy:
 
Last edited:

ThE_MarD

Recognized Developer
Dec 10, 2014
3,848
4,605
Grande Prairie
LeEco Le Max 2
Moto X4
Heyyo, new test build going up! twrp-3.3.0-x2-pieblobs-9.0-fixed_system_and_vendor_restore has... you guessed it, fixed system and vendor restore. Link in the first post as always.

This is a TWRP specific bug for devices built on 9.0 so that means x2, zl1 and zl0 will unfortunately have this issue (and other 9.0 TWRP devices like oneplus3).

We'll need this merged for Official TWRP builds to also receive the fix:
https://gerrit.omnirom.org/33894
 

ThE_MarD

Recognized Developer
Dec 10, 2014
3,848
4,605
Grande Prairie
LeEco Le Max 2
Moto X4
Heyyo @mlody95pl , please ensure you are using either the latest official or test build of TWRP based on 3.3.0 Android 9.0 Pie. I just tested adb sideload and it works for me. Please also ensure adb and fastboot are updated on your PC.

Here's proof from my log of flashing firmware-20S-x829-le_x2.zip via adb sideload.

Code:
adb version
Android Debug Bridge version 1.0.39
Version 1:8.1.0+r23-5~18.04
Installed as /usr/lib/android-sdk/platform-tools/adb

fastboot --version
fastboot version 1:8.1.0+r23-5~18.04
Installed as /usr/lib/android-sdk/platform-tools/fastboot

Code:
I:operation_start: 'Sideload'
Starting ADB sideload feature...
E:[MTP] request read returned -1, errno: 5I:Disabling MTP
Stopping adbd...
adbd pid 497 found, sending kill.
BOARD_HAS_NO_REAL_SDCARD := true
RECOVERY_SDCARD_ON_DATA := true
I:Lun file '/sys/class/android_usb/android0/f_mass_storage/lun0/file' does not exist, USB storage mode disabled
TW_INCLUDE_CRYPTO := true
I:TW_BRIGHTNESS_PATH := /sys/class/leds/lcd-backlight/brightness
I:Found brightness file at '/sys/class/leds/lcd-backlight/brightness'
I:Got max brightness 255 from '/sys/class/leds/lcd-backlight/max_brightness'
I:TWFunc::Set_Brightness: Setting brightness control to 102
I:LANG: en
I:TWFunc::Set_Brightness: Setting brightness control to 5
I:TWFunc::Set_Brightness: Setting brightness control to 0
sideload-host file size 46378041 block size 65536
I:TWFunc::Set_Brightness: Setting brightness control to 25
Installing zip file '/sideload/package.zip'
unknown fuse request opcode 2016
I:Update binary zip
Verifying package compatibility...
Package doesn't contain compatibility.zip entry
I:Extracting updater binary 'META-INF/com/google/android/update-binary'
I:Zip does not contain SELinux file_contexts file in its root.
I:has_legacy_properties: Found legacy property match!
I:Legacy property environment initialized.
unknown fuse request opcode 2016
UFS device detected
Target: LeEco/LeMax2_NA/le_x2_na:6.0.1/FIXNAOP5802011301S/letv11301725:user/release-keysAttempting to process /dev/block/bootdevice/by-name/sbl1bak

/dev/block/bootdevice/by-name/sbl1bak not present. Skipping
Attempting to process /dev/block/bootdevice/by-name/rpmbak
Copying /dev/block/sde into lun_list[0]
Patching firmware images...Attempting to process /dev/block/bootdevice/by-name/tzbak

Attempting to process /dev/block/bootdevice/by-name/abootbak
Attempting to process /dev/block/bootdevice/by-name/hypbak
Attempting to process /dev/block/bootdevice/by-name/lksecappbak
/dev/block/bootdevice/by-name/lksecappbak not present. Skipping
Attempting to process /dev/block/bootdevice/by-name/keymasterbak
Attempting to process /dev/block/bootdevice/by-name/cmnlibbak
Attempting to process /dev/block/bootdevice/by-name/cmnlib64bak
Attempting to process /dev/block/bootdevice/by-name/pmicbak
Preparing /dev/block/sde for update stage 1
gpt_get_state: Block size is  4096
gpt_get_state: Block size is  4096
UFS device detected
Attempting to process /dev/block/bootdevice/by-name/sbl1bak
/dev/block/bootdevice/by-name/sbl1bak not present. Skipping
Attempting to process /dev/block/bootdevice/by-name/rpmbak
Copying /dev/block/sde into lun_list[0]
Attempting to process /dev/block/bootdevice/by-name/tzbak
Attempting to process /dev/block/bootdevice/by-name/abootbak
Attempting to process /dev/block/bootdevice/by-name/hypbak
Attempting to process /dev/block/bootdevice/by-name/lksecappbak
/dev/block/bootdevice/by-name/lksecappbak not present. Skipping
Attempting to process /dev/block/bootdevice/by-name/keymasterbak
Attempting to process /dev/block/bootdevice/by-name/cmnlibbak
Attempting to process /dev/block/bootdevice/by-name/cmnlib64bak
Attempting to process /dev/block/bootdevice/by-name/pmicbak
Preparing /dev/block/sde for update stage 2
gpt_get_state: Block size is  4096
gpt_get_state: Block size is  4096
UFS device detected
Attempting to process /dev/block/bootdevice/by-name/sbl1bak
/dev/block/bootdevice/by-name/sbl1bak not present. Skipping
Attempting to process /dev/block/bootdevice/by-name/rpmbak
Copying /dev/block/sde into lun_list[0]
Attempting to process /dev/block/bootdevice/by-name/tzbak
Attempting to process /dev/block/bootdevice/by-name/abootbak
Attempting to process /dev/block/bootdevice/by-name/hypbak
Attempting to process /dev/block/bootdevice/by-name/lksecappbak
/dev/block/bootdevice/by-name/lksecappbak not present. Skipping
Attempting to process /dev/block/bootdevice/by-name/keymasterbak
Attempting to process /dev/block/bootdevice/by-name/cmnlibbak
Attempting to process /dev/block/bootdevice/by-name/cmnlib64bak
Attempting to process /dev/block/bootdevice/by-name/pmicbak
Preparing /dev/block/sde for update stage 3
gpt_get_state: Block size is  4096
gpt_get_state: Block size is  4096
script succeeded: result was [1.000000]I:Updater process ended with RC=0
I:Legacy property environment disabled.
I:Install took 11 second(s).
I:Signaling child sideload process to exit.
I:Waiting for child sideload process to exit.
sideload_host finished
 

Top Liked Posts

  • There are no posts matching your filters.
  • 37
    TWRP-Feature-Image-810x298_c.png
    Code:
    #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 doing this to your device
    * 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.
    */

    This is for OFFICIAL and BETA builds of TWRP for the LeEco Le Max 2

    Stable Downloads:
    [url]https://twrp.me/leeco/leecolemax2.html[/URL]

    Test Downloads:
    https://osdn.net/projects/twrp-for-x2/releases/

    Sources:
    Official: https://github.com/TeamWin/android_device_leeco_x2
    Tests: https://github.com/ThEMarD/android_device_leeco_x2-twrp

    Platform Tools (adb/fastboot):
    https://developer.android.com/studio/releases/platform-tools.html#download

    Installation:
    1. Make sure your bootloader is unlocked
    2. Download the recovery image from above
    3. Reboot into fastboot
    4. Run this command (Change the .img to whatever the name of file is you downloaded):
      Code:
      fastboot flash recovery twrp-3.5.0_9-0-x2.img
    5. Once it is flashed, please force a reboot to recovery by holding down the Power and Volume Up buttons at the same time until the phone reboots and you see the LeEco logo and the word "recovery" underneath it. (This is because if you allow normal boot after flashing TWRP and you are using EUI ROM and your phone reboots to EUI ROM? It will overwrite recovery with stock EUI ROM recovery. Forcing a reboot from bootloader to recovery prevents this issue)

    Upgrade instructions
    1. Download desired TWRP version
    2. Reboot to recovery
    3. Select Install
    4. tap on "install image" and select the TWRP.img you downloaded from step one
    5. select the recovery partition and install the TWRP.img to it
    6. Reboot to recovery and confirm that the updated TWRP image is installed

    For the TEST builds of TWRP? Please let me know if this works. If so? I will submit it to Gerrit for official updates.

    Credits:
    • bigbiff for helping me get setup on on gerrit.twrp.me for official status and updating official TWRP for the Le Max 2
    • Varzag, LEvvvEL, harryohh, kayyappan, bilausdaniel and anyone else I missed who tested my builds of TWRP
    • Ncrypt3d : He had a original base that did not boot but we ping ponged and got it working.
    • AndroPlus-org Fixing Decryption and getting OTG working with some cables
    • deadman96385 for the work he has done on for the Le Max 2
    • jrior001 for his work on TWRP for the Le Max 2 and in general for msm8996-common stuff too
    • codeworkx for his tweaks I implemented into my TWRP commit and everything he has done for LeEco devices
    • andr68rus for everything he has done for the LeEco Le Max 2
    • infrag as well for everything he has done for the Le Max 2
    • shivatejapeddi as well for his work on the Le Max 2
    • GalaticStryder for helping resolve the f2fs issue and his contributions to the kernel and x2's truly panel fix
    • Dianlujitao for his continued work on TWRP and fixing encryption footers for TWRP based on 8.1 and above
    • ok I could literally be here all day typing so essentially anyone who has worked on the msm8996 common kernel for LineageOS (note: will take forever to generate the list https://github.com/LineageOS/android_kernel_leeco_msm8996/graphs/contributors)

    XDA:DevDB Information
    [OFFICIAL&TESTS]TWRP for the LeEco Le Max 2, Tool/Utility for the LeEco Le Max 2

    Contributors
    ThE_MarD, deadman96385, jrior001, Ncrypt3d, AndroPlus-org, codeworkx, andr68rus, infrag, shivatejapeddi
    9
    Hi excellent work.
    Check this to if anything can help on development..

    le_x2 Latest TWRP 3.2.1-1. Updated Firmware Recovery .. Kernel latest OREO-N-Support. f2fs support, more partitions for backup and restore. Extra tools inside.. Flash it through TWRP, like a regular zip . https://drive.google.com/open?id=1T3NQ_QQafWulIxtD9JT-yH0wYXZtK7Ye
    SS
    https://imgur.com/a/qHJWV
    9
    Heyyo, new test build up! "twrp-x2-3.2.3-unofficial-pstore-fde-vendorwipe" has a kernel update for pstore support, the pending Full Disk Encryption fixes (current official 3.2.3-1 build of TWRP has a bug with wipe / format that prevents FDE from working correctly).

    The fixes for FDE also includes a patch that allows to and from f2fs on data with our encrypted footer.

    Also, as requested by users the ability to wipe vendor (be VERY careful about this! I don't recommend wiping vendor since ROM installs flash an image to vendor partition, but here's the option to wipe it anyways since it's what users have requested. Wiping vendor without flashing a new ROM immediately after will cause the device to not boot).

    I also have no plans to update my guide to include vendor wiping since I don't recommend it.

    EUI ROM doesn't use the vendor partition as well, so it doesn't care we renamed last_parti to vendor, thus there's no need to wipe in order to install EUI ROM.

    Please also note, once installed it'll show TWRP version 3.2.3-0... that is fine. That "-1" on official only means device patched version and doesn't reflect any major TWRP patch version... That, and I'm too lazy to manually change device patch version number on my unofficial builds lol...


    OH! I totally forgot to request feedback for encryption on both ext4 and f2fs on Oreo or earlier ROMs after wiping or formatting data!!! Pie ROMs might still have unreliable FDE, so the best test ROMs would be earlier versions of Android with confirmed working FDE. :good:
    8
    Heyyo, new test build is up! (link to my unofficial test builds in the first post) twrp-x2-3.3.0-unofficial-encryptionfooterfix is synced to the latest TWRP sources (I'm guessing the TWRP team is gearing up for a new version, hence it built as 3.3.0). This version contains the merged commit for fixing the bugged format data function for devices with encryption footers (which LeEco devices use).
    8
    Heyyo, Updated unofficial TWRP for Project Treble Vendor partition mounting (if the device is "treblized" already) and updated kernel for Pie support as well!

    https://www.androidfilehost.com/?fid=1322778262904020817

    (Will try to push to TWRP Gerrit once they fix android_device_leeco_x2 branch... I think a recent upgrade to TWRP's Gerrit accidentally removed our branch)