[X Style (Pure) Android Development] xdadevelkl:
Hello!

Thanks for sharing the stock files. I've tried to revert my XT1572 to stock, but am stuck at the following issue happening when trying to execute the above commands:

...
(bootloader) Please fully flash the signed build before locking phone!
OKAY [ 0.002s]
finished. total time: 0.002s
target reported max download size of 536870912 bytes
sending 'partition' (32 KB)...
OKAY [ 0.002s]
writing 'partition'...
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 0.362s
target reported max download size of 536870912 bytes
sending 'bootloader' (2699 KB)...
OKAY [ 0.078s]
writing 'bootloader'...
(bootloader) flashing aboot ...
(bootloader) flashing sbl1 ...
(bootloader) flashing pmic ...
(bootloader) flashing rpm ...
(bootloader) flashing tz ...
(bootloader) flashing hyp ...
(bootloader) flashing sdi ...
OKAY [ 1.654s]
finished. total time: 1.732s
target reported max download size of 536870912 bytes
sending 'logo' (2001 KB)...
OKAY [ 0.057s]
writing 'logo'...
OKAY [ 0.046s]
finished. total time: 0.103s
target reported max download size of 536870912 bytes
sending 'boot' (40960 KB)...
OKAY [ 1.199s]
writing 'boot'...
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 1.888s
target reported max download size of 536870912 bytes
sending 'recovery' (41040 KB)...
OKAY [ 1.190s]
writing 'recovery'...
OKAY [ 1.505s]
finished. total time: 2.695s
target reported max download size of 536870912 bytes
sending 'system' (261600 KB)...
OKAY [ 7.359s]
writing 'system'...
(bootloader) Invalid signed image
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 7.763s
target reported max download size of 536870912 bytes
sending 'system' (251387 KB)...
OKAY [ 7.072s]
writing 'system'...
(bootloader) Invalid signed image
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 7.091s
target reported max download size of 536870912 bytes
sending 'system' (256147 KB)...
OKAY [ 7.203s]
writing 'system'...
(bootloader) Invalid signed image
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 7.222s
target reported max download size of 536870912 bytes
sending 'system' (259804 KB)...
OKAY [ 7.315s]
writing 'system'...
(bootloader) Invalid signed image
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 7.339s
target reported max download size of 536870912 bytes
sending 'system' (260425 KB)...
OKAY [ 7.329s]
writing 'system'...
(bootloader) Invalid signed image
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 7.338s
target reported max download size of 536870912 bytes
sending 'system' (247396 KB)...
OKAY [ 6.963s]
writing 'system'...
(bootloader) Invalid signed image
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 7.007s
target reported max download size of 536870912 bytes
sending 'system' (257578 KB)...
OKAY [ 7.256s]
writing 'system'...
(bootloader) Invalid signed image
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 7.271s
target reported max download size of 536870912 bytes
sending 'system' (257301 KB)...
OKAY [ 7.237s]
writing 'system'...
(bootloader) Invalid signed image
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 7.248s
target reported max download size of 536870912 bytes
sending 'system' (262140 KB)...
OKAY [ 7.386s]
writing 'system'...
(bootloader) Invalid signed image
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 7.391s
target reported max download size of 536870912 bytes
sending 'system' (217924 KB)...
OKAY [ 6.129s]
writing 'system'...
(bootloader) Invalid signed image
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 6.154s
target reported max download size of 536870912 bytes
sending 'modem' (41675 KB)...
OKAY [ 1.182s]
writing 'modem'...
OKAY [ 0.927s]
finished. total time: 2.109s
erasing 'modemst1'...
OKAY [ 0.005s]
finished. total time: 0.005s
erasing 'modemst2'...
OKAY [ 0.005s]
finished. total time: 0.005s
target reported max download size of 536870912 bytes
sending 'fsg' (675 KB)...
OKAY [ 0.020s]
writing 'fsg'...
OKAY [ 0.037s]
finished. total time: 0.057s
erasing 'cache'...
OKAY [ 0.010s]
finished. total time: 0.010s
erasing 'userdata'...
OKAY [ 0.193s]
finished. total time: 0.193s
...
(bootloader) Please flash valid signed images just after lock begin
(bootloader) command!
OKAY [ 0.002s]
finished. total time: 0.002s

Do you have an idea where the problem with the failing validation comes from and how I could solve it? I had AICP Lollipop and subsequently Marshmallow installed. Also the boot loader does not seem to get locked.

This happens on the 5.1 Android version. I also just tried the EU 6.0 flash and that worked and locked the boot loader. Is it possible to also get rid of the modified boot loader on boot time, when flashing stock?

Thanks in advance!