[Moto Z2 Play  Guides, News, & Discussion] felipecassiors:
Your bootloader must be unlocked.

You can't lock the bootloader, to do this you will need a signed firmware from Motorola (and no one found yet). Instead you can use Magisk to hide the unlocked bootloader, bypass SafetyNet and be able to use Google Pay, for example.

You will not get OTA updates from Motorola even if you somehow lock the bootloader because your phone is registered forever to the "retcn" software update channel, instead of "retail" or "retbr".

Recommended: set your Platform Tools (adb and fastboot) system wide using this guide

https://xdaforums.com/android/software/guide-how-to-set-fastboot-adb-to-wide-t3591240

Tested for updating from Oreo stock without wipe.

Steps for clean flashing or update

- Place the suitable script attached on the extracted ROM folder and flash (these scripts are only for XT1710-08 variant to prevent lost modem signal)

- After all the commands succeeded, wait for a full reboot (because of encryption)

- Flash TWRP

- Flash Magisk normally through TWRP

- Be happy

Firmware (you can use this on other XT1710 variants)

Version: PPS29.133-30 (Android 9.0 Pie)

https://mirrors.lolinet.com/firmwar...ubsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip

Other versions:

https://mirrors.lolinet.com/firmware/moto/albus/official/RETAIL/

TWRP

https://xdaforums.com/z2-play/development/-t3715660

Magisk

https://xdaforums.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445

Motorola drivers https://motorola-global-en-aus.custhelp.com/app/answers/prod_detail/a_id/86934/p/154,153

Google SDK Platform Tools https://developer.android.com/studio/releases/platform-tools

Commands for flashing and wipe

PS: the difference from the official `flashfile.xml` commands is that it doesn't contains `fastboot erase modemst1` and `fastboot erase modemst2`

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 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 system system.img_sparsechunk.12
fastboot flash oem oem.img
fastboot erase carrier
fastboot erase cache
fastboot erase userdata
fastboot erase DDR
fastboot oem fb_mode_clear
fastboot reboot

Commands for flashing without wipe (update)

PS: the only difference from the previous one is that it doesn't contains `fastboot erase userdata`

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 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 system system.img_sparsechunk.12
fastboot flash oem oem.img
fastboot erase carrier
fastboot erase cache
fastboot erase DDR
fastboot oem fb_mode_clear
fastboot reboot

Thanks to

[MENTION=4582030]eqbirvin[/MENTION]

[MENTION=3813670]Junior Passos[/MENTION]

[MENTION=1631349]HTCDevil[/MENTION]