[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] Bobernator:
Welcome everyone!

This project has started, becouse we need real solution for the problem. The problem of hard bricked Moto devices. It is like a curse.

When my device bricked I have done solid research, I have gathered many informations and files essential to revive my cellphone but 5 years experience of linux, rooting, compiling kernels and roms weren't enough to make it work.

But nevermind. I am even more determinated and I am asking ALL of You guys here to help me. Together we will come to solution.

Here is what I got, happy reading :cool: :

DICTIONARY:

PBL - Primary bootloader of the chip - this is like BIOS for phone so it checks chip for damage and problems and then it tries to load SBL but if SBL is corrupted or checksum doesn't match, PBL invokes Qualcomm HS-USB QDLoader 9008 emergency mode. PBL is hard flashed into SoC and can't be corrupted by firmware.

SBL - Second stage bootloader wich is more advanced than PBL. It initializes phone hardware and ABOOT.

ABOOT - Application bootloader (HBOOT). You probably know this one well. Android botloader.

Full mmcblk0 backup - Backup of whole phone flash storage byto to byte.

blankflash - method of repairing msm phones in 9008 state

programmer.mbn - Special type of software programmer that is being sent to chip in Qualcomm 9008 emergency mode. There it comunicates with pc via firehose protocol. Each phone has set of their own programmers, they are unique to phone and other programmers don't work. These programmers are signed so tampering it results in not working one.

firehose protocol - it is used to tell programmer what operations it must do on chip.

singleimage.bin - this package contains instructions for programmer and set of files it need (for example to replace)

gpt_main0.bin - Partition layout

rawprogram0.xml - instructions for programmer

patch0.xml - I don't know yet

STAR.exe - Application for managing and editing contents of singleimage.bin aka blankflash files

QPST - Flash tool from Qualcomm it basic function is to handle blank-flashing in a better way, also it allows for in-depth debugging of the process

Qualcom Premium Tool - Program made by Mppg Myanmar that is capable of making unlocking bootloader, OEM locks, making backup/restore of chip firmware, handling blank-flashing in VERY specific way (creating instructions for programmer), reading eMMC structure from firmware (can generate gpt layout so very useful!!!), modyfing FW and removing Xiaomi account. It also contains ALL programmers

for more:

https://xdaforums.com/android/general/info-android-device-partitions-basic-t3586565

https://alephsecurity.com/

https://github.com/alephsecurity/firehorse

https://github.com/aravindvnair99/Motorola-Moto-E-XT1022-condor-unbrick

INFO:

1. What causes the brick

I bet 100$ that you hard-bricked your Moto Z Play by installing OTA updates after downgrading firmware. This is only known reason for me at the time of writing this. There is most probable reason why it happens, look:

There are two most common chips on which smartphones are built - Qualcomm and Mediatek. While Mediatek chips are "modification friendly" and simple, Qualcomm chips are somewhat more advanced and have many features that can be enabled or disabled during prorammming in factory. One of them is PBL signature checking. During programming of your phone, proper signatures of SBL are written to it. When someone tries to override default SBL with the new one, it checksums are compared with that stored. If they match, new one is flashed, if not, then update does not happen.

Ok, but what it has to do with brick?!

I explain:

1. You decide to downgrade your firmware

2. During flashing, everything goes "well" (Phone boots), but trully update is partial:

FW in chip is (obviously) more recent that the one you downgrade to, and SBL signature is different (updated), so when it is compared to the signature of SBL from FW you want to flash, it don't match. That don't rise error and flashing continues. Only partition that stays untouched is bootloader, but all other partitions get replaced by those in FW zip. SBL is still compatible with the new partition offsets and partition layout overall so phone functions normally.

3 When OTA is executed, it checks the version of currently installed firware. The most reliabe way to do it is to check checksum of SBL which is pretty logical becouse it's checksum is like "fingerprint" of firmware. Normally, if it would detect the old firmware, OTA would be stopped, but newer SBL tricks it and OTA installs anyway.

4 Results are horrible, becouse OTA does not check GPT table and flashes partitions in bad sectors, corrupting FW.

This causes bootloader to go into Qualcomm HS-USB QDLoader 9008 safe mode.

5 Viola! Hard brick!

2. How to fix it?

That is jolly good question! What we have to do is to reflash full chip firmware. Suprisingly I see some solutions, but those need to be developed:

A) SD-BOOT

It turns out that our fancy chip can probably boot from SD-CARD! The procedure works like this:

- When chip starts, one of the very first things it does is loading the memory, so it can actually work. The trick, is that chip loads it from specific disk, marked with exact name (I don't remember which, but I will do research). Speccially repared SD-CARD can appear with that name, so chip boots from it, not from internal memory. (This trick is proved to work on this model)

How to do it?

- Get full dd of working phone - it must be phone with the SAME chip and very likely the same model

- flash it to SD-CARD of 32GB or more, class 10 speed or higher, directly to card, not partition

- put card in phone, turn it on and wait

- you should see HBOOT

- select fastboot and flash new FW via it

- viola!

!!!THIS IS COMPLICATED PROCEDURE, I WILL MAKE DETAILED THREAD SOON, BUT FOLLOW IT ONLY IF YOU KNOW WHAT ARE YOU DOING!!!

B) FIREHOSE/SAHARA ATTACK

This could be achieved by sending payload via Firehose programmer that would allow to break verification of SBL or somehow allow SBL to be flashed. Now, PBL blocks attempts to update SBL. I have thesis that it is becouse PBL do not allows for SBL downgrade, so it's version must be higher, but we try to flash same version of SBL so it doesn't work. That thesis needs confirmation.

C) CRAFT BLANKFLASH

This would be last resort. It will work for sure, but this method needs knowledge and I don't know if it is doable.

STEP 1: Get white-listed blankflash checksums from OTA (we would need to reverse engineer those)

STEP 2: Break hash

STEP 3: Craft blankflash with needed hash

STEP 4: Flash

NEVER USE BLANKFLASH (ATTENTION!)

DO NOT try any blankflash files. They can make situation a lot worse and even physically (!) dmage your phone.

D) JTAG

Medusa Box etc.

E) Qualcomm Premium Tool

This can even work, but it is untested and there is a slight chance that can worsen state of phone (needs confirming).

The tool is very advanced and I need to gather info about usage, so very probable to be a good solution if we will learn how to use it!

E) METHOD 7

Interesting method from this guy: (7th option, I have contacted him if it is compatibile)

https://github.com/aravindvnair99/Motorola-Moto-E-XT1022-condor-unbrick/blob/master/Unbrick%20methods.md

3. DOWNLOAD

(Links will be aded *soon*)

XDA:DevDB Information

Unbrick Developement for Moto Z Play (addison) Full-Brick, Tool/Utility for the Moto Z Play

Contributors

Bobernator, Stayn, Artim_96, Camarda

Version Information

Status: Nightly

Created 2019-05-04

Last Updated 2019-05-14