[Moto Maxx Original Android Development] fgl27:
Check Changelog click here

How to install it.

Using Fastboot:

Download mfastboot

The fastboot I share is need replace fastboot with mfastboot in the commands below...

Copy the file you download form OP to the folder of fastboot and use the command in the bootloader screen

fastboot flash recovery recovery_name.img

! replace recovery_name with the name of the file, example:

fastboot flash recovery twrp-3.0.2-0-quark.img

Via app Flashify (for root users)

If you have root, try Flashify is really simple.

Install the app, download the recovery to the phone internal memory, open the app, chose recovery image, chose from file, confirm and flash, after you will go straight to the new recovery.

Via TWRP:

Yes TWRP can flash images recovery and boot image.

- install

- images... (is in the bottom right of the screen)

- select the image and image type (boot or recovery)

- swipe

- reboot to test, to recovery if flash a recovery or to system if is a boot...

...............................................................................

keep system read only?

[IMG="keep sys r only"]https://dl.dropboxusercontent.com/u/281742759/twrp/1%20(1).png[/IMG]

This will be asked in the first time you boot to recovery after flash the recovery, if you not accepts it TWRP may be replace by the previously recovery of your device, but read way...

Devices that ship with 5.0 and higher as their initial OS are using block level OTA updates. With this style of OTA update, the update script checks to see if the system partition has ever been mounted read/write. Further, the script also usually runs an SHA sum of the entire system partition to detect if any changes have been made. If any changes have been made, the OTA update will refuse to install. Since not all OEMs and devices have factory images available, we have created a new feature in TWRP that detects if the system partition has ever been mounted read/write. If not, you will be prompted asking if you want TWRP to mount system as read/write. If you choose not to allow TWRP to mount as read/write, TWRP won’t prompt to install SuperSU and TWRP won’t try to patch the stock ROM to prevent TWRP from being replaced by stock recovery. The goal of this option is to hopefully allow the user to make a raw system image backup that they can use to get back to a state where they can take OTA updates again.

..............................................................................

Note about restore from Stock 5.x.x to 4.4.4 and vice versa:

The format of data partition is different, in 4.4.4 is ext4 and 5.x.x is f2fs.

I have restore more then 100 times in my test, in some i end-up in a "bad/bug ROM" and it happens when flash 4.4.4 over 5.0.2 or vice versa, in the most bad one the device lost response of the touch screen even in the recovery, the bug was simply resolved by restoring to stock via fastboot using files from a stock XML rom. In others bug's android boot after boot i try to unlock to use and it reset, and stay in that loop, boot try to unlock reset, i try to wipe everything but system and did not work, in all those case partition format of data was wrong.

TWRP will backup the partition exactly how it is, If the backup is EXT4 and the Data partition of the device is f2fs TWRP will restore the data and will not change the format.

That may cause a problem, so when restoring to a different OS version advanced wipe the partition and change the format.

To do that click Wipe>advanced Wipe> select Data> click on Repair or change File System>change File System>

For Kitkat android 4.4.4 choose EXT4

For lollipop android 5.x.x choose F2FS

Swipe to change

Now restore.

But be aware that the data partition is were internal memory is, so if you change the file system you will loose all the files in internal memory

The wipe of internal memory doesn't happening if you only wipe data partition without change file system.

This will not affect custom ROM, but i recommend to use f2fs.

.....................................................................................

Note about encrypt

Test done in Nougat in the link below

Last Nougat test

Test done in Lollipop below

TWRP supports backup a encrypted system, but i only test this on lollipop stock ROM.

This is a simple description how to encrypt backup and restore the encrypted system.

Stock ROM

You can only encrypt if you have stock recovery and no modification to yours ROM, that means no root or rooted app like xposed modules etc, so if you have uninstall everything and do a full un-root.

To encrypt go to setting>secure>encryption the process take a while...

If you already have stock encrypted ROM you can flash TWRP and make a backup of it.

To remove the encryption you need to flash back the stock recovery and do a factory reset in Settings>Backup & Reset>Factory Reset

Factory Reset will deleted all the files of the device! so make a copy of important data...

