axon7tool: Flash and backup boot/recovery using EDL mode

Search This thread

tennear

Senior Member
Nov 28, 2016
73
114
Note: This is an inherently dangerous tool. I have made every effort to make it as safe as possible. But there is always a risk of bricking your device. You assume all responsibility for the consequences. Proceed with caution.

Warning: To avoid bricking your device, NEVER write both boot and recovery in one session. ALWAYS write one partition, test, then write the other. This is why the tool will only write one partition at a time.

Warning: There are versions of TWRP for the Axon 7 that are known to erase your IMEI when doing a restore. Do NOT do a TWRP restore unless your are SURE that you have a good version of TWRP!

This tool will allow you to:
  • Backup your boot and recovery partitions.
  • Flash a boot or recovery image (including the signed TWRP image).

See following posts for operating system specific setup instructions.

Once your setup is complete, enter EDL mode:
1. Power off phone.
2. Hold both volume buttons.
3. Plug phone into computer.
4. For G models, you must "adb reboot edl" (see other threads).

Usage:
axon7tool <mode> <partition(s)>
Note: The tool name will vary depending on your operating system.

<mode> is -r for read, -w for write.

For read mode, <partition> is one or more of gpt, boot, recovery. Files will be created as <partition>-backup.bin

For write mode, <partition> is boot or recovery. File will be read from <partition>.bin

Examples:

To backup everything on Linux:
./axon7tool-1.5-linux -r gpt boot recovery

To write recovery on Win64:
Place file as recovery.bin
axon7tool-1.5-win64 -w recovery

Links to axon7tool:
axon7tool-1.5-linux (main)
axon7tool-1.5-linux (alternate)
axon7tool-1.5-win64.exe (main)
axon7tool-1.5-win64.exe (alternate)

Link to signed TWRP removed.

FAQ:

Q: Can you provide a signed boot image with root?
A: No. I do not have the ZTE signing key, and tenfar's images are not current.

Q: Can I have the source code for the tool?
A: No.

Q: Can you provide the programmer?
A: No.

Q: Do you accept donations?
A: No, all work is provided freely for community use.
 
Last edited:

tennear

Senior Member
Nov 28, 2016
73
114
Setup instructions for Linux:

1. Ensure your login user is in the "plugdev" group.
$ id
You should see plugdev in the list. If not, add yourself to the group and logout/login to take effect.

2. Ensure your udev rules are setup.
Create a file eg. /etc/udev/rules.d/qcom.rules that contains:
Code:
SUBSYSTEM=="usb", ATTRS{idVendor}=="05c6", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", GROUP="plugdev"

3. All done!
 
Last edited:
Questions:
1) Does the backup of boot and recovery partitions work like backing up through TWRP (if the recovery is already flashed to TWRP)
2) The signed TWRP image is by... ZTE?

1- No this doesn't work like backing up with TWRP, This tool is more powerful than Custom Recovery (TWRP), and you should be very careful on how to use it.
Like @tennear mention about try first by using -r (read) then just flash the sign TWRP.
I personally recommend just flash TWRP and DON'T mess with Boot image.

2- the Sign TWRP is not provided by ZTE, ZTE will NEVER release a Custom Recovery for us users.
 

tennear

Senior Member
Nov 28, 2016
73
114
Questions:
1) Does the backup of boot and recovery partitions work like backing up through TWRP (if the recovery is already flashed to TWRP)
2) The signed TWRP image is by... ZTE?

1. The tool writes the raw partitions to your PC. Whatever you have in the partition is written out, whether it is stock recovery or TWRP or whatever.

2. The signed TWRP image is copied from the zip that tenfar provided in his post. I did not create it, and I cannot create signed images.
 
  • Like
Reactions: DrakenFX

Controllerboy

Senior Member
Jan 28, 2012
123
131
Ghent
Forgive me my noobiness, but here’s a step-by-step-instruction list. Am I thinking right? I want to minimise the risk when I try your tool tomorrow.

