yashsingh1/xdaforums huggingface dataset:
[Xperia Z5 Android Development] tobias.waldvogel:
That looks all right. I have the same device. I don't think this is kernel related then. Did you ever modify some of the .prop files or any /system files?

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] ahasae:
no i didn't

just i have xposed and some module

i try the aur v3 kernel and and everything works again the ( dual sim )
[Xperia Z5 Android Development] ccathcart:
"no image for model suzuran"/"unsupported/untested for model suzuran

Hi. I followed the tutorial at twigstechtips.blogspot.com step by step (except that I didn't downgrade because my phone came with Lollypop and I hadn't upgraded yet). It's rooted now, but DRM functionality is gone and TWRP is missing. I assume this is because when I used rootkernel I got the following error messages:

"Skipping TWRP integration. No image for model suzuran"

and

"Skipping drmfix. Unsupported/untested for model suzuran"

I'm confused because I thought "model suzuran" was the Z5C which this thread is about. Could you please tell me what I am missing?
[Xperia Z5 Android Development] tobias.waldvogel:
You are right. In order to avoid problems on untested devices I added a model verification in the last version, but I forgot to add suzuran and satzuki as well. I will a provide an update this evening. My apologies.
[Xperia Z5 Android Development] tobias.waldvogel:
So far I don't have explanation for this. I have an E6683 myself and never faced such an issue. I'm running MM 185.
[Xperia Z5 Android Development] lionelbac:
Anybody has tested it on MM .185? It get stucked on disabling dm-verity with the v4.3
[Xperia Z5 Android Development] ccathcart:
Oh thank goodness there was a simple explanation. This was driving me crazy. Thanks for all your help and work!
[Xperia Z5 Android Development] tobias.waldvogel:
Please try version V4.31. This should add TWRP and drmfix again for the Z5C and the Z5P as well.
[Xperia Z5 Android Development] ccathcart:
Thank you so much! It's all working now.

Btw, I flashed the device key I had formerly extracted again, as per the last step of twig's tutorial. I feel like both times a different unit was specified by Flashtool. I apologize if this is a stupid question, but do I now have the device key written in two different TA partitions of my phone?
[Xperia Z5 Android Development] Duvel999:
can't generate the device key

flash_dk <TA backup> DK.ftf ends up in error cant find the given file?

everything is in the folder..

any advice or a step for step tutorial

I got a patched kernel with supersu & twrp;)
[Xperia Z5 Android Development] tobias.waldvogel:
It is always the same unit. If you look at the code of flash.sh you can that it is creating a flash file for unit 0x7EC ;) You can also easily check the generated file. Ftf files are just zip files. You can open it with any zip packer.
[Xperia Z5 Android Development] tobias.waldvogel:
I'm afraid I need a little bit more precise information to help you. Could you paste the whole output of running the script? (As text please, not as graphic ;) )
[Xperia Z5 Android Development] Duvel999:
Just a question;

Everything works well on my rooted 6653 MM.

But how to reactivate my original device key with the code?

flash_dk DK.ftf or flash_dk TA-####.img restore-drm-keys.ftf

I got in the Rootkernel folder all files like Kernel elf, Patched kernel elf, Supersu V2.65 and my TA backup.

Do I need to move some files?

Rename in the code flash_dk TA-####.img restore-drm-keys.ftf my TA backup code?

But I get a error to make the "restore-drm-keys.ftf". file.

I am on windows 10.

Oké, Will copy the output[emoji6]

Sent from my E6653

---------- Post added at 10:26 PM ---------- Previous post was at 09:40 PM ----------

@ Tobias,

this is the output.

C:\Users\....\Downloads\Xperia Z5\rootkernel_v4.24_Windows_Linux>flash_dk <TA backup> DK.ftf

System cannot find the supported file.

C:\Users\....\Downloads\Xperia Z5\rootkernel_v4.24_Windows_Linux>
[Xperia Z5 Android Development] bleh815:
Patched CM13 kernel

