FORUMS
Remove All Ads from XDA

[Recovery] Official TWRP for the ZTE Axon 7

1,493 posts
Thanks Meter: 6,178
 
Post Reply Email Thread
Team Win Recovery Project 3.1.1-0



This is for the A2017, A2017U, and A2017G.

WARNING: The ZTE Axon 7 stock boot image has dm-verity, which prevents you from booting if you swipe to enable system modifications!
SOLUTION: Follow the full rooting steps below in order to allow system modifications without the risk of a boot loop!

WHAT IS TWRP?

Oh come on, you know what it is - don't try to fool me!
In case you're serious, though...

Team Win Recovery Project is a custom recovery for Android devices.
It allows you to back up and restore your data, flash custom ROMs to your device, repair broken file systems, and root your device.

Read more about TWRP here: https://twrp.me/about/

DOWNLOAD

You can find the device page here:
http://teamw.in/devices/zteaxon7.html

There is a download link there, as well as instructions on how to flash it.

You can find up to date fastboot & adb binaries here!
UNLOCKING YOUR BOOTLOADER

WARNING: Unlocking your bootloader will erase all userdata on the device! Your device will be completely reset to factory defaults!

A2017U or A2017 users can simply unlock from EDL mode using MiFlash here.

I do not have a method for A2017G, there may be other threads on XDA to guide you through the process.

FULL STEPS FOR OBTAINING ROOT

Follow these instructions until someone nice comes along and makes a video from them (without ads):
  1. Unlock your bootloader! See above!
  2. Download TWRP for the ZTE Axon 7.
  3. Reboot your device into fastboot mode. To do this, select reboot from the power menu and hold the [Volume Up] button while your device reboots or boots from power off.
  4. Once you're in fastboot with your bootloader unlocked, you're ready to flash TWRP. To do this, run the command (replacing twrp.img with the actual image name):
    fastboot flash recovery twrp.img
  5. Once the image is flashed, you should use your volume keys to navigate to RECOVERY and the press the power key to select it.
  6. At this point, you will reach the screen asking you if you want to allow system modifications.
    By swiping right, you will trigger dm-verity, and if you don't follow the next step you will be unable to boot!
    If you are going to root your device and follow the rest of these steps, then it is safe to swipe right and enable modifications.
  7. If you want to be rooted with SuperSU:
    Download the latest SuperSU stable by Chainfire.
    Without exiting TWRP, transfer the SuperSU zip to your device over MTP* and flash it using [Install] in TWRP.
    ---or (not both) ---
    If you want to be rooted with Magisk:
    Download the latest Magisk stable by topjohnwu.
    Without exiting TWRP, transfer the Magisk zip to your device over MTP* and flash it using [Install] in TWRP.
    ---or (not both) ---
    If you want to be rooted with something else or just want a bootable system:
    Download the latest dm-verity and forced encryption disabler zip.
    Without exiting TWRP, transfer the no-verity-opt-encrypt zip to your device over MTP* and flash it using [Install] in TWRP.
    This will also allow you to use [Format Data] to completely disable your encryption if desired.
  8. Go to [Reboot] -> [System].
  9. Wait 2-5 minutes for your device to finish setting itself up. (SuperSU will reboot you a few times)
* MTP, known as Media Transfer Protocol, is the same way you transfer files from your PC to your device when booted into system.

UPDATING TWRP

To update TWRP, simply download the new twrp.img on your phone, then boot into your current TWRP and flash it.
To flash a twrp.img, navigate to [Install] -> [Flash Image] -> select your twrp.img -> [x] Recovery -> Flash!
After that, just use [Reboot] -> [Recovery] to reboot into the updated TWRP.

CHANGES
  • v3.1.1-0 (twrp.me) - See release details here!
  • v3.1.0-0 (twrp.me) - See release details here!
  • v3.0.4-1 (build.nethunter.com) - Fix crash on selecting reboot with an empty data partition, add Data backup warnings
  • v3.0.4-0 (build.nethunter.com) - Capability restoration for Nougat, F2FS backport support, EXT4 decryption support
  • v3.0.3-1 (twrp.me) - Use crypto libraries from ROM (Nougat support). Fix USB OTG and Fast Charging. Reduce boot times.
  • v3.0.3-0 (twrp.me) - Renamed to ailsa_ii, Persist merged with EFS, Modem no longer mounted, Backup/Restore/Flash Bluetooth/System Image added. LA.HB.1.3.1.c1-19500-8x96.0 + Linux 3.18.45.
  • v3.0.2-0 (twrp.me) - Initial release.

