yashsingh1/xdaforums huggingface dataset:
[ONE Q&A, Help & Troubleshooting] Mr.Ak:
The original swollen battery has battery backup issues too? If not,I advice you to use that again,as no better,or equal and genuine batteries are available anywhere.
[ONE Q&A, Help & Troubleshooting] pr091:
No, never had a problem with the original one but it was starting to break the back cover... So I threw it in the bin ? the seller sent me another sealed battery, maybe I should try it. Any advice on how to calibrate it properly?
[ONE Q&A, Help & Troubleshooting] Mr.Ak:
Search battery thread in accessories section.
[ONE Q&A, Help & Troubleshooting] iPusak Gaoq™:
Mind telling me what is the serial number on the battery connector? those serial number can tell you whether you bought an original battery or OEM battery...
[Sony Xperia XZ1  Guides, News, & Discussion] N1ghtr08d:
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 [MENTION=4297219]modpunk[/MENTION] FOR HIS PORT OF TWRP TO THE XZ1 AND YOU CAN THANK [MENTION=490110]janjan[/MENTION] 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://xdaforums.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://xdaforums.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 "4.4.78-Amjal-Safi-amjalsafi@amjalsafi #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
[Sony Xperia XZ1  Guides, News, & Discussion] pergoteborg:
Sorry.You forgot to flash SR5-SuperSU-v2.82-SR5-20171001224502.zip in TWRP recovery after step 13 :)

Posting not relevant anymore!!!

1:st posting fixed by N1ghtr08d
[Sony Xperia XZ1  Guides, News, & Discussion] N1ghtr08d:
Thanks bro. I had edited it and I must have missed putting that back in. Fixing it now
[Sony Xperia XZ1  Guides, News, & Discussion] dcro95:
Any try to use Magisk instead of SuperSU ? I need to use some apps witch don't work with root phone.
[Sony Xperia XZ1  Guides, News, & Discussion] modpunk:
If you turn the phone off, press and hold 'Volume Up' and attach a USB Cable from your PC it will boot into the bootloader. The LED will be blue then ...
[Sony Xperia XZ1  Guides, News, & Discussion] N1ghtr08d:
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.
[Sony Xperia XZ1  Guides, News, & Discussion] N1ghtr08d:
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!
[Sony Xperia XZ1  Guides, News, & Discussion] Deleted member 4333722:
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?
[Sony Xperia XZ1  Guides, News, & Discussion] pergoteborg:
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?
[Sony Xperia XZ1  Guides, News, & Discussion] Deleted member 4333722:
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.
[Sony Xperia XZ1  Guides, News, & Discussion] pergoteborg:
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)
[Sony Xperia XZ1  Guides, News, & Discussion] N1ghtr08d:
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.
[Sony Xperia XZ1  Guides, News, & Discussion] pergoteborg:
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!!!
[Sony Xperia XZ1  Guides, News, & Discussion] Deleted member 4333722:
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.
[Sony Xperia XZ1  Guides, News, & Discussion] pergoteborg:
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,
[Sony Xperia XZ1  Guides, News, & Discussion] dcro95:
Hi all, do you think that TWRP, Androplus kernel et Magisk work on a XZ1 Dual ?
[Sony Xperia XZ1  Guides, News, & Discussion] N1ghtr08d:
I don't know. To be honest, you'd need to check with modpunk and aledoom if their recovery and kernel are compatible
[Sony Xperia XZ1  Guides, News, & Discussion] Magus420:
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.
[Sony Xperia XZ1  Guides, News, & Discussion] N1ghtr08d:
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.
[Sony Xperia XZ1  Guides, News, & Discussion] N1ghtr08d:
Here's the thread in question. He posted right at the end of the thread just before me.

