yashsingh1/xdaforums huggingface dataset:
[Xperia Z5 Compact General] tekemlaef:
Hey trax7,

thanks for answering, found that out and i am now running Xposed with Magisk on 7.1.1 on min Z5 compact.

To refer to the thread, here is what i varied:

rootkernel build without su, xposed and TWRP(skipped anyway)

flashed this modified TWRP: https://xdaforums.com/crossdevice-dev/sony/twrp-3-1-0-z5-z5c-z5p-t3571050 (Z5 series not anymore officially supported by TW)

flashed with TWRP Magisk: https://xdaforums.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445

flashed build.img again, as kernel should be flashed after installing Magisk

flashed with TWRP this universal Xposed for Magisk: https://xdaforums.com/xposed/unofficial-systemless-xposed-t3388268

using Xposed-installer mentioned in the Guide: https://xdaforums.com/xposed/material-design-xposed-installer-t3137758 , didn't try the official one

Maybe there is an easier way now to get root on a Z5c with 7.1.1. Sorry for bumping an old thread then. I couldn't find any though.
[Xperia Z5 Compact General] trax7:
No, kernel should definitely NOT be flashed after installing Magisk!

Magisk patches the kernel so if you flash it again after Magisk, you lose root and Magisk.
[Xperia Z5 Compact General] packetfire:
I followed this guide to the letter, and all was successful except the restoration of the DRM key. but I am frustrated by “matching the connected device”, which seems to be a moving target. I may need a suggestion as to a more appropriate release to run.

After downgrading to Lollipop, and saving the TA partition, I was then using flashtool to install a release of code that does not present battery issues, in this case 32.2.A.5.11 (Marshmallow). But the flashtool insisted that my phone was an “E5823” (non-US version) when it clearly is an “E5803” (US version).

=-=-=-= START LOG =-=-=-=

19/006/2018 13:06:55 - INFO - Selected Bundle for Sony Xperia Z5 Compact(E5803). FW release : 32.2.A.5.11. Customization : Customized US

19/006/2018 13:06:55 - INFO - Preparing files for flashing

19/010/2018 13:10:12 - INFO - Please connect your device into flashmode.

19/021/2018 13:21:01 - INFO - Using Gordon gate drivers version 3.2.0.0

19/021/2018 13:21:02 - INFO - Opening device for R/W

19/021/2018 13:21:02 - INFO - Device ready for R/W.

19/021/2018 13:21:02 - INFO - Reading device information

19/021/2018 13:21:03 - INFO - Phone ready for flashmode operations.

19/021/2018 13:21:03 - INFO - Opening TA partition 2

19/021/2018 13:21:03 - INFO - Current device : E5823 - CB5A29BC8S - Unknown: Sep 20 2017/12:00:48 - 1292-0963_32.4.A.1.54 - GENERIC_32.4.A.1.54

19/021/2018 13:21:03 - INFO - Closing TA partition

19/021/2018 13:21:03 - ERROR - The bundle does not match the connected device

19/021/2018 13:21:03 - INFO - Ending flash session

19/021/2018 13:21:07 - INFO - Device disconnected

=-=-=-= END LOG =-=-=-=

So, I decided to load an android version for the E5823, (E5823_Vodafone NZ_1298-7637_32.2.A.5.11_R8C) which went flawlessly, except for the DRM key step:

=-=-=-= START LOG =-=-=-=

19/012/2018 15:12:41 - INFO - Opening device for R/W

19/012/2018 15:12:41 - INFO - Device ready for R/W.

19/012/2018 15:12:41 - INFO - Reading device information

19/012/2018 15:12:42 - INFO - Phone ready for flashmode operations.

19/012/2018 15:12:42 - INFO - Opening TA partition 2

19/012/2018 15:12:42 - INFO - Current device : E5823 - CB5A29BC8S - Unknown: Sep 20 2017/12:00:48 - 1292-0963_32.4.A.1.54 - GENERIC_32.4.A.1.54

