• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[GUIDE] Full root with Magisk and DRM fix [UNMAINTAINED]

Search This thread

N1ghtr08d

Senior Member
Feb 15, 2011
778
188
Dublin
Prefix: my xz1 died on me so I was forced to buy a new phone and therefore I won not be maintaining this thread any further. The guide should be relevant even without my help but I just won't be answering any questions regarding this thread or anything to do with the xz1.

YOU DO NEED TO UNLOCK YOUR BOOTLOADER AND THEREFORE WILL LOSE YOUR DRM KEYS!
NONE OF THIS IS MY ORIGINAL WORK BUT MY PROCESS IS ORIGINAL. YOU CAN THANK @modpunk FOR HIS PORT OF TWRP TO THE XZ1 AND YOU CAN THANK @janjan FOR HIS HARD WORK IN CREATING THE FIRST FULLY FUNCTIONAL KERNEL THAT SUPPORTS MAGISK AND STILL OFFERS A WORKING CAMERA AND SONY FEATURES


Here we go.....

1: Download modpunk's port of TWRP from this thread: https://forum.xda-developers.com/xperia-xz1/development/recovery-twrp-3-2-1-t3727602
Make sure to check the dates on the files and always download the latest version.

2: Download Janjan's kernel and DRM package here:
https://forum.xda-developers.com/xperia-xz1/development/kernel-sony-xz1-23-january-2018-t3739586
Make sure to check the dates on the files and always download the latest version.

3: Enable developer settings and enable ADB Debugging. I shouldn't have to say this part but something tells me if i don't then i'll get loads of questions about not being able to connect to the phone, lol.

4: Connect the phone to your pc and copy the 3 zip files contained in the janjan download to your phone. You don't need to copy the boot.img to your phone.

5: Open a cmd window on your pc and type the following:
adb reboot bootloader