https://xdaforums.com/xperia-xz1/how-to/xz1-xz1-compact-lb-root-drm-backup-t3672176/page16
[Sony Xperia XZ1  Guides, News, & Discussion] pergoteborg:
I have the dual (G8342) myself and it works perfectly, both fw5.51 with kernel in OP and FW8.49 with kernel a few posts up :o
[Sony Xperia XZ1  Guides, News, & Discussion] Magus420:
Ok so heres where I am as to rooting my xz1 (g8343), I finally got the bootloader unlocked, First problem was I couldnt find any xz1 on sony site, I just went through the xz tutorial instead to get my unlock code. I then battled with Having windows 8 and having to do some work arounds to be able to install unsigned drivers lol, So I got this all figured out and then after the reboot I got this msg "this device is unlocked and cannot be trusted, device will reboot in 5 seconds" Did I S*** the bed somewhere or maybe i just happened to flash twrp wrong because im having issues booting into TWRP to flash SuperSU to obtain my root... Im a long time samsung user so im really on a big learning curve here with xperia... Device came 4th in the anutu benchmark though before and I am trying to up my score on that. So yeah has anyone had this come up before or? Should I have included a missed step possibly?

FYI Xreality "X-Reality is an image processing technology that enhances the images and videos displayed on the Xperia. It makes pictures look sharper, reduces noise, improves contrast, and fine tunes saturation."

as far as I can tell mine definetly stopped working as theres a noticable color difference, Almmost makes the color less attractive so to speak but yeah.
[Sony Xperia XZ1  Guides, News, & Discussion] pergoteborg:
"Not trusted"-message is always there on recent FW:s when bootloader is unlocked.

To enter TWRP, make sure phone is off (restart does not work). Press and hold Volume Down. Press powerbutton until phone vibrates, kepp pressing Volume Down. When you see TWRP, release Volume Down.
[Sony Xperia XZ1  Guides, News, & Discussion] N1ghtr08d:
How can I help? It seems the only question you had was did you do something wrong? The answer is "No" you didn't. When you unlock the bootloader on any device, you get that warning from Google at the beginning of the boot process simply because the border is unlocked. It's absolutely nothing to worry about, we all have it.

Secondly, yes the camera is now distorted and takes every picture with a horrible green picture, that's why we now have the DRM fix to revert that problem and return full functionality to the camera and to the other Sony apps like xreality and other Sony apps.

Once you have the bootloader unlocked, simply turn off the phone, then hold the vol up button while plugging it into a USB cable connected to your PC. Once windows recognizes that the phone has been connected you can release the vol up button.

I'm assuming you used the minimal adb installer and now have the ability to run adb commands system wide so, open a cmd prompt and type the following command

Fastboot flash recovery /path/to/the/twrp/Img/you/downloaded

Actually what I do instead of typing the whole path is I simply drag and drop the image from my folder onto the cmd screen and it inputs the path itself.

That should take a grand total of 2 seconds to flash. Once it's finished, just unplug your phone, wait for the LED light on the phone to turn off then press and hold power and vol down together until the phone vibrates once then release both buttons. Wait a few seconds and it'll boot into TWRP for you. Enter your lockscreen pin/password to decrypt the data partition.

Once booted into TWRP tap install, navigate to the folder on your sd card where you stored the DRM fix zips and flash then in the correct order then simply reboot the device and you now have functioning TWRP and all the camera and Sony functions back working properly.
[Sony Xperia XZ1  Guides, News, & Discussion] N1ghtr08d:
Actually I accidentally discovered you don't need to keep holding the volume button. Once it vibrates, let go of both, it still enters TWRP.

Always glad to have your help bro ?
[Sony Xperia XZ1  Guides, News, & Discussion] Magus420:
My question is how I get into twrp, as it won't allow me at the moment.. I hold both down until the first vibration and that's when I get that msg I was saying... it says will reboot in 5 seconds and I'm unable to actually get into recovery to flash super su, mybe my device (g8343) needs a different TwRP? I've noticed it's 1 number off from most of the other people's.. them being (g8342 or g8341)
[Sony Xperia XZ1  Guides, News, & Discussion] pergoteborg:
Shouldn't be a problem, you got a canadian G8341 (see here)