19/012/2018 15:12:42 - INFO - Closing TA partition

19/012/2018 15:12:42 - ERROR - The bundle does not match the connected device

19/012/2018 15:12:42 - INFO - Ending flash session

=-=-=-= END LOG =-=-=-=

So what did I do wrong here? How do I overcome the confusion over the model number of the phone?

My only concern for the DRM Key is to have the camera de-noise features.

Thanks!
[Xperia Z5 Compact General] Zoryn:
Stuck on Sony logo

Hi there,

This is my first attempt to root a phone, and although i followed carefully all the steps in this tutorial (and didn't see any error at any point) i end up with a rootchecker that says "not rooted"...

Can anyone point me in the right direction plz?

Thanks
[Xperia Z5 Compact General] chizzo_ita:
Hi, I have problems in the step 8.

command prompt: The term 'fastboot' is not recognized as the name of a cmdlet

why? :(
[Xperia Z5 Compact General] Ps24u:
Something strange, i cannot disable Developer Options, the slider always comes back to "on" on its own.

I suspect it is because "OEM Unlocking" feature has been used before..?

Anyone who followed this guide can check on their device?
[Xperia Z5 Compact General] Macknoob:
probably because you do not have fastboot.exe in that folder. try copy the file you need to flash to the flashtool folder which holds fastboot and adb: perhaps C:\Flashtool\x10flasher_lib ?
[Xperia Z5 Compact General] Wolverrinester:
can't set pin on suspersu

Followed step by step your guide, It works fine! thank's for your work.

Im in trouble with superuser app, if i try to set pin protection he ask the pin two times but it immediatly forget. I also find that file system/.pin doesn't exist.

anyone have the same?
[Xperia Z5 Compact General] tjorvenalsson:
First, big thanks to mhaha for writing this guide, which is very nicely to follow!

Just some short questions because I am a bit confused about which firmwares the procedure works with: If I understood the prerequisites correctly, I can only flash a rooted kernel from/to a Marshmellow firmware earlier than build 32.2.A.5.11. This note in Step 6, however, suggests that patching a rooted kernel also works with later firmware versions like Nougat:

I don't understand that. Do I have to use a firmware with build number <=32.2.A.5.11 from Step 4 on?
[Xperia Z5 Compact General] XSeries:
Flash mode Not working

I tried it now for several times and it worked pretty well until i have to put my phone (Sony Xperia Z5 Compact (E5823)) into flash mode. I don't know why but flash tool does not recognize it if i put my phone into flash mode onto the pc...

Any help would be very good
[Xperia Z5 Compact General] file2mail:
just went through this

You are probably using windows 10. The latest windows wont let drivers that arent signed to be installed. the flashmode drivers can be installed from flashtool/drivers, but before installing them, you must set it so you can install the drivers

as an admin open command prompt and run

bcdedit /set testsigning off

(https://www.howtogeek.com/167723/ho...8.1-so-that-you-can-install-unsigned-drivers/ )

you can turn this off after.

then install the drivers and you should be able to connect
[Xperia Z5 Compact General] sabotage154:
hello. i tried this but cant seem to be able to restore ta backup.

z5c e5803

ran rootkernel using kernel.elf from .54 mea region and have patched boot.img

selected yes to everything except drm fix since i have my ta backup

generated DK.tft using rootkernel tool

flashed .54 mea region to device using flashtool

flash rootkernel generated boot.img via fastboot

flashed recovery recovery_suzuran_230218.img via fastboot

flashed DK.tft using flashtool

flashed magisk via recovery and got root

i am able to boot into system, root is working but do not have my drm keys. when i do security tests i get errors.

do you know what im doing wrong?

should i just do the drm fix via rootkernel? what is the differnce between drm fix and restorng my ta?
[Xperia Z5 Compact General] jutphaas:
I don't know what you do wrong but I would just run it with drm fix. Photos should be fine with that.
[Xperia Z5 Compact General] luidgiking:
Why not simply flash twrp and magisk?
[Xperia Z5 Compact General] nagelo:
I was facing the same issue and this worked for me!!! Big thumps up! You may edit the first page of your thread. ;)
[Xperia Z5 Compact General] mhaha:
What is the condition of your phone? If you have not rooted yet, do not skip any part of the steps, you must start from Step 1.

If it's already rooted, then... why are you in this thread :p

Or are you asking how to upgrade firmware after you're rooted? If so, this guide isn't written for and thus probably not suitable for that use case.

I've never had the experience of upgrading a rooted firmware while retaining all the user data and settings (commonly referred to as a "dirty flash", this guide is for a "clean flash"), so unfortunately I can't give you instructions that I've personally tested and verified to work.

In theory, from what I understand and have read on this forum, you can start from Step 3 and in Step 5, leave every checkbox unchecked, and skip the DRM flash in Step 7 (it's a one time procedure). But there may be other conflicting instructions such as in Step 6, where usage of a designated version of the rootkernel tool may not be suitable for the firmware version you're trying to upgrade to.

I suggest you provide more detailed information about what you're trying to do, and hope someone with knowledge sees it and lends you a helping hand. You can also try on your own, and I invite you to share your experiences with us.
[Xperia Z5 Compact General] Rufo3:
Yes the point is I would like to upgrade my rooted phone doing a dirty flash and somehow I manage to did it. The info I was asking was exactly if step 7 ta.img restore was a one time procedure or one I have to repeat every time.

Anyway what I did is: follow the guide from step 4 avoiding username wipe in step 5 and step 7 ta.img restore and using the trick of rootkernel suggested of mixing version 5.0 and 5.11. The result of all is that my phone is updated, with root and seems to rub well and smooth!

Thanks to all and to the guide, very well made!
[Xperia Z5 Compact General] Malcolm143:
Rootkernel 5.0 worked like a treat for me.

Thanks a lot guys for your efforts and suggestions :good:

Much appreciated
[Xperia Z5 Compact General] mhaha:
I've cleaned up the formatting for better visual consumption, and split the original Step 7 into two steps (Step 7 and Step 8) with emphasis that the DRM key is a one-time procedure, including a quote from the author of the rootkernel tool. Original Step 8 is now Step 9. Hopefully this will make things clearer, apologies for having to reorder the steps, step numbers should be final.
[Xperia Z5 Compact General] Thistletea:
Where can I find rootkernel 5.0? The link to rootkernel only has 5.11 and 5.20
[Xperia Z5 Compact General] mhaha:
The rootkernel dev removed the v5.0 package for some reason, I don't know why.

You can try using the newest v5.22, but I ran into problems flashing the kernel patched by v5.22. I got stuck at boot, and then it went into recovery mode. Granted, I only reflashed the kernel without reflashing the entire firmware, but according to the dev that should be all that's necessary.

If you want, I've uploaded v5.0 here with the firmware compatibility modifications already made (so you can skip the first instruction in Step 6).

But keep in mind the dev probably removed it for a good reason, so use at your own risk.

EDIT: I've contacted the dev tobias, and he explained that it was removed to reduce confusion of too many attachments, and also that there is a limit to the number of attachments allowed. It wasn't removed because of bugs or security reasons, so it's safe to continue using v5.0 if you like.

He also fixed the problem I described above in a newer version (v5.23) to be released in the coming days. I'll test and update the guide once it's available.

EDIT 2: v5.23 worked for me, I've slightly altered the wording in the original post and kept the link to v5.0 as an option in case newer versions break.
[Xperia Z5 Compact General] a2zonlyt:
First of all how did you upgrade your z5C to nougat (7.0), because there is no OTA update in my z5C i am running MM(6.0.1),

and second is this possible to root via this method if somehow i upgrade to nougat (7.0)?
[Xperia Z5 Compact General] a2zonlyt:
any one please tell me which one i need to download to follow this thread??
[Xperia Z5 Compact General] a2zonlyt:
some body please answer me.... please...
[Xperia Z5 Compact General] mhaha:
This guide is written primarily for first time rooting, which requires firmware that's not newer than 5.11. If you've already got your DRM keys backed up, then it's ok to use MM or N firmware for rooting, just understand that xposed currently doesn't work for Nougat, so if you want xposed you'll need to use 5.11 instead of 376.
[Xperia Z5 Compact General] nagelo:
First, thanks for the great guide. My Z5C is running on root now very well. :) However, how can I get /system access with this method? Is there any way? Currently my system blocks any kind of write access to system folders.
[Xperia Z5 Compact General] Gewiz:
Which firmware you are on? 5.11? In this case you probably made a wrong choice during patching your kernel with the rootkernel tool.

Be sure that said Yes on disable Sony RIC. You can run rootkernel again and then just flash the new kernel to your device.
[Xperia Z5 Compact General] Faz196:
Hello. I downloaded the firmware from experifirm on flashtool. I extracted the kernel from there. I followed all the instructions in this tutorial.

P.s I didn't back up my ta keys in the past so I have lost it completely. O well, still managed to root it.

Since my last post, I have downgraded back to marshmallow because I don't like nougat. I used magisk to do a systemlesss root.
[Xperia Z5 Compact General] Jhonbennet:
Hi developers i am new at xda and i want you to know that I've got android 7.0 official update on my z5c E5823 today, and now fully upgraded to android 7.0..

Now i want to know that is it possible to downgrade it to 5.11 and root? If possible then how can i downgrade my phone?
[Xperia Z5 Compact General] nagelo:
I've done everything as described at the guide, anwered all questions with Y. However, i'll try to patch the kernel once again. :rolleyes:
[Xperia Z5 Compact General] --jenana--:
As far as I know, this is not a kernel-issue, not a firmware-issue, it only has to do with granting rights.

I'm not sure if this is what you're looking for, but in earlier Android versions, I did this with ES File Explorer. You should go to "tools" in the menu, and enable "Root Explorer". If you click to open the Root Explorer, you can go to "Mount R/W". In this window you can grant rights to / and /system (and some other maps).

There used to be another problem with root for some apps. The problem was that some apps look for su binary in one of these folders: /system/xbin/ ** /system/sbin/ ** /system/bin/ ** /vendor/bin/ ** /sbin/ . Problem was solved by copying files from /su/bin/ to /system/xbin/ (about 7 files).

I've never tested this on Nougat, because I'm not on Nougat yet. (I'm still figuring out which guide I should follow, because I don't have any TA backup, and bootloader is already unlocked for a long time)
[Xperia Z5 Compact General] Gewiz:
If you are on 5.11, make sure to use rootkernel ver 5.0.

If you have trouble again try it with my img

https://xdaforums.com/showpost.php?p=69987858&postcount=10
[Xperia Z5 Compact General] mhaha:
Yes it's possible to downgrade, perform steps 3~5 to get your phone to 5.11, then start from step 1.

At step 3, you should make a choice of which firmware version you want to use to gain root. If you opt to use 5.11, then skip steps 3~5 and continue at step 6. If you want to upgrade back to Nougat, then at step 3 download the Nougat firmware and continue without skipping any steps.

Note that xposed currently is not supported on Nougat, so skip all parts about xposed.

Remember to back up your data first, see step 0.
[Xperia Z5 Compact General] mhaha:
Since you haven't backed up your TA partition before unlocking your bootloader, it doesn't really matter. You can simply follow this guide starting from step 3 and skip step 7. The rootkernel tool applys DRMfix that fixes most (if not all) DRM dependant features, which works whether you have your own DRM keys or not.
[Xperia Z5 Compact General] mhaha:
You should have access to /system, I tested moving a text file to /system using Total Commander, which has "root functions everywhere" enabled. When moving the file, a prompt pops up asking to grant permission to mount /system with write functions, and after confirming the task is completed.

Test done on 305 firmware, rooted using v5.0 rootkernel tool with SuperSU 2.76 for reference.
[Xperia Z5 Compact General] Jhonbennet:
okay thanks, one more question, i have another z5c which is still in MM (32.2.A.5.11) . which step should i follow to get root?? if i do not want to upgrade it to Nougat.
[Xperia Z5 Compact General] mhaha:
Start from step 0, and at step 3 download 5.11.
[Xperia Z5 Compact General] Jhonbennet:
https://drive.google.com/open?id=0B108JS3RZ0g2Q3Myb2xock1DSUU

as you said i have downloaded the the 5.11 firmware through "xperifirm" but in the folder there are too many files, i do not know what to do now, as far as i know FTF file is flashable.

you can see my screenshot in the given link
[Xperia Z5 Compact General] --jenana--:
That worked well ;)

It gave me the opportunity to test what I said that could be Nagelo's problem. I experienced the same problems in some apps: root is enabled, but some programs couldn't write to the /system partition. I solved it by doing exactly what I advised earlier:

- copy content from /su/bin/ to /system/xbin/

- grant permission with my file explorer. I used ES File Explorer, but other programs are fine of course.

---------- Post added at 10:06 ---------- Previous post was at 09:52 ----------

In your screenshot, that's the folder with the firmware files. That's what you get after step 3. Now you go to step 4, and create a tft-file out of this.

Result: folder with too many files will be bundled in one flashable tft-file.
[Xperia Z5 Compact General] marcell222:
Hi

After step 2 connected phone to charger and it powered on. Just set debuging and dev option and powered of. Can I prossed to step 4 or should do something else?
[Xperia Z5 Compact General] pelago:
Many thanks for the guide. You might want to mention in Steps 6 and 9 that Xposed doesn't work on Nougat.

Has anyone written a guide as easy to follow as this one for upgrading firmware once already rooted? Is there anything like FlashFire (which I use successful on my Nexus 7) which works on the Z5C, which does the upgrading on the device, keeping root?
[Xperia Z5 Compact General] a2zonlyt:
i have selected the source folder, as the description says "You should see your device name appear automatically in Device and the folder list below populated" but there is no appearance of automatically device?

am i do something wrong?
[Xperia Z5 Compact General] Jhonbennet:
okay thanks, but when i downloaded the firmware from Xpirifirm the downloaded folder is "E5823_Customized AU_1298-7260_32.2.A.5.11_R6C" inside this folder there are a lot of files and another folder named "boot" if i select "E5823_Customized AU_1298-7260_32.2.A.5.11_R6C" as a source folder, then how can boot folder be selected?
[Xperia Z5 Compact General] marcell222:
Hallo again

Step 8 - Flash the kernel. We should be in rootkernel folder

For somone loking for help with drivers problems(windows7,after new install) how I did it

1 Install adb-setup-1.4.3 . 2 or 3 times yes, install driver No

2 Install flashtool 0.9.23.1 dont forget replace x10flasher.jar in folder C/FlashTool after instalation.

3 In folder FlashTool/drivers run and install 1 Flashmode Drivers 2 Fastboot Drivers 3 Xperia Z5 Compact Device Driver

That what helped me solve problems with drivers

Big thanks to mhaha
[Xperia Z5 Compact General] --jenana--:
Ok, so then you go to Flashtool > Tools > Bundles > Create and then you select that folder "E5823_Customized AU_1298-7260_32.2.A.5.11_R6C". And then you follow the rest of the guide. It's all explained in step 4. It's like magic. You select the source folder, so that program knows where to look for the files, you select everything in that window, and after a few seconds you end up with only one tft-file.

You can also double click the grey area next to "device". It will give you the right device automatically (after you selected the source folder) or it gives you a list where you can manually select Sony Xperia Z5 Compact > E5823.

Please, just follow the guide. It literally says (a few lines earlier) "Open command prompt and navigate to the rootkernel directory". So yes, you should be in the rootkernel directory because that's where the boot.img is.
[Xperia Z5 Compact General] a2zonlyt:
would you please tell me how much time it took to create a FTF file, because I've started the bundle creation process now it is almost 1 hour past but it is stuck at the point you can see in attachment.
[Xperia Z5 Compact General] marcell222:
For sure too long.For me maybe ~10 min. You can always cancel and try to start again
[Xperia Z5 Compact General] --jenana--:
Download firmware + create tft (+ drink coffee) + make kernel: 13 minutes 45 seconds ;)
[Xperia Z5 Compact General] a2zonlyt:
what if you upload the created FTF to any cloud so i can directly download it from, instead of creating my own bundle, I've tried several but no luck , i am sick of this thing but badly want to get root :(:(:(:(:(:(:(:(:(
[Xperia Z5 Compact General] --jenana--:
Sorry, that's a 2.7GB file, I'm not gonna upload that.

