[Moto Z2 Play  ROMs, Kernels, Recoveries, & Other D] twelfth:
What this thread is for:

Booting into TWRP Recovery for the Moto Z2 Play Retus Variant

Rooting the Z2 Play Retus Variant with Magisk

Things you will need:

IMPORTANT: You

WILL

need a USB C OTG cable and USB Thumbdrive (or a USB C Thumbdrive)

Magisk Zip 13.3 Mod uploaded by Junior Passos: https://www.androidfilehost.com/?fid=889764386195922735

Magisk Manager v5.1.1 apk: https://github.com/topjohnwu/MagiskManager/releases/download/v5.1.1/MagiskManager-v5.1.1.apk

DM Verity and Forced Encryption Disabler v5.1: https://androidfilebox.com/miscellaneous/dm-verity-and-forced-encryption-disabler/

My modified TWRP: https://www.androidfilehost.com/?fid=673368273298983327 md5: ebcecfaf2e00725561555dd398f883dc

Magisk ZIP and DM Verity ZIP must be put on a thumbdrive. Installing from (external) SD Card will not work with this version of TWRP.

Things you will need to keep in mind:

Make sure you fully update your device before unlocking and rooting as it likely will break OTAs. You'll likely have to rely on stock images posted by users to this forum from now on.

In order to be able to do what you need to do in TWRP, you will need to format data due to forced encryption. You won't be able to root and boot your device otherwise.

My version of TWRP is a hacky build. It works, but one feature in particular does not work: External SD card mounting. Until an updated build is made to fix this issue (of which I will require the assistance of people MUCH better at this than I am), you will need to use a USB C OTG cable and a thumbdrive to be able to back up your device and to flash ZIPs.

Try booting (not flashing) the TWRP build here first: https://xdaforums.com/z2-play/development/twrp-3-1-1-0-moto-g5-plus-albus-t3622593 - If it doesn't work (hangs on logo), then try mine.

DO NOT

install SuperSU from within TWRP.

These instructions assume you know how to use ADB and Fastboot Android tools. If you need the utilities, you can download the Windows versions from here: https://xdaforums.com/showthread.php?t=2317790

How to boot into TWRP, make backups and root your device:

0)

Your device must already be bootloader unlocked.

0a)

DO NOT install SuperSU from within TWRP!!

1) Boot into Fastboot (powered off, hold down Power and Vol Down)

2) Plug your USB C cable into your computer and phone, make sure you have the Android tools installed.

3) Use fastboot command to boot into TWRP (NOT flash): fastboot boot albus_twrp.img

3a) I do not recommend flashing this version of recovery to the device because, as I said before, it's a hacky build. I don't want people to rely on it as their permanent recovery in case issues are found and fixed later.

4) Swipe to allow modification, click Cancel when it asks for passphrase to read encrypted partition.

5) Press Wipe on main screen, slide to wipe. This will wipe Data, Cache and Dalvik partitions. You will need to do this because the partitions will have to remain unencrypted after you flash DMVerity and Encryption Disabler.

5a) Yes, you have to wipe. DM Verity and forced encryption will cause your device to fail to boot if you don't disable them.

6) Back up your device. Attempting to back up System Image may fail because the partition is over 4GB and nearly every thumbdrive will be formatted in Fat32. Back up System, Boot and Recovery.

7) Install DM-Verity ZIP.

8) Install Magisk ZIP linked in this thread.

9) Reboot into system. Anticipate a longer first boot.

10) Sideload Magisk Manager.

Magisk running on Z2 Play:

What I did:

Extracted kernel, img_info and dt.img from the

retus albus

system image and dumped it into a harpia twrp build. I suspect the other version of TWRP was built against a different AOSP version, triggering a SELinux boot block. In my version of TWRP, fstab paths are correct but for some reason MicroSD won't mount. I'll leave that to the professionals. Everything else that I did (as described above) worked and was my exact method for doing so.

Finally:

Special thanks to Dees_Troy for TWRP. Without you, devices would suck.

Here's the Moto Z2 Play Albus boot.img for anyone who wants to take on the task of doing an official TWRP build for the device. https://www.androidfilehost.com/?fid=889764386195927416