yashsingh1/xdaforums huggingface dataset:
[Xperia Z5 Android Development] bongo1:
Followed instructions and something worked because it restored my DRM, xreality now works.

However TWRP would not boot. So I flashed twrp 3.0.2 recovery manually and can now boot to it. However system partition is not mountable. Any ideas where this has gone wrong? I ran script without superSU as I wanted to install manually after via twrp. Thanks.

---------- Post added at 05:43 PM ---------- Previous post was at 05:37 PM ----------

Oh god worked it out now. Its vol+ rather than vol- to get to the twrp recovery. Confused me as normally I use vol- to get to twrp! The build in twrp from the script mounts internal fine.
[Xperia Z5 Android Development] waleedsq81:
Some Fixs

i fix recovery.fstab@0644 & twrp.fstab@0644 in \Android\twrp_leo\root\etc & \Android\twrp_aries\root\etc

and added \Android\twrp_sirius

please add it in next version
[Xperia Z5 Android Development] tobias.waldvogel:
Thanks for this [emoji2] I will include it next weekend when I'm back from holidays

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

Can you make a script to only create recovery images?
[Xperia Z5 Android Development] RyTekk:
You can choose N for other options, so easy.
[Xperia Z5 Android Development] KbaB.BroS:
Can you tell me how?
[Xperia Z5 Android Development] RyTekk:
You just run the command and you will see the options, there are two choices yes or no for you.
[Xperia Z5 Android Development] KbaB.BroS:
That's where the problem begins for me. Pushing Y on the command when wanting to inject TWRP gives me an error with the init binary, it skips installation.

Problem is that the recoveries existing for my device, Z5p, are old, which gives me errors and bugs with installations weirdly. The stock kernel works fine with this script, but the kernel from Romaur doesn't. And stock kernel doesn't boot up with the custom ROM installed, so I'm forced with using a kernel without recovery.
[Xperia Z5 Android Development] RyTekk:
Do you mean this rom?

Stock kernel should work on this ROM, it's based-on stock, stock kernel just doesn't boot on AOSP-based ROM.
[Xperia Z5 Android Development] KbaB.BroS:
Yes, for whatever reason the I'm stuck in the boot up screen when fastbooting it
[Xperia Z5 Android Development] shoey63:
You can't boot a stock kernel (modified with this tool or not) on a custom AOSP rom. You need to repack the AOSP boot.img. And if it doesn't repack, report the errors, eg: No DTB image found etc..
[Xperia Z5 Android Development] KbaB.BroS:
But it's not a AOSP ROM, it's based on the latest FW, 32.1.A.1.185
[Xperia Z5 Android Development] shoey63:
Ok sorry, mis-read it then.
[Xperia Z5 Android Development] bongo1:
Is it possible to do DRM restore without twrp, or remove twrp after? i.e how close to stock can I get the phone back to without a TA backup?
[Xperia Z5 Android Development] tobias.waldvogel:
You can select each option individually. If you want just drm fix then say n to all others. Nevertheless as discussed several times and mentioned in the first post some things won't work if you don't have your TA backup.

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] bongo1:
Thanks, I've now read every post on the read. To confirm from my understanding, without TA backup it is impossible to play widevine content? No current fix exists anywhere?
[Xperia Z5 Android Development] tobias.waldvogel:
Yes, that's true unfortunately.

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] bongo1:
**** lol. Insurance claim here I come. Only self to blame trigger happy flashing.
[Xperia Z5 Android Development] nkod:
https://www.youtube.com/watch?v=c4krMSdyMV4&feature=youtu.be

lock or unlock ?
[Xperia Z5 Android Development] Klaus N.:
If you follow exactly the steps of this thread (including the described ta backup play back), it shows that result. I think, it mocks that there's a locked bl?

No matter what happened, it works excellent :good:

@Tobias

Thank you very much for your awesome job - you really rock!

