yashsingh1/xdaforums huggingface dataset:
[Xperia Z5 Compact General] Faz196:
good news

thanks for your help. very good tutorial, realy made easy to understand

successfully rooted my nougat z5c with this,

you the best thanks
[Xperia Z5 Compact General] Malcolm143:
Hi Brokich,

Unfortunately not (yet).

After finishing step 7 my device is stuck at the bootloader :(

I've tried now several times re-flashing (steps 5-7) but unfortunately no luck yet...Will try to repeat the whole procedure over the next days again.
[Xperia Z5 Compact General] notabene:
I am getting problem with flashing kernel :

FAILED (remote: Command not allowed) my bootloader status was unknown at first, then I got unlock code at sony website, then it said my bootloader is unlocked, followed your tutorial and now I not able to flash kernel.. :(
[Xperia Z5 Compact General] Major00101:
Hello guys

On step 5 i get this error

5/031/2017 13:31:03 - INFO - Device connected in flash mode

05/031/2017 13:31:28 - INFO - Selected Bundle for Sony Xperia Z5 Compact(E5823). FW release : 1298-5497_32.2.A.5.11_R13C. Customization : Customized UK

05/031/2017 13:31:28 - INFO - Preparing files for flashing

05/033/2017 13:33:12 - INFO - Please connect your device into flashmode.

05/033/2017 13:33:13 - INFO - Opening device for R/W

05/033/2017 13:33:14 - INFO - Start Flashing

05/033/2017 13:33:14 - INFO - Processing loader.sin

05/033/2017 13:33:14 - INFO - Checking header

05/033/2017 13:33:14 - ERROR - Processing of loader.sin finished with errors.

05/033/2017 13:33:14 - INFO - Ending flash session

05/033/2017 13:33:14 - ERROR - null

05/033/2017 13:33:14 - ERROR - Error flashing. Aborted

05/033/2017 13:33:14 - INFO - Device connected in flash mode

Any idea why ?
[Xperia Z5 Compact General] zegovernator:
Did you backup your TA-partition before the bootloader status was unknown?
[Xperia Z5 Compact General] notabene:
Yes, why?

---------- Post added at 01:13 PM ---------- Previous post was at 12:49 PM ----------

I was able to flash FTF file. But not the kernel.
[Xperia Z5 Compact General] zegovernator:
Okay. It sounds like you wiped your TA partition. On which firmware did you backup your TA? Lollipop using Iovy.root or Marshmallow using this guide? I experienced the same problem once. I recovered my TA partition via Iovy.root. (because back then the only possibility was to downgrade to LP and then backup/restore TA).

Check if the service menue states:

[Bootloader unlock allowed:no] and [Remote Lock State: Locked]

If so, restore TA.
[Xperia Z5 Compact General] notabene:
This guide, latest firmware 32.2.A.5.11.

Currently my phone stucked at after boot in TM logo.

Trying to repair via PC Companion

Phone booted. Will check if bootloader is really unlocked.

Bootloader unlock allowed : yes

Remote Lock state : UnLockd

Checked DRM all OK
[Xperia Z5 Compact General] zegovernator:
Flash a .tft from the MM version your backed up your TA image from. When flashing, ensure to tick everything under wipe except TA Misc.
[Xperia Z5 Compact General] notabene:
Well finally was able to do all the steps, but phone wont boot. Stucked in Sony logo, led is yellow and then power off..
[Xperia Z5 Compact General] Malcolm143:
Yeah, same here.

Tried now multiple times but it always gets stuck at the xperia screen with orange/yellow LED :(

One thing that I noticed was "ERROR - root : this bundle is not valid" when I start to create the bundle. Straight after locating the custom firmware that I dowloaded with Xperifirm the message comes up in the log. Thought that this is not an issue though, or is it?

Cheers,

Malcolm
[Xperia Z5 Compact General] notabene:
Need to use phone tomorrow, how can i revert to stock for a while since I cannot do it throught Xperia companion?

---------- Post added at 03:37 PM ---------- Previous post was at 03:26 PM ----------

Did you use customized firmware? I did not, i used Tmobile CZ

Now with bootloader unlocked even PC Companion doesnt work..

So the problem is after flashing custom kernel with rootkernel+DRM fix.

So after hours of trying from step 5 with different settings for kernel, I ended up with stock rom flashed via flashtool..

tried to flash back DRM keys from Dirty cow TA Backup, using this command flash_dk TA_E5823.img DK.ftf but when rebooted in service menu drm keys are still gone.. :(

EDIT:

Seems like there is more users with same issue with Z5C and latest rootkernel

https://xdaforums.com/xperia-z5/development/root-automatic-repack-stock-kernel-dm-t3301605/page200
[Xperia Z5 Compact General] mhaha:
Hmm, I never ran into the stuck at boot problem, and I just successfully flashed a new phone on the same day I posted the guide. That said, I was using v5.0 of the rootkernel tool, not the latest v5.11. The rootkernel developer mentioned that there's battery drain problems with v5.11, so I decided to use the older v5.0 that helped me root two Z5C's several times in the past. Try patching the kernel again using v5.0 and see if that fixes it.

Note that v5.0 only supports up to firmware version 32.A.0.253 out of the box, you will need to make the following modification to support up to 32.2.A.5.11:

Download and unzip rootkernel v5.11 and v5.0.

Open folder \rootkernel_v5.11_Windows_Linux\Android\twrp_common_kmodules

Copy and overwrite all 7 sub-folders (folder names look like 3.10.49-perf-g83fc9bc etc.) to \rootkernel_v5.0_Windows_Linux\Android\twrp_common_kmodules

Then patch the kernel using v5.0 tool.
[Xperia Z5 Compact General] notabene:
Thanks, will try in the evening.
[Xperia Z5 Compact General] Rufo3:
Just to know, if I'm upgrading from previous firmware version, do I have to do all steps or I can start from step 4 (flashing ftf file)?
[Xperia Z5 Compact General] NeoBeum:
I found one of my posts a while back that shows a bug with unlocking and locking bootloader

https://xdaforums.com/attachment.php?attachmentid=4099321&d=1491209962

If the flags aren't visually matching what the device has written in the start of the TA, it will cause errors,

if it's marked as unlocked, but unable to be toggled, you're in the limbo state, and need to correct the flags

---------- Post added at 16:38 ---------- Previous post was at 16:33 ----------

Hey, [MENTION=5722545]mhaha[/MENTION] , you can add to your guide an option to get recovery to the Recovery partition using this: https://xdaforums.com/showpost.php?p=72358526

I didn't write a step-by-step as your guide is the same process.
[Xperia Z5 Compact General] mhaha:
I'd love to include your work in the guide as an alternative method, but

1. The current guide as is still "works"

2. Generally, I'm not comfortable with giving out advice on things I haven't personally tried before. Your development is very recent, and at the moment I don't have the time or means to test it out and see how it can be adapted to compliment the guide.

So, I'm sorry that I must respectfully decline updating the guide for now.

I do encourage anyone with the capacity and motivation to head on over and try it out for yourself.

And as always, thank you NeoBeum for contributing and giving back to the community. Your remark about making a GUI to simplify/combine rooting processes sounds promising and time/pain-saving. If it does come to fruition, could be a game changer for rooting the Z5C (and Z5 series I guess?). Looking forward to its development!
[Xperia Z5 Compact General] mhaha:
Interesting, how do you correct said flags?
[Xperia Z5 Compact General] NeoBeum:
You need to lock, unlock (Ftool), relock (Ftool), and then go back and use Official Sony method to unlock

If you used Flashtool before Androxyde fixed the TA section - it's very dangerous.

I'd only advise users with sufficient knowledge to try and rectify anything using the automated BLU for earlier versions. I wiped my IMEI fault finding this bug.

It's recoverable if you have your DK. I worked with hardware before I started studying software, so I'm fairly comfortable with NVRAM and other Hardware stuff. But still new to Software programming and Android.

edit: I forgot to add, this also causes issues when updating major versions of droid. Lollipop to Marshmallow or MM to Nougat. This is because, when the device boots to the new OS, it disables Developers options, Enabling Dev Options to look at the menu will show the flag in the correct state, however, if you disable dev options, you will see the flag for unlocking toggle to Off, and then the menu option for it grey out and become unselectable again. This is one of the reasons for overheating. I never suffered any heat problems with SU because I was able to correct the problem. I now have a script to open dev options without actually displaying it in the main settings menu.

also note that when you go in to the limbo state, where the device thinks that it is locked, but you have customised, you will be able to connect to xperia companion.
[Xperia Z5 Compact General] netaccs:
May be I made some mistake while writing here. I was trying to say that first time I use Supersu-XXXX.zip.

After that I have no root. So I run rootkernel again this time withous supersu, I used the second way phh superuser.

In tutorial says that if I use phh after all completed I need to install the apk from play store.

Yes I am using Nougat and can't understand what I should do to have twrp.

I look in xda for rootkernel it says that is supported and integrated.

I will try again to make clean flash, ftf new extraction of kernels, new run of rootkernel,

without step7 drm keys, flash the kernel after all completes will install phh superuser from playstore.
[Xperia Z5 Compact General] freexta:
thank you, figured it out myself after a while with being able to flash stock fw.

here are the screenshots of my dev settings (305) loaded right now:

ht tp://imgur. com/a/GFLFv

(remove space between ht tp and . com)

sorry couldn't rearrange them due to posting on my tablet (OEM settings at the bottom)

so there's a bug in this sounds great maybe I can try stuff out for you? really want to root it and i don't worry too much about bricking it
[Xperia Z5 Compact General] NeoBeum:
The flags are ok

Can you screenshot your Security Test

Dial:

*#*#SERVICE#*#*

Go to Service Tests > Security

and then

Service Info > Software Info

Service Info > Configuration
[Xperia Z5 Compact General] mhaha:
What firmware version are you trying to root? 32.3.A.2.33?

Does your rootkernel log look like this?

If so, about TWRP integration, see this rootkernel page, some relevant discussion going on.

The reason this is necessary is because the last official rootkernel version 5.23 was released when the latest Nougat firmware is 32.3.A.0.376. Newer firmware isn't supported "out of the box" unfortunately. Thankfully, all that's required is a quick modification as described in the linked discussions above to fix.

Your conclusion for going forward with a new attempt at rooting using phh's superuser sounds about right. Wish things work out for you.
[Xperia Z5 Compact General] freexta:
sure. here we go (again sorry for the disorder of the screenshots):

ht tp://imgur. com/a/3S0fE
[Xperia Z5 Compact General] NeoBeum:
I shouldve asked for this one too

Service Menu » Service Info » SIM Lock

The first few on the list should read 0 to indicate the carrier hasn't locked the device,

Everything else is good, and you should go find a Lollipop FTF because you can back-up your TA because it looks like everything is intact.

I'm uploading the Australian Lollipop FTF for another , I'll link it when it's done

---------- Post added at 01:38 ---------- Previous post was at 01:28 ----------

If you wanted Recovery in the Recovery partition, you could also try my build as an option
[Xperia Z5 Compact General] freexta:
yeah I think the simlock state is fine, here's the shot (Italian fw loaded): ht tp://imgur. com/a/snLYj

sounds good, what's the TA backup for?

edit: I see, all the important information is stored in that ta partition. so it's good for "unbricking" and generally backup/restore of genuine information. could it also help in unlocking the bootloader though?
[Xperia Z5 Compact General] netaccs:
Run Flashtool. Inside it click xperiafirm and download Version: 32.3.A.2.33 / R2D

Flashtool convert it to FTF. Should I manualy download via xperifirm and

creating FTF as is in step 4 or leave it that way ?

Flash the FTF. Wipe all (apps_log, diag, persist, ssd,userdata )

+ MISC-TA options Cust-reset, master-reset, reset-wipe-reason or without them ?

Extract kernel.sin from TFT using Winrar.

rootkernel:

rootkernel kernel.elf boot.img

Rootkernel V5.23

- Unpacking kernel

Found elf boot image

Kernel version: 3.10.84-perf-g1016077

Found appended DTB

- Detected vendor: somc (Sony), device: suzuran (Xperia Z5 compact), variant: row

- Unpacking initramfs

- Detected platform: 64-bit

- Detected Android version: 7.0

- dm-verity is enabled. Disable? (Say yes if you modify /system) [Y/n] Y

Disabling dm-verity

- Sony RIC is enabled. Disable? [Y/n] Y

Disabling Sony RIC

- Skipping TWRP recovery. No kernel modules for 3.10.84-perf-g1016077 available

I have them placed in to the rootkernel folder, also in 3.10.84-perf-g1016077 folder.

- Install DRM fix? [Y/n] Y

- Install busybox? [Y/n] N

- Creating new initramfs

- Creating boot image

- Cleaning up

Done

flash_dk TA_E5823.img DK.ftf

Flash with Flashtool selecting DK.ftf

Flash the kernel via fastboot (volume up and plug to usb)

fastboot flash boot boot.img

Power on the phone for first time

Quick setup, Install Phh superuser from market, reboot the phone.

The phone still not rooted.

Re patch the kernel again with phh.

Still no root.

Make new boot.img with supersu 2.82

rootkernel kernel.elf boot.img

Rootkernel V5.23

- Unpacking kernel

Found elf boot image

Kernel version: 3.10.84-perf-g1016077

Found appended DTB

- Detected vendor: somc (Sony), device: suzuran (Xperia Z5 compact), variant: row

- Unpacking initramfs

- Detected platform: 64-bit

- Detected Android version: 7.0

- dm-verity is enabled. Disable? (Say yes if you modify /system) [Y/n] Y

Disabling dm-verity

- Sony RIC is enabled. Disable? [Y/n] Y

Disabling Sony RIC

- Skipping TWRP recovery. No kernel modules for 3.10.84-perf-g1016077 available

- Found SuperSU-v2.82-20170528234214.zip. Install? [Y/n] Y

Adding service entry for SuperSU

- Install DRM fix? [Y/n] Y

- Install busybox? [Y/n] N

- Creating new initramfs

- Creating boot image

- Cleaning up

Done

then flash boot.img

fastboot flash boot boot.img

target reported max download size of 536870912 bytes

sending 'boot' (17512 KB)...

OKAY [ 0.605s]

writing 'boot'...

OKAY [ 0.334s]

finished. total time: 0.945s

When poweron the phone there is SuperSu icon.

Grant access to adaway but it says "disabled"when I start it.

Grant access es file explorer, but when I restore apps, the cached data is not restored.

pp I try CE1 FTF - same result. Obviously I make huge mistake somewhere :/

This is the first phone I was unable to root :/
[Xperia Z5 Compact General] fedecasaux:
Fingerprint problem

Hi! thaks for this but i have a problem. I made all this steps and i falsh the E5803_32.3.A.2.33_1298-3109_R5D USA version of firmaware. Then i restore the DRM keys and i Flash the boot image. But no i don´t have the option to use the fingerprint security add. How can i solve this?

Thanks in advance

Federico
[Xperia Z5 Compact General] mhaha:
That's not a bug, it's a feature. :D

Solve this by flashing non-US firmware.

EDIT: Or check this thread.
[Xperia Z5 Compact General] a2zonlyt:
few months ago i have rooted my phone via the method and choose to stay on MM Rom , now i want to update it to 7.0 Rom,

please guide me how can i update it, the reason of asking because i do not want to mess with my bravia engine which is working fine as i backup and restored my DRM keys.

I know xposed will not work on 7.0 Rom but i want to update it please help me.
[Xperia Z5 Compact General] mhaha:
Please see first bullet point in prerequisite of the guide, namely the blue text portion.
[Xperia Z5 Compact General] pedrosvk:
Thank you, your method worked.

I dont understand why still after downgrading from android 7 to android 6 none of the one click rooters worked (one click rooter asked money, kingo root fails, iroot fails, wondershare fails...)

If I install any updates now, will I lose root access?
[Xperia Z5 Compact General] NeoBeum:
because of the sec policy. that's what a big part of updates are.

and yes, if you upgrade to 7.1.1, you will lose superuser.
[Xperia Z5 Compact General] a2zonlyt:
i have downloaded the firmware E5823_32.3.A.0.378 middle east through this link

https://mega.nz/#!toxzUS5J!cBDTHlL5jA43dQHuJNzwhoXnMtas6AQ6qClb3vtZ50g

is this possible to directly flash the this rom instead of downloading through xperifirm?

and is this rom is rootable?

note: let me know you that i am currently on MM rooted via your given method and i followed all the steps.

i just need to make sure that i am on a right track.
[Xperia Z5 Compact General] NeoBeum:
almost everything is able to get root access, but a marshmallow to nougat upgrade will have conflicts for fstab in the built-in twrp with rootkernel
[Xperia Z5 Compact General] a2zonlyt:
you said flashing the DRM key is one time process but now i flashed the the 6.0.1 again via flashtool, i skip the step 7, and now my bravia engine is not working, help me please what could i do now, is there any solution to bring it back?
[Xperia Z5 Compact General] mhaha:
Have you checked the service menu first?

https://xdaforums.com/showpost.php?p=71482754&postcount=99
[Xperia Z5 Compact General] a2zonlyt:
Yes my DRM keys were working perfectly before, first 3 lines were "[key ok][active].

Let me know you i tried to restore TA partition with the given steps as i have a backup of it, and my DRM keys are working again, but now i do not want to root the phone can i skip the step 6 and step 8,

Is this possible to flash the DK.ftf without flashing the patched kernal?

And please assure me that as long as i have a backup of my TA partition, can i restore it again and again or it is dangerous to fo that , because in my phone it does not seems one time process. :(
[Xperia Z5 Compact General] a2zonlyt:
now i am flashing 7.1.1 rom when i tried to path it , it stuk on "install DRM fix"

as you can see in the picture

help m
[Xperia Z5 Compact General] mhaha:
Sorry, I never ran into the problems you described, and I'm not a developer, so not much I can do to help you...

I did not bother to root (yet) after flashing Android 7.1.1, so I do not know what obstacles you might run into.

The basic concepts of the guide still stands, but you may need some additional tuning with the rootkernel tool to work properly.

I did notice that you're using v5.0, maybe patch again using the newest version?

Since you're experiencing problems related to the rootkernel tool, I suggest you ask in the rootkernel thread instead.

There are many knowledgeable folks there, maybe somebody knows why you've hanged at applying the DRM-fix to the kernel and provide assistance.

Android 7.1.1. was not available at the time this guide was written, and the rootkernel developer has not updated the tool since the same time, so it may be something incompatible with the tool and newer Android versions.

I know that some devs created their own modified rootkernel tool for later Android versions, so maybe you should check it out.

And yes, as long as you backed up your DRM keys before you unlocked your bootloader, it is always possible to restore it to full stock state with keys intact. Don't worry.
[Xperia Z5 Compact General] maciek12:
Hello guys, i have rooted my phone, installed 7.1.1 android nougat and phh's superuser but i cant get Hellium working(an app for making app backups). My phone keeps waiting for Hellium Desktop application althought on PC the Hellium app shows it has been enabled. Do you know what can cause this?

EDIT:

I installed Titanium Backup and it doesnt detect root. I also dont get any superuser prompt to allow.
[Xperia Z5 Compact General] NeoBeum:
I have no idea why I would bother adding all of that to complement my guide, when you've done it here, and there are plenty of other threads with equally good material. I'm quoting this in mine because god knows why

---------- Post added at 21:36 ---------- Previous post was at 21:33 ----------
[Xperia Z5 Compact General] a2zonlyt:
(sorry for out of topic) (sorry for out of topic)

my bravia engine working fine in images but not on video i could not fine any post to resolve it, would you please help me?

(sorry for out of topic)(sorry for out of topic)
[Xperia Z5 Compact General] interestor:
All went well after hours of research and problem solving. The Sony instructions are confusingly written, I wish OP mhaha had written the guide for Sony.

Extracting my TA partition went smoothly, resulting in the exclamation:

Pulling image

Cleaning up

TA Successfully pulled to TA_E5823_CB5A28EXVM_Tue0808-20170.img

Press any key to continue . . .

I continued on until Step 7 flash DRM keys. Then I discovered that the command window had lied to me, the TA img was not successfully pulled! This is seriously heavy, this is the whole point, to preserve camera functionality.

When I finished crying, I went on to Step 8 and flashed the kernel.

Researching how to get some other DRM keys, the forum posts tend to point back to the rootkernel thread. I need to know, does this kernel tool return the functionally of the DRM keys? Maybe not my own original keys in the phone, but does this keep the camera working well? I do see that have the X-Reality on my display.
[Xperia Z5 Compact General] interestor:
I can answer that.

Yes.
[Xperia Z5 Compact General] mhaha:
Sorry, like you said, it's off topic, and I don't know why or how to resolve.

Please start a new thread in the Z5C help subforum, at the very least your issue will have better visibility, and maybe someone will see it and help you.
[Xperia Z5 Compact General] mhaha:
I did include a note in Step 1 to check the file size of TA_E5823.img. I'm sorry you missed it.

To prevent more unfortunate occurrences, I've edited the guide to enhance the note, should be harder to miss now.
[Xperia Z5 Compact General] interestor:
I appreciate your concern Mhaha. I did see the note of file size when I followed the instructions, but when the command returned “success” I thought that was right. Your enhanced warning is an improvement.
[Xperia Z5 Compact General] tt-bert:
Problem with restoring DRM keys

Post can be deleted
[Xperia Z5 Compact General] PhobiaSoft:
Followed the guide easily and effectively, great job [MENTION=5722545]mhaha[/MENTION]! Now that I have the ROM debloated and themed the way I want, its very important to me that I become unrooted to pass the Safety Net Check. Can anyone give me advice on how to unroot after completing this process?

EDIT: Switched to Magisk from SuperSU, and no longer had to unroot to pass Safetynet. Might want to include that bit of information in the guide to help others. More and more apps are incorporating SafetyNet checks into themselves, and if passing those checks is as simple as installing a Magisk zip instead of a SuperSu zip, people should be aware the option exists. Magisk can be downloaded from this thread, and the installation is as simple as skipping the optional SuperSu installation in RootKernel, and then installing the Magisk zip file afterward through TWRP. I also found that disabling Sony RIC and installing Busybox each tripped the SafetyNet check, so you might want to avoid those as well.
[Xperia Z5 Compact General] NeoBeum:
Almost all superuser flavours are interchangeable with each other, as are recoveries with proper build signatures.

That is why you can use the same process as most guides here as a reference, and use what ever Recovery and superuser app you like.

This was the rationale for argument in my thread, there was no need for me to regurgitate material that's been written plenty of times before.

You can get busybox and have RIC enabled with Magisk and still pass CTS. Fyi
[Xperia Z5 Compact General] sheraro:
congrats for the new device, hope we'll see more tutorials from you in XZ1 compact threads (when root + drm comes), hoped that you could update the op a last time with new xposed for nougat + magisk procedure, thanks again !