FEATURES
  • MTP support
  • USB OTG storage support
  • Legacy USB Mass Storage mode support - use your phone like an SDCard reader or flash drive!
  • Hardware Qualcomm-based full-disk encryption support
  • f2fs file system support (read, write, format, backup & restore)
  • exFAT file system support (read, write, format)
  • NTFS file system support (read, write, format)
  • ADB root
  • Full SELinux support
  • Built in android 6.0 tree
  • Allows ZTE full OTA flashing (only for A2017U firmware)

KNOWN ISSUES
  • F2FS takes a long time to boot, see below.

WHY DOES F2FS MAKE TWRP SO SLOW?

When TWRP boots up or wipes partitions and a few other scenarios, it checks each partition to see how much disk space is used. Ext4 handles disk usage calls quite efficiently and will finish this very fast. F2FS on the other hand is very slow when it comes to checking disk usage. We're unsure why this is. Every file on the F2FS formatted partition adds a little more time, and a device that is 30 GB full could take up to 10 minutes to boot TWRP!
I suggest switching your data partition to ext4 - all the f2fs hype is merely from benchmarks that don't actually represent real world use (ie. you're not writing thousands of files per second)
For someone who doesn't do lots of write access to their data partition, ext4 can actually be advantageous (it has faster access times and reads!)

HOW DO I GET LOGS SO WHEN I COMPLAIN I'M NOT COMPLETELY IGNORED OR SHAMED BY OTHER USERS?

To get logs while in TWRP, you should connect your device to your PC and use adb.
adb pull /tmp/recovery.log
adb exec-out dmesg > dmesg.log

This will create 2 files in the directory your shell is currently in, recovery.log and dmesg.log. You will need to upload these somewhere such as a pastebin or Google Drive. You can also attach it to your XDA post (recommended!)

If you are having an operating system boot issue, you should gather a ramoops log instead. Do this while in TWRP after the failed boot:
adb exec-out "tar c /sys/fs/pstore 2>/dev/null" > pstore.tar

CONTACT & SUPPORT

You can find us on IRC at #twrp on chat.freenode.net.
You can also post in this thread and I will attempt to answer any questions you may have.

SOURCE CODE

TWRP: https://github.com/omnirom/android_bootable_recovery (android-7.1)
Device tree: https://github.com/TeamWin/android_device_zte_ailsa_ii (android-6.0)
Kernel: https://github.com/jcadduono/android...neplus_msm8996 (twrp-6.0)

CONTRIBUTIONS

Gerrit for TWRP: http://gerrit.omnirom.org/
Gerrit for officially supported devices: http://gerrit.twrp.me/

XDA:DevDB Information
Team Win Recovery Project for the ZTE Axon 7, Tool/Utility for the ZTE Axon 7

Contributors
jcadduono, Team Win
Source Code: https://github.com/TeamWin/android_device_zte_ailsa_ii


Version Information
Status: Stable
Current Stable Version: 3.0.4-1
Stable Release Date: 2017-02-08

Created 2016-12-09
Last Updated 2017-11-25
The Following 38 Users Say Thank You to jcadduono For This Useful Post: [ View ]
9th December 2016, 05:45 AM |#2  
Senior Member
Thanks Meter: 89
 
More
Link does not work is there a typo?
9th December 2016, 05:50 AM |#3  
jcadduono's Avatar
OP Recognized Developer
Flag Thunder Bay
Thanks Meter: 6,178
 
Donate to Me
More
Quote:
Originally Posted by lokissmile

Link does not work is there a typo?

Nope, bigbiff is just taking long time to hit the go button on jenkins to build the device and rebuild twrp.me lol
I think he fell asleep

You can use this for now: https://build.nethunter.com/test-bui...2-0-a2017u.img
9th December 2016, 06:31 AM |#4  
lafester's Avatar
Senior Member
Thanks Meter: 647
 
More
Downloaded and installed although not sure how this differs from the one in the unlock thread. Made a backup everything seems OK. Thanks!
9th December 2016, 06:58 AM |#5  
jcadduono's Avatar
OP Recognized Developer
Flag Thunder Bay
Thanks Meter: 6,178
 
Donate to Me
More
Quote:
Originally Posted by lafester

Downloaded and installed although not sure how this differs from the one in the unlock thread. Made a backup everything seems OK. Thanks!

It shouldn't be any different, or any differences there are should be minimal.

One (and maybe only) notable difference might be that it uses ZTE's USB configuration rather than Google's.
It also supports legacy mass storage. (accessing sdcard like a flash drive, instead of MTP)

I should also add that it's pretty much 1/3 of the size too lol.
9th December 2016, 07:08 AM |#6  
Senior Member
Thanks Meter: 535
 