Hi, thank you very much for providing us with this wonderful work! I've successfully patched a stock .158 kernel on my own and got my backed up DRM keys working just like a charm.

So i went on and tried to patch unofficial CM13 kernel with drmonly.sh but unfortunatly the result doesn't boot.

I'd be glad to provide further details thus i don't know what's helpful for you.

Update: what actually did not work was trying to fastboot boot cm13_patched.img but when i was curious enought to actually flash that beast it booted all fine. So i've tested in reverse and even fastboot boot cm13_untouched.img did not boot either. Obviously there's plenty of things i just didn't understand properly.
[Xperia Z5 Android Development] tobias.waldvogel:
I dont't think that CM includes the propietary Sony apps and drivers. So it doesn't make any sense to use this with CM, I'm afraid.

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] bleh815:
Oh, i hoped it would give me "better" camera results with DRM keys restored, not? Comming from z1 compact (with no drm keys backed up) i had quite a bad camera experience there.

Maybe my preserved keys and your nice wrapper lib would help any of these backported cameras (e.g. this) to achive HQ pics?
[Xperia Z5 Android Development] tobias.waldvogel:
I really doubt that. The whole trustzone apps are vendor specific. It would be extremely difficult to port this. Anyway Sony is delivering current Android releases, so I don't see any reason to use CM for now.

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] Joeisgood99:
Hey [MENTION=357342]tobias.waldvogel[/MENTION]

Thanks for your hard work!

I started yesterday to make a suzuran specific option for your tool but I check your post today and you v already released another version that includes Z5C! THANKS!!

Anyway I get this error when running your script (v4. 3.1) in ubuntu 14.04, on latest stock kernel from experifirm.

:~/Desktop/rootkernel__v4.3.1_windows_linux$ ./rootkernel.sh kernel.elf newboot.img