(there are problems atm with paypal; as soon it works again, I'll send you a little something.)
[Xperia Z5 Android Development] RyTekk:
Yeah, I got it too, the system is lied that bl is locked, how brilliant tobias is :D
[Xperia Z5 Android Development] nkod:
:D
[Xperia Z5 Android Development] Klaus N.:
@tobias.waldvogel

For your efforts & awesome work:

8FV30783AY853272F
[Xperia Z5 Android Development] Nown:
Hi, is it just me, or all the arguments in the guide have disappeared? For example, the last command in the guide reads "flash_dk DK.ftf", instead of "flash_dk something.img DK.ftf"... I guess the arguments got removed by some HTML sanitization filter, because they were between <...>.
[Xperia Z5 Android Development] Klaus N.:
It is assumed that there's a little basics, indeed. Referring to this command, you've to put in TA-XX.img between "flash_dk" and "dk.ftf".
[Xperia Z5 Android Development] Nown:
What I mean is that a few days back, the arguments DID appear on the guide (between <...>), so I guess it is a display problem on the forum, not a voluntary omission...
[Xperia Z5 Android Development] nkod:
Test boot file

**Disclaimer I do not take any responsibility for your device

Restore for twrp

https://mega.nz/#!6l5UnL6L
[Xperia Z5 Android Development] tobias.waldvogel:
Thanks for commenting this. It must have happened when I last edited it with tapatalk. As I am still on vacation until tomorrow I did not recognize it before. I corrected the commands again.

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] tobias.waldvogel:
Thank you very much for supporting this project [emoji2]

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] Learnincurve:
I have two phones and managed to back up the TA partition using the accepted method, on phone #1. On phone 2., I THINK I have flashtool-generated images of the keys at

~/.flashTool/registeredDevices/CB5A25X50H/s1ta/2016-03-30_10-30-23/1.ta and 2.ta

I have two questions:

1. How can I convert the .ta files to a backup image?

2. Can I safely (no brick) use the above method to flash the DK to the phone and recover in case the key is incorrect (eg wrong phone)?

BR.
[Xperia Z5 Android Development] tobias.waldvogel:
Forget about it. The S1 protocol blocks the dk unit, i.e it is excluded. If it would be that easy we would have used it long ago[emoji6]

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] digitalSeb:
Hello,

I followed the instructions and everything is fine. But when I try adaway it wants to write the host file and that is not possible. I found out that I can't change the permissions for /system/etc/hosts even with a file Explorer with SU allowed.
[Xperia Z5 Android Development] rualyth:
He Tobias.waldvogel,

First of all: thanks a lot for all this and the continued support you're providing :)

I have a somewhat noobisch question but can't find a solution in this thread or elsewhere. I followed your guide, which was very clear (used v4.41). I backed up my TA partion before unlocking using iovyroot. Flashing the devicekey ftf has me stumped tho. The creation of de devicekey tft seems to works fine, it recognized the phone model from the TA backup. I put the generated ftf in the firmware folder of my flashtool installation (64bit-version: 0.9.22.1). Then I choose to flash using flashmode and I need to select a firmware to flash. However the devicekey ftf doesn't show up in the list of available firmwares.

Some info: I'm using a D6553 (Xperia Z3+). Downloading firmwares using xperifirm in flashtool and flashing those worked just fine. When I open the devicekey ftf I can see a single .sin file and the META-INF folder.

I don't understand why flashtool doesn't show it. My guess is that it filters out incomplete/small ftf's or something to protect the user from doing something stupid(tm) :). Should I be using the older 0.9.18 version of flashtool or is there else something I've missed? Any help or more information on this would be much appriciated!

On request I can supply files, logs and do additional tests if required.

With kind regards, Wessel
[Xperia Z5 Android Development] tobias.waldvogel:
May be you let Sony RIC on as I recommend. In this case no write access to /system is possible. You may try to repeat the steps and choose to switch off Sony RIC or you can temporarily disable it with the following command from a terminal session:

echo 0 >/sys/kernel/security/sony_ric/enable

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] digitalSeb:
No data loss when I do your guide steps again? Dumb question i guess
[Xperia Z5 Android Development] tobias.waldvogel:
No, no data loss[emoji6]

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] Klaus N.:
I've used FlashTool v.0.9.22.1, it recognized the dk.ftf (1 kb), and worked flawlessly:
[Xperia Z5 Android Development] rualyth:
He Klaus thanks for the quick repsonse. Weird. I will try again then when I have some time to generate the tft again. A tad nervous now that I might have borked my ta backup :silly:

Edit:

Yay, me is stupid :) I named the file .tft instead of the needed .ftf in my rush to root it. No sweat now flashing :)
[Xperia Z5 Android Development] celderic:
[MENTION=357342]tobias.waldvogel[/MENTION]

currently using v4.24 and the kernel for 32.1.A.1.185 E6653 and SuperSU-v2.65

works fine :)

tried to update to v4.41, pressed Y for all, on windows. Phone boots fine and SuperSU app is installed, but binary can't be found, downgrading to the old kernel patched with v4.24 and the same SuperSU version works fine on this same rom installation.

(also pressing Y and enter would be better than just pressing Y and it going on to the next as it does currently)
[Xperia Z5 Android Development] PereAzzrael:
thank you msg

