[Moto G4 Play ROMs, Kernels, Recoveries, & Other De] PatC11:
UPDATED to include instructions for flashing other ROMS

I've successfully unlocked, flashed TWRP, rooted, and flashed Lineage on both an XT1602 and an XT1607. I'd done this before on other devices, but had forgotten just how it all came together, so when I was done I went back and made this step-by-step guide. It's a bit shorthand.

Many thanks to squid2 for his TWRP port, to the folks who make superuser, to parrotgeek1 for superSUFixer.zip, and to spiked_mistborn for reminding me about it. And, of course, huge thanks to squid2 and Alberto97 for the killer Lineage ROM. It is

far

better than stock or the last Nougat CM. If I forgot anyone, or made any mistakes here, somebody please point them out. Have fun!

1.	Preparation (if the links don't work, search on xdaDevelopers or with Google)

a.	Backup entire phone to the extent you are able, either with a dedicated tool and/or to Google via the Android backup feature

b.	Download and install Motorola Device Manager on your computer from https://motorola-global-portal.custhelp.com/app/answers/detail/a_id/88481 so as to make sure you have the proper drivers

c.	Download adb and fastboot tools onto your computer from

http://xdaforums.com/showthread.php?t=2588979 or

http://xdaforums.com/showthread.php?t=2317790​

d.	Download TWRP for Moto G4 Play to same folder as adb and fastboot tools from http://xdaforums.com/devdb/project/?id=16870#downloads

e.	Depending upon whether you want to flash Lineage or stay with the stock ROM, download to the same directory on your computer either:

i. Lineage and the Lineage SU addon (if you want root) from https://xdaforums.com/g4-play/development/rom-lineageos-14-1-moto-g4-play-t3544646 and Google apps (arm 7.1 micro) from http://opengapps.org/; or,

ii. superSUFixer.zip from http://xdaforums.com/g4-play/development/automatic-flashable-zip-fix-supersu-t3464396 and superusersu.zip from http://www.supersu.com/download

Note: I did not find superSUFixer.zip necessary when I intially rooted, but after later installing squid's kernel it was indispensable to reinstallation of superusersu.zip.​

g. Attach phone to computer with USB cable, enable file transfer on phone and either copy the Lineage zip and Lineage SU addon zip and gapps.zip to your phone, OR copy superSUFixer.zip and superusersu.zip to the phone (you don't need to copy twrp)​

2.	Unlock bootloader

a.	Enable developer options (Settings/About Phone/tap Build Number 7x)

b.	Enable USB debugging on phone (Settings/Developer Options)

c.	Enable OEM unlock on phone (same)

d.	Open command window and change to the directory where you put adb, fastboot, and twrp

e.	> adb devices (to check that you are connected - you should get a response with a device id)

f.	> adb reboot bootloader

g.	>fastboot oem get_unlock_data

h.	On computer, go to https://motorola-global-portal.custhelp.com/app/standalone/bootloader/unlock-your-device-a (you need to proceed through the login and to the second page)

i.	Copy data returned by phone in the command window (make sure you copy all of it!)

ii.	Paste that data into the Data Scrub Tool on the web page

iii.	Copy scrubbed data, paste it into the box on the web page at step 6, and click the button; if it says you can't unlock your device, either you didn't copy and paste all the data, or your phone can't be unlocked and you're done; otherwise,​

i.	Copy unlock key from email

j.	> fastboot oem unlock <unique unlock key>​

3.	Flash TWRP

a.	> fastboot flash recovery twrp.img

b.	> fastboot reboot recovery​

4.	Flash Lineage and root, or just root -- when the phone has rebooted into recovery (you'll be in TWRP now)

a. follow prompts to make TWRP permanent or not

b. DO A FULL BACKUP OF EVERYTHING with TWRP

c. make sure you performed step b (or you may wish you had later, if something goes wrong!)

d. To flash another ROM, in TWRP

i. Wipe Data, Cache, and Dalvik. (Yes, you have to do this.)

ii. For Lineage - Install the Lineage zip file, the Lineage SU addon zip file, and the gapps zip file, one after the other, in that order, WITHOUT REBOOTING in between. TWRP will let you add all three to its queue to flash in order;

iii. For other ROMs - see instructions for those ROMs, but in general, install the ROM zip file, and then the gapps zip file, one after the other without rebooting in between. For root access, depending on the ROM, you may need superSUFixer, supersu.zip, or both; again, see the instructions for the ROM you are flashing.​

OR

e. To stick with the stock ROM but get root access, DO NOT WIPE, just flash superSUFixer and then supersu.zip
​

5.	If TWRP does not automatically reboot your phone (if you unchecked the "reboot when done" box), then reboot to the System; if you left the box checked, then your device will reboot by itself once the zip files have been flashed.

6. Follow the prompts to set up your new ROM or stock Android.

7. Reboot into recovery (TWRP) and make another backup!

8. Want to get rid of the "Unlocked Bootloader!" warning screen? Flashing this file from TWRP worked for me (all the others I tried did not work):

https://xdaforums.com/attachment.php?attachmentid=4065906&d=1488923356​