./rootkernel.sh: 6: [: /bin/ls: unexpected operator

-e - Unpacking kernel

-e Found elf boot image

./rootkernel.sh: 20: ./rootkernel.sh: dwc3_msm.prop_chg_detect: bad variable name

./rootkernel.sh: 165: local: 10: bad variable name

./rootkernel.sh: 165: ./rootkernel.sh: dwc3_msm.prop_chg_detect: bad variable name

-e Kernel version:

-e Found appended DTB

./rootkernel.sh: 80: local: Suzuran-ROW": bad variable name

./rootkernel.sh: 80: ./rootkernel.sh: dwc3_msm.prop_chg_detect: bad variable name

:~/Desktop/rootkernel__v4.3.1_windows_linux$

I got the same error when running v4. 3 that I modded for z5c. both times the error was from lines within unpack_kernel() function.

This is the command I use when packing boot image with zimage that makes reference to driver dwc3_msm.prop_chg_detect.

mkbootimg --cmdline "androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 boot_cpus=0-5 dwc3_msm.prop_chg_detect=Y coherent_pool=2M dwc3_msm.hvdcp_max_current=1500 enforcing=0" --base 0x00000000 --kernel arch/arm64/boot/Image.gz-dtb --ramdisk ../final_files/ramdiskE5823.cpio.gz --ramdisk_offset 0x02000000 --pagesize 4096 -o ../final_files/boot_E5823.img --tags_offset 0x01E00000

However your just changing ramdisk so not sure why this driver is causing an issue.

I have no idea what causes

local: 10: bad variable name

or

Suzuran-ROW": bad variable name

Any other z5c users have this issue?

Thanks again!
[Xperia Z5 Android Development] tobias.waldvogel:
Loooking at your output it might be the shell you are using. This is meant to be run with bash (or busybox ash).
[Xperia Z5 Android Development] Joeisgood99:
Thanks for the quick reply!

Thought I was using bash (mainly coz of the #!/bin/sh at the top of your script.)

When I check I get this output.

HOME@user:~$ echo $0
bash
HOME@user:~$

Thanks for prompting me to check but now Im sure its bash. What else could cause this??!
[Xperia Z5 Android Development] tobias.waldvogel:
Actually it is run with /bin/sh. And the "-e" doesn't look like bash as bash has the -e option for echo. Try to run it with explicitely with bash:

bash rootkernel.sh .....
[Xperia Z5 Android Development] Joeisgood99:
You

Are

THE

MAN

:~/Desktop/rootkernel__v4.3.1_windows_linux$ bash ./rootkernel.sh kernel.elf newboot.img

- Unpacking kernel

Found elf boot image

Kernel version: 3.10.84

Found appended DTB

- Detected vendor: somc (Sony), device: suzuran (Z5C), variant: row

- Unpacking initramfs

- Detected platform: 64-bit

- Detected Android version: 6.0

- Disabling dm-verity

- Disabling SONY RIC

- Installing TWRP

- Configuring keyprovd

- Configuring credmgrd

- Configuring secd

- Configuring wvkbd

- Configuring drmserver

- Creating new initramfs

- Creating boot image

- Cleaning up

Done

Thanks!!! I think that has solved several of my life’s problems.

Ill edit this post to let you know if it boots.

EDIT: This tool works fine on ubunto (provided you use bash) ukernel

Boots fine and boots in to TWRP, volume up to internal recovery works, volume down boot fotakernel just freezes at yellow led..

Rooted after first boot with SU 2.71, couldn’t root with SU 2.67.
[Xperia Z5 Android Development] alexchia:
Hi Tobias !

v4.31 doing well over here with LP (E6883_32.0.A.6.209) and MM (E6883_32.1.A.1.185) via Windows 7.

Thank You very much !
[Xperia Z5 Android Development] RyTekk:
<TA backup> is the name of your TA backup, not to do type <TA backup> in command, and you must have TA backup file in the same folder or you would point to its direction manually.
[Xperia Z5 Android Development] Soheil_rf:
[MENTION=357342]tobias.waldvogel[/MENTION]

I try all of version on my Z5 Dual MM 185

Every thing like recovery, root, DRM,. . . works good, but sometimes after restart my phone hanging on end of bootanimation after that screen turn to black and blink red notification

How can i fix it?

Is this relatet to xposed framework?

Is any one had this problem?
[Xperia Z5 Android Development] Duvel999:
:D

Thx. RyTekk:good::laugh:

Found the right code after some testing.

flash_dk <TA backup> DK.ftf needs to be edited as your

flash_dk TA_XXXXXXXX.img DK.ftf

,then you get your DK key (1 KB / 500 bytes)

like for example flash_dk TA-15042016.img DK.ftf
[Xperia Z5 Android Development] tobias.waldvogel:
I have the same deivce (E6683) with MM185 with SuperSU and xposed installed. I never had such an issue so far. May be it is related to a particular xposed module? I have only the HideSimIcons and another module written by me so far.
[Xperia Z5 Android Development] Soheil_rf:
Thanks mate

Yes i disabled some modules, till now everything works normal

PS, if you written useful module please share with us

Thanks again
[Xperia Z5 Android Development] noorul89:
How do I install this? I have a E6853 bootloader unlocked, do I just flash this in TWRP? Thank you :)
[Xperia Z5 Android Development] tobias.waldvogel:
Please read the 1st post completely. This is a command line tool meant to be run on your desktop PC (Windows or Linux)

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] Thorstenk:
Your newest version gives me the following errors ...

I am running it on Ubuntu 14.04

Any Idea how to fix?
[Xperia Z5 Android Development] tobias.waldvogel:
Please run the script with bash.

bash rootkernel.sh ......