Step 1: Enable Developer options in phone by tapping the build number
Step 2: Enable OEM Unlock in phone (is this needed?)
Step 3: Enable debugging (for adb)
Step 4: Connect phone to PC
Step 5: Download Zadig
Step 6: Install Zadig
Step 7: Open command in the folder in which you downloaded adb.exe (and the rest of the files that come with it) (Richt click while holding shift to get the option to open CMD in a folder)
Step 8: Enter the command “Adb Devices” to reassure your device is detected
Step 9: Enter the command “Adb reboot edl” to reboot the phone to EDL mode
Step 10: After phone has rebooted to EDL mode, run Zadig, select WInUSB driver and install it for your device
Step 11: Rename “axon7tool-1.5-win64.exe” to “axon7tool.exe”
Step 12: Download “axon7-2017u-twrp-signed.img” to the folder where axon7tool.exe is located
Step 13: Open command in the folder in which you have downloaded axon7tool-1.5-win64.exe (renamed to axon7tool.exe)
Step 14: Enter command “axon7tool -r gpt”.
Step 15: Enter command “axon7tool -r boot”
Step 16: Enter command “axon7tool -r recovery”
Step 17: Verify if the tool has created “gpt-backup.bin”, “boot-backup.bin”, “recovery-backup.bin”.
Step 18 (unsure): rename “axon7-2017u-twrp-signed.img” to “recovery.bin” ?
Step 19: enter “axon7tool -w recovery recovery.bin
Step 20: Wait for the command to finish
Step 21: Place the .zip file for Z.A.D. Mix7 or CM13 on your SD card via your PC or Axon 7. Also download Gapps.zip of your choice and place on SD card.
Step 22: Boot your Axon 7 to TWRP Recovery by holding the power button simultaneously with volume down (or is it volume up?)
Step 23: Perform a full wipe of Dalvik, Cache and Data in TWRP
Step 24: Flash the .zip of your custom ROM of choice in TWRP
Step 25: Flash the .zip of your Google Apps of choice in TWRP
Step 26: Perform a full wipe of Dalvik, Cache and Data in TWRP
Step 27: Reboot your phone, enjoy the custom ROM of your choice.

Is this the correct procedure?

I’m a bit unsure of step 18. Am I doing it right? Or do you need to unzip that .img somehow to find a recovery.bin file? Or do you need to get that file from somewhere else? Or do you need to rename “axon7-2017u-twrp-signed.zip” to “recovery.img”?

For Z.A.D. MIX7, I suppose you still need to flash a SuperSU version seperately? I heard in CM it's baked-in.

Thanks for the help.

Jan
 
Last edited:

tennear

Senior Member
Nov 28, 2016
73
114
Step 1: Enable Developer options in phone by tapping the build number
Step 2: Enable OEM Unlock in phone (is this needed?)
Step 3: Enable debugging (for adb)
None of these steps should be necessary.
Step 4: Connect phone to PC
Step 5: Download Zadig
Step 6: Install Zadig
I believe you just run zadig, I don't remember an installer.
Step 7: Open command in the folder in which you downloaded adb.exe (and the rest of the files that come with it) (Richt click while holding shift to get the option to open CMD in a folder)
Step 8: Enter the command “Adb Devices” to reassure your device is detected
Step 9: Enter the command “Adb reboot edl” to reboot the phone to EDL mode
Step 10: After phone has rebooted to EDL mode, run Zadig, select WInUSB driver and install it for your device
Step 11: Rename “axon7tool-1.5-win64.exe” to “axon7tool.exe”
Renaming the tool is optional.
Step 12: Download “axon7-2017u-twrp-signed.img” to the folder where axon7tool.exe is located
Step 13: Open command in the folder in which you have downloaded axon7tool-1.5-win64.exe (renamed to axon7tool.exe)
Step 14: Enter command “axon7tool -r gpt”.
Step 15: Enter command “axon7tool -r boot”
Step 16: Enter command “axon7tool -r recovery”
The tool is "one shot". You can read any combination of gpt, boot, and recovery in one session, then the tool will restart the phone.
Step 17: Verify if the tool has created “gpt-backup.bin”, “boot-backup.bin”, “recovery-backup.bin”.
Step 18 (unsure): rename “axon7-2017u-twrp-signed.img” to “recovery.bin” ?
Yes, this is correct.
Step 19: enter “axon7tool -w recovery recovery.bin
Step 20: Wait for the command to finish
Yes, this is correct. Writing boot or recovery takes about 30 seconds. Then the tool will reboot your phone. Be sure to hold the Vol+Up button to reboot into recovery.
Step 21: Place the .zip file for Z.A.D. Mix7 or CM13 on your SD card via your PC or Axon 7. Also download Gapps.zip of your choice and place on SD card.
Step 22: Boot your Axon 7 to TWRP Recovery by holding the power button simultaneously with volume down (or is it volume up?)
Step 23: Perform a full wipe of Dalvik, Cache and Data in TWRP
Step 24: Flash the .zip of your custom ROM of choice in TWRP
Step 25: Flash the .zip of your Google Apps of choice in TWRP
Step 26: Perform a full wipe of Dalvik, Cache and Data in TWRP
Step 27: Reboot your phone, enjoy the custom ROM of your choice.
Everything past step 20 is up to you. :)
Is this the correct procedure?

I’m a bit unsure of step 18. Am I doing it right? Or do you need to unzip that .img somehow to find a recovery.bin file? Or do you need to get that file from somewhere else? Or do you need to rename “axon7-2017u-twrp-signed.zip” to “recovery.img”?

For Z.A.D. MIX7, I suppose you still need to flash a SuperSU version seperately? I heard in CM it's baked-in.