Wiping all the partition in TWRP will not remove the encryption.

After the device finish the factory reset all the data of you phone will be deleted and the encryption will be gone.

Now you can flash back TWRP again and have fun...

If you need to restore that encrypted backup you can but after it finish restoring you will see that it is un-encrypted.

Custom ROM

I tested encrypt on custom Marshmallow AOSP base ROM (all the CM's), it is not need any recovery the only thing that is need to encrypt is that the encryption block of data be clean before encrypt.

Cleaning the encryption block of data

TWRP can't clean that so if the user encrypt the device the only way of clean that is by erasing the data via fastboot:

mfastboot erase userdata

The down side of it is that the partition will be erased lost every file of data and internal memory + when the system boot the data partition will be formatted as EXT4 that have a small performance lost over F2FS, to have it back to F2FS is need to give the command then start the OS, after the device finish boot and optimized it will format the partition and is need to go back to recovery and format the data as F2FS, going on wipe > advanced > select data > "repair change..." >change file sys> F2FS... then boot to the device and use it...

Note about official TWRP, USB driver via USB-OTG work, but your driver need to be formatted as FAT32(small drivers) or exFAT (big drivers), on the Mod version I have update the NTFS support and it now works

...........................................................

Collection of "Special_flash_zip" to go with the Mod TWRP

As some things are not directly attainable through TWRP menus, but they can be achieved via extra zips...

Clean_modem_status.zip

Logo_Flasher.zip

Modem_Flasher.zip

Clean_modem_status.zip

as the name implies this will erase the modem status partition, and erase any bad modem status, this can help in situations were the users is with some radio problem, one most famous on Quark is when user can get a GPS lock...

I test the GPS after flashing this and it works... (I did not had a GPS problem, but will test after I get one...)

Logo_Flasher.zip

This is a zip that can flash logo.bin via TWRP, is need of the user to have the logo.bin then place it inside of the root of the zip, then flash it over TWR.

Modem_Flasher.zip,

This is a zip made to flash the Radio.img + Clean modem status, thus achieving the update of Radio and clean any bad old radio status.

This zip is empty need the user to add the files on the future I will make a zip with the radio image inside... the below explain how to put the files inside.

As on Quark the radio.img is complex image that can't be flash via TWRP it is need to have a special zip, this zip contains the content of radio image after the user have flash it via fastboot, then for that I made this tutorial in how to use the zip, see the below hide...

Tutorial how to make this zip to work...

This zip must be used with a full backup of stock Modem image that can be achieve via app using apk called partition backup or via ADB

1# APP process... config the app Click on the tool, then in backup formats section, mark only Raw partition image

The partitions name to backup are

modem

mdm1m9kefs3

the file must be in sd/Partitionsbackups, the file names need to be just like describe below

before you put they on the zip so rename the files according the below...

modem.img

mdm1m9kefs3.img

make no modifications to the files, and place it on the root of this zip

The just flash the zip via TWRP

#############

2# ADB process, you must have SuperSu from Chainfire installed before making this, CM root will not work.

use the commands "adb devices" to check if the device is connected it will show the device serial number if it is...

then do the next two lines

adb shell
su

* after command "su" press enter 3 or more times... until the cmd displays

root@:/ #

then... do the next 4 lines

dd if=/dev/block/mmcblk0p1 of=/sdcard/modem.img
dd if=/dev/block/mmcblk0p32 of=/sdcard/mdm1m9kefs3.img

the files will be on the internal memory, the file names need to be just like describe below before you put they on the zip

modem.img

mdm1m9kefs3.img

make no modifications to the files or to the file name, and place it on the root of this zip

The just flash the zip via TWRP

The recommendation is to make a modem backup of yours device after you get a GPS lock, and store it to use whenever you need because you have a radio related problem, or make one to share on XDA with other users, be aware to share Radio zip and describe from with device model and ROM you pull it from, because flashing other device Radio may cause problem...

............................................................

This TWRP is theme-able, go to the tread to change the looks:

[THEME][TWRP] TWRP Materialised - Dark / Light / Play