I will add an automatic switch to bash in the next version

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] Thorstenk:
Perfect Thanks!
[Xperia Z5 Android Development] russel5:
[MENTION=357342]tobias.waldvogel[/MENTION] try your scripts on my z3c today, first something change, but it works. New boot.img and ftf file. Xreality works I can update Sony's apps via whats new (without drm keys it's not possible). One thing I don't see any key in services tests - security. But thanks for your work anyway, it's working.
[Xperia Z5 Android Development] mhaha:
Potential time/brain cell saving tip for Z5 compact users trying to root: flash SuperSU BETA 2.71, do NOT use stable 2.65!

I don't know why the stable version 2.65 doesn't grant me root. I did not integrate SuperSU with the kernel to avoid the bootloop possibility described in the OP.

Everything else was successful. I tried flashing 2.65 multiple times in TWRP, did full wipes, reset, deleted su.img, nothing worked.

I checked posts claiming they got root, and noticed they all flashed 2.71. So I tried and it worked.
[Xperia Z5 Android Development] sxtester:
Hi Tobias,

kindly ask you to add "Aries" (Z3 compact, D5803 & D5833) as well as "Ivy" (Z3+/Z4, E6533 & E6553) to the supported model list.

People have confirmed them to work fine here:

Z3C

Z3+/Z4

Question: Is there any command line switch to override/disable the model check (only for those brave enough of course)?

Ok, there's none. You check it on line 367 onwards. So one would currently need to create a separate directory for an unknown device.

Big thanks to you and [MENTION=3975929]zxz0O0[/MENTION] for finally turning my Z3+ into something useful! :highfive:
[Xperia Z5 Android Development] tobias.waldvogel:
Yes, basically it's like that. In the meanwhile I did some more improvements. I'm using now for all devices a common 32bit TWRP. There is no need to have a 64bit version for the 64bit device (Z5,Z3+/Z4) as the 32bit version work there as well. So I have now a common directory and only deltas for the different models.

So at the end in the device directories there will be basically the kernel modules.

If you copy the sumire directory to ivy, does then recovery work for you? The points to check are

- adb (connect via adb shell and file transfer in Windows Explorer)

- touchscreen

- CPU temperature

Currently I am also adding the possibility to choose for the different options if you want to have them or not. E.g. for security reasons I prefer to leave Sony RIC on (i.e. no write access to /system) and only be able to write to /system from recovery. With the next version everyone can choose him/herself. There will be an override option for untested devices as well ;)
[Xperia Z5 Android Development] sxtester:
Makes perfect sense, a lot easier to maintain going forward.

Will be able to try that on the yet to arrive second Z3+, hope I'll get it coming Monday/Tuesday. The other one I have access to is (now again) used by my wife (which I must not screw up ;)). Anyway, I'm pretty confident that "sumire" (Z5) and ivy (Z3+/Z4) are compatible as it is basically the same HW, but I will surely try and report back early next week.

That'll be great! Thanks again!
[Xperia Z5 Android Development] a-st:
Hi,

I've flashed SuperSU 2.71 through TWRP an now I can't gain superuser access anymore. Also tried reflashing original boot.img right after rootkernel.sh but also without success.

Could anybody help me please?

Thanks!

a-st
[Xperia Z5 Android Development] tobias.waldvogel:
You may try to delete /data/su.img in recovery.
[Xperia Z5 Android Development] a-st:
Thanks that did the trick :)

Just f.y.i. following worked fine on Z3+ dual

Everything works fine so far :)