Thanks for the help.

Jan
You cannot unzip an img file.

The TWRP image provided is just as tenfar provided for 2017u users. You only need to rename it to recovery.img for using the tool.

If someone has the 2017g TWRP file, I can upload and link it. The links in the tenfar post have been removed.
 

rczrider

Senior Member
May 20, 2015
733
543
Markarth
Folks who are able to use this new tool/method successfully, please report back with your variant. I can't test this myself, so I'm relying on some verification before I update the newbie guide to point here instead of tenfar's thread (which is outdated and no longer updated as tenfar is now inactive).
 

Controllerboy

Senior Member
Jan 28, 2012
123
131
Ghent
<-- SNIP -->
If someone has the 2017g TWRP file, I can upload and link it. The links in the tenfar post have been removed.

I found this on the 65th page of Tenfar's thread (http://xdaforums.com/showpost.php?p=69215285&postcount=642)

khaino said:
Step 1: Download the zip file and extract to your local disk. a2017 for Chinese model,and a2017u for US model,a2017g for HK & EU model
a2017u :B20_blunlockedhttp://d-h.st/KaaQ
a2017u B20 http://d-h.st/LqR5 (modified from @rczrider�s backup real stock b20 boot.img)
a2017u B27 http://d-h.st/kRgq
a2017 B06:http://d-h.st/ztXw
a2017 B07:http://d-h.st/VVlf
a2017 B08: http://d-h.st/bT6r
a2017 B09:http://d-h.st/sBjo
a2017 B10:http://d-h.st/cBOE(wifi not working) http://d-h.st/aceq (from official update.zip)
a2017g B02 :http://d-h.st/aPiC
a2017g B03:http://d-h.st/r3Z4
TWRP recovery 3.0.2-2 : http://d-h.st/dgWW
latest tools:http://d-h.st/Ienb with dump function

So I just use the file from http://d-h.st/r3Z4 (axon7root-a2017g-b03.zip), unzip and rename the .img file to recovery.img?
The issue here is that the hosting used is so crappy I can't even download the file...
 

tennear

Senior Member
Nov 28, 2016
73
114
So I just use the file from http://d-h.st/r3Z4 (axon7root-a2017g-b03.zip), unzip and rename the .img file to recovery.img?
The issue here is that the hosting used is so crappy I can't even download the file...

That is correct.

d-h.st seems to be down for the past few days. I guess it will come back at some point, and you can download the zip file to extract the recovery image. Or maybe someone else has a copy of it...
 

tennear

Senior Member
Nov 28, 2016
73
114
@tennear
As far as u know TWRP is the same for every A7, sign or not.

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.
 

MATTHEWLONG

Senior Member
Jun 17, 2007
179
24
I wouldnt say I was a newbie but how do you get the file to run. Even with Antivrus off, the computer just wont run it.

Thank you for the time and support.
 

Controllerboy

Senior Member
Jan 28, 2012
123
131
Ghent
The .exe file isn't meant to be ran on it's own. Double-clicking it won't do a thing. You need to use cmd (command) to execute commands to the file. If you look at my post on the first page of this thread, you'll get an idea of how the process works. But please don't follow my post as of now, since it's not detailed nor 100% correct yet.