You're on an old version of FlashTool.

From changelog last version -->> 0.9.23.2

Fixed a bug preventing from creating FTF bundles

So you should update FlashTool before you try again ;)
[Xperia Z5 Compact General] a2zonlyt:
Come on man, now i am at latest version....:crying::crying::crying::crying::crying:
[Xperia Z5 Compact General] mhaha:
Hi, can I assume that you've solved your problem?
[Xperia Z5 Compact General] mhaha:
That is a good suggestion, I will amend the guide.

Once you've rooted and want to upgrade firmware, the steps are actually similar to what is described in this guide, the concept is the same: flash new firmware, and patch the kernel.

Tips for upgrading:

Start from step 0, and in addition make a nandroid backup in TWRP just in case something goes wrong.

To do so, boot into recovery (turn off phone, power on, during boot on Sony screen wait for LED to light yellow and press VOL UP once, the LED should turn orange indicating success) tap Backup and select Boot, Data, System partitions to backup.

Skip steps 1~2

In step 5, skip this instruction: Under Wipe/Sin check all options (APPS_LOG, DIAG, SSD, USERDATA), leave all other options unchecked.

Every checkbox should be unchecked.

This preserves your data (known as a "dirty flash"), it will be just like a normal OTA update. However, it's generally recommended to do a clean flash when upgrading to a different OS version, such as MM -> N.

