• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[EDL][A2017/A2017U] Emergency DL Mode TWRP + Unlock + Upgrade

Search This thread

jcadduono

Recognized Developer
Jan 17, 2014
1,492
6,214
29
Thunder Bay
adduono.com
3a4b28281b.png


INTRODUCTION

I'm providing a set of files that allow you to unlock your bootloader or recover from the closest thing you can get to a hard brick.
MiFlash is capable of flashing anything to your phone while it is in Emergency Download mode.
Yes, this is voodoo magic and it works! Recover from any and all bricks! Some might call it necromancy. ;)
However, it can be also be used even if the device is perfectly alright to simplify upgrading procedures and make ROM flashing fairly painless.

This is for A2017U (North America) and A2017 (China) models only! Do not attempt this on A2017G.

INSTRUCTIONS

If you are flashing TWRP on a locked bootloader, you must first enable OEM unlocking on your device.
You can do this by navigating to Settings -> About phone -> Tap "Build number" 7 times.
Now navigate to Settings -> Advanced settings -> Developer options -> Enable "OEM unlocking".
Follow the steps below with the FASTBOOT_UNLOCK package first, then go into fastboot mode and use the
"fastboot oem unlock" command to unlock (and wipe) your device. Download adb and fastboot below.

Install the Qualcomm QUSB_BULK drivers from below.
You should be able to simply extract them, then right click qcser.inf and press Install.
If you don't have this option, then use devmgmt.msc (Device Manager) to update the driver after entering EDL mode by
selecting manual install and browsing to the qcser.inf file there.
Once the drivers are installed, your device should be recognized as a COM port called "Qualcomm HS-USB QDLoader 9008".

Now install MiFlash (download below).
Open MiFlash and use the [select] button to select the A2017U_*_EDL folder package that you wish to flash.
Boot into EDL mode. (hold Volume Up + Volume Down + Power until you're stuck on a black screen)

Now just hit [flash] - watch the progress bars move and wait for the device row to turn green with flash complete!

If you are flashing TWRP, use the [Power] + [Volume Up] key combo to exit EDL mode and enter recovery. Release the keys when you see the ZTE logo.
You must have an unlocked bootloader to enter TWRP!

If the flash fails or is unable to communicate with the device, use the [Power] + [Volume Up] + [Volume Down] key combo to restart EDL mode.
Release the keys after 5 seconds then wait another 5 seconds before using the [refresh] or [flash] buttons on MiFlash.

EDL PACKAGES

FASTBOOT_UNLOCK
This will unlock all fastboot operations, including OEM unlock and fastboot boot/flash.
WARNING: Unlocking your bootloader will erase all userdata on the device! Your device will be completely reset to factory defaults!
Click here to download! (ZIP, 195.8 KiB)

B29_TWRP (Marshmallow 6.0)
This will install TWRP 3.0.4-1 and unlock fastboot operations while restoring B29 boot stack.
Click here to download! (ZIP, 59.4 MiB)

B15-NEW_TWRP (Nougat 7.0)
This will install TWRP 3.0.4-1 and unlock fastboot operations while restoring B15-NEW boot stack.
Click here to download! (ZIP, 60.6 MiB)

B15-NEW_FULL (Nougat 7.0)
This will install the entirety of the B15-NEW firmware and boot stack, including signed OEM system and boot. OTA capable and unlocks fastboot operations.
Click here to download! (ZIP, 2.4 GiB)

B19-NOUGAT_TWRP (Nougat 7.1.1)
This will install TWRP 3.0.4-1 and unlock fastboot operations while restoring B19-NOUGAT boot stack.
Click here to download! (ZIP, 61.0 MiB)

B19-NOUGAT_FULL (Nougat 7.1.1)
This will install the entirety of the B19-NOUGAT firmware and boot stack, including signed OEM system and boot. OTA capable and unlocks fastboot operations.
Click here to download! (ZIP, 2.4 GiB)

TOOLS

Xiaomi MiFlash Installer
Version: 2016.08.30.0
Click here to download! (MSI, 31.0 MiB)

Qualcomm QUSB_BULK Drivers
Version: 2.1.1.0 (2014-01-25)
WHQL signed.
Once the drivers are installed, your device should be recognized as a COM port called "Qualcomm HS-USB QDLoader 9008".
Click here to download! (ZIP, 2.7 MiB)

ADB & Fastboot
Visit the SDK Platform Tools download page

Using this, you should safely be able to recover from any brick!

Once in TWRP, you can flash a full OTA or restore your backups and be on your way. :)

It is tested and working on Windows 10 64-bit.
All zips are signed with Android SignApk and can be verified with TWRP. (they won't install, just say it's not a valid zip after verifying)

A2017 (China) can use this to convert their phone to A2017U if they want. DO NOT flash on A2017G.

POSSIBLE ISSUES & SOLUTIONS

OTA update zips may fail in stock recovery even after flashing FULL EDL packages. This is because MiFlash does not erase blocks before writing the system image. You can run this command from TWRP terminal or adb shell to erase system partition before flashing the EDL package:
dd if=/dev/zero of=/dev/block/bootdevice/by-name/system bs=272144
Once this is done, OTA zips should succeed in stock recovery after flashing a FULL EDL package.

CREDITS

This was based on the A2017 B07 EDL zip provided by @tenfar at this XDA thread.

HISTORY
  • 2017-04-10 - Added B19-NOUGAT FULL and TWRP package
  • 2017-02-11 - Added B15-NEW FULL signed OTA capable package
  • 2017-02-11 - Added fastboot operation unlock package
  • 2017-02-11 - Separated MiFlash, Qualcomm QUSB_BULK Driver, and EDL packages, removed 7z archives
  • 2017-02-09 - Added B15-NEW TWRP package
  • 2017-02-09 - Added B29 TWRP package
 
Last edited:

jcadduono

Recognized Developer
Jan 17, 2014
1,492
6,214
29
Thunder Bay
adduono.com
Any idea if this will work with Nougat or not?

It will work on Nougat, however, you will end up on B29 bootloader. You'll need to flash B29 full and upgrade again. :(
I am having some weird issues with Nougat boot stack flashing + TWRP so I'll hold off on posting a B15-NEW version of this for now.

Update: You can now flash the B15-NEW TWRP package instead.
 
Last edited:

DrakenFX

Senior Member
Oct 11, 2010
1,859
2,538
Los Angeles
www.youtube.com
@jcadduono
N BootStack from LineageOS thread can be use for this if you want to give a try, instead of B29.

The stack is from a zip N file (I can't disclose right now) and is full N stack, minus Boot and System of course.

P.S. be advice that " keymaster.mbn " file flashes to " xlbbak " partition. Or just check the updater_script for N changes.
 
Last edited:

Altomugriento

Senior Member
Oct 28, 2013
161
45
Situation: A2017U full stock in Nougat no unlocked bootloader, no root
Want to: Install LOS because i HATE this bullsh... called MIFAidonotknowWTF
Can i use this procedure to do that?
Thanks a LOT
 
Last edited:
  • Like
Reactions: kitcostantino

TeutonJon78

Senior Member
Jul 24, 2010
574
283
So basically, MiFlash just lets you firehose in any file to a QualComm device from EDL mode? That's pretty handy.
 

Snaptraks

Senior Member
Jan 23, 2016
61
26
I assume the TWRP image will only work on an unlocked bootloader device, right?

Then again, I don't see why a locked bootloader device would get in such a bricked state in the first place.
 

lafester

Senior Member
Feb 11, 2007
3,399
648
trying to wrap my head around this whole bootstack/fastboot issue we have with the a7.
So in theory one could use this tool and then unlock (or just have working fastboot) directly from b15?
Then download the bootstack from los thread and be good to go? Or would that bork fastboot again...
I think I am currently running b20 bootstack on b15 by flashing draken's unlock zip without issue (that I know of) but am considering flashing the N version from los thread.
 

Altomugriento

Senior Member
Oct 28, 2013
161
45
Have fun! Nougat images are now up!
Can you help me to do this from full stock nougat?

1) Enable "OEM UNLOCKING" under Developer Options
2) Flash with MIflash the "A2017U_B15-NEW_TWRP_EDL"
2) reboot to recovery (vol - and power)
3) fastboot oem unlock
4) reboot to TWRP
5) Flash LineajeOS and Gapps

thanks for your help
 

jcadduono

Recognized Developer
Jan 17, 2014
1,492
6,214
29
Thunder Bay
adduono.com
Can you help me to do this from full stock nougat?

1) Enable "OEM UNLOCKING" under Developer Options
2) Flash with MIflash the "A2017U_B15-NEW_TWRP_EDL"
2) reboot to recovery (vol - and power)
3) fastboot oem unlock
4) reboot to TWRP
5) Flash LineajeOS and Gapps

thanks for your help
step 2.5) reboot to bootloader from recovery
step 4) wipe system in twrp
step 6) use the [Format Data] button on wipe page of twrp (lineageOS may not be compatible with your current encryption, this will wipe all your settings and internal storage)

and yes that's everything, I believe.
 

icenight89

Senior Member
Dec 18, 2010
2,727
778
Sticky. Nuff said.

Dev is finally taking off on this phone, thanks to literally 4 or 5 key people. I was afraid I'd made a mistake purchasing instead of O+3, but has worked out well.

Thanks for all your help in your free time.
 
  • Like
Reactions: Y2Ne1

jcadduono

Recognized Developer
Jan 17, 2014
1,492
6,214
29
Thunder Bay
adduono.com
@jcadduono
N BootStack from LineageOS thread can be use for this if you want to give a try, instead of B29.

The stack is from a zip N file (I can't disclose right now) and is full N stack, minus Boot and System of course.

P.S. be advice that " keymaster.mbn " file flashes to " xlbbak " partition. Or just check the updater_script for N changes.

Thanks buddy, that keymaster -> xblbak appears to have been my issue! So illogical.
I compiled applypatch and used that to apply the B29_TO_B15-NEW .p files to my B29 binaries so they should be nice and exact. (sha1 matches from updater-script)

I can provide a full B15-NEW verity/OTA update friendly package if somebody wants. Just let me know.
 

khangozzy

Senior Member
Aug 18, 2006
554
50
Hanoi
Hi @jcadduono

I'm about to get my A7 (A2017U version) in few days. Would you please advise which method/process/steps is the best to upgrade to stock, rooted and fastboot working N B15 build?
Thanks
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 79
    3a4b28281b.png


    INTRODUCTION

    I'm providing a set of files that allow you to unlock your bootloader or recover from the closest thing you can get to a hard brick.
    MiFlash is capable of flashing anything to your phone while it is in Emergency Download mode.
    Yes, this is voodoo magic and it works! Recover from any and all bricks! Some might call it necromancy. ;)
    However, it can be also be used even if the device is perfectly alright to simplify upgrading procedures and make ROM flashing fairly painless.

    This is for A2017U (North America) and A2017 (China) models only! Do not attempt this on A2017G.

    INSTRUCTIONS

    If you are flashing TWRP on a locked bootloader, you must first enable OEM unlocking on your device.
    You can do this by navigating to Settings -> About phone -> Tap "Build number" 7 times.
    Now navigate to Settings -> Advanced settings -> Developer options -> Enable "OEM unlocking".
    Follow the steps below with the FASTBOOT_UNLOCK package first, then go into fastboot mode and use the
    "fastboot oem unlock" command to unlock (and wipe) your device. Download adb and fastboot below.

    Install the Qualcomm QUSB_BULK drivers from below.
    You should be able to simply extract them, then right click qcser.inf and press Install.
    If you don't have this option, then use devmgmt.msc (Device Manager) to update the driver after entering EDL mode by
    selecting manual install and browsing to the qcser.inf file there.
    Once the drivers are installed, your device should be recognized as a COM port called "Qualcomm HS-USB QDLoader 9008".

    Now install MiFlash (download below).
    Open MiFlash and use the [select] button to select the A2017U_*_EDL folder package that you wish to flash.
    Boot into EDL mode. (hold Volume Up + Volume Down + Power until you're stuck on a black screen)

    Now just hit [flash] - watch the progress bars move and wait for the device row to turn green with flash complete!

    If you are flashing TWRP, use the [Power] + [Volume Up] key combo to exit EDL mode and enter recovery. Release the keys when you see the ZTE logo.
    You must have an unlocked bootloader to enter TWRP!

    If the flash fails or is unable to communicate with the device, use the [Power] + [Volume Up] + [Volume Down] key combo to restart EDL mode.
    Release the keys after 5 seconds then wait another 5 seconds before using the [refresh] or [flash] buttons on MiFlash.

    EDL PACKAGES

    FASTBOOT_UNLOCK
    This will unlock all fastboot operations, including OEM unlock and fastboot boot/flash.
    WARNING: Unlocking your bootloader will erase all userdata on the device! Your device will be completely reset to factory defaults!
    Click here to download! (ZIP, 195.8 KiB)

    B29_TWRP (Marshmallow 6.0)
    This will install TWRP 3.0.4-1 and unlock fastboot operations while restoring B29 boot stack.
    Click here to download! (ZIP, 59.4 MiB)

    B15-NEW_TWRP (Nougat 7.0)
    This will install TWRP 3.0.4-1 and unlock fastboot operations while restoring B15-NEW boot stack.
    Click here to download! (ZIP, 60.6 MiB)

    B15-NEW_FULL (Nougat 7.0)
    This will install the entirety of the B15-NEW firmware and boot stack, including signed OEM system and boot. OTA capable and unlocks fastboot operations.
    Click here to download! (ZIP, 2.4 GiB)

    B19-NOUGAT_TWRP (Nougat 7.1.1)
    This will install TWRP 3.0.4-1 and unlock fastboot operations while restoring B19-NOUGAT boot stack.
    Click here to download! (ZIP, 61.0 MiB)

    B19-NOUGAT_FULL (Nougat 7.1.1)
    This will install the entirety of the B19-NOUGAT firmware and boot stack, including signed OEM system and boot. OTA capable and unlocks fastboot operations.
    Click here to download! (ZIP, 2.4 GiB)

    TOOLS

    Xiaomi MiFlash Installer
    Version: 2016.08.30.0
    Click here to download! (MSI, 31.0 MiB)

    Qualcomm QUSB_BULK Drivers
    Version: 2.1.1.0 (2014-01-25)
    WHQL signed.
    Once the drivers are installed, your device should be recognized as a COM port called "Qualcomm HS-USB QDLoader 9008".
    Click here to download! (ZIP, 2.7 MiB)

    ADB & Fastboot
    Visit the SDK Platform Tools download page

    Using this, you should safely be able to recover from any brick!

    Once in TWRP, you can flash a full OTA or restore your backups and be on your way. :)

    It is tested and working on Windows 10 64-bit.
    All zips are signed with Android SignApk and can be verified with TWRP. (they won't install, just say it's not a valid zip after verifying)

    A2017 (China) can use this to convert their phone to A2017U if they want. DO NOT flash on A2017G.

    POSSIBLE ISSUES & SOLUTIONS

    OTA update zips may fail in stock recovery even after flashing FULL EDL packages. This is because MiFlash does not erase blocks before writing the system image. You can run this command from TWRP terminal or adb shell to erase system partition before flashing the EDL package:
    dd if=/dev/zero of=/dev/block/bootdevice/by-name/system bs=272144
    Once this is done, OTA zips should succeed in stock recovery after flashing a FULL EDL package.

    CREDITS

    This was based on the A2017 B07 EDL zip provided by @tenfar at this XDA thread.

    HISTORY
    • 2017-04-10 - Added B19-NOUGAT FULL and TWRP package
    • 2017-02-11 - Added B15-NEW FULL signed OTA capable package
    • 2017-02-11 - Added fastboot operation unlock package
    • 2017-02-11 - Separated MiFlash, Qualcomm QUSB_BULK Driver, and EDL packages, removed 7z archives
    • 2017-02-09 - Added B15-NEW TWRP package
    • 2017-02-09 - Added B29 TWRP package
    7
    @jcadduono



    Do you have any technical reason to believe it isnt working on A2017G or is it just not tested?

    Because if you have already bricked your device what do you have to lose?



    hi,in my opinion ,the g modle is all the same as the u model ,the only different is software and efs infomation ,but need some one dare to test .
    if something wrong you will lost imei and meid in efs .

    i can not find a way to write meid info into efs for now ,but i success write imei into efs .if i remember it right .it's a bit long longer ago .

    sorry for my english.

    the dfu mode is customized by zte .in compared with edl mode .there will need a auth with the dfu protocol ,

    the firehose protocol is below :
    pc send a command through com ,phone send back a hello packet ,pc send firehose programmer ,phone accept it to sram and execute it ,and enter firehose mode , the pc send command to phone with file followed ,firehose programmer write it to ufs emmc chip .... until all file send and write .

    the dfu protocal needs one step more before phone send back hello ,it 's a auth file .i cant get it for now ,let me dig a deep further on the official flash tool in the following days .

    i am still waitting someone to report that they fixed their bricked g modle with special cable.:(

    i feel like it is my fault that they bricked their device .i must say sorry .and try to help them fix their device .


    从我的 iPhone 发送,使用 Tapatalk
    5
    This thing works, guys! OMGOMGOMG! :highfive::laugh:
    My device was in a "heavily bricked" state. No LED light on connect and permanent EDL mode. I am now fully functional after trying EVERYTHING but this.
    5
    Has anyone attempted the 7.1.1 OTA running "B15-NEW_FULL (Nougat)" EDL ?

    Sorry I've been away for some time - addicted to World of Warcraft!

    I just did it myself successfully without issues and am uploading B19-NOUGAT FULL EDL package now.

    Unfortunately there is an issue with verification even though the data is fine, this is because MiFlash is not erasing empty block ranges to zero when flashing the sparse system image, so byte remnants of old filesystem remain (no harm). The solution is to run from TWRP before flashing the full EDL:
    dd if=/dev/zero of=/dev/block/bootdevice/by-name/system bs=272144
    This will clear all system blocks to zero, and the next time you flash the EDL it will be an exact bit match of what official OTA is expecting.

    In other thoughts...
    Holy crap, ZTE finally enabled user selected password based FDE encryption! Even more impressive is that it actually works on TWRP 3.0.4-1!
    I still think they need to hire a native English speaker to fix their translations though... :)

    Update: B19-NOUGAT FULL and TWRP EDL packages should be uploaded by sometime tomorrow morning (ex. ~10 hrs from this post)
    Eat my Canadian 70 KB/s upload speed ;)

    Update: ALL DONE!
    5
    Can you help me to do this from full stock nougat?

    1) Enable "OEM UNLOCKING" under Developer Options
    2) Flash with MIflash the "A2017U_B15-NEW_TWRP_EDL"
    2) reboot to recovery (vol - and power)
    3) fastboot oem unlock
    4) reboot to TWRP
    5) Flash LineajeOS and Gapps

    thanks for your help
    step 2.5) reboot to bootloader from recovery
    step 4) wipe system in twrp
    step 6) use the [Format Data] button on wipe page of twrp (lineageOS may not be compatible with your current encryption, this will wipe all your settings and internal storage)

    and yes that's everything, I believe.