Also Z5 Kernel from AndroPlus (https://kernel.andro.plus/kitakami_r2.html) works fine on E6533 :)

[MENTION=357342]tobias.waldvogel[/MENTION]: I'm currently trying to get CM13 to work on our device and could need some help with kernel/recovery, as self compiled kernel/twrp/cwm gets stuck at Sony logo. How can I reach you outside xda? Maybe IRC/Jabber/etc.?
[Xperia Z5 Android Development] sxtester:
Adding to that, while badly waiting :p for my Z3+ (single-SIM variant E6553) to arrive I already did the prepare part. Nicely works... (This is for FW E6553_32.1.A.1.185_R3C (Android 6.0)_Customized CE1):
[Xperia Z5 Android Development] zohaib0001:
[MENTION=357342]tobias.waldvogel[/MENTION]

Andro_Plus released a new updated recovery

twrp-3.0.2-0-E6653-20160429.img

Please update your mod also
[Xperia Z5 Android Development] tobias.waldvogel:
To be honest I don't understand what you want me to update. TWRP did not release a new version. The latest TWRP version is still 3.0.2 if I'm not mistaken.
[Xperia Z5 Android Development] Duvel999:
Please don't ask for eta...

Tobias has also a life, work etc beside Xda.
[Xperia Z5 Android Development] AndroPlus:
If my TWRP build got some important changes, I will post it in my kernel thread.

You don't need to update since it has only minor changes.
[Xperia Z5 Android Development] tobias.waldvogel:
Probably that would be good idea, although it is not required for this script.

I just extract TWRP from the images published on the offficial site twrp.me, as I didn't want to recompile TWRP myself.

In order to make it easier to support multiple devices and not only the Z5 I'm using now a common 32-bit version extracted from the pollux image (Tablet Z) and merge it with device specific stuff (kernel modules, twres files). Regarding the CPU temperature display I just patch the string /sys/class/thermal/thermal.... to /etc/cpu_temperature in order to be able to adjust it for each device.

The next version has much more compatible devices for TWRP included. So far it was tested successfully on Z4,Z5,Tablet Z2 and Tablet Z4.
[Xperia Z5 Android Development] Daniel_GB:
after searching for a while I have finally found a .170 firmware for my Z5p dual E6833 to backup my TA partition!

I have a few question before unlocking my phone:

1) Does this method work on Z5p dual?

2) Does restoring TA and re-locking boot-loader recover every functionality lost by unlocking boot-loader? (like Camera BIONZ feature)

3) Does using drmfix restore every functionality that are lost by unlocking boot-loader?

tnx in advance
[Xperia Z5 Android Development] mhaha:
I'm having difficulty entering TWRP by the VOL DOWN method.

I am able to use adb command to reboot into recovery, but fail to do so by holding VOL DOWN while booting.

After pressing the power button and phone vibrates, I immediately pressed and hold VOL DOWN, but the phone seems to ignore that completely and boots normally. I tried multiple times.

Then I tried holding VOL DOWN once the LED flashes yellow, but the phone hanged instead. I had to force shutdown.

Am I doing something wrong? Any help appreciated, thanks.
[Xperia Z5 Android Development] tobias.waldvogel:
Yes, it does

If you restore the TA partition then your phone is like before, but of course no root possible.

The only issue reported so far seems to be ScreenMirroring. I'm investigating this. Everything else like camera, x-reality a.s.o. works
[Xperia Z5 Android Development] tobias.waldvogel:
It is VOL UP for TWRP. ;)

VOL DOWN starts the recovery on the FOTA partition, which is normally the stock recovery, only used for OTA updates.
[Xperia Z5 Android Development] mhaha:
Oh my god... that sounds like the utter most basic thing to screw up, now I feel like a complete idiot.

I mean, I did Google a bit, and found sources like Sony developer website and the xda Z5 guide thread all saying to press VOL DOWN to enter recovery. Never thought about trying VOL UP.

Thanks for pointing it out! VOL UP it is, entered TWRP in no time.
[Xperia Z5 Android Development] najoor:
We noticed that in your latest version (4.31) support for tablet z4 is removed from the drmonly script. Can you please put it back in the next version? Alternatively, can you give me the permission to post an older version of your code (4.24) which worked on tablet z4 in our tablet's forum?