Skip step 7
[Xperia Z5 Compact General] marcell222:
Hi Yes after step2 phone was accidentally powered on. Had to go through android introduction and set again: Developer options and USB debugging.

After that step 5 and everything flahed correctly.

My phone is now rooted :)

Thank you for your attention.
[Xperia Z5 Compact General] torben5247:
My phone is overheating.

I flashed the E5823_Customized NOBA_1298-7782_32.3.A.0.378_R3D and repacked the boot.img using rootkernel v5.23.

I have tried with and without flashing super su, and with and without kcal.

It does not make any differences hot phone and battery drain.

Anyone got the same experience?

edit: i did not restore the ta partition as described in the tutorial, but i don´t think that will do any difference
[Xperia Z5 Compact General] a2zonlyt:
i am stuck at step 6, in second line it says "extract kernel.sin from FTF".. i looked all the file i have downloaded but it does not make any sense i am unable to find kernel.sin or am i doing wrong? tell me if i am wrong.
[Xperia Z5 Compact General] mhaha:
You're doing it wrong. You're supposed to find this file from the ftf file you created from step 5. See attachment.
[Xperia Z5 Compact General] ninestarkoko:
I would just underline in bold text that unlocking the bootloader wipes also your music and photos. People might think that it is referred only to internal "not visible" memory (apps, passwords,..) Otherwise, great updated guide for the recent events.