[Moto Z Guides, News, & Discussion] yanniclord:
Oi guys!

So for now i might be alone on this, but i am certain that some few of you have wondered on how to get Viper4Android to work on the Moto Z without flaws. I am here to give you a small guide, because i figured out how to fairly easy add V4A.

There are 3 simple steps, but they can (in case you haven't done the first one yet) take some time.

If you have already Unlocked your Bootloader, disabled Force_Encrypt (either by manually editing the boot.img or flashing [MENTION=490110]janjan[/MENTION] his ROM), installed a RECOVERY like TWRP and ROOTED your device, then you can skip right ahead to STEP 3.

Also, before you go ahead, do a BACKUP of all your important data, as it will CERTAINLY be lost when unlocking the bootloader (this does not count for inserted microSD cards, but just to be safe, remove the microSD or backup your data somewhere else, like your PC or a cloud service).

One more heads-up: You NEED a USB-C Cable that you can connect to your PC, otherwise this guide will be useless for you. Also, all my commands listed in the upcomming guide are listed with " ", but ignore these when entering the commands in the Command Prompts.

STEP 1:

1: As for every Android phone, you need an Unlocked Bootloader and TWRP (and also ROOT, etc).

-1.1: Download the Motorola USB Drivers HERE, and the ADB Fastboot Driver/Tool HERE.

-1.2: Install the Motorola USB Drivers first, then install the ADB All-In-One Tool after that (When installing the ADB AIO, choose yes for all options).

-1.3: On your Moto Z, enable Developer Options by going into the Phone Settings, then the last "About Phone" option, and then scroll to the bottom where it says "Build Number". Tap that "bar" 7 times until it says that you unlocked the Developer Options menu.

-1.4: Go back into the Main Settings Menu of your Phone, and then right above the "About Phone", should be an option called "{ } Developer Options". Go in there, and right in the beginning is an option called "OEM unlocking". Enable that option (when it asks you for your PIN/Password/Pattern, just enter it).

-1.5: Scroll just a little further down in the Developer Options menu, and you will see a section called "Debugging", in which the first option is called "USB debugging". Enable that option as well.

-1.6: Now put your Moto Z into Fastboot Mode. You can do this either by connecting your Moto Z to the PC, then open a Command Prompt (look in Windows for CMD), and type "adb reboot bootloader", OR by turning your Moto Z completely off, and then turning it back on WHILE holding BOTH the Volume Down and Power Button (if your Moto Z turns off all the time, the second the Phone vibrates, let go off the buttons).

-1.7: Now that your Phone is in Fastboot Mode, you will have to connect it to your PC by a USB-C cable. If you have done that, open a Command Prompt in Windows (again, by typing CMD in the Windows Start Search), and type this: "fastboot oem get_unlock_data"

-1.8: You will end up getting a result that will look a little like this (the numbers do NOT work for you, don't try them for steps required later on):

$ fastboot oem get_unlock_data

(bootloader) 0A40040192024205#4C4D3556313230

(bootloader) 30373731363031303332323239#BD00

(bootloader) 8A672BA4746C2CE02328A2AC0C39F95

(bootloader) 1A3E5#1F53280002000000000000000

(bootloader) 0000000

-1.9: Copy the entire string you just got from the Command Prompt, and put it into any kind of Text Field or Text Editor. Remove the bootloader part, and also everything else, like [Info] or the likes, and same goes for empty spaces. The only thing you should be left with looks like this: 0A40040192024205#4C4D355631323030373731363031303332323239#BD008A672BA4746C2CE02328A2AC0C39F951A3E5#1F532800020000000000000000000000

-1.10: Now you go to THIS website to get the Unlock Code for your Phone (You will have to register at Motorola to be able to get the Unlock Code. It is easier if you just use Google+, it is much faster and you can skip the entire register process). There will be instructions there as well to guide you for how to enter the code, just in case you misunderstood my guide.

-1.11: Once you registered and entered the code, click the blue button below called "Can my device be unlocked?". Once Motorola confirms that your Moto Z can be unlocked, you click the "I agree" option, and then the "Request unlock key" button.

-1.12: You will get a pop-up telling you about it voiding your warranty, click "OK" on that one as well.

-1.13: Now, Motorola will tell you that they sent you the unlock code for your device to the E-Mail you registered with, so go and check your E-Mail account for that code.

-1.14: Copy the unlock code, go back to that Command Prompt (in case you closed it, open a new one), and enter this: "fastboot oem unlock UNLOCK_CODE_HERE" <<<< Where the UNLOCK_CODE_HERE means that you will have to replace this with the unlock key from your E-Mail.

-1.15: Now click ENTER, and your device will be Unlocked. After this, your device SHOULD reboot automatically, but if not, pick the REBOOT option in the Fastboot Mode Menu, and click the Power Button to confirm. From now on, every time you start your Phone, you will be greeted with the Unlocked Warning screen, but that is ok, nothing stopping your Phone from working or the likes.

-1.16: Let your Moto Z fully boot up, and when you have done that, shut it down again, and go back into Fastboot Mode using the above mentioned button combination.

-1.17: At this you will have to download the TWRP Recovery Image. You can find this for the Moto Z HERE, or HERE.

-1.18: Rename the downloaded file to just twrp.img, then go back to your Command Prompt (or open a new one), and enter this: "fastboot flash recovery twrp.img"

-1.19: Now let the RECOVERY be flashed, and then in the Fastboot Menu on your Moto Z, use the Volume Keys to navigate up and down, and navigate to "RECOVERY". Use the Power Button to confirm that option, and let it boot into the TWRP RECOVERY. Once you have done that, in TWRP, pick the Reboot option, and click the "System" button, so that the RECOVERY boots into the normal Android OS.

Congratulations, that was step 1 (and all its detailed sub-steps).

Now to STEP 2:

2: As the Moto Z has its entire storage and OS fully force-encrypted, we have to fix that. There are two ways, but as of now, i recommend the best one, as the other one is a bit hard to do unless you are a bit more tech-savvy.

-2.1: You will have to download the currently only actual ROM for the Moto Z from XDA user [MENTION=490110]janjan[/MENTION] . You can find the download HERE. Download the corresponding US or EU version, depending on where you bought your device.

-2.2: I will have to mention here shortly, that the ROM you are about to install currently has one issue, which its severity depends on how much you currently need that "feature". The developer [MENTION=490110]janjan[/MENTION] is working hard to fix, so you might want to wait in case you are disturbed by that "feature" not working. What is that feature you ask? Moto Mods. Some work, some don't, and the Incipio Battery Pack is one of those that do not work. If you can live with this issue until it is fixed, there is nothing stopping you from installing this ROM, but if you feel that you absolutely cannot live without it, then you might want to stop at this point and return when the issue has been fixed.

-2.3: So if you have decided to continue, then congratulations. To continue, you will have to enter the TWRP RECOVERY. Do NOT set up your Phone, as everything will be Wiped once more. So just enter the RECOVERY through the Bootloader (Fastboot). Shut down the Phone, hold the Volume Down and Power Button, wait for the Fastboot Menu to come up, navigate with the Volume Down Key to the RECOVERY option and confirm with the Power Button.

-2.4: Now connect your Phone to your PC with the USB-C Cable, and then go into the "Mount" menu. There it will let you open your Phone storage like on normal Android through MTP. Find the ROM .zip file you downloaded earlier, and put it somewhere in your Phones storage, like the Download folder, or create a new Folder you can easily recognize.

-2.5: If you have transferred the ROM .zip to your Phone, go back to the Main Menu, and pick the "Wipe" option (upper right). Now just Swipe the blue button to the right to do a full Factory Reset.

-2.6: Once it is done with the Factory Reset, go back to the Main Menu, and pick the "Install" (upper left, first option) option. Now navigate to where you uploaded your ROM .zip file, and then click that file once you have found it. Swipe to the right again to Flash the ROM.

-2.7: When it has finished flashing the ROM, Reboot the device, and you do that either by clicking "Reboot" (button to the lower right) right after the ROM has been flashed, or going back to the Main Menu and using the Reboot option.

-2.8: The Phone WILL take a good while to boot, so give it at least 10-15 minutes. If nothing happens by then, hold the Power Button to turn your Phone off and check the steps again and see if you did something wrong. If it did boot successfully, then take the time to setup your Phone, Language, Login Methods, etc.

And congratulations again, this was step 2. At this point you are done with all the time consuming things.

This is the last step, STEP 3:

3: I recommend that you install XPOSED BEFORE installing Viper4Android, as i found problems doing it the other way around. In case you thought about installing the XPOSED Framework, do that FIRST, NOT after having installed V4A.

-3.1: The only working version of Viper4Android i found is the ViperAtmos Universal Edition. You can download it directly HERE, or check the thread HERE (downloads are in the bottom. Remember to download the "ViPERAtmos 4.8 Sony Beats Universal Edition" .zip file).

-3.2: You will also have to download the SELinuxModeChanger app, with the direct link HERE, or the thread HERE.

-3.3: Now you push/transfer the downloaded files to your Moto Z, either by Cable or Wireless, the way you do it is up to you, but put it somewhere where you will find the files easily, like the Downloads folder.

-3.4: Now on your Moto Z download any file manager, go to the directory you pushed the files in, and install the SELinuxModeChanger.apk file. Open the app, give it full ROOT permissions, and then pick the "Permissive" option. Now reboot your device once, and it will automatically set SELinux to Permissive every time you boot your Moto Z (you can choose to let it notify you when it changes the mode).

-3.5: Reboot your Moto Z into the RECOVERY (steps found above). Here you go directly to the "Install" option, navigate to where you put your ViperAtmos .zip file, and install it by Swiping to the right. Do NOT pick the option to clear cache and dalvik/ART, i had problems with this the last time, and V4A wouldn't work (if you feel for it, then you can try clearing cache and dalvik/ART, but i found out that it works just fine not doing any of that).

-3.6: Reboot your Moto Z into the normal Android OS, and now you are done. Remember to check in the SELinuxModeChanger if the mode is set to Permissive, because if it is not, then Viper4Android (ViperAtmos) will crash your Phone, so make sure that is set.

Now you are done installing Viper4Android using the Universal Edition from ViperAtmos, well done!

If you have found any spelling mistakes in my guide and are absolutely annoyed by it/them, then tell me please!

Ok, have a good one everyone!