[RECOVERY][TREBLE] TWRP Recovery for Zenfone 3

Search This thread

Giovix92

Recognized Developer
Oct 22, 2015
1,679
1,687
Catanzaro, Italy
This is a TWRP fully Treble-ready with "Treble enabler" option in order to repartition safely the device.

Features:

  • TWRP fully Treble-ready;
  • Maintained with latest TWRP version;
  • Fully compatible with non-Treble devices - can be used as normal without Treble partitioning;
  • USB-OTG fixed
  • Has 'TWRP survival' function for automatically re-installing TWRP recovery when installing ROMs and kernels;
  • Adds a "Treble enabler" option that allows you to repartition your device in order to support Treble.
    • Has the option to shrink userdata to create Vendor partitions. All relevant partitions will be resized and formatted in one go.
    • If you shrink Userdata, it will ERASE DATA AND INTERNAL STORAGE COMPLETELY - but your device will stay compatible with all existing non-Treble ROM's

Instructions

  • Flash the recovery.
  • Reboot Recovery
  • Optional - Use the "Advanced > Treble enabler" option for repartition option.

If you opted to repartition for Treble, you are ready to flash a Treble ROM/Vendor pack.

About TWRP survival

TWRP survival is a simple hook that detects if a boot.img will be installed and restores TWRP after it's flashed. This only works if you have booted TWRP with Tissot Manager 2.0 from a real recovery boot - NOT from a recovery 'hot boot' (fastboot boot method).

You will see in the install log if a TWRP survival attempt is successful in the flash text output.

Automatic TWRP survival works when:
  • Flashing a ROM ZIP (or AIO) with TWRP
  • Flashing a boot.img in TWRP "Install Image" mode

Automatic TWRP survival does NOT work when:
  • Flashing a boot.img via fastboot
  • Restoring boot in a TWRP backup
  • Any other way of flashing a boot.img

In these cases, be sure the use the TWRP Installer immediately after flashing or restoring a backup - otherwise you may get the device into a confused state (especially if you restore a non-TWRP boot then try to install an AIO ROM without installing a new TWRP first).

Download

https://zenfone3-dev.gitlab.io/recovery/twrp-treble/

FAQ

Q) After I flash TWRP, I get kicked into fastboot when trying to boot the ROM!
A) Your kernel is not Treble-compatible.

Q) How do I update TWRP?
A) Just flash the ZIP installer again, then Reboot Recovery. Note that this will erase Magisk on BOTH slots if you have it installed to either, requiring you to reflash it to one/both slots. See my Treble guide FAQ section for more info on Magisk interaction.

Q) My PC can't see the MTP (storage) device from TWRP!
A) For dualboot compatibility, MTP is automatically disabled at various points. Just enable it manually in the Mounts menu to get access.

Q) If I shrink Userdata for Treble, will stock and OTA work?
A) I have heard varying results on this. It does for some, not for others. Please assume that this will NOT work.

Q) Can I restore a non-Treble TWRP backup after I repartition for Treble? And the other way around?
A) Yes!

Q) I see "Failed to mount '/system' (Device or resource busy)" red error in TWRP after flashing a ROM
A) You can safely ignore it. You just need to reboot recovery before you can flash anything else (like Gapps) to this ROM.

Thanks to:
@CosmicDan for his files for Tissot Manager & this thread template
@makorn645, @planet9, @Oki for Party

XDA:DevDB Information
TWRP Recovery for Zenfone 3, Tool/Utility for the Asus ZenFone 3

Contributors
Giovix92, makorn645,
Source Code: https://github.com/Giovix92/android_device_asus_zenfone3/tree/twrp-8.1


Version Information
Status: Stable
Current Stable Version: 20190312
Stable Release Date: 2019-03-12

Created 2019-03-12
Last Updated 2019-03-12
 
Last edited:

dVinsmoke

Senior Member
Apr 11, 2015
272
195
Soul Society
Just the treble los16 zenfone3 on our forum for now

But then I see no difference from a "normal" ROM ported specifically to a device. Should not Treble support be able to use them on several different devices?

For example, should not I be able to go to the AEX Treble download area and use it on ZF3? If it would not be the same as having to wait for a dev port AEX to ZF3.

I'm really confused lol
 

makorn645

Senior Member
Nov 27, 2016
225
1,411
Nonthaburi
But then I see no difference from a "normal" ROM ported specifically to a device. Should not Treble support be able to use them on several different devices?

For example, should not I be able to go to the AEX Treble download area and use it on ZF3? If it would not be the same as having to wait for a dev port AEX to ZF3.

I'm really confused lol
What do you expect? It's still in an early stage of porting. Some device specific bits still run from /system. GSI's may work but I doubt anything will work properly.
And I don't plan of supporting GSIs anyway.
 