It's my intention to try my luck tomorrow and I'll post a detailed and 100% correct step-by-step-process.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 35
    Note: This is an inherently dangerous tool. I have made every effort to make it as safe as possible. But there is always a risk of bricking your device. You assume all responsibility for the consequences. Proceed with caution.

    Warning: To avoid bricking your device, NEVER write both boot and recovery in one session. ALWAYS write one partition, test, then write the other. This is why the tool will only write one partition at a time.

    Warning: There are versions of TWRP for the Axon 7 that are known to erase your IMEI when doing a restore. Do NOT do a TWRP restore unless your are SURE that you have a good version of TWRP!

    This tool will allow you to:
    • Backup your boot and recovery partitions.
    • Flash a boot or recovery image (including the signed TWRP image).

    See following posts for operating system specific setup instructions.

    Once your setup is complete, enter EDL mode:
    1. Power off phone.
    2. Hold both volume buttons.
    3. Plug phone into computer.
    4. For G models, you must "adb reboot edl" (see other threads).

    Usage:
    axon7tool <mode> <partition(s)>
    Note: The tool name will vary depending on your operating system.

    <mode> is -r for read, -w for write.

    For read mode, <partition> is one or more of gpt, boot, recovery. Files will be created as <partition>-backup.bin

    For write mode, <partition> is boot or recovery. File will be read from <partition>.bin

    Examples:

    To backup everything on Linux:
    ./axon7tool-1.5-linux -r gpt boot recovery

    To write recovery on Win64:
    Place file as recovery.bin
    axon7tool-1.5-win64 -w recovery

    Links to axon7tool:
    axon7tool-1.5-linux (main)
    axon7tool-1.5-linux (alternate)
    axon7tool-1.5-win64.exe (main)
    axon7tool-1.5-win64.exe (alternate)

    Link to signed TWRP removed.

    FAQ:

    Q: Can you provide a signed boot image with root?
    A: No. I do not have the ZTE signing key, and tenfar's images are not current.

    Q: Can I have the source code for the tool?
    A: No.

    Q: Can you provide the programmer?
    A: No.

    Q: Do you accept donations?
    A: No, all work is provided freely for community use.
    7
    Setup instructions for Win64:

    1. Download zadig from http://zadig.akeo.ie/

    2. Put device in EDL mode.

    3. Run zadig. Select the WinUSB driver. If you have installed the Qualcomm EDL driver, you may need to tick "Edit" and find the device in the list.

    4. All done!
    7
    Excuse me for my ignorance, but how does this tool differ from tenfars tool? Beside not being able to write two partitions at the same time that is.

    TIA,

    Cheerz,
    /Cacti

    * Not being able to write two partitions at the same time is a huge feature. Writing both boot and recovery is a major source of bricked devices.

    * It consults the device partition table to ensure that it finds the proper location for the partitions. tenfar's tool does not do this -- it blindly assumes all devices have the same partition table. (No, I don't have his sources. Yes, I know this to be true.)

    * It can read the partition table (GPT). This is handy for me, to diagnose users' issues.

    * It runs on Linux (and I can make a Mac version).

    * It is maintained. tenfar is MIA.
    6
    Setup instructions for Linux:

    1. Ensure your login user is in the "plugdev" group.
    $ id
    You should see plugdev in the list. If not, add yourself to the group and logout/login to take effect.

    2. Ensure your udev rules are setup.
    Create a file eg. /etc/udev/rules.d/qcom.rules that contains:
    Code:
    SUBSYSTEM=="usb", ATTRS{idVendor}=="05c6", GROUP="plugdev"
    SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", GROUP="plugdev"

    3. All done!
    5
    Forgive me my noobiness, but here’s a step-by-step-instruction list. Am I thinking right? I want to minimise the risk when I try your tool tomorrow.

    Step 1: Enable Developer options in phone by tapping the build number
    Step 2: Enable OEM Unlock in phone (is this needed?)
    Step 3: Enable debugging (for adb)
    Step 4: Connect phone to PC
    Step 5: Download Zadig
    Step 6: Install Zadig
    Step 7: Open command in the folder in which you downloaded adb.exe (and the rest of the files that come with it) (Richt click while holding shift to get the option to open CMD in a folder)
    Step 8: Enter the command “Adb Devices” to reassure your device is detected
    Step 9: Enter the command “Adb reboot edl” to reboot the phone to EDL mode
    Step 10: After phone has rebooted to EDL mode, run Zadig, select WInUSB driver and install it for your device
    Step 11: Rename “axon7tool-1.5-win64.exe” to “axon7tool.exe”
    Step 12: Download “axon7-2017u-twrp-signed.img” to the folder where axon7tool.exe is located
    Step 13: Open command in the folder in which you have downloaded axon7tool-1.5-win64.exe (renamed to axon7tool.exe)
    Step 14: Enter command “axon7tool -r gpt”.
    Step 15: Enter command “axon7tool -r boot”
    Step 16: Enter command “axon7tool -r recovery”
    Step 17: Verify if the tool has created “gpt-backup.bin”, “boot-backup.bin”, “recovery-backup.bin”.
    Step 18 (unsure): rename “axon7-2017u-twrp-signed.img” to “recovery.bin” ?
    Step 19: enter “axon7tool -w recovery recovery.bin
    Step 20: Wait for the command to finish
    Step 21: Place the .zip file for Z.A.D. Mix7 or CM13 on your SD card via your PC or Axon 7. Also download Gapps.zip of your choice and place on SD card.
    Step 22: Boot your Axon 7 to TWRP Recovery by holding the power button simultaneously with volume down (or is it volume up?)
    Step 23: Perform a full wipe of Dalvik, Cache and Data in TWRP
    Step 24: Flash the .zip of your custom ROM of choice in TWRP
    Step 25: Flash the .zip of your Google Apps of choice in TWRP
    Step 26: Perform a full wipe of Dalvik, Cache and Data in TWRP
    Step 27: Reboot your phone, enjoy the custom ROM of your choice.

    Is this the correct procedure?

    I’m a bit unsure of step 18. Am I doing it right? Or do you need to unzip that .img somehow to find a recovery.bin file? Or do you need to get that file from somewhere else? Or do you need to rename “axon7-2017u-twrp-signed.zip” to “recovery.img”?

    For Z.A.D. MIX7, I suppose you still need to flash a SuperSU version seperately? I heard in CM it's baked-in.

    Thanks for the help.

    Jan