[Moto Z Guides, News, & Discussion] enetec:
EDIT: this is for Marshmallow only. For Nougat some adjustments are required and this way *does not work*!

It's only some days that I have finally my Moto Z on hands and have to say it's really a great piece of hardware for... geeks! :p

At first it seems nothing particular because of its really-close-to stock Android (it isn't for unexperienced users in my opinion... they haven't added neither a reboot option to Vanilla Android! :cyclops:), but more I use it, more I go with modifications, more I like it: it's really well developed to be modified and customized and in this is great!

It's very hard to brick in my opinion, I really love the simple (to access...) and well working system for fastboot/recovery/bootloader etc... and in this it is even better than I expected...

Now I want to share some of my experiences of these days to (eventually) help new users...

My idea was to unlock it installing recovery, root, Xposed support, etc. leaving firmware as stock as possible (for now... ;)) and in the most "systemless" mode possible... Let's start!

First step was to unlock bootloader. No particular issues here (but Motorola web site that was down for a while when I need it for unlock code...! :rolleyes:). Only thing to note, command adb reboot fastboot often reboot to system instead. No problem, since access to fastboot by keys is very simple on Z. ;)

Unlocking bootloader made a factory reset too, but this is common...

Flash TWRP: no problem at all. Only thing, if you are going to make the first backup without letting TWRP patching your system partition to have a full stock backup, prepare to flash it twice, since if you don't find the required setting after, at first system boot, the stock recovery will be rewritten (a common behaviour anyway...). This TWRP (3.0.2.0) is complete and well working in my opinion. Nothing to be surprised, since it's an official version...

Second step has been to disable encryption. Encryption introduces a bit "slowerness" that I didn't want and could be an issue in case of problems to be resolved... more, I don't need it.

Stock kernel doesn't permit to disable it and phone arrives already encrypted (all data and internal storage too).

So I flashed in TWRP the patch to disable forced encryption that you could find here in another thread and it works fine.

Please note that to decrypt phone you have to not only wipe data, BUT to format it, deleting ALL the contents of internal storage too. So... save them before! ;)

Wanting (if possible...) a systemless modified system (ehm....), next step was to flash Magisk v.9 in TWRP and install Magisk Manager apk. All fine, no problem at all.

Then I tried to root using phh's SuperUser as hinted as best method to use with Magisk. I tried flashing both v.266 & v.266-2 (latest...), no errors during flashing, BUT no one has been able to get root... :confused:

So I went with SuperSU v.2.78 (not a particular one... the stock one! ;)) and it flashed with no issues and obtained root in perfect way (I'm not sure if in system or systemless way...:rolleyes:)

Xposed: I installed "Material version installer" apk, since it's able to install both system and systemless versions of Xposed.

I tried both the available systemless versions (v.86), that this apk download and make them installed by TWRP automatically, but none apparently work. So I uninstalled them and I went with stock (system) one, that installs and works fine at first attempt. Modules as GravityBox works perfectly as expected.

I hope these experienced could be usefull for others. I'm here for eventual opinions/suggestions/Q&A... :fingers-crossed:

EDIT: please note that "unencrypt" and "Magisk" steps *are mandatory* to have SuperSU installed with no issues. At 99% in systemless mode. ;)

EDIT: root this way is obtained in system mode.