dVinsmoke

Senior Member
Apr 11, 2015
272
195
Soul Society
What do you expect? It's still in an early stage of porting. Some device specific bits still run from /system. GSI's may work but I doubt anything will work properly.
And I don't plan of supporting GSIs anyway.

Being sincere I did not expect anything, since I did not understand anything lol This Treble left me was confused lol

So what's the difference of the Lineage Treble for a Lineage normal running in ZF3?
 

makorn645

Senior Member
Nov 27, 2016
225
1,411
Nonthaburi
Being sincere I did not expect anything, since I did not understand anything lol This Treble left me was confused lol

So what's the difference of the Lineage Treble for a Lineage normal running in ZF3?
Currently nothing much ( updated proprietary bits + vendor image taken in place )
Maybe in the near future when everything is in place. I'll seperate Vendor image from builds ( noticable smaller updates )
 

Giovix92

Recognized Developer
Oct 22, 2015
1,679
1,687
Catanzaro, Italy
Currently nothing much ( updated proprietary bits + vendor image taken in place )
Maybe in the near future when everything is in place. I'll seperate Vendor image from builds ( noticable smaller updates )
Also, when vendor img will be split from the ota package, with (if necessary) some adjustments we can flash GSI ROMs easily. :)
 
  • Like
Reactions: Williknot

fcbn98

Member
Apr 20, 2017
18
6
Feedback:
* HAVE A BACKUP. This tool messes with your partition table and is still unstable. Your data partition can be resized to the wrong size.

Will come back after a few months to provide more feedback. Appreciate the work guys.
 

[QS]

Senior Member
Jun 28, 2011
64
19
Works fine for me, data is correctly resized even with multiple changes from normal to treble and back...

Can't seem to wipe /cache partition.

Anyone knows why?
 

Giovix92

Recognized Developer
Oct 22, 2015
1,679
1,687
Catanzaro, Italy
Feedback:
* HAVE A BACKUP. This tool messes with your partition table and is still unstable. Your data partition can be resized to the wrong size.

Will come back after a few months to provide more feedback. Appreciate the work guys.
Well, that's normal.
Since you're going to make a new /vendor partition of about 1024mb, /data should be deleted & recreated in order to give some space to the new partition.
Also, what do you mean with "can be resized to the wrong size"?
The tool is pretty stable tho. Can you give more info such as model (ex. ZE552KL 4/64), script version (ex. 4.3b) & other?
Thanks.
 
  • Like
Reactions: CharlDay

Kaisogen

Member
Apr 2, 2018
9
0
I've successfully installed this tool, although attempting to install the new LOS 16 Android 9 ROM we have on this forum results in an error: 7, "Failed to mount '/vendor' (Invalid argument)"

From what I've perused so far in my research, that error mostly crops up on non-treble builds of TWRP, yet I definitely used the latest version from your website. I also redownloaded the latest version of LOS just to recheck, and yep, nothing's changed.
Any clue about what's going on here? I don't know much about Treble ROMs, or custom ROMing to be all honest.

EDIT: I have found the enable Treble option. Even when enabled and installed, after reboot, the /vendor partition cannot be read. It seems that after doing this too, I can't load files over USB, or mount my SD Card. I'm getting pretty confused as to what's happening. I can't boot into system, and fastboot won't connect to my PC.
 
Last edited:

makorn645

Senior Member
Nov 27, 2016
225
1,411
Nonthaburi
I've successfully installed this tool, although attempting to install the new LOS 16 Android 9 ROM we have on this forum results in an error: 7, "Failed to mount '/vendor' (Invalid argument)"

From what I've perused so far in my research, that error mostly crops up on non-treble builds of TWRP, yet I definitely used the latest version from your website. I also redownloaded the latest version of LOS just to recheck, and yep, nothing's changed.
Any clue about what's going on here? I don't know much about Treble ROMs, or custom ROMing to be all honest.

EDIT: I have found the enable Treble option. Even when enabled and installed, after reboot, the /vendor partition cannot be read. It seems that after doing this too, I can't load files over USB, or mount my SD Card. I'm getting pretty confused as to what's happening. I can't boot into system, and fastboot won't connect to my PC.
Did you follow these steps properly?
https://zenfone3-dev.gitlab.io/tutorials/repartition
 