More
UnjustifiedDev's unofficial TWRP is 3.0.2-2. I recall people were having issues with restoring some partitions (mostly EFS), so he backported the bugfix from the 7.0 TWRP code, which seemed to have fixed the issues. Does this official build include that bugfix?
9th December 2016, 07:49 AM |#7  
Senior Member
Thanks Meter: 53
 
More
Is there any technical reason why this version shouldn't be installed on A2017G?
9th December 2016, 07:55 AM |#8  
jcadduono's Avatar
OP Recognized Developer
Flag Thunder Bay
Thanks Meter: 6,178
 
Donate to Me
More
Quote:
Originally Posted by xtermmin

UnjustifiedDev's unofficial TWRP is 3.0.2-2. I recall people were having issues with restoring some partitions (mostly EFS), so he backported the bugfix from the 7.0 TWRP code, which seemed to have fixed the issues. Does this official build include that bugfix?

That bug was fixed in September on the 6.0 branch.

Quote:
Originally Posted by _phk_

Is there any technical reason why this version shouldn't be installed on A2017G?

I don't have any technical reason, just from what I've read it won't boot. You can try it, let me know what happens. Actually please do, because if it does boot it would be quite pleasing and I'd end up unifying them.
The Following 2 Users Say Thank You to jcadduono For This Useful Post: [ View ]
9th December 2016, 08:55 AM |#9  
celoxocis's Avatar
Senior Member
Flag Belgrade
Thanks Meter: 2,175
 
More
Is this TWRP using the stock B29 kernel or your custom Kernel?

I was building my own TWRP for the Axon-7 the other day. Mainly to include more partitions for backup purpose while working on CM and back to stock. (Especially persist).

As far as I saw the CM rom messes with persist (creates folders and files in persist).

Should ZTE release Android 7.0 in January I want to be able to go back using the backup created of B29 and simply run the OTA.

If CM messes with persist and one goes back to B29 to upgrade to Android 7. The OTA partitions check before upgrade will probably fail with checksum errors. And the upgrade will fail.

One would have to go all the way back to factory B20 then =>B27 =>B29=>Android 7.

Correct me if I'm wrong.
But shouldn't we include at least those partitions that CM touches in TWRP for proper restore possibilities? And future upgrades of Stock?
9th December 2016, 09:51 AM |#10  
Senior Member
Thanks Meter: 535
 
More
Quote:
Originally Posted by celoxocis

...If CM messes with persist and one goes back to B29 to upgrade to Android 7. The OTA partitions check before upgrade will probably fail with checksum errors. And the upgrade will fail...

So far, none of the OTAs (at least for the US model) have done a check of persist, but who knows if they will for Nougat.
9th December 2016, 09:56 AM |#11  
jcadduono's Avatar
OP Recognized Developer
Flag Thunder Bay
Thanks Meter: 6,178
 
Donate to Me
More
Quote:
Originally Posted by celoxocis

Is this TWRP using the stock B29 kernel or your custom Kernel?

I was building my own TWRP for the Axon-7 the other day. Mainly to include more partitions for backup purpose while working on CM and back to stock. (Especially persist).

As far as I saw the CM rom messes with persist (creates folders and files in persist).

Should ZTE release Android 7.0 in January I want to be able to go back using the backup created of B29 and simply run the OTA.

If CM messes with persist and one goes back to B29 to upgrade to Android 7. The OTA partitions check before upgrade will probably fail with checksum errors. And the upgrade will fail.

One would have to go all the way back to factory B20 then =>B27 =>B29=>Android 7.

Correct me if I'm wrong.
But shouldn't we include at least those partitions that CM touches in TWRP for proper restore possibilities? And future upgrades of Stock?

It uses a custom very minimal kernel configuration with modifications to make it more compatible with TWRP.

Why does modification of persist matter? Persist can't affect OTAs as it's meant to be modified, it's only a firmware/calibration cache.
If it ever had an issue you could simply type:
make_ext4fs /dev/block/bootdevice/by-name/persist

CM should not modify any partitions that are meant to be static.

The only partitions that will need to be fixed to take OTAs should be: boot, system, recovery, modem (NON-HLOS.bin)
The only reason modem needs to be fixed is because it's used in TWRP and I can't enable both backup and read-only at the same time.
Update: I'll just make two entries, backup/restore for raw modem emmc, and read-only mount for decrypt. (should be safe to do this with mounttodecrypt unmounting it)

Quote:
Originally Posted by xtermmin

So far, none of the OTAs (at least for the US model) have done a check of persist, but who knows if they will for Nougat.

They will not. There is no logical reason to check a partition that is designed to be modified.

In fact, I'll add Persist (calibration data) to the Wipe page!
The Following 3 Users Say Thank You to jcadduono For This Useful Post: [ View ]
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