[Pie/Oreo/Nougat] How to root your Z2 [ALL]

Search This thread

Uzephi

Inactive Recognized Contributor
Apr 20, 2012
3,439
1,894
Usa
Google Pixel 3a
Since no guide has been updated with information on official TWRP for root and backup reasons, I thought I'd create one.

DISCLAIMER:
To do this method requires you to unlock your bootloader. Your warranty is now void. This method assumes you have basic knowledge of ADB and Fastboot commands and know how to recover your device if you accidentally type a wrong command and now boot to TWRP and can't boot to system. If you cannot recover from this, Read up on guides to "return to stock" and familiarize yourself on how to recover your device should something go wrong.


There are two methods for root. You can flash TWRP to your boot image to be able to reboot to TWRP without a PC, or just a temp boot so you can just have root and not TWRP. I'll put in brackets the minor differences.

1: Get ready
Download latest build of TWRP img file from their website.(Previous link is to their instructions and device specific patches, download page is HERE.) {download the latest zip if you want to flash TWRP}
Download what you want on your phone (SU, Magisk, etc)

2:
Hook phone up to your PC, be sure you have latest adb/fastboot drivers. (I do not support windows related questions. If you have latest drivers, you'll have no issue with the below commands, Linux just works for this kind of thing)

3:
Navigate to your directory that has that img downloaded. (windows, shift right click and say "open command prompt here")
Type the below commands, and terminal output should be similar: (I.E. this is a copy/paste of terminal)
Main thing to remember is "Fastboot boot {filename}.img"
Code:
uzephi@Nash:~$ adb reboot bootloader
uzephi@Nash:~$ cd Downloads
uzephi@Nash:~/Downloads$ fastboot boot twrp-3.2.1-1-nash.img
downloading 'boot.img'...
OKAY [  0.841s]
booting...
OKAY [  5.135s]
finished. total time: 5.976s
uzephi@Nash:~/Downloads$
BE SURE TO DO BOOT AND NOT FLASH!!! (If you ask why you can no longer boot to system, I'll let you know you missed this line.)

5:
You're now in TWRP!
It will ask you for your password. This is your PIN or password to unlock your phone. Enter it.
TWRP has now decrypted your storage to read the zip file(s) you put on your phone!
Go to install and navigate to your directory where you put that file
Install Magisk/SU/TWRP/whatever you please.
(Note: some root zips require a factory reset)

6:
Reboot!

You're Done congratulations!

Attached are images if they help you see you're doing the right thing.



Special thanks @erfanoabdi @invisiblek @npjohnson @joemossjr @jbats

Without the above people a lot of what's above woudn't have been possible for this device specifically. Also, thanks to everyone who pitched in to get a device over to invisiblek. Leaps and bounds have been done since that donation. And thanks to the other devs who have invested in this phone and their time to help out.


(Quoted from Nathan Chance)
Quite a few people have asked to donate to me in the past and I have turned them down. I am not in this for the money, this is my hobby, something I truly enjoy. If you truly want to donate to something (it is not expected in the slightest), I recommend an entity like the Open Source Initiative, the Free Software Foundation, XDA, or any one of the people I have thanked in the OP. Additionally, you are free to copy any and all of my work; the only thing I request is that you not ask for donations as well (though I can't really enforce this lol). Thank you.
 

Attachments

  • Screenshot_2018-02-27-21-59-12.png
    Screenshot_2018-02-27-21-59-12.png
    98.7 KB · Views: 5,924
  • Screenshot_2018-02-27-21-59-38.png
    Screenshot_2018-02-27-21-59-38.png
    154.9 KB · Views: 5,906
Last edited:

Uzephi

Inactive Recognized Contributor
Apr 20, 2012
3,439
1,894
Usa
Google Pixel 3a
Random issues post:

SU does some wonky edits to the ramdisk. It is highly suggested to flash Magisk for root.

Some have reported needing to wipe data after flashing Magisk. If you can't boot after flashing Magisk, just go back into recovery (can be twrp or stock) and wipe data/factory reset to boot again.
 
Last edited:
  • Like
Reactions: psycho4us4

droidgreg

Senior Member
Jun 11, 2011
51
8
I get into a bootloop and right back into TWRP using this method. I got the failed to mount data invalid argument. I got rid of this by formating data in TWRP. Now I get failed to mount system device or resource busy when I attempt to flash Magisk.
Bootloop.

I am on TMO running the latest 27.1 Oreo
 

Uzephi

Inactive Recognized Contributor
Apr 20, 2012
3,439
1,894
Usa
Google Pixel 3a
I get into a bootloop and right back into TWRP using this method. I got the failed to mount data invalid argument. I got rid of this by formating data in TWRP. Now I get failed to mount system device or resource busy when I attempt to flash Magisk.
Bootloop.

I am on TMO running the latest 27.1 Oreo

Be sure to mount system under the "mount" button
 

droidgreg

Senior Member
Jun 11, 2011
51
8
I need the OCX27.1 oreo. I did a return to stock flashall to OCX27 and now reflashed TWRP and Magisk and boots fine but I lost baseband and IMEI
 

will4958

Senior Member
Jun 13, 2008
353
39
I apologize in advance for asking a question that may have an obvious answer, but will this work for the Verizon variant of the Z2 Force? I'm not interested in trying out different ROMs just yet, but I would like to be able to remove adds, bloatware, and go back to using FoxFi the way it was meant to be used, specifically as a wireless hotspot. I can use the hotspot feature built into the phone, but it caps at 15 gigs & gets reduced to low, low speed after. Thanks in advance. Oh, and I should mention I'm currently running Oreo.
 

Uzephi

Inactive Recognized Contributor
Apr 20, 2012
3,439
1,894
Usa
Google Pixel 3a
I apologize in advance for asking a question that may have an obvious answer, but will this work for the Verizon variant of the Z2 Force? I'm not interested in trying out different ROMs just yet, but I would like to be able to remove adds, bloatware, and go back to using FoxFi the way it was meant to be used, specifically as a wireless hotspot. I can use the hotspot feature built into the phone, but it caps at 15 gigs & gets reduced to low, low speed after. Thanks in advance. Oh, and I should mention I'm currently running Oreo.

This guide assumes you can unlock your bootloader. Since Verizon and AT&T feel they have a right to lock down their devices, this guide won't work. That is why I voted with my wallet and left Vz after my M7 due to them putting phone OEM's privates in a vice and forced them to lock out those carrier variants.
 

droidgreg

Senior Member
Jun 11, 2011
51
8
It probably hasn't been tested, but it should work in theory.
I was on 27.1 when I attempted to root and got into a bootloop and lost my baseband when I flashall back to stock OCX27. I have a feeling 27.1 update isn't compatible with this method and cannot be downgraded to even OCX 27 Oreo
 

mr.duck254

Senior Member
Jul 23, 2017
96
126
so no go on 27.1 twrp? I have root on 27.1 TMO obtained post update. Obtained by fastbooting the nash twrp and running magisk 16.zip. No needing to format data or anything

I was just wondering about the installable twrp zip. I am coming from samsung development so all this A/B partitioning and some of the other partitions are new to me.
As soon as I can get twrp on the phone and feel comfortable recovering. The kernels and roms will start coming.

Feels strange not having odin to save my ass :D
 
Last edited:

luponcooper

Member
Dec 20, 2016
6
0
Doesn't work for me, i've done every step whitout problems but after installing SU and reboot, it wont boot anymore, stays in Moto logo.
 

Uzephi

Inactive Recognized Contributor
Apr 20, 2012
3,439
1,894
Usa
Google Pixel 3a
Doesn't work for me, i've done every step whitout problems but after installing SU and reboot, it wont boot anymore, stays in Moto logo.

I'll put a warning about SU then. It also causes other stuff to not flash right. Suggested root is magisk for our device. Reflash your boot.img from the flash all and reroot with magisk then wipe data (wiping might not be needed, I never had to but some people have needed to).
 

luponcooper

Member
Dec 20, 2016
6
0
I'll put a warning about SU then. It also causes other stuff to not flash right. Suggested root is magisk for our device. Reflash your boot.img from the flash all and reroot with magisk then wipe data (wiping might not be needed, I never had to but some people have needed to).

Thanks a lot uzephi for answering.
I have the 6gb ram and 64gb model, XT1789-05. I try whit no succes to install Magisk (Error1) so i made a factory reset but still doesn't boot, stays in M logo.
Im super noob, can you guide me? i dont know how to recover the boot.img.

excuse my english.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 29
    Since no guide has been updated with information on official TWRP for root and backup reasons, I thought I'd create one.

    DISCLAIMER:
    To do this method requires you to unlock your bootloader. Your warranty is now void. This method assumes you have basic knowledge of ADB and Fastboot commands and know how to recover your device if you accidentally type a wrong command and now boot to TWRP and can't boot to system. If you cannot recover from this, Read up on guides to "return to stock" and familiarize yourself on how to recover your device should something go wrong.


    There are two methods for root. You can flash TWRP to your boot image to be able to reboot to TWRP without a PC, or just a temp boot so you can just have root and not TWRP. I'll put in brackets the minor differences.

    1: Get ready
    Download latest build of TWRP img file from their website.(Previous link is to their instructions and device specific patches, download page is HERE.) {download the latest zip if you want to flash TWRP}
    Download what you want on your phone (SU, Magisk, etc)

    2:
    Hook phone up to your PC, be sure you have latest adb/fastboot drivers. (I do not support windows related questions. If you have latest drivers, you'll have no issue with the below commands, Linux just works for this kind of thing)

    3:
    Navigate to your directory that has that img downloaded. (windows, shift right click and say "open command prompt here")
    Type the below commands, and terminal output should be similar: (I.E. this is a copy/paste of terminal)
    Main thing to remember is "Fastboot boot {filename}.img"
    Code:
    uzephi@Nash:~$ adb reboot bootloader
    uzephi@Nash:~$ cd Downloads
    uzephi@Nash:~/Downloads$ fastboot boot twrp-3.2.1-1-nash.img
    downloading 'boot.img'...
    OKAY [  0.841s]
    booting...
    OKAY [  5.135s]
    finished. total time: 5.976s
    uzephi@Nash:~/Downloads$
    BE SURE TO DO BOOT AND NOT FLASH!!! (If you ask why you can no longer boot to system, I'll let you know you missed this line.)

    5:
    You're now in TWRP!
    It will ask you for your password. This is your PIN or password to unlock your phone. Enter it.
    TWRP has now decrypted your storage to read the zip file(s) you put on your phone!
    Go to install and navigate to your directory where you put that file
    Install Magisk/SU/TWRP/whatever you please.
    (Note: some root zips require a factory reset)

    6:
    Reboot!

    You're Done congratulations!

    Attached are images if they help you see you're doing the right thing.



    Special thanks @erfanoabdi @invisiblek @npjohnson @joemossjr @jbats

    Without the above people a lot of what's above woudn't have been possible for this device specifically. Also, thanks to everyone who pitched in to get a device over to invisiblek. Leaps and bounds have been done since that donation. And thanks to the other devs who have invested in this phone and their time to help out.


    (Quoted from Nathan Chance)
    Quite a few people have asked to donate to me in the past and I have turned them down. I am not in this for the money, this is my hobby, something I truly enjoy. If you truly want to donate to something (it is not expected in the slightest), I recommend an entity like the Open Source Initiative, the Free Software Foundation, XDA, or any one of the people I have thanked in the OP. Additionally, you are free to copy any and all of my work; the only thing I request is that you not ask for donations as well (though I can't really enforce this lol). Thank you.
    2
    Note: we do not have a recovery partition. Never flash the img file! Download the flashable zip if you want twrp on your phone and flash per OP instructions.
    2
    Hi Guys. is this manual synonymous with the XT1789-06? Be happy about any answer.

    Translated with Google

    It should work on all Z2 Variants: I.E XT1789-xx
    1
    Random issues post:

    SU does some wonky edits to the ramdisk. It is highly suggested to flash Magisk for root.

    Some have reported needing to wipe data after flashing Magisk. If you can't boot after flashing Magisk, just go back into recovery (can be twrp or stock) and wipe data/factory reset to boot again.
    1
    Hello new here. I already flash my phone back to stock through the How To Guide for Sprint, but whenever I install Magisk it boot loops. Is there a possible fix for this? I tried Magisk 16.0, 19.0, and 19.1?

    After installing magisk, try formatting data in TWRP, not wipe, but format and type yes. Something is up with the encryption and needs to be wiped and rekeyed. FYI, this will erase all data on your internal storage so it is advised to back up to an SD card before formatting.