[X Style (Pure) General] ResistanceIsFutile:
M X P E users Windows based ADB Flashing

[MENTION=5593145]stevejohnson42[/MENTION]

Hope you don't mind :)

Sir, I've addressed this post to you with the hopes that others will find it helpful and informing as well.

Whither their revisiting the thread to get the stock Nougat image on their device again, or the first time visitor going through the process.

Either type of users going back or to a stock Nougat ROM environment, (after a custom ROM's use ) or (in upgrading to the stock Nougat OS).

Some may have messed around already not understanding what they've done to their device - finding they need help now using this threads process or with it's linked Guide.

But if they've done something to their device to get it in a mixed configuration, who can help them proper ?

That is where they need to get a "getvar all" in ADB/Fastboot for theirselves and/or others to know and how to begin in helping them.

In ADB/Fastboot-

1. type > fastboot devices, and press enter key-

(This command check communication with phone and ensures that all drivers are installed correcly).

2. type > fastboot getvar all, and press enter key -

(This command forces the phone to give us all the information about firmware version, bootloader status, cid number, phone model id and all other data that a phone can give us).

3. Users wanting help should get and post their devices "getvar all" stripping out the devices sensitive information (imei, meid, etc...) from it.

In another comment you've said "I always run the adb commands in administrative mode in W10."

I'd hope anyone having ADB troubles in getting continued failures - errors during the flashing of any part/piece of a Stock firmware image and in using any version of Windows at least try the ADB flashing commands from the Administrative Mode in their Windows version too.

Example: Like in re-running that ADB command's part/piece (3-4 times) over, and it continues to get a failed error of that part/piece and/or with multiple parts/pieces failed errors.

[[Certain commands require write permissions to the applicable partition.

Normally, the phone manufacturer has restricted the write authorization by an individual software and/or hardware solution.]]

In this here threads OP (THREAD WHERE YOUR AT NOW) - "Moto X Pure Factory Firmware Nougat NPH25.200-22" - a guide is offered under the words "for detailed instructions" and can be found using that link.

Where as, [MENTION=2001582]acejavelin[/MENTION] in his guide has always contended, asserted and maintained earnestly-

"Be aware you do NOT have to lock the bootloader, have Status Code of 0, or have it show "Official" status to successfully accept and apply an OTA update, it will happily apply with an unlocked bootloader and unofficial software status, as long as you have a 100% pure stock ROM installed, the updater script doesn't care what the bootloader reports."

-There is also a warning in the Guides first post to NOT use the recovery image from the Moto's website, as it is incorrectly labeled and a huge downgrade that does have the potential to brick the device or just not work - found in "Just a blurb on Marshmallow software version -specifically under- 18 or 18_18".

-If you are interested in returning to stock WITHOUT locking the bootloader, then follow the guides ADB flashing event commands, but use these two separate following commands in place of the "TWO LOCK" commands in the ADB flashing sequence listed under the (code box) in the guide.

fastboot oem fb_mode_set

--IN REPLACING THAT OF-- fastboot oem lock begin

*** THE VERY FIRST COMMAND LISTED TO ENTER....

fastboot oem fb_mode_clear

--IN REPLACING THAT OF-- fastboot oem lock

*** THE SECOND UP FROM THE VERY LAST COMMAND LISTED TO ENTER....

Then please remember the other points of interest in acejavelin's guide for his advice and notes-

A. To see what version your bootloader is at now, go into ADB/Fastboot commands and perform a "fastboot getvar ro.build.fingerprint" and look at the output, it should be pretty clear.

B. You must use a factory firmware image that is the same version as what you have installed now or it's being a newer version, to successfully relock the bootloader.

-If you lock with this ADB flashing process, you can unlock the bootloader again and even use the same Motorola unlock token...

-Subsequent bootloader unlocking will wipe the phones data as well - remember to make a backup if you want to keep something.

-Doing this ADB flash - will set the OEM Locking option in Developer options to disabled, although it is perfectly safe to leave it like this, acejavelin suggests turning it on immediately since your warranty is gone and if something does go wrong you'll have the ability to unlock again to fix it.

-If you attempt to use a firmware image that is older than what you have installed currently, you will receive a Preflash Validation Error indicating such when you attempt to flash the partition table (gpt.bin).

C. "Preflash Validation Error" - At this point you can either continue the flash and NOT lock the bootloader at the end, or stop until you can find a same stock image version as what you have installed now - or one being newer for your device.

D. This main ADB flashing process without being changed (as it's listed in the Guides "code box") will return your bootloader status to LOCKED.

If you've not changed the "TWO LOCK" commands - as their offered in the guide as well as I've given to you above.

-Although STATUS will still show a 2, and your software status to OFFICIAL...

-Also, some users have noted that after completing this process the software status does NOT go back to read "Official", if it does not, upon accepting the OTA (I'm thinking of the small Oct. 2017 Security Update OTA), it should go back to read Official after the OTA is accepted as successful to the device.

-The Status Code will always show 2 (relocked) or 3 (unlocked), and it can never go back to 0 (locked) state now.

-It will still pass SafetyNet for Android Pay, Pokemon GO, and banking/financial apps, though.

E. In doing this stock Nougat image ADB flashing procedure, when done the logo shown when booting up will still say your bootloader is unlocked - Warning...

-Fix this by downloading a tested and verified working logo.bin from the guide download the logo from this thread and extracting the logo.bin file to the same folder as the platform-tools directory and (replacing the original logo.bin one there).

Note: I find it perfectly ok to re-name the fixed logo.bin file as the original one here, though you might want to keep it's name intact for you recall of changing it out.

-Other logo.bin files that may work can be found in this thread.

F. Remember, that you will get checked for FRP even after flashing with this procedure, so either remove your Google account prior to your flashing or be sure to keep/know your g. accounts credentials.

-This procedure will not bypass (FRP) - Factory Reset Protection in any way.

G. Follow the Guides "code box" using each of the ADB commands, entering them only ONE AT A TIME, Do Not Just Copy and Paste the entire ADB flashing event section as one ADB command, or trying it in running some kind batch script.

-Those that have report such as they may have done - won't be here to help you in your time of need.

-You need to really watch that each piece actually flashes successfully or if it's just going through the motions - hence witnessing an "OK" or "Failed" after each piece is seen by yourself - and at that point reflashing that piece again till an OK is seen.

-Help will come from the people using the normal way of ADB flashing each individual piece, to the people following the ADB flashing process as the normal - correct way and then with finding they need some help...

-Newer versions of Android allow the updater script to make a bunch of checks, including, to individual files, missing/modified parts, or even if the system partition has ever been mounted as read/write.

(Thankfully it's not been reported happening in Motorola devices - to be checking of that, but it is still possible). If any check fails, the update fails. We have seen lots of people just unroot and put the stock recovery on a device and the update fails. It all depends what you have changed on your device.

H. The first boot can take what seems like forever, some users report it takes 30 minutes to get to the Setup Wizard screens.

I. See, read and in understanding - along with following the guides "Prerequisites:, Notes, as well users comments in specific problems using the threads search box".

-Read through the guide at least twice and make yourself an outline to follow - if it's your first attempt ever in doing this...

Honestly, the best thing to do would be to use the Nougat firmware linked in the first post for the Moto X Pure edition in both threads.

EXACTLY following the instructions in the guides link found in this OP's first post.

It will return your device to out of the box factory condition on the current Nougat release, (note you will still see the Unlocked Bootloader warning screen logo, even though the bootloader may have been relocked).

And see the unlocked bootloader Warning too, if you've taken the steps offered of the two ADB commands of returning to the stock Nougat without locking the bootloader and then without having replaced the original logo.bin in the ADB flashing event with a fixed logo.bin file - or not having done so later in flashing a fixed logo.bin through ADB after the Nougat image flashed. Covered in E. above.

Then your success depends on you following this tried and tested ADB/Fastboot flashing method and you've not tried to follow some trail blazers post straying from the normal ADB flashing method.

Inspired by acejavelin's contributions to the Moto X Pure (XT1575) - and based mostly for a Windows user.

IMPORTANT NOTE:

I, myself and another poster here in this thread have offered links to some Nougat image files - none of these files have been verified as Official Stock Firmware images / if you use them you do so at your own risk...