[Moto Z2 Play  Guides, News, & Discussion] TravellingGuy:
I really do appreciate all you guys out there posting your steps to get back to stock and lock the bootloader.

I've literally tried every possible combination of fastboot, mfastboot, mfastbootv2, and all the different variants of ROMs posted. Haha, but it *always* fails for me. :)

Two things I notice, and I'm not sure if you guys see these or not.

One is that I always "get the (bootloader) Image signed with key bad key" message when I try to flash the boot.img. I'm not sure if that's something you guys get as well?

The other thing is I always see the "(bootloader) Check 'Allow OEM Unlock' in Android Settings > Developer" message when I run the lock command. [MENTION=6316899]sevenstar75[/MENTION], I notice in your final oem lock command, you don't see this. This makes me think that this is what is different for me. In my developer settings, the OEM Lock toggle is disabled, with a message to the effect of "Bootloader is already unlocked", and I can't change the toggle. This makes sense, as my bootloader IS unlocked, but why don't you see/get that message as well, I wonder?

Here is some sample output of what I'm doing and seeing:

fastboot oem lock
...
(bootloader) WARNING: This command erases all user data.
(bootloader) Please re-run this command to continue.
OKAY [ 0.002s]
finished. total time: 0.002s

fastboot oem lock
...
(bootloader) Check 'Allow OEM Unlock' in Android Settings > Developer
(bootloader) Options
OKAY [ 0.002s]
finished. total time: 0.002s

fastboot flash oem oem.img
target max-sparse-size: 256MB
sending 'oem' (232923 KB)...
OKAY [ 6.020s]
writing 'oem'...
OKAY [ 3.161s]
finished. total time: 9.181s

fastboot flash system system.img_sparsechunk.0
target max-sparse-size: 256MB
Sparse-Flash is enabled!
sending sparse 'system' (262142 KB)...
OKAY [ 6.856s]
writing 'system'...
OKAY [ 4.225s]
sending sparse 'system' (259055 KB)...
OKAY [ 6.732s]
writing 'system'...
OKAY [ 3.632s]
finished. total time: 21.444s

fastboot flash system system.img_sparsechunk.1
target max-sparse-size: 256MB
Sparse-Flash is enabled!
sending sparse 'system' (245604 KB)...
OKAY [ 6.441s]
writing 'system'...
OKAY [ 3.479s]
sending sparse 'system' (240099 KB)...
OKAY [ 6.273s]
writing 'system'...
OKAY [ 3.105s]
sending sparse 'system' (30320 KB)...
OKAY [ 0.800s]
writing 'system'...
OKAY [ 0.414s]
finished. total time: 20.512s

fastboot flash system system.img_sparsechunk.2
target max-sparse-size: 256MB
Sparse-Flash is enabled!
sending sparse 'system' (255375 KB)...
OKAY [ 6.686s]
writing 'system'...
OKAY [ 3.752s]
sending sparse 'system' (258527 KB)...
OKAY [ 6.836s]
writing 'system'...
OKAY [ 4.416s]
finished. total time: 21.690s

fastboot flash system system.img_sparsechunk.3
target max-sparse-size: 256MB
Sparse-Flash is enabled!
sending sparse 'system' (262140 KB)...
OKAY [ 7.145s]
writing 'system'...
OKAY [ 3.449s]
sending sparse 'system' (258973 KB)...
OKAY [ 6.839s]
writing 'system'...
OKAY [ 3.405s]
finished. total time: 20.838s

fastboot flash system system.img_sparsechunk.4
target max-sparse-size: 256MB
Sparse-Flash is enabled!
sending sparse 'system' (261624 KB)...
OKAY [ 6.844s]
writing 'system'...
OKAY [ 3.589s]
sending sparse 'system' (258473 KB)...
OKAY [ 7.094s]
writing 'system'...
OKAY [ 3.587s]
finished. total time: 21.113s

fastboot flash system system.img_sparsechunk.5
target max-sparse-size: 256MB
Sparse-Flash is enabled!
sending sparse 'system' (253898 KB)...
OKAY [ 6.661s]
writing 'system'...
OKAY [ 3.451s]
sending sparse 'system' (262134 KB)...
OKAY [ 6.944s]
writing 'system'...
OKAY [ 4.081s]
sending sparse 'system' (8244 KB)...
OKAY [ 0.231s]
writing 'system'...
OKAY [ 0.160s]
finished. total time: 21.527s

fastboot flash system system.img_sparsechunk.6
target max-sparse-size: 256MB
sending 'system' (252681 KB)...
OKAY [ 6.432s]
writing 'system'...
OKAY [ 3.292s]
finished. total time: 9.725s

fastboot flash boot boot.img
target max-sparse-size: 256MB
sending 'boot' (16384 KB)...
OKAY [ 0.448s]
writing 'boot'...
(bootloader) Image signed with key bad key
OKAY [ 0.458s]
finished. total time: 0.906s

fastboot oem lock
...
(bootloader) Check 'Allow OEM Unlock' in Android Settings > Developer
(bootloader) Options
OKAY [ 0.002s]
finished. total time: 0.002s