6: Once the pc recognizes the phone in bootloader mode then type:
fastboot flash boot path/to/the/boot.img (I usually just type "fastboot flash boot " and then just drag and drop the boot image into the cmd window.

7: Once the boot image is flashed unplug the cable from the phone then reboot it. Once it's running then make sure the kernel info has changed to say "[email protected] #1

8: Once again, boot into bootloader by running the adb command
adb reboot bootloader

9: Once in the bootloader type into the cmd window:
fastboot flash recovery path/to/the/recovery.img

10: Reboot to system and then power off the phone.

11: Once it's off, boot into TWRP manually by holding the power button + the vol down button until the phone vibrates once, then let go and it'll boot into TWRP.
NOTE: It will ask you for your password to decrypt the data partition. This password is whatever your pin number or password you use on your phone lockscreen. If you don't use any lockscreen security then the password is: default_password.

12: Once in TWRP flash 2-Patching_drm_Su and 3-Magisk and then reboot to system and check that magisk is installed.

13: Finally open magisk and open the Modules section then tap the + icon and locate and flash the last zip 4-kernel_permissive and then reboot the phone and open magisk and check the modules section to ensure the Magisk SELinux Permissive Script is active.


Now you have a fully functional XZ1 with Magisk root and a properly functioning camera and Sony features.
Enjoy!

N1ghtr08d
 
Last edited:

N1ghtr08d

Senior Member
Feb 15, 2011
778
188
Dublin
Thanks modpunk, that is very true. I guess my preference is just to use ADB.
As far as magisk is concerned, I believe that none of the magisk releases work with this device. I would prefer to use magisk also so if anyone figures out how to install it successfully without putting the phone in a bootloop, please share it here and I will update this guide. I'd rather have SuperSU than no root at all.
 

N1ghtr08d

Senior Member
Feb 15, 2011
778
188
Dublin
Does anybody have any tips for installing Viper4android? I renamed the audioeffects file in System/Vendor/Etc and installed the Nougat test io fix version and when I opened the app and allowed it to update the drivers, everything went well and looked successful, however upon reboot and opening the app to set it up, it just tells me to update the drivers and reboot again and even doing that just lands me back at the same point.
Does anybody know how I can get it installed and running properly?
Coincidentally V4A installs and runs perfectly now that it can be installed through Magisk Manager!
 
Last edited:

trevorftard

Senior Member
Nov 9, 2011
129
27
Brenham, TX.
What FOTA kernel.img are you referring to? There wasn't one linked in the post, and Sony's fotakernel files are in .sin formats. Flashing just the boot.img linked in your post results in a brick. Flashing the fotakernel_X-FLASH-ALL-C93B.sin included in Sony's firmware also results in a brick. Has anyone got this to work?
 
Last edited:

pergoteborg

Senior Member
Feb 11, 2009
225
97
Göteborg
What FOTA kernel.img are you referring to? There wasn't one linked in the post, and Sony's fotakernel files are in .sin formats. Flashing just the boot.img linked in your post results in a brick. Flashing the fotakernel_X-FLASH-ALL-C93B.sin included in Sony's firmware also results in a brick. Has anyone got this to work?

Flash boot.img to both boot partition and FOTAKerner partition
fastboot flash boot boot.img
fastboot flash FOTAKernel boot.img

---------- Post added at 02:50 PM ---------- Previous post was at 02:45 PM ----------

Can I use the aledoom's port of the Andro+ kernel at https://mega.nz/#!00l3mABT!RCuCfvwxROggim9D_GwfdhZDTPQJomNrfWZy_lsq0-U for the new 47.1.A.8.49 release?
 

pergoteborg

Senior Member
Feb 11, 2009
225
97
Göteborg
What FOTAKernel boot.img though? Am I supposed to download one from somewhere? It's not in OP or in the Sony firmware that I've downloaded.
The link https://mega.nz/#!00l3mABT!RCuCfvwxROggim9D_GwfdhZDTPQJomNrfWZy_lsq0-U is the download link for boot.img

fastboot flash FOTAKernel boot.img
The parameters is:
fastboot - An Android SDK command and library used to communicate with a connected android device
flash - The fastboot command you wish to execute. "fastboot flash" takes two parameters, which are:
FOTAKernel - The partition on the connected phone you want to flash and
boot.img - The file you want to flash into FOTAKernel partition.

In this case is the same file (boot.img) flashed into BOTH boot partition(fastboot flash boot boot.img) and into FOTAKernel partition(fastboot flash FOTAKernel boot.img)
 

N1ghtr08d

Senior Member
Feb 15, 2011
778
188
Dublin
Thank you for the help Pergoteborg. I thought the guide was fairly self explanatory.
I pointed out in the op that the one boot image I provided in the download is to be flashed to 2 different partitions.
If you follow my instructions as provided you will have success. It's really easy to follow along if you read it properly.
 

pergoteborg

Senior Member
Feb 11, 2009
225
97
Göteborg
Can I use the aledoom's port of the Andro+ kernel at https://mega.nz/#!00l3mABT!RCuCfvwxROggim9D_GwfdhZDTPQJomNrfWZy_lsq0-U for the new 47.1.A.8.49 release?
I tested myself and answer is NO. Therefor no magisk for 47.1.A.8.49 yet since we do not have kernel support. Root achieved by SuperSU
So I :
  • Got phone in flash mode (Vol- when putting in computer USB cable, Green light). Ran NewFlasher with 47.1.A.8.49
  • Booted phone, turned it of and set it to fastboot mode (Vol+ when putting in computer USB cable, Blue light)
  • Flashed TWRP: fastboot flash recovery twrp-3.2.1-0-poplar-patchlevel-2017-11-05.img
  • Booted phone, Uninstalled Magisk manager, Installed SuperSU App from Google Play.
  • Turned off phone, booted into TWRP (Vol- and pwr, release pwr button when phone vibrates, hold on the Vol- button)
  • Installed Magisk-uninstaller-20171123.zip to get rid of Magisk. Installed SR5-SuperSU-v2.82-SR5-20171001224502.zip to get SU

HIPP!!!
 

trevorftard

Senior Member
Nov 9, 2011
129
27
Brenham, TX.
The link https://mega.nz/#!00l3mABT!RCuCfvwxROggim9D_GwfdhZDTPQJomNrfWZy_lsq0-U is the download link for boot.img

fastboot flash FOTAKernel boot.img
The parameters is:
fastboot - An Android SDK command and library used to communicate with a connected android device
flash - The fastboot command you wish to execute. "fastboot flash" takes two parameters, which are:
FOTAKernel - The partition on the connected phone you want to flash and
boot.img - The file you want to flash into FOTAKernel partition.

In this case is the same file (boot.img) flashed into BOTH boot partition(fastboot flash boot boot.img) and into FOTAKernel partition(fastboot flash FOTAKernel boot.img)

Thanks for being actually helpful. I wasn't familiar with the FOTAKernel partition. I though it was a typo that was supposed to be the name of some boot.img. I'm familiar with everything else about fastboot. I'm still getting a glitchy display after flashing the boot.img to the boot and FOTAKernel partitions. I think I'll just check out and give up on this one.
 
  • Like
Reactions: pergoteborg

pergoteborg

Senior Member
Feb 11, 2009
225
97
Göteborg
Hi There
Thank's to my hero aledoom who ported XZ1 (G8342) FW47.1.A.8.49 to Androplus we can now enjou latest FW and Magisk
Download the patched kernel here (aledoom´s direct link here)
If you currently have root with SU, get rid of it by flasching UPDATE-unSU-signed.zip in TWRP
Then follow the OP, but use kernel from here instead of OP boot.img.

I currently testing MAGISK 15.0 and it's working fine except there is no modules ported to the new template just yet,
 
Last edited:

Magus420

Member
Dec 28, 2017
8
0
So this is actually my first official post as a new member on this site but have been a long time user of the guides here. I have a question but I want to root my xz1 to optimize the performance and what not and just cause haha. My question is about what's being lost. I noticed something called xreality or something won't be accessible. What is this? Reason I'm asking is that I playmobile legends and this phone and only this phone I've found has an in game option for. "high frame rate" mode.. I'm not interested in rooting it if all I'll do is make it perform less rather then the opisite anywho Sony's alot different then most android im finding so I figure what the hell better make an account finally and ask.
 

N1ghtr08d

Senior Member
Feb 15, 2011
778
188
Dublin
I have no idea what xreality is. Is it a Sony app?
As far as what's lost, you lose the DRM keys so the camera stops working correctly, as in when you take a photo it just turns out as a green image instead of the picture you intended.
Now with that being said, someone over on the root bounty thread apparently discovered a fix for this that allows the camera to function fully as before. I have tried flashing this fix on my personal device and it didn't work as expected however I'm using magisk for root instead of SuperSU like the poster stated so I'm waiting on a reply from him regarding the usage of magisk Vs SuperSU with his fix.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 22
    Prefix: my xz1 died on me so I was forced to buy a new phone and therefore I won not be maintaining this thread any further. The guide should be relevant even without my help but I just won't be answering any questions regarding this thread or anything to do with the xz1.

    YOU DO NEED TO UNLOCK YOUR BOOTLOADER AND THEREFORE WILL LOSE YOUR DRM KEYS!
    NONE OF THIS IS MY ORIGINAL WORK BUT MY PROCESS IS ORIGINAL. YOU CAN THANK @modpunk FOR HIS PORT OF TWRP TO THE XZ1 AND YOU CAN THANK @janjan FOR HIS HARD WORK IN CREATING THE FIRST FULLY FUNCTIONAL KERNEL THAT SUPPORTS MAGISK AND STILL OFFERS A WORKING CAMERA AND SONY FEATURES


    Here we go.....

    1: Download modpunk's port of TWRP from this thread: https://forum.xda-developers.com/xperia-xz1/development/recovery-twrp-3-2-1-t3727602
    Make sure to check the dates on the files and always download the latest version.

    2: Download Janjan's kernel and DRM package here:
    https://forum.xda-developers.com/xperia-xz1/development/kernel-sony-xz1-23-january-2018-t3739586
    Make sure to check the dates on the files and always download the latest version.

    3: Enable developer settings and enable ADB Debugging. I shouldn't have to say this part but something tells me if i don't then i'll get loads of questions about not being able to connect to the phone, lol.

    4: Connect the phone to your pc and copy the 3 zip files contained in the janjan download to your phone. You don't need to copy the boot.img to your phone.

    5: Open a cmd window on your pc and type the following:
    adb reboot bootloader

    6: Once the pc recognizes the phone in bootloader mode then type:
    fastboot flash boot path/to/the/boot.img (I usually just type "fastboot flash boot " and then just drag and drop the boot image into the cmd window.

    7: Once the boot image is flashed unplug the cable from the phone then reboot it. Once it's running then make sure the kernel info has changed to say "[email protected] #1

    8: Once again, boot into bootloader by running the adb command
    adb reboot bootloader

    9: Once in the bootloader type into the cmd window:
    fastboot flash recovery path/to/the/recovery.img

    10: Reboot to system and then power off the phone.

    11: Once it's off, boot into TWRP manually by holding the power button + the vol down button until the phone vibrates once, then let go and it'll boot into TWRP.
    NOTE: It will ask you for your password to decrypt the data partition. This password is whatever your pin number or password you use on your phone lockscreen. If you don't use any lockscreen security then the password is: default_password.

    12: Once in TWRP flash 2-Patching_drm_Su and 3-Magisk and then reboot to system and check that magisk is installed.

    13: Finally open magisk and open the Modules section then tap the + icon and locate and flash the last zip 4-kernel_permissive and then reboot the phone and open magisk and check the modules section to ensure the Magisk SELinux Permissive Script is active.


    Now you have a fully functional XZ1 with Magisk root and a properly functioning camera and Sony features.
    Enjoy!

    N1ghtr08d
    3
    Im still on stock with the firmware 47.2.A.11.228 and everything is just really complicated to me as I havent had any experience with rooting yet. I have read that backing up the drm keys isnt necessary anymore because the camera still works when rooting on pie. I havent unlocked the bootloader yet because im still trying to find a uptodate instruction on how to root the xz1 properly but everything is unfortunately outdated... would be very thankful if you could tell me how I can root this phone!

    Ok, first thing you need to do is get your driver's installed adb and fastboot and you phone gets recognized..
    Now, you do want to backup your drm keys , granted it may not be needed for the camera but you will lose your video image ehancement and sound stuff so read through j4nn's op and follow the attached guide (all credits to the author) .. yell if you have a question ..
    3
    That guide you're referring to is an old guide for an old firmware, I have no idea if it works anymore or not.
    If you followed my guide and failed then I promise you you've gone wrong somewhere down the line. You'd be the only person with this phone that the process wouldn't work.
    3
    I finally upgraded to .205 and I had the same issues as you guys reported regarding the permissive kernel so I'm gonna edit the op.
    Thanks for the heads up guys.
    3
    No. I've enough on my plate these days and don't have time to make videos. I wrote the instructions to be as easy to follow as possible. In fact it's easier to follow the written guide since you can copy/paste any of the commands if necessary and you can't do that with a video.
    Sorry.