[Moto Z Play Guides, News, & Discussion] masivb:
Hello fellow XDA enthusiasts!

I have been scavaging the forums on how to relock my bootloader after flashing this custom rom and a custom TWRP recovery.

Nothing worked to get me back to STOCK! (Sources):

https://xdaforums.com/moto-z-play/how-to/guide-relock-bootloader-to-lasted-stock-t3718190

https://xdaforums.com/moto-z-play/how-to/guide-relock-oreo-bootloader-to-stock-t3784621

However... I managed to modify existing methods to make one that DID work… for me. (XT1635-02)

Here it is:

DISCLAIMER: I HAVE NO RESPONSIBILITY IN ANY WAY IF SOMETHING GOES TERRIBLY WRONG WITH YOUR DEVICE.

Step 1:

Install Motorola Drivers.

Step 2:

Install ADB Minimal.

or

ADB Tiny.

Step 3:

Download this latest signed image (Oreo, August 1, 2018).

Copy all of its contents into the directory where you installed your ADB Minimal (C:\ if portable).

Mirror ( only if AFH down use this link! )

Step 4:

Plug the Moto Z Play into your computer and HOLD DOWN 'volume down' + 'power' buttons.

Open up ADB Minimal and type ​

cd..
cd..
cd ADB
fastboot devices

(you should see your device!)

Alternatively, if you are booted on your phone, make sure ADB is enabled in developer mode

(see here)

and device is authorized on PC, type:​

cd..
cd ADB
adb reboot bootloader
adb devices

Once confirmed you see your device. Copy & paste the following commands:
​

fastboot getvar max-sparse-size
fastboot oem fb_mode_set
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash modem NON-HLOS.bin
fastboot flash fsg fsg.mbn
fastboot erase modemst1
fastboot erase modemst2
fastboot flash dsp adspso.bin
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash system system.img_sparsechunk.5
fastboot flash system system.img_sparsechunk.6
fastboot flash system system.img_sparsechunk.7
fastboot flash system system.img_sparsechunk.8
fastboot flash system system.img_sparsechunk.9
fastboot flash system system.img_sparsechunk.10
fastboot flash system system.img_sparsechunk.11
fastboot flash oem oem.img
fastboot erase carrier
fastboot erase cache
fastboot erase userdata
fastboot erase DDR
fastboot oem fb_mode_clear
fastboot oem lock
fastboot oem lock
fastboot flash oem oem.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash system system.img_sparsechunk.5
fastboot flash system system.img_sparsechunk.6
fastboot flash system system.img_sparsechunk.7
fastboot flash system system.img_sparsechunk.8
fastboot flash system system.img_sparsechunk.9
fastboot flash system system.img_sparsechunk.10
fastboot flash system system.img_sparsechunk.11
fastboot flash boot boot.img
fastboot oem lock

Step 5:

You will may have to manually press 'enter' on your keyboard to enter the last command which will reboot your device and Voilà La!

You should have relocked bootloader. (y):ROFLMAO:​