Top Liked Posts

  • There are no posts matching your filters.
  • 11
    This is a TWRP fully Treble-ready with "Treble enabler" option in order to repartition safely the device.

    Features:

    • TWRP fully Treble-ready;
    • Maintained with latest TWRP version;
    • Fully compatible with non-Treble devices - can be used as normal without Treble partitioning;
    • USB-OTG fixed
    • Has 'TWRP survival' function for automatically re-installing TWRP recovery when installing ROMs and kernels;
    • Adds a "Treble enabler" option that allows you to repartition your device in order to support Treble.
      • Has the option to shrink userdata to create Vendor partitions. All relevant partitions will be resized and formatted in one go.
      • If you shrink Userdata, it will ERASE DATA AND INTERNAL STORAGE COMPLETELY - but your device will stay compatible with all existing non-Treble ROM's

    Instructions

    • Flash the recovery.
    • Reboot Recovery
    • Optional - Use the "Advanced > Treble enabler" option for repartition option.

    If you opted to repartition for Treble, you are ready to flash a Treble ROM/Vendor pack.

    About TWRP survival

    TWRP survival is a simple hook that detects if a boot.img will be installed and restores TWRP after it's flashed. This only works if you have booted TWRP with Tissot Manager 2.0 from a real recovery boot - NOT from a recovery 'hot boot' (fastboot boot method).

    You will see in the install log if a TWRP survival attempt is successful in the flash text output.

    Automatic TWRP survival works when:
    • Flashing a ROM ZIP (or AIO) with TWRP
    • Flashing a boot.img in TWRP "Install Image" mode

    Automatic TWRP survival does NOT work when:
    • Flashing a boot.img via fastboot
    • Restoring boot in a TWRP backup
    • Any other way of flashing a boot.img

    In these cases, be sure the use the TWRP Installer immediately after flashing or restoring a backup - otherwise you may get the device into a confused state (especially if you restore a non-TWRP boot then try to install an AIO ROM without installing a new TWRP first).

    Download

    https://zenfone3-dev.gitlab.io/recovery/twrp-treble/

    FAQ

    Q) After I flash TWRP, I get kicked into fastboot when trying to boot the ROM!
    A) Your kernel is not Treble-compatible.

    Q) How do I update TWRP?
    A) Just flash the ZIP installer again, then Reboot Recovery. Note that this will erase Magisk on BOTH slots if you have it installed to either, requiring you to reflash it to one/both slots. See my Treble guide FAQ section for more info on Magisk interaction.

    Q) My PC can't see the MTP (storage) device from TWRP!
    A) For dualboot compatibility, MTP is automatically disabled at various points. Just enable it manually in the Mounts menu to get access.

    Q) If I shrink Userdata for Treble, will stock and OTA work?
    A) I have heard varying results on this. It does for some, not for others. Please assume that this will NOT work.

    Q) Can I restore a non-Treble TWRP backup after I repartition for Treble? And the other way around?
    A) Yes!

    Q) I see "Failed to mount '/system' (Device or resource busy)" red error in TWRP after flashing a ROM
    A) You can safely ignore it. You just need to reboot recovery before you can flash anything else (like Gapps) to this ROM.

    Thanks to:
    @CosmicDan for his files for Tissot Manager & this thread template
    @makorn645, @planet9, @Oki for Party

    XDA:DevDB Information
    TWRP Recovery for Zenfone 3, Tool/Utility for the Asus ZenFone 3

    Contributors
    Giovix92, makorn645,
    Source Code: https://github.com/Giovix92/android_device_asus_zenfone3/tree/twrp-8.1


    Version Information
    Status: Stable
    Current Stable Version: 20190312
    Stable Release Date: 2019-03-12

    Created 2019-03-12
    Last Updated 2019-03-12
    4
    [QS said:
    ;79165451]Works fine for me, data is correctly resized even with multiple changes from normal to treble and back...

    Can't seem to wipe /cache partition.

    Anyone knows why?
    A bugfix release will be coming along with the next LineageOS build.
    3
    But then I see no difference from a "normal" ROM ported specifically to a device. Should not Treble support be able to use them on several different devices?

    For example, should not I be able to go to the AEX Treble download area and use it on ZF3? If it would not be the same as having to wait for a dev port AEX to ZF3.

    I'm really confused lol
    What do you expect? It's still in an early stage of porting. Some device specific bits still run from /system. GSI's may work but I doubt anything will work properly.
    And I don't plan of supporting GSIs anyway.
    1
    Currently nothing much ( updated proprietary bits + vendor image taken in place )
    Maybe in the near future when everything is in place. I'll seperate Vendor image from builds ( noticable smaller updates )
    Also, when vendor img will be split from the ota package, with (if necessary) some adjustments we can flash GSI ROMs easily. :)
    1
    Great work guys!! Waiting for vendor partition, for some tests!
    Well, repartition works fine. After repartition a new /vendor partition of 1024mb will be made.
    Although, you'll loose your data (apps+personal). So make sure to do a full backup of your device.
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone