[GUIDE] [A2017G] Install TWRP, Unlock BL, Flash Custom ROM

Search This thread

Controllerboy

Senior Member
Jan 28, 2012
123
131
Ghent
<disclaimer> I take no credit for anything in this guide. A BIG Thanks goes out to @tennear, @Unjustified Dev, @DrakenFX and @Starvirus. They are the ones who figured out the process described below and provided the excellent LineageOS 14.1 ROM. I just wrote this all-in-one-guide because I think the information is way too cluttered and spread over these forums.</disclamer>

<disclaimer> If you're not 100% sure what you're about to do, please first scroll down to the bottom of this post to see a list of DON'T's, a few things you SHOULD ABSOLUTELY NOT DO if you want to keep using your device.</disclaimer>

After having had quite some phones (Moto Defy +, Oneplus One, Nexus 5x,...) and having flashed a lot of ROMs on them, I thought I had quite some experience in these matters. Alas. Unlike Oneplus, ZTE would rather not have users fiddling with their devices. There are also three versions of the Axon 7 called the A2017 (China), A2017G (Global) and A2017U (USA), each with some minute differences from the others. This makes unlocking BL, flashing a custom recovery and installing custom ROMs not so easy on this device.

The following guide describes how to go from a stock, not rooted, locked bootloader A2017G on Marshmallow Firmwares (B03 to B10) to an unlocked bootloader TWRP recovery LineageOS 14.1 A2017G. A2017U users, this guide should work for you too, but I hear there's an alternative, easier process exclusively for A2017U users. A2017 users do not proceed, this guide won't work for you. Users on stock Nougat, do not proceed, this guide won't work for you. You need to downgrade to Marshmallow first. Even A2017G or A2017U Marshmallow users must proceed with caution. There's always a tiny chance this process bricks your device. By following this guide, you will lose all your data on your internal memory. Please backup before proceeding. The data on your SD card should be safe.

A) Flashing TWRP Recovery to your device.
Q: Why do I need TWRP?
A: TWRP is a custom recovery system. It lets your backup your system in case anything goes wrong. It also lets you flash custom ROMs and zip files containing patches like viper4android or A.R.I.S.E. (audio) and root your device via SuperSU.

0) Boot up a windows computer with a 64bits processor. Verify your Axon 7 is charged at least 75%. Temporarily disable your antivirus software to allow axon7tool to work.
1) Backup all the data of your phone's internal memory that you don't want to lose. Copy it to your PC
2) Download the axon7tool from here: http://www.filedropper.com/axon7tool-15-win64
3) Download minimal adb and fastboot from here: https://www.androidfilehost.com/?fid=457095661767103465
4) Unzip the minimal adb and fastboot file, place the folder with the files in it somewhere you can easily find it
5) Place the axon7tool exe in the same folder as adb.exe and rename it to "axon7tool.exe" (it's easier to work with that way)
6) Download the TWRP .img and .bin files from here: https://drive.google.com/open?id=0B4UVMBVpYdVwcnlaZU1NRldoRjA
7) Place the TWRP .img file in the same folder as "adb.exe" and "axon7tool.exe", rename it to "recovery.img"
8) Make a copy of the "recovery.img" file and name it "recovery.bin". Leave it in the same folder
9) Go to settings in your phone and go to "About Phone". Tap "Build Number" 7 times to make the Developer Options available
10) Go to "Developers options" and tick "Allow OEM unlock" and "Android Debugging"
11) Connect your Axon 7 to your PC
12) Open a command window by holding shift and right-clicking in a blank space in the folder where the "adb.exe", " axon7tool.exe", "recovery.img" and "recovery.bin" files are located. Click "Open command window here"
13) Type "adb devices" and hit enter. You should see one device with some code listed
14) Type "adb reboot edl" and hit enter. Your device will reboot to EDL mode. It appears to be off, but it is in fact in EDL mode.
15) Go to Device Manager on your pc and verify your Axon 7 is listed as "QUSB_BULK"
16) In command, type "axon7tool -r gpt boot recovery" and hit enter
17) After it is executed, your phone will reboot. Wait until it has fully booted.
18) In command, type "adb reboot edl"
19) Verify you now have 3 backup files in your ADB folder for gpt, recovery and boot. These are backup files in case something goes wrong
20) In command, type "axon7tool -w recovery"
21) Wait until it finishes
22) Your phone should reboot
23) Shut down your phone and boot it to TWRP by holding both the power and volume up button to verify you have TWRP
24) TWRP might ask you for a password. If it does, simply tap cancel. It will ask you if you want to modify system. Swipe to agree

NOTE: if you have problems connecting to your phone as QUSB_BULK, download Zadig and replace your drivers with WinUSB ones. If axon7tool doesn't recignise your device even when connected as QUSB_BULK, try killing adb.exe via task manager before retrying.

B) Unlock the bootloader
Q: Why do I need to unlock the bootloader?
A: With an unlocked bootloader, you can install custom ROMs.

1) Go to https://mega.nz/#F!rcFCQZ7C!vn457hU1zDwc0uVpvm5otw and download the aboot.img file from there (1024Kb). Put it in the same folder you used in the previous process
2) Download this file: https://www.androidfilehost.com/?fid=529152257862665656
3) Unzip the file and copy/cut the file called "fastboot_unlock.img"
4) Paste that file in the folder where "adb.exe", "axon7tool.exe", "recovery.img", "recovery.bin" and "aboot.img" are located
5) If there's none open, open a new command window in that folder again (Shift + right-click and "open command window here")
6) Type "adb push aboot.img /sdcard/" and hit enter
7) Type "adb push fastboot_unlock.img /sdcard/" and hit enter
8) Type "adb shell dd if=/dev/block/bootdevice/by-name/fbop of=/sdcard/fbop_lock.img" and hit enter
9) Type "adb shell dd if=/dev/block/bootdevice/by-name/aboot of=/sdcard/aboot_lock.img" and hit enter
10) Type "adb pull /sdcard/fbop_lock.img" and hit enter
11) Type "adb pull /sdcard/aboot_lock.img" and hit enter
12) Type "adb shell dd if=/sdcard/fastboot_unlock.img of=/dev/block/bootdevice/by-name/fbop" and hit enter
13) Type "adb shell dd if=/sdcard/aboot.img of=/dev/block/bootdevice/by-name/aboot" and hit enter
14) Type "Adb reboot bootloader" and hit enter to go to the bootloader
15) Type "Fastboot oem unlock" and hit enter
16) Follow the instructions on your phone and use the volume and power buttons to confirm you want to unlock your bootloader
17) Boot into TWRP by holding both power and volume up button
18) Type "Wipe" and choose "Format Data"
NOTE: If you get a permissions denied issue, try doing these steps while your device is in TWRP.

C) Update bootstack, Install LineageOS 14.1 and update your TWRP to latest version
Q: Why do I need Lineage OS 14.1?
A: It's a custom ROM that's a lot smoother than any available stock rom for any of the Axon 7 versions. Aside from an audio bug (the speakers make a rattling noise when the volume is turned higher than 80-90%) it's perfect. You can however find quite some other decent ROMS here.
Q: Why do I need the latest TWRP?
A: Tenfar's signed TWRP version is the only one that will be accepted by a locked phone, so you need to flash that version first to unlock your bootloader. You should however not use it for backing up and restoring, since it contains fatal flaws that can lead to bricking your phone. Update it using the steps below.

1) Download the latest unofficial Lineage OS 14.1 ROM from here: https://www.androidfilehost.com/?fid=457095661767134540
2) Download the A2017G Nougat bootstack from here: https://www.androidfilehost.com/?fid=673368273298930583 (A2017U users: your bootstack is here
3) Download the latest TWRP .img from here: https://build.nethunter.com/twrp/zte/twrp-3.0.4-1-ailsa_ii.img
4) Download a Google Apps version from here: http://opengapps.org/?arch=arm64&api=7.1/ .You must use an ARM64 file since that is the type of the CPU in the Axon 7. You must use 7.1 Gapps since that's the android version Lineage OS 14.1. is based on. Which one you choose is up to you, the "smaller" you go the less google apps will be installed as stock. You can always download the ones you miss via the play store after having installed LineageOS
5) Put the bootstack, the LineageOS and the chosen Gapps zips on your MicroSD card. Also put the TWRP.img on there
6) Flash the A2017G Nougat bootstack: Flash -> select the bootstack file on the microSD card
7) Flash LineageOS 14.1, then flash the Gapps zip file (again via TWRP)
8) Update your TWRP recovery by choosing "Install" and then clicking "Install Image" (bottom right) and selecting the TWRP .img file
9) Wipe dalvik, cache and data
10) Reboot
11) Enjoy your phone

In the unlikely case that you're greeted by a screen that asks you for a password because your system is somehow encrypted, reboot to TWRP and format your data partition to ext4 instead of f2fs (wipe -> advanced)

If your phone doesn't pop up as QUSB_BULK in EDL, you probably installed the driver that came with the phone. The device will pop up below Ports (COM & LPT) on Device Manager as Qualcomm something-something USB device. Uninstall that driver and reinstall winUSB drivers through Zadig.

If axon7tool fails with a what() and STD-exception and whatnot - if you installed the Zadig driver
Go to Device Manager, right click QUSB__BULK and Uninstall, then use the "adb reboot edl" command. Install the winUSB driver via Zadig. Reboot the phone by holding the power button about 10 seconds. Enter the command adb reboot edl again. Enter "axon7tool -r gpt boot recovery" in command.

If LOS refuses to install and you get the error axon7.verify_trustzone, install the universal bootloader (A2017X_B15_UniversalBootloader) before the N Modem.
So, the steps after you get access to TWRO are: 1) Install univ. BL (A2017X_B15_... .zip); 2) Install A2017G_N_modem.zip; 3) Install LOS14.1 zip; 4) Optionally, install Gapps; 5) Flash TWRP img

DON'T's:
- DO NOT use the signed TWRP (3.0.2) to backup or restore, it might brick your device
- DO NOT use this guide when you're on locked stock nougat, you need to downgrade to Marshmallow first
- DO NOT flash the wrong N bootstack. There's a different version for G and U devices
- DO NOT use this guide if you're on an A2017 (Chinese) device
- DO NOT unplug your cable from your PC or Axon while axon7tool is doing it's magic
- DO NOT make a mistake or typo, it can be fatal
- DO NOT try flashing random zips or files or formatting this and that when your device doesn't act according to the guide, post your issue instead
- DO NOT wipe anything else than Data, Dalvik and Cache in TWRP

ADDITIONAL STEPS:
- You can opt to root your device by flashing the latest SuperSU zip file
- You can opt to upgrade your unofficial LineageOS to the latest official version to receive weekly OTA updates
 
Last edited:

PsyJoe

Senior Member
Mar 6, 2012
81
20
First of all, thanks a lot for this guide! But I saw the TWRP image is actually for the A2017U version. I read in the forum that flashing this on the G-version could soft brick your phone.
So the question is, can I just flash this on my A2017G or is there even a version for the european model?
 

Controllerboy

Senior Member
Jan 28, 2012
123
131
Ghent
First of all, thanks a lot for this guide! But I saw the TWRP image is actually for the A2017U version. I read in the forum that flashing this on the G-version could soft brick your phone.
So the question is, can I just flash this on my A2017G or is there even a version for the european model?

Both the aboot.img and the TWRP.img come from A2017U versions. For the moment, we do not know if there is any difference in the aboot file between A2017U and A2017G, but it's highly unlikely. @tennear sent me a tool to read the partitions on my A2017G and the result showed the partitions were the same as those in the A2017U model.

For the moment, there's only one TWRP version, made for A2017U, but it seems to work on all models. I quote tennear here:
Unpacking the TWRP image for A2017U, it says:
ro.product.model=A2017U

So this recovery seems to be specific to A2017U.
But unpacking the TWRP image for A2017 (China), it says:

ro.product.model=ZTE A2017U
Hmm, different but still A2017U.

I don't have the TWRP image for A2017G (yet), so I can't tell what it says. But given the above, and that the G and U models are almost identical, I am thinking the A2017U image will run on all devices.

I suspect nearly all bricks on A2017G devices happen when A2017G users use tenfar's tool to unlock the BL. There's a lot of margin for error, for example with the whole COM ports shizzle. I advise not to go down that route. I also advise against trying to flash a rooted image through TWRP without unlocking your bootloader. Especially the command "axon7root.exe -p 4 -b -r" (flashing both boot.img and recovery.img at the same time) seems to kill specifically A2017G devices, that seem to have an extra "DFU" mode, which the A2017 and A2017U devices don't seem to have. A2017G devices get stuck in that mode and there's no way to get them out again.

TL;DR I think the risk isn't in flashing TWRP, but in flashing both boot and recovery at the same time, in the axon7root tool and in flashing a rooted stock rom without unlocking BL.
 
Last edited:

HansWursT619

Senior Member
Jan 11, 2011
107
16
Thank you for this one thread guide. Should make it a lot easier.

Maybe you can add a few words and links to the B03 files that allow a downgrade from higher versions.

You have a typo in step 14), should be adb not ab :p
 
Last edited:

le_cactus

Senior Member
Nov 25, 2005
569
36
Amsterdam
OnePlus Nord 2 5G
30) TWRP might ask you for a password. If it does, simply tap cancel. It will ask you if you want to modify system. Swipe to agree

Hi,
So, the backup can be restored, even if we cancel the password? Isn't the backup encrypted than?

Also, when we do swipe to agree to modify the system partition, is flashing SuperSU enough to gain root?

I'm not so much interested in installing a custom ROM (yet) but do want a safe way to gain root.

Thanks for your time and efford,

Edit: And all this is safe (step A) when on B08?

Cheers,
/Cacti
 
Last edited:

Znuf

Senior Member
Jun 10, 2008
332
77
Sion
For twrp. It work fine, i just flash it on my 2017G and everything is good.

Just the lastest version of SuperSU didn't work. I use 2.65
 
  • Like
Reactions: Infy_AsiX

le_cactus

Senior Member
Nov 25, 2005
569
36
Amsterdam
OnePlus Nord 2 5G
15) Go to Device Manager on your pc and verify your Axon 7 is listed as "QDL_BULK"
16) In command, type "axon7tool -r gpt" and hit enter
*sigh*

My device manager (Win7 x64) lists my A2017G as QUSB_BULK (and no red led, just a black screen) after reboot to EDL and the axon7tool sais not connected.

Anyone knows whats up with that and how to solve that?

TIA,
Cheerz,
/Cacti
 

Controllerboy

Senior Member
Jan 28, 2012
123
131
Ghent
*sigh*

My device manager (Win7 x64) lists my A2017G as QUSB_BULK (and no red led, just a black screen) after reboot to EDL and the axon7tool sais not connected.

Anyone knows whats up with that and how to solve that?

TIA,
Cheerz,
/Cacti
Hi

I don't think "QUSB_BULK" is bad, nor the lack of the red LED. When I did the process on my device it also showed different states at different attempts. I also had to try multiple times before axon7tool detected it.

If I were you, I would try to shut down your device completely, restart and try to boot to EDL again by using command "adb reboot edl". Alternatively, you could try removing your device from USB, then shutting it down, then holding both volume buttons while connecting it to your PC. Some G devices don't boot to EDL this way, but some do.

Just keep trying multiple times. Axon7tool doesn't work in any other mode than EDL, so you can't do any damage by using the tool in a wrong mode.
 

le_cactus

Senior Member
Nov 25, 2005
569
36
Amsterdam
OnePlus Nord 2 5G
Hi

I don't think "QUSB_BULK" is bad, nor the lack of the red LED. When I did the process on my device it also showed different states at different attempts. I also had to try multiple times before axon7tool detected it.

If I were you, I would try to shut down your device completely, restart and try to boot to EDL again by using command "adb reboot edl". Alternatively, you could try removing your device from USB, then shutting it down, then holding both volume buttons while connecting it to your PC. Some G devices don't boot to EDL this way, but some do.

Just keep trying multiple times. Axon7tool doesn't work in any other mode than EDL, so you can't do any damage by using the tool in a wrong mode.
Thanks for the tips, I'll keep trying both methods.

Cheers,
/Cacti
 

le_cactus

Senior Member
Nov 25, 2005
569
36
Amsterdam
OnePlus Nord 2 5G
Thanks for the tips, I'll keep trying both methods.

Cheers,
/Cacti
I give up. Or at least at this computer.

Just to be sure, the QDL_BULK/QUSB__BULK, shoild it be an unknown device, one with a yellow exclamation mark? Or should I install a driver for it, and if so where do i find it? Google didn't help me out today :p

I'll try another pc, see if that does work.

Cheers,
/Cacti
 

Controllerboy

Senior Member
Jan 28, 2012
123
131
Ghent
I think we've found your problem. There shouldn't be a yellow exclamation mark, your PC should really have drivers for your device. On my PC, this wasn't needed, but can you try to download and open Zadig?

When connected in EDL mode, search for your device by ticking the box "show all devices" (in one of the options dropout links in the top bar). You should see "QUSB_BULK" again. Select "WinUSB drivers" and install those. See if your PC recognises your device in EDL after doing that and try finding it with axon7tool. A reboot of your phone might be needed.
 

Killerdog

Senior Member
Aug 15, 2009
266
94
Cannes
Hi,

i unlock my A2017G b06 with a slightly different way (Starvirus + draken FX TWRP) but i forgot to make a backup of stock rom before flash cm13.

Can you please make a clean one and share it.

Thanks in advance
 

DeJe63

Senior Member
May 18, 2012
320
39
Thanks for the description.
For your information. As you can see in tennears thread, you can short cut steps 16 - 22 to "axon7tool -r gpt recovery boot". This saves a lot of time and reboots. :D

Also, in the BL unlock steps, "wipe data" most commonly not enough. You need "format data".
 
Last edited:

Controllerboy

Senior Member
Jan 28, 2012
123
131
Ghent
I unlock my A2017G b06 with a slightly different way (Starvirus + draken FX TWRP) but i forgot to make a backup of stock rom before flash cm13.
Can you please make a clean one and share it.
Here's the file from DrakenFX: http://xdaforums.com/showpost.php?p=68873485&postcount=3
Flash bootstack only once, then flash BO6 stock ZIP. In my experience it doesn't replace TWRP with stock recovery, even when you're not rooted.

Thanks for the description.
For your information. As you can see in tennears thread, you can short cut steps 16 - 22 to "axon7tool -r gpt recovery boot". This saves a lot of time and reboots. :D

Also, in the BL unlock steps, "wipe data" most commonly not enough. You need "format data".
Thanks for the tricks. I didn't know you could do all three commands at once. I'll update my guide.
 
  • Like
Reactions: Killerdog

Dust2Dust

Senior Member
Dec 14, 2006
398
35
Utrecht
Will this work for B08 or should I go all the way back to "B03 (or others)" ??


Tutorial looks good and simple, big thanks!
 

DeJe63

Senior Member
May 18, 2012
320
39
In general it works.
For some reason I was not able to update from DragenFX B06 to OTA B08. So I flashed stock recovery, stock B06, OTA B08 and just flashed back TWRP with axon7tool...and it worked. ;) But it may be that I make some mistakes on the way to B08.

I was at BL unlock before.
 

le_cactus

Senior Member
Nov 25, 2005
569
36
Amsterdam
OnePlus Nord 2 5G
I think we've found your problem. There shouldn't be a yellow exclamation mark, your PC should really have drivers for your device. On my PC, this wasn't needed, but can you try to download and open Zadig?

When connected in EDL mode, search for your device by ticking the box "show all devices" (in one of the options dropout links in the top bar). You should see "QUSB_BULK" again. Select "WinUSB drivers" and install those. See if your PC recognises your device in EDL after doing that and try finding it with axon7tool. A reboot of your phone might be needed.


Hi,


That worked flawlessly on my Win7 box, but I have general USB problems on that device. Got timeouts a few times during the axon7tool -r commands, so I don't dare doing a axon7tool -w command on that machine. So I stepped over to my Win10 x64 machine, but that machine it keeps identifying it as a "Qualcomm HS-USB QDLoader 9008 (COM3) device." :crying: axon7tool -r gives my a "Failed to connect"

Thanks for the help though, much appreciated.

Cheers,
/Cacti
 

Controllerboy

Senior Member
Jan 28, 2012
123
131
Ghent
I would agree that it's not a wise idea to write a custom recovery to a phone when the connection between the phone and the PC is unstable.

However, that doesn't solve your problem. Seems like your PC decided to install some drivers that are incompatible with the axon7tool.
Did you already try to uninstall the Qualcomm drivers via device manager and reconnect your device to pc? Did you try Zadig on your win10 machine?
There's a guide on the internet to (temporarily) disable automatic driver installation for new USB devices. Perhaps you could do that and then use Zadig to install WinUSB?

To be honest, if that doesn't work I don't really know other things to try. Except visiting someone you know with a Win7 64bit PC, that is :)
 

le_cactus

Senior Member
Nov 25, 2005
569
36
Amsterdam
OnePlus Nord 2 5G
I would agree that it's not a wise idea to write a custom recovery to a phone when the connection between the phone and the PC is unstable.

However, that doesn't solve your problem. Seems like your PC decided to install some drivers that are incompatible with the axon7tool.
Did you already try to uninstall the Qualcomm drivers via device manager and reconnect your device to pc? Did you try Zadig on your win10 machine?
There's a guide on the internet to (temporarily) disable automatic driver installation for new USB devices. Perhaps you could do that and then use Zadig to install WinUSB?

To be honest, if that doesn't work I don't really know other things to try. Except visiting someone you know with a Win7 64bit PC, that is :)
Thanks for the tips. I'll let you know how things work out.

Cheers,
/cacti
 

Top Liked Posts

  • There are no posts matching your filters.
  • 59
    <disclaimer> I take no credit for anything in this guide. A BIG Thanks goes out to @tennear, @Unjustified Dev, @DrakenFX and @Starvirus. They are the ones who figured out the process described below and provided the excellent LineageOS 14.1 ROM. I just wrote this all-in-one-guide because I think the information is way too cluttered and spread over these forums.</disclamer>

    <disclaimer> If you're not 100% sure what you're about to do, please first scroll down to the bottom of this post to see a list of DON'T's, a few things you SHOULD ABSOLUTELY NOT DO if you want to keep using your device.</disclaimer>

    After having had quite some phones (Moto Defy +, Oneplus One, Nexus 5x,...) and having flashed a lot of ROMs on them, I thought I had quite some experience in these matters. Alas. Unlike Oneplus, ZTE would rather not have users fiddling with their devices. There are also three versions of the Axon 7 called the A2017 (China), A2017G (Global) and A2017U (USA), each with some minute differences from the others. This makes unlocking BL, flashing a custom recovery and installing custom ROMs not so easy on this device.

    The following guide describes how to go from a stock, not rooted, locked bootloader A2017G on Marshmallow Firmwares (B03 to B10) to an unlocked bootloader TWRP recovery LineageOS 14.1 A2017G. A2017U users, this guide should work for you too, but I hear there's an alternative, easier process exclusively for A2017U users. A2017 users do not proceed, this guide won't work for you. Users on stock Nougat, do not proceed, this guide won't work for you. You need to downgrade to Marshmallow first. Even A2017G or A2017U Marshmallow users must proceed with caution. There's always a tiny chance this process bricks your device. By following this guide, you will lose all your data on your internal memory. Please backup before proceeding. The data on your SD card should be safe.

    A) Flashing TWRP Recovery to your device.
    Q: Why do I need TWRP?
    A: TWRP is a custom recovery system. It lets your backup your system in case anything goes wrong. It also lets you flash custom ROMs and zip files containing patches like viper4android or A.R.I.S.E. (audio) and root your device via SuperSU.

    0) Boot up a windows computer with a 64bits processor. Verify your Axon 7 is charged at least 75%. Temporarily disable your antivirus software to allow axon7tool to work.
    1) Backup all the data of your phone's internal memory that you don't want to lose. Copy it to your PC
    2) Download the axon7tool from here: http://www.filedropper.com/axon7tool-15-win64
    3) Download minimal adb and fastboot from here: https://www.androidfilehost.com/?fid=457095661767103465
    4) Unzip the minimal adb and fastboot file, place the folder with the files in it somewhere you can easily find it
    5) Place the axon7tool exe in the same folder as adb.exe and rename it to "axon7tool.exe" (it's easier to work with that way)
    6) Download the TWRP .img and .bin files from here: https://drive.google.com/open?id=0B4UVMBVpYdVwcnlaZU1NRldoRjA
    7) Place the TWRP .img file in the same folder as "adb.exe" and "axon7tool.exe", rename it to "recovery.img"
    8) Make a copy of the "recovery.img" file and name it "recovery.bin". Leave it in the same folder
    9) Go to settings in your phone and go to "About Phone". Tap "Build Number" 7 times to make the Developer Options available
    10) Go to "Developers options" and tick "Allow OEM unlock" and "Android Debugging"
    11) Connect your Axon 7 to your PC
    12) Open a command window by holding shift and right-clicking in a blank space in the folder where the "adb.exe", " axon7tool.exe", "recovery.img" and "recovery.bin" files are located. Click "Open command window here"
    13) Type "adb devices" and hit enter. You should see one device with some code listed
    14) Type "adb reboot edl" and hit enter. Your device will reboot to EDL mode. It appears to be off, but it is in fact in EDL mode.
    15) Go to Device Manager on your pc and verify your Axon 7 is listed as "QUSB_BULK"
    16) In command, type "axon7tool -r gpt boot recovery" and hit enter
    17) After it is executed, your phone will reboot. Wait until it has fully booted.
    18) In command, type "adb reboot edl"
    19) Verify you now have 3 backup files in your ADB folder for gpt, recovery and boot. These are backup files in case something goes wrong
    20) In command, type "axon7tool -w recovery"
    21) Wait until it finishes
    22) Your phone should reboot
    23) Shut down your phone and boot it to TWRP by holding both the power and volume up button to verify you have TWRP
    24) TWRP might ask you for a password. If it does, simply tap cancel. It will ask you if you want to modify system. Swipe to agree

    NOTE: if you have problems connecting to your phone as QUSB_BULK, download Zadig and replace your drivers with WinUSB ones. If axon7tool doesn't recignise your device even when connected as QUSB_BULK, try killing adb.exe via task manager before retrying.

    B) Unlock the bootloader
    Q: Why do I need to unlock the bootloader?
    A: With an unlocked bootloader, you can install custom ROMs.

    1) Go to https://mega.nz/#F!rcFCQZ7C!vn457hU1zDwc0uVpvm5otw and download the aboot.img file from there (1024Kb). Put it in the same folder you used in the previous process
    2) Download this file: https://www.androidfilehost.com/?fid=529152257862665656
    3) Unzip the file and copy/cut the file called "fastboot_unlock.img"
    4) Paste that file in the folder where "adb.exe", "axon7tool.exe", "recovery.img", "recovery.bin" and "aboot.img" are located
    5) If there's none open, open a new command window in that folder again (Shift + right-click and "open command window here")
    6) Type "adb push aboot.img /sdcard/" and hit enter
    7) Type "adb push fastboot_unlock.img /sdcard/" and hit enter
    8) Type "adb shell dd if=/dev/block/bootdevice/by-name/fbop of=/sdcard/fbop_lock.img" and hit enter
    9) Type "adb shell dd if=/dev/block/bootdevice/by-name/aboot of=/sdcard/aboot_lock.img" and hit enter
    10) Type "adb pull /sdcard/fbop_lock.img" and hit enter
    11) Type "adb pull /sdcard/aboot_lock.img" and hit enter
    12) Type "adb shell dd if=/sdcard/fastboot_unlock.img of=/dev/block/bootdevice/by-name/fbop" and hit enter
    13) Type "adb shell dd if=/sdcard/aboot.img of=/dev/block/bootdevice/by-name/aboot" and hit enter
    14) Type "Adb reboot bootloader" and hit enter to go to the bootloader
    15) Type "Fastboot oem unlock" and hit enter
    16) Follow the instructions on your phone and use the volume and power buttons to confirm you want to unlock your bootloader
    17) Boot into TWRP by holding both power and volume up button
    18) Type "Wipe" and choose "Format Data"
    NOTE: If you get a permissions denied issue, try doing these steps while your device is in TWRP.

    C) Update bootstack, Install LineageOS 14.1 and update your TWRP to latest version
    Q: Why do I need Lineage OS 14.1?
    A: It's a custom ROM that's a lot smoother than any available stock rom for any of the Axon 7 versions. Aside from an audio bug (the speakers make a rattling noise when the volume is turned higher than 80-90%) it's perfect. You can however find quite some other decent ROMS here.
    Q: Why do I need the latest TWRP?
    A: Tenfar's signed TWRP version is the only one that will be accepted by a locked phone, so you need to flash that version first to unlock your bootloader. You should however not use it for backing up and restoring, since it contains fatal flaws that can lead to bricking your phone. Update it using the steps below.

    1) Download the latest unofficial Lineage OS 14.1 ROM from here: https://www.androidfilehost.com/?fid=457095661767134540
    2) Download the A2017G Nougat bootstack from here: https://www.androidfilehost.com/?fid=673368273298930583 (A2017U users: your bootstack is here
    3) Download the latest TWRP .img from here: https://build.nethunter.com/twrp/zte/twrp-3.0.4-1-ailsa_ii.img
    4) Download a Google Apps version from here: http://opengapps.org/?arch=arm64&api=7.1/ .You must use an ARM64 file since that is the type of the CPU in the Axon 7. You must use 7.1 Gapps since that's the android version Lineage OS 14.1. is based on. Which one you choose is up to you, the "smaller" you go the less google apps will be installed as stock. You can always download the ones you miss via the play store after having installed LineageOS
    5) Put the bootstack, the LineageOS and the chosen Gapps zips on your MicroSD card. Also put the TWRP.img on there
    6) Flash the A2017G Nougat bootstack: Flash -> select the bootstack file on the microSD card
    7) Flash LineageOS 14.1, then flash the Gapps zip file (again via TWRP)
    8) Update your TWRP recovery by choosing "Install" and then clicking "Install Image" (bottom right) and selecting the TWRP .img file
    9) Wipe dalvik, cache and data
    10) Reboot
    11) Enjoy your phone

    In the unlikely case that you're greeted by a screen that asks you for a password because your system is somehow encrypted, reboot to TWRP and format your data partition to ext4 instead of f2fs (wipe -> advanced)

    If your phone doesn't pop up as QUSB_BULK in EDL, you probably installed the driver that came with the phone. The device will pop up below Ports (COM & LPT) on Device Manager as Qualcomm something-something USB device. Uninstall that driver and reinstall winUSB drivers through Zadig.

    If axon7tool fails with a what() and STD-exception and whatnot - if you installed the Zadig driver
    Go to Device Manager, right click QUSB__BULK and Uninstall, then use the "adb reboot edl" command. Install the winUSB driver via Zadig. Reboot the phone by holding the power button about 10 seconds. Enter the command adb reboot edl again. Enter "axon7tool -r gpt boot recovery" in command.

    If LOS refuses to install and you get the error axon7.verify_trustzone, install the universal bootloader (A2017X_B15_UniversalBootloader) before the N Modem.
    So, the steps after you get access to TWRO are: 1) Install univ. BL (A2017X_B15_... .zip); 2) Install A2017G_N_modem.zip; 3) Install LOS14.1 zip; 4) Optionally, install Gapps; 5) Flash TWRP img

    DON'T's:
    - DO NOT use the signed TWRP (3.0.2) to backup or restore, it might brick your device
    - DO NOT use this guide when you're on locked stock nougat, you need to downgrade to Marshmallow first
    - DO NOT flash the wrong N bootstack. There's a different version for G and U devices
    - DO NOT use this guide if you're on an A2017 (Chinese) device
    - DO NOT unplug your cable from your PC or Axon while axon7tool is doing it's magic
    - DO NOT make a mistake or typo, it can be fatal
    - DO NOT try flashing random zips or files or formatting this and that when your device doesn't act according to the guide, post your issue instead
    - DO NOT wipe anything else than Data, Dalvik and Cache in TWRP

    ADDITIONAL STEPS:
    - You can opt to root your device by flashing the latest SuperSU zip file
    - You can opt to upgrade your unofficial LineageOS to the latest official version to receive weekly OTA updates
    9
    Additions to the post

    @Controllerboy I've just rooted my phone and (no offense to you or anyone) from all the small bits of info that i found lacking over every post, it feels like I just installed iOS on a Nokia 1100...

    So, could you add these things to the main post? Every problem I had on the way had already been asked to every OP on the other posts, so it would be more helpful if you just condensed all the steps in your post. BTW i have (had, more like it) an A2017G with B10:

    - If your phone doesn't pop up as QUSB__BULK over EDL mode, then it's probably likely that you had installed the driver that came with the phone (there was an option to install a driver that seemingly did only dev features whenever you connected the USB wire). The device will pop up below Ports (COM & LPT) on the Device Manager (win10 ofc) as Qualcomm something-something USB device. You only have to uninstall the driver if this happens (Programs and Features - ZTE driver). I was dumbfounded when this happened to me :p After this, Zadig was needed in my case, because the icon had a yellow sign

    -axon7tool fails with a what() and STD-exception and whatnot - if you installed the Zadig driver, do this:
    >go to Device Manager, right click QUSB__BULK and Uninstall
    >adb reboot edl
    >install Zadig winUSB driver
    >reboot phone via power button (~10 secs)
    >adb reboot edl
    >axon7tool -r gpt boot recovery
    That should do the trick.

    -after unlocking BL, installing TWRP and all, when you want to install LOS14.1, LOS refuses to install with error axon7.verify_trustzone - to fix this you have to install the UNIVERSAL BOOTLOADER BEFORE THE N MODEM. I didn't find any mention of the A2017X_B15_UniversalBootloader file in this post. So:
    After you get access to TWRP you have to:
    >Install univ. BL (A2017X_B15_... .zip)
    >Install A2017G_N_modem.zip
    >Install LOS14.1 zip
    >Install optionally Gapps
    >Flash TWRP img

    I think that's all. Thank you for the really nice guide. I'm in no way criticizing your work or the devs' work here, but I want to help people who might have the same errors than me in the future. ;)
    5
    I cant download the twrp in the OP either, most of the time the download doesn't work and the one time it did it gave me a package file instead
    i downloaded it a couple of days ago, i uploaded it here: https://we.tl/dv78KwQZCY
    5
    Hi All,

    I have a quick question as I'm having problem booting into edl mode. After following step 14 my device reboots and appears it is off without the red notification light on. I was unable to recognize the device as stated in step 15 or continue to carry on with step 16, instead I received an error message "error: failure to connect". I can no longer restart my device and was only able to boot up again by going into recovery mode( holding down the volume up and power button"). I tried again and it is the same result. Please help, thanks!

    Assuming you are using Windows, go to the device manager and ensure that when you plug your device in edl mode, it is identified in the device manager as QUSB_BULK without the warning signal.

    If you have the QUSB_BULK with a warning icon then you need to install the Qualcomm usb driver.

    If you obtain the Qualcomm HS-USB QDloader 9008 device instead of QUSB_BULK, then you have to use the zadig tool in windows. go to Options and activate List all devices. Then select QUSB_BULK in the drop down control at the top and WinUSB in the lower control. Then click on the button to replace the driver. After this, QUSB_BULK should appear in the Device manager and you should be able to execute axon7tool.


    By the way, do not forget to deactivate the antivirus, otherwise axon7tool won't be able to transfer data.
    4
    So after all i can confirm the method is working for A2017G with B08, but i had to modify some steps:
    Prior to Bootloader unlock only tenfar's recovery was working for me. (This)
    Dont use it for any other purpose than BL unlock though, as it is buggy, especially DO NOT BACKUP OR RESTORE EFS with this.
    After i unlocked the BL (procedure as in OP), i was able to fastboot flash the normal official recovery and it works.
    So atm i only rooted stock by flashing supersu in TWRP but I'll probably soon will change to cm.