just a thank you note from a happy visitor:

used your script v4.1 on E6633

31.1.A.1.163 1298-3659 R6C (got it here on xda)

worked from kernel.elf extracted from the ftf file I had just flashmod onto my e6633,

used BETA-SuperSU-v2.72-20160510112018.

TWRP installed by you is v3.0.2-0 (awesome !)

the script worked flawlessly.

T H A N K Y O U !

:)

(i have not backed the TA partition, lost my keys, so did not test that part)
[Xperia Z5 Android Development] ivanmemento:
Hello to everybody, and really big thanks for now, one day i will try to give a better help, but, i am really afraid to say that i don't understand if is my windows 10 or something else, because i have putted together kernel.elf + supersu.zip + drm restore.zip + tabackup.img all in your folder and start all the executable, and really don't understand where i am wrong :( :( please i feel really noob, and this is the 3rd sony that i root this one is getting me crazy starting from the fact that i cant find the correct driver and i must use flashtool because adb doesn't recognize it or if yes, generates an error when give a imput after found it in fastboot devices string.... please someone can help ?

Okay I am about ready to say that the problem is my windows 10 that did not get rights to use it, because it doesn't recognize any file and so the prompt page doesn't appear, any suggestion?
[Xperia Z5 Android Development] Klaus N.:
Today I've tried to update SuperSU to v.2.74. I've renamed it to "SuperSU.zip", put it into the rootkernel folder, rerun the script and flashed the resulting boot.img via fastboot. But my device (E6653, rooted, stock) has still SuperSU v.2.72, although I've disabled Sony RIC. Maybe it has to do with selinux set to enforcing?

So, is it possible to update SuperSU without a factory reset?
[Xperia Z5 Android Development] tobias.waldvogel:
Please try to uninstall the SuperSU app first (Settings->Apps) and let me know id then 2.74 is installed.

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] Klaus N.:
You're the man - it worked :good:

Thank you very much!
[Xperia Z5 Android Development] waleedsq81:
Some Fixs and Added

thanx to add my changes

but i make other edits on twrp.fstab@0644

like TWRP on RecRootV4 by [MENTION=2822871]Wolfbreak[/MENTION]

and support honami (but DRM fix not working on it)
[Xperia Z5 Android Development] ivanmemento:
Hi, please can you explain why I cant open the prompting section, can you explain like I am a noob what to do after putted inside the folder all the files needed? because i really don't understand what i have to start .cmd or something else;

OR I must use adb with windows prompt and write rootkernel <extracted kernel> boot.img? the problem is that it say file not found :(((((((

Sorry for smothering but i am getting crazy i read like 10 times all the post and i am trying root since 2 month :/

Thanks a lot !!!
[Xperia Z5 Android Development] Klaus N.:
Just open the rootkernel folder, then right-click there in a free space while holding the shift button. Then go on, as in the startpost described.
[Xperia Z5 Android Development] asweetlove:
find /dev -name boot

dd if= of=/sdcard/kernel.img

when i ran this, i get error dd: can't open '': No such file or directory

please help

Currently on Slim 185
[Xperia Z5 Android Development] guhvanoh:
if needs an input file. You need to specify it just like you did for the output file of.
[Xperia Z5 Android Development] ivanmemento:
I have done like that but there is no prompting section, if i open that command and (i did it) i have a file boot.img 1kb that is invalid file, so there's something wrong :( i open it all with all the strings and command, i have also triyed on windows 7 sp1 (that is the only release) so I really don't understand where is this prompt disable ric off on ; and so on... But Thanks for the help !!!
[Xperia Z5 Android Development] tobias.waldvogel:
It seems that in one of my last updates from tapatalk everything with <..> was removed. I corrected it again:

find /dev -name boot

dd if=<output of the find command before> of=/sdcard/kernel.img

For if= you need to use the output of the find command before.
[Xperia Z5 Android Development] tobias.waldvogel:
I assume that your issue is this:

As it seems that it is not clear to everyone I also want to mention that <...> is a placeholder. E.g. <extracted kernel> means that you should replace it with then name of your extracted kernel, which could be kernel.elf

I added it to first post, just in case.
[Xperia Z5 Android Development] asweetlove:
i see, thank you, i was confused as what to put there lol, so i finished everything, and all are working well
[Xperia Z5 Android Development] ivanmemento:
Thanks for your tips but was not that :D not so noob eh :D i mean that the file boot.img after done rootkernel string appear like 1kb and is not possible , and also what is the sequence correct to use all this command because it doesn't open any file prompt it just generates that boot.img maybe is windows 10
[Xperia Z5 Android Development] Aklo01:
Hi,

I've rooted my Z5 E6653 on MM version 32.1.A.1.185 using rootkernel version 3.2

Everything works like a charm.

But I'd like to redo the whole thing using rootkernel 4.x to flash my device keys into alt TA partition. It looks like a much better solution than the old method.

(keys will survive when flashing different rom)

I already have TA.img (via iovyroot tool) and Kernel.elf (185).

What will be the process in this case ?

I suppose:

1) Flash stock 185 rom via flash tool

2) Apply the procedure described in op from creation of new kernel to the end.

Am I correct ?

One additional question:

tobias says:

If rootkernel searches for device key, should I flash it with flashtool BEFORE running rootkernel ?

many thanks
[Xperia Z5 Android Development] shoey63:
Rootkernel.sh creates a boot.img for you to flash.

Flash it. You can flash DK.ftf before or after. I would do it before, but it shouldn't make any difference.
[Xperia Z5 Android Development] ratelutz:
restoring device keys fails

i hope someone can help me.

everything works except flashing device keys. when i try to flash fashtool throws this error:

27/014/2016 09:14:56 - INFO - For flashtool, Unknown Sources and Debugging must be checked in phone settings

27/015/2016 09:15:20 - INFO - Selected Bundle for Sony Xperia Z5(E6653). FW release : 1.0. Customization : DeviceKey

27/015/2016 09:15:20 - INFO - Preparing files for flashing

27/015/2016 09:15:20 - INFO - Please connect your device into flashmode.

27/015/2016 09:15:23 - INFO - Device disconnected

27/015/2016 09:15:53 - INFO - Device connected in flash mode

27/015/2016 09:15:53 - INFO - Opening device for R/W

27/015/2016 09:15:53 - INFO - Start Flashing

27/015/2016 09:15:53 - INFO - No loader in the bundle. Searching for one

27/016/2016 09:16:00 - INFO - Processing loader.sin

27/016/2016 09:16:00 - INFO - Checking header

27/016/2016 09:16:00 - ERROR - Processing of loader.sin finished with errors.

27/016/2016 09:16:00 - INFO - Ending flash session

27/016/2016 09:16:00 - ERROR - null

27/016/2016 09:16:00 - ERROR - Error flashing. Aborted

27/016/2016 09:16:00 - INFO - Device connected in flash mode

what i am doing wrong here?

Edit: don't know what was wrong but i reinstalled flashtool und flashed again: workes!!
[Xperia Z5 Android Development] Killuminati91:
Hey there, thanks for all the work!

I need some help to get the kernel.elf. I downloaded the newest Androplus kernel for the Z5C and of course ended up with a boot.img.

How do I proceed to get the kernel.elf from this file? Opening with winrar tells me the file is corrupt.
[Xperia Z5 Android Development] Klaus N.:
That doesn't work with winrar; take 7zip to extract it.
[Xperia Z5 Android Development] dodo1515:
Hello guys,

Thanks for your great work [MENTION=247703]tobias[/MENTION],it works,install Supersu,rooted,only issue is that l'm unable to mount or remount filesystems?:confused: please help?any idea?

Thanks
[Xperia Z5 Android Development] shoey63:
Did you disable RIC in the boot.img creation process?
[Xperia Z5 Android Development] dodo1515:
No l didn't disable it,it's because of that? ?l really dont know,eveything done without any errors..:confused:

Did the process again with RIC disable,Thanks a lot [MENTION=4675598]shoey63[/MENTION]!!
[Xperia Z5 Android Development] dodo1515:
Hello guys,

Sony is releasing rolling out new firmware for Z5 (32.2.A.0.224):),what will be the procedure to update while keeping root:confused:

Thanks.
[Xperia Z5 Android Development] devilmaycry2020:
The procedure is as same as before.
[Xperia Z5 Android Development] deepongi:
i think i asked this before, but i dont recall.

how do i get access to external_sdcard via twrp on windows? havent tested in linux yet.

regards.
[Xperia Z5 Android Development] tobias.waldvogel:
With TWRP bundled in this tool you should see both, the internal memory and the sdcard in Windows Explorer
[Xperia Z5 Android Development] deepongi:
device isnt even detected, either on windows or linux.

device manager shows nothing, and lsusb output:

infected_@infected-labs ~/Desktop $ lsusb
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 008: ID 046d:c326 Logitech, Inc.
Bus 001 Device 004: ID 1532:0009 Razer USA, Ltd
Bus 001 Device 003: ID 0424:2504 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
infected_@infected-labs ~/Desktop $

its only on twrp. with device booted, i have access.

ps: i used your tool on windows, latest version and .224 kernel.
[Xperia Z5 Android Development] celderic:
E6653 32.1.A.1.185

v4.31 with supersu v2.65 works fine.

V4.42 with the same .zip of 2.65 doesn't, binary can't be found when opening supersu.

Also there is a significant size difference, I've not investigated further.

https://mega.nz/#!2BVnkACa!xDhgB52zyfBjfyUCXNXtOv_wexrAiwjMdbTL_2K-_RI
[Xperia Z5 Android Development] tobias.waldvogel:
I'm using currently 2.71. May be you want to try this one. Please uninstall the SuperSU application before.

Cheers,

Tobias
[Xperia Z5 Android Development] tobias.waldvogel:
This is odd. Nobody ever reported such an issue. I also updated my phone yesterday to .224 with no issues at all. So, just to be sure, it only doesn't show up in TWRP, but working correctly in normal Android?
[Xperia Z5 Android Development] JTdevAndroid:
Yes that's the exact behaviour.

I also have the exact same problem as [MENTION=1077833]infected_[/MENTION] using the tools on windows with the Z5 Compact V.224 kernel
[Xperia Z5 Android Development] deepongi:
yes. device when its on twrp recovery isnt detected on the PC.

when device is booted normally into the stock ROM, i can see the device, both on windows and linux.
[Xperia Z5 Android Development] tobias.waldvogel:
It's a problem with kernel modules. They don't load in recovery. Although the kernel version is still 3.10.84 it is a different identifier. I will provide a fix for this, probably today.

Cheers,

Tobias
[Xperia Z5 Android Development] tobias.waldvogel:
Version 4.5 is out with a fix ;)
[Xperia Z5 Android Development] arjun.arora:
Awesome!! Thanks buddy..
[Xperia Z5 Android Development] deepongi:
well done, its fixed :victory:

i have access to internal/external memory on windows (ill confirm linux also in a minute)

regards.

edit: working on linux also.
[Xperia Z5 Android Development] Learnincurve:
Hi :)

Running v4.5 in Linux for new ivy fw v. 32.2.A.0.224

everything goes fine, except the tool isn't picking up the correct twrp module:

bash rootkernel.sh /home/.../.flashTool/firmwares/kernel.elf /home/.../.flashTool/firmwares/boot-patched-RIC-disabled_ivy_32_2_A_0_224.img

- Unpacking kernel

Found elf boot image

awk: line 5: return outside function body

Kernel version:

Found appended DTB

- Detected vendor: somc (Sony), device: ivy (Z3+/Z4), variant: row

- Unpacking initramfs

- Detected platform: 64-bit

- Detected Android version: 6.0.1

- Disabling dm-verity

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

Disabling Sony RIC

- Skipping TWRP recovery. Module core_ctl.ko for not found

I see the modules at:

locate core_ctl.ko

/home/.../FlashTool/Android/twrp_common_kmodules/3.10.49-perf-g83fc9bc/core_ctl.ko

/home/.../FlashTool/Android/twrp_common_kmodules/3.10.84-perf-g19d6d92/core_ctl.ko

/home/.../FlashTool/Android/twrp_common_kmodules/3.10.84-perf-g4a67e86/core_ctl.ko

/home/.../FlashTool/Android/twrp_ivy/kmodules/3.10.49/core_ctl.ko

/home/.../FlashTool/Android/twrp_ivy/kmodules/3.10.84/core_ctl.ko

...

any ideas?

BR.
[Xperia Z5 Android Development] tobias.waldvogel:
I will provide a fix today [emoji6]

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] Learnincurve:
You're a star!
[Xperia Z5 Android Development] JTdevAndroid:
ADB and MTP is fixed but i see no interface when i boot in recovery: no menus no button.

I also used the script without installing TWRP and then i flashed only the recovery image but was still the same.
[Xperia Z5 Android Development] tobias.waldvogel:
Which device do you have ?
[Xperia Z5 Android Development] tobias.waldvogel:
I just published v4.51 with a fix ;)
[Xperia Z5 Android Development] a-st:
Hi Tobi,

how did you fix the issue? I tried adding self-compiled TWRP but I'm facing same issue (no adb, system mounts ro only, etc.) with version 4.5. Any hints would be helpful :)

Thanks and best regards,

a-st
[Xperia Z5 Android Development] JTdevAndroid:
E5823 Z5 Compact

edit:

nevermind v4.51 fixed it

thanks again for your work!