Thanks again for your great work.
[Xperia Z5 Android Development] tobias.waldvogel:
I reworked the script to verify exactly the model and the kernel in order to be able to support several kernel versions and devices. The version I'm working currently on does support table Z4 again (model karin). You could help me by trying this test version: https://www.dropbox.com/s/3wvdnybsof13wom/rootkernel_v4.4_Windows_Linux_RC2.zip?dl=0

Please note that there is no seperate DRM only script anymore, as this you can now choose for each item if you want to add it or not. So DRM only would be confirming only DRM fix with y and everything else with n. But as I don't have such a device I would be in particular interested if TWRP is working.
[Xperia Z5 Android Development] najoor:
I tried the new version and answered yes to all the options. You can see the log below. Everything worked except for 2 things:

1- When I run busybox from a terminal it says:

/system/bin/sh: busybox: can't execute: Permission denied

2- Thw TWRP integration didn't happen. That is not a problem though for the TZ4 androplus kernel becuase it comes with its own recovery.

Script output log:

C:\Users\najoor\Desktop\rootkernel_v4.4_Windows_Linux_RC2>rootkernel.cmd boot.img x1.img TA-07102015.img

- Unpacking kernel

Found android boot image

Kernel version: 3.10.84

- Detected vendor: somc (Sony), device: karin, variant: row

- Unpacking initramfs

- Detected platform: 64-bit

- Detected Android version: 6.0

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

Disabling Sony RIC

- Install TWRP recovery? [Y/n] Y

Skipping TWRP integration. Could not identify init binary

- Found SuperSU-v2.71-20160331103524.zip. Install? [Y/n] Y

Adding service entry for SuperSU

- Install busybox? [Y/n] Y

- Install DRM fix? [Y/n] Y

Configuring tpm-service

Configuring credmgrd

Configuring secd

Configuring wvkbd

Configuring drmserver

- Creating new initramfs

- Creating boot image

- Cleaning up

Done
[Xperia Z5 Android Development] tobias.waldvogel:
Thanks for testing this. Busybox integration only works together with TWP integration. I will make it then dependent, in order not to confuse everyone.

Absolutey right. As I don't own this device, may I ask you a favour? Could yo try it with the stock and check if the recovery works? Afterwards you can put again Androplus kernel on your device if you prefer ;)
[Xperia Z5 Android Development] najoor:
Sure, I will be happy to help.

I used MM kernel 186. You can see the log below. Now when the device boots up I can get into recovery by pushing vol up. However, the touch screen doesn't work in the recovery and the only thing I can do it to do a hard reset. If I use vol dn the devices just freezes up on the boot splash screen. Everything else seems to work fine. Thanks again.

Let me know if you want me to try your build again after you apply the fixes.

Log:

C:\Users\najoor\Desktop\rootkernel_v4.4_Windows_Linux_RC2>rootkernel.cmd kernel.elf xsnt.img TA-07102015.img

- Unpacking kernel

Found elf boot image

Kernel version: 3.10.84

Found appended DTB

- Detected vendor: somc (Sony), device: karin, variant: row

- Unpacking initramfs

- Detected platform: 64-bit

- Detected Android version: 6.0

- Disabling dm-verity

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

Disabling Sony RIC

- Install TWRP recovery? [Y/n] Y

Installing TWRP

- Found SuperSU-v2.71-20160331103524.zip. Install? [Y/n] Y

Adding service entry for SuperSU

- Install busybox? [Y/n] Y

- Install DRM fix? [Y/n] Y

Configuring tpm-service

Configuring credmgrd

Configuring secd

Configuring wvkbd

Configuring drmserver

- Creating new initramfs

- Creating boot image

- Cleaning up

Done
[Xperia Z5 Android Development] tobias.waldvogel:
Could you try this one? https://www.dropbox.com/s/t33i4mk6qo08sm1/rootkernel_v4.4_Windows_Linux_RC3.zip?dl=0

Even if touch would not work at least adb should work, so you can use e.g. adb -d reboot for restarting your tablet