[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
OFFICAL TWRP RELEASED, this thread is no longer active. 3-30-2018

https://twrp.me/motorola/motorolamotox4.html

---

UNOFFICIAL BUILDS -- USE AT YOUR OWN RISK AND KNOW HOW TO GET YOURSELF OUT OF TROUBLE IF IT ARISES. I ASSUME NO RESPONSIBILITY FOR YOUR BROKEN THINGS. :)

UPDATED 01-11-2018

There are now 7.1 based and 8.0 based builds. Obviously, be careful to select the proper download. While I don't think flashing/booting the wrong one would permanently brick the device, let's not find out :)

For now I will not be attempting to make data decryption work. It is REQUIRED that you unencrypt your device by formatting userdata, so back up your stuff first.

IMPORTANT NOTES:

TWRP for OREO is a bit of a pain as it currently requires manually editing your fstab. I have tried to automate this process, but it breaks stuff. So just be aware before you begin that it is a rather time consuming process.

If you make any change to your boot partition after flashing SuperSU, you will need to reflash it or you will get a bootloop.

8.0 OREO TWRP INSTALLATION:

OREO SEEMS VERY FINICKY AND DOES NOT LIKE CHANGES TO ITS FILESYSTEM -- BE PREPARED TO REFLASH STOCK.

0. FLASH OREO FACTORY IMAGE (may work otherwise, but we should be starting from fresh stock here)

1. Download FASTBOOT BOOTABLE TWRP for 8.0/OREO below

2. Download SuperSU 2.82 SR5 below

3. Move SuperSU to external SD or USB OTG

4. From bootloader, fasboot

BOOT

TWRP

5. Flash SuperSU (note: do not format /data now... not necessary and will cause errors on boot)

6. Reboot system

7. With any root file editor/text editor (Amaze, Total Commander, etc) open /system/vendor/etc/fstab.qcom as a text file for editing.

8. At the end of the /data partition entry, delete "fileencryption=ice" and replace it with "encryptable=footer".

9. Save fstab.qcom (and make sure it is actually saved properly!)

10. Reboot to bootloader and fasboot

BOOT

TWRP

11. Go to Wipe, hit the FORMAT DATA button, and type "yes" to format /data. This will erase your data, obviously:silly:

12. Reboot system (should now be unencrypted, verify in Settings>Security or by booting TWRP and checking /data with File Manager.

If you later choose to flash TWRP (not the bootable we used here!), you may need to flash SuperSU again to avoid bootloops.

7.1.1 NOUGAT TWRP INSTALLATION:

1. Download current TWRP for 7.1.1 build below

2. Download SuperSU 2.85 SR5 (https://xdaforums.com/apps/supersu/2014-09-02-supersu-v2-05-t2868133

3. Move SuperSU to your external Micro SD card.

4. Fastboot

flash

the TWRP image.

5. Reboot to TWRP.

6. FORMAT data (not wipe...use the "FORMAT DATA" button and type "yes". OBVIOUSLY THIS WILL ERASE YOUR DATA)

7. Install SuperSU 2.85 SR5

8. Reboot to system (it WILL bootloop a couple times...don't panic!) and confirm that device is unencrypted by checking that SETTINGS>SECURITY>ENCRYPTION now prompts "encrypt" (don't do it).

DOWNLOADS:

TWRP FOR 7.1.1 (Nougat) DOWNLOAD: https://drive.google.com/open?id=1Et-AQgCNx7WDAwzihlI51euUa2ixKHEP

TWRP FOR 8.0 (Oreo) DOWNLOAD: https://drive.google.com/open?id=1WcVS_3rloF7jxPulj_jKxfsp3zy5pB5N

FASTBOOT BOOTABLE TWRP IMAGE (OREO BASED): https://drive.google.com/open?id=12ClviqtEjtflB63UQ1CZQNKEqkprBO0u **For temporary TWRP boot using "fastboot boot". Do not flash or you will be stuck in recovery!**

DEVICE TREE: https://github.com/mightysween/android_device_motorola_payton (NEEDS TO BE UPDATED WITH OREO BRANCH)

changelog:

BETA4

-reverted to 3.2.0 for current build (release candidate rebased to 3.2.1).

-fixed "format data" button

-finalized fstab for OTG/SD/INTERNAL mounting

-target is now UNENCRYPTED devices only (/data decrypt will not be fixed)

BETA3

-Rebased to TWRP 3.2.1

-USB OTG working

-all partitions mounting correctly

-considered working except for decrypt and MTP/ADB

BETA2

-fixed internal storage mount

BETA1

- updated source to TWRP 3.2.0

ALPHA3

- Fixed USB mounting (adb/mtp still nonfunctional) BROKEN IN BETA1

ALPHA2

- SD Card fixed

ALPHA1

- /system is now properly mounted.

- now plays nice with our working root method.

- ramdisk is patched to prevent first boot encryption once /data is decrypted (now requires flashable ZIP)

NOT WORKING:

adb/mtp/sideload

/data decryption (abandoned -- /data access requires unencryption)

CREDITS: [MENTION=4825505]kraatus90[/MENTION] for kernel fix, [MENTION=631273]Chainfire[/MENTION] for SuperSU, [MENTION=5672995]jcadduono[/MENTION] for no-verity-opt-encrypt scripts.

---