When you get the "reboot in 5 seconds...", just keep holding on to Vol-

which FW are you on?

BTW, you should really follow this thread in order to get the only currently working DRM fix for unlocked XZ1
[Sony Xperia XZ1  Guides, News, & Discussion] sofyanpall:
xperia xz1 g8342 47.1A.2.374

The great developers site YouTube needs to explain the software for smart phones, until the moment I could not open the root in my phone did not work all the ways

An update was 47.1.A.8.49 introduced and succeeded and root failed

No problem I have to enter recovery mode When rebooting appears the screen repair of the system is no progress . In recovery mode, a file is not installed . While a file magisk is installed well

( 47.1A.2.374 When you take a picture of the touch button appear green, when the long press to capture multiple images shows the images normally, the outer shooting button works fine)

( 47.1.A.8.49 On the system all images are green )
[Sony Xperia XZ1  Guides, News, & Discussion] Magus420:
Ok to update you I have got into twrp, I just said F*** it im going to try one last time and this time I only flashed the twrp.img not the boot ones again and that seemed to alllow me to finally boot into recovery instead of safe mode.... however..... Ive tried flashing super su twice now and both times i havent achieved root access... not sure why but It also never asked me to decrypt anything like the guide stated. as for the keys and what not im honestlly only a gamer and Im basiclally at my wits end already with this phone being as ridiculas as it is to get this root but any help to what i do now would be awesome. Any one has a Note 5-7 or 8 Ill trade ya this xz1 :) fw is what exact;y sorry? Been a long night... If its like oreo then yeah if not where do I find it

---------- Post added at 03:46 PM ---------- Previous post was at 03:09 PM ----------

I've officially rooted my xz1 finally. Thanks to everyone for the help. And the files. If any one has any game optimization apps or mods or anything that's going to boost my performance please let me know. As I said my knowledge on Sony is far more limited then samsung
[Sony Xperia XZ1  Guides, News, & Discussion] N1ghtr08d:
I have to change the OP. I didn't realize that when you flash the 2 boot images it replaced the stock recovery. The order should be to flash the boot images THEN the recovery.
[Sony Xperia XZ1  Guides, News, & Discussion] N1ghtr08d:
OP changed, soon to be updated with the newer method involving the newer firmware and the DRM fix with Magisk once we get a working kernel to support it in the new firmware.
[Sony Xperia XZ1  Guides, News, & Discussion] jimboblunn:
Root unlocked bootloader

Hi guys found your thread very interesting I have a XZ1 G8341 with unlocked bootloader could/would any of you explain steps for rooting? My last device was Z5 Premium which i found root for, I would really like to do the same. Thanks In Advance...
[Sony Xperia XZ1  Guides, News, & Discussion] N1ghtr08d:
I'm not being rude here but... You're posting that question on a thread that teaches you how to do exactly what you want. Read my OP, you'll get root in no time. Bare in mind my guide is currently for the previous version of firmware, not the current one ending in 8.49.
[Sony Xperia XZ1  Guides, News, & Discussion] Manuel Lobos:
Check the Links?
[Sony Xperia XZ1  Guides, News, & Discussion] N1ghtr08d:
Thanks. I'll update the link now but bare in mind that this is for an older firmware. I'm waiting on a full solution including the DRM fix and using Magisk before I update it as this is the only solution we all want.
[Sony Xperia XZ1  Guides, News, & Discussion] N1ghtr08d:
OP updated
[Sony Xperia XZ1  Guides, News, & Discussion] Manuel Lobos:
Not work on 47.1A.12.34?
[Sony Xperia XZ1  Guides, News, & Discussion] N1ghtr08d:
No because this guide involves flashing a kernel and that kernel isn't supported in that firmware
[Sony Xperia XZ1  Guides, News, & Discussion] FerrisBueller:
For the future it looks like we have to assume with each monthly firmware update from Sony that Magisk does not work anymore?
[Sony Xperia XZ1  Guides, News, & Discussion] N1ghtr08d:
No, the problem is not with Magisk. The problem is that, for this guide, flashing Magisk involves flashing a different kernel first. That kernel is only supported on the 5.51 firmware and nobody take is running that anymore. We're hopeful of a new kernel in the near future. Then and only then will this guide be updated.
[Sony Xperia XZ1  Guides, News, & Discussion] snake218:
noob question... a XZ1 with "unlocked bootloader allowed: NO" ...can do nothing (root) with it, rigth?
[Sony Xperia XZ1  Guides, News, & Discussion] N1ghtr08d:
Correct, unfortunately
[Sony Xperia XZ1  Guides, News, & Discussion] lovetezza:
Hallo.

TWRP & boot.img was installed.

But restarting eternity
[Sony Xperia XZ1  Guides, News, & Discussion] N1ghtr08d:
What firmware are you on? Have you read the whole OP? I stated that this guide is ONLY for the 5.51 firmware. It's literally the first thing I wrote.
[Sony Xperia XZ1  Guides, News, & Discussion] AbrarZShahriar:
adding camerapi2 to enable Gcam possible with this?
[Sony Xperia XZ1  Guides, News, & Discussion] N1ghtr08d:
No idea. That would be nothing to do with rooting. That's app specific.
[Sony Xperia XZ1  Guides, News, & Discussion] OutAndAbout:
Hi, the link in Step 2. no longer works. Is it possible to update please?

(presume still applicable to version 12.75 as per OP)
[Sony Xperia XZ1  Guides, News, & Discussion] N1ghtr08d:
Thanks for the heads up. He changed the link address. OP has been updated with the new link.
[Sony Xperia XZ1  Guides, News, & Discussion] PhobiaSoft:
Really appreciate your work [MENTION=3666806]N1ghtr08d[/MENTION]. I've been lurking on this thread for a while waiting for a stable and safe root for the XZ1 Compact so I can finally move from my Z5 Compact. One of the biggest struggles we've had over on the Z5 forums was not in rooting the phone with SuperSU, but in passing Google's SafetyNet after rooting. [MENTION=5813612]sceryavuz[/MENTION] wrote a great guide on rooting the Z5 while still passing SafetyNet, and one of the key steps to this was dropping SuperSU entirely: https://xdaforums.com/xperia-z5/development/safetynet-stock-kernel-twrp-magisk-t3621133

I'm super impressed by your work with the XZ1 so far, but (correct me if I'm wrong) your method seems to rely on SuperSU to root just like "old" methods for the Z5. Does this mean that an XZ1 rooted using this method and using Magisk will fail SatefyNet anyway? I would be extremely grateful if someone could give me explicit clarification on if apps like Android Pay, Snapchat, Netflix, Pokemon Go, etc, are working as intended after rooting via this method. If so, I'll be buying an XZ1 Compact ASAP.
[Sony Xperia XZ1  Guides, News, & Discussion] N1ghtr08d:
Thanks very much! This method gives full root with Magisk. The new version doesn't even install SuperSU unlike it's previous release and, yes, all apps work as intended. I don't personally pay Pokemon go but I can confirm that Google Pay works fine and I believe Netflix works fine also.

I noticed you mentioned that you're running a XZ1C..... This thread and all of the files and info contained are for the XZ1. I cannot be held liable if something damages or goes wrong with your phone because they run different firmware, if you decide to use the files provided.
[Sony Xperia XZ1  Guides, News, & Discussion] postz:
Unrooting

Hi [MENTION=3666806]N1ghtr08d[/MENTION], thanks for posting this tutorial. I really want to do this on my XZ1 right right now, but before I do I'd like to know if the process can be reversed without any problems and, if so, how I would go about doing that.

The main reason I would like to root the phone is to uninstall some of the preinstalled apps (like Facebook). I don't necessarily want to leave the phone rooted, although I may depending on how useful it is.

So after following this tutorial, can the phone then be unrooted?