yashsingh1/xdaforums huggingface dataset:
[Xperia Z5 Android Development] dermaze:
Thank you for those details.

By the way, on a linux system, you can simply enter

sudo mount -t ext4 -o loop /path/to/system.ext4 /path/to/your/favourite/mountpoint

in order to mount the extracted ext4 image and copy the files.
[Xperia Z5 Android Development] YasuHamed:
yes, whenever i need trwp, i use fastboot command

---------- Post added at 10:15 PM ---------- Previous post was at 10:15 PM ----------

rename the last know trwp folder to 3.10.84-perf-g1016077 and it will flash it in to kernel

which script version you are using ?
[Xperia Z5 Android Development] sceryavuz:
Thanks, I forgot to mention. I thought everyone was using MS :p
[Xperia Z5 Android Development] dermaze:
Actually, [MENTION=5813612]sceryavuz[/MENTION] has a better method in post #2373: Extracting the kernel modules from the ftf you want to flash / use.
[Xperia Z5 Android Development] camaro322hp:
I'm already rooted with Androplus kernel and have TWRP. All I need to do is restore my DRM keys which were backed up with iovyroot, but it's not clear exactly what steps to take to run drmonly. Could someone help?
[Xperia Z5 Android Development] Thorstenk:
Where using your newest version I get this ...

./rootkernel.sh kernel.elf boot.img
./rootkernel.sh: 7: [: /bin/ls: unexpected operator
-e - Unpacking kernel
-e Found elf boot image
-e Found appended DTB
-e - Unpacking initramfs
-e - Disabling dm-verity
-e - Disabling SONY RIC
-e - Adding tools
-e - Adding TWRP image
-e - Installing init script
- Renaming init to init.bin
-e - 64-bit platfrom detected
-e - Configuring keyprovd
./rootkernel.sh: 138: [: lib-preload64.so: unexpected operator
-e - Configuring secd
./rootkernel.sh: 138: [: lib-preload64.so: unexpected operator
-e - Installing library
-e - Creating new initramfs
-e - Creating boot image
-e - Cleaning up
-e Done

What is causing this?

is this critical or should the resulting kernel image still work?
[Xperia Z5 Android Development] tobias.waldvogel:
Sounds like an error. On which Linux are you running this?
[Xperia Z5 Android Development] tobias.waldvogel:
drmonly is then right one.

But don't forget to run as well flash_dk step.

One more thing you should check is if this kernel is the right one for your Android version.
[Xperia Z5 Android Development] frostmore:
hi, i rooted my lolipop (.200) following your instructions and also converting the .elf file to .img file while rooting the kernel.

when i tried to test boot the kernel in adb,it was able to download the the boot.img,went to booting.... the failed (status read failed (too many links)

i did this on a locked bootloader with TA keys intacts.

i read that by using your method,restoring the original TA keys that you backed up will enable a locked bootloader with stock kernel that is rootable.

not sure why there was an error when i test boot.did i do something wrong?
[Xperia Z5 Android Development] Thorstenk:
Hm weird, I am running Ubuntu 14.04.4 LTS, and the former version (3.2) of your tool works nicely ...
[Xperia Z5 Android Development] ctap001:
1. Download and Extract Root Kernel 4 to a folder on your desktop.

2. Open command window on the folder where you extracted RK4.

3. Copy the TA File made by iovyroot to the same folder.

5. Get the DK.ftf created by #4 and paste it to the firmwares folder of your flashtool

6. Select Flash on flashtool

7. Select DK.ftf and flash it to your Z5c
[Xperia Z5 Android Development] camaro322hp:
Thank you, that makes more sense. A couple follow up questions:

So I'm not doing anything with the drmonly file? From tobias' reply, it sounds like that should be used somewhere.

Also, when I flash DK.ftf with flashtool, that won't mess with my system/data at all? Anything special I need to do in flashtool to leave system/data unchanged?
[Xperia Z5 Android Development] ctap001:
Aside from getting it into a folder somewhere? I think no. From what I can gather you are using the drmonly file when you type

As for DK.ftf, it doesn't seem like it will flash anything but the Device Key. I have done this yesterday and everything is in order.
[Xperia Z5 Android Development] Vanta-Chan:
Is this now the correct instruction for the newer root?

(currently: Z5P, MM 32.1.A.1.163, Kernel: 3.10.84-phatsuki_mm_sxz5p root@kali #1)

1.: Backup files

2.: Backup (everything? There're Boot, Recovery, TA, System, Files, Firmware, OEM, LTALabel, modemst1 & modemst2 "Baseband" with files in it.) in TWRP

3.: Restore stock ROM & TA partition v0.3 using Method 1 (which relocks BL)

4.: Use v0.4 TA Backup from iovyroot thread to backup restored TA partition

5.: Unlock Bootloader

6.: Root using this thread (needs better explainment of the methods. Where to get .ftf file? Flashtool by Androxyde?)

7.: no need for this patch anymore

8.: No need to install Busybox, already included

9.: Install latest dev version of SuperSU with TWRP

10.: Restore TWRP Backup with all settings

cc [MENTION=357342]tobias.waldvogel[/MENTION] [MENTION=3975929]zxz0O0[/MENTION]
[Xperia Z5 Android Development] Bronnel:
Hi, I have already created my rooted kernel using v3 of the tool on my Z5 Dual (E6633) 32.1.A.1.185, unlocked the bootloader, and rooted my device, everything is working great , do I need to create another rooted kernel for my device using v4 of the tool, so can I just flash it with fastboot and not lose data and not starting from scratch?
[Xperia Z5 Android Development] rolo143:
Thank you! This worked like a charm! :D

I have a Z5C. With the latest firmware. (32.1.A.1.185)

First I was unsure how did it work, but it's not that hard, actually. If you have problems try this:

1. Open your firmware file (.ftf) with WinRar and extract kernel.bin

2. Using Flashtool, go to Tools -> SIN editor then search for the folder where you saved kernel.bin and select extract.

You should now have a kernel.elf file where you saved the kernel.bin

3. Extract the zip file from OP to a folder (I suggest C:\Folder, to have easy access) and then move the kernel.elf file to that folder.

4. Open a command prompt from that folder or just press WIN KEY + R and type cmd to open the terminal. Then type "cd C:\Folder" without the " to go to that directory

5. Once your are in that directory type "rootkernel kernel.elf newkernel.img" again, without the "

6. You should now have a file "newkernel.img" in that folder.

7. Now I asume you already have Android SDK and fastboot/adb drivers installed on your PC.

Navigate to "C:\Android\sdk\platform-tools" folder and move the newkernel.img there.

8. Connect your phone in fastboot mode (volume + then plug) and then open a command prompt in platform-tools. Then type "fastboot devices" to make sure it detects device. Then type "fastboot flash boot newkernel.img" and wait a second.

That's it. Now you have flashed the new kernel image with twrp 3.0.1 just turn on your phone and when you see a yellow led press volume up to access recovery and then flash SuperSu zip which you already have saved in your internal memory. Now you have successfully rooted your device. Enjoy! :)
[Xperia Z5 Android Development] tobias.waldvogel:
You just create a new kernel with this script and flash it via fastboot. Furthermore you need to flash your device key as described.

But this will not reset your phone or delete any data. There was only one reset, when you unlocked the bootloader ;)
[Xperia Z5 Android Development] ninestarkoko:
You must keep your bootloader unlocked if you want root or modded kernel

Please, don't tag people if there's no specific need. zxz0O0 is not involved in modded kernel.

A lot of confusion...

You should FIRST backup your TA partition using iovyroot (which is a package that gives only temporary root access to backup TA partition), then backup all your files and unlock your bootloader (which wipes everything in the phone) using Sony guide. Then use this package to mod the stock kernel or use a custom kernel and DRM restore fix from this thread, install the kernel and finally, flash latest SuperSU
[Xperia Z5 Android Development] Bronnel:
Correct me if I'm wrong

So now you're saying there are two methods to restore the DRM keys, either using drmonly command like this (drmonly newkernel.img TA-xxxxxxx.img) [newkernel.img being created by v4] and then flash this with fastboot.

or create DK.ftf using (flash_dk TA-xxx.img DK.ftf) and Flash this file with flashtool.
[Xperia Z5 Android Development] Vanta-Chan:
Sorry. I think you didn't understand, at what status my phone is. I've backed the TA with v0.3 and did this tutorial to root my phone. Times have changed since that tutorial and now there's this thread. Do I need to do a change to my phone? If yes, what and in what order do I need to do it? I have that one issue in ES File Explorer, which doesn't enable it's root functions.
[Xperia Z5 Android Development] tobias.waldvogel:
V4.2 is now with TWRP 3.0.2 ;)
[Xperia Z5 Android Development] Bronnel:
so drmonly is for non stock kernel, right?
[Xperia Z5 Android Development] rolo143:
Man, I just installed v4 with twrp 3.0.1

whats the main difference with the new one?

If I want to update, I just have to use rootkernel again with the elf file I already have, right? And then flash again the new img is that correct? Will I lose root after this?

Thanks
[Xperia Z5 Android Development] devilmaycry2020:
Read change log at first post,if you don't want to update everyday just wait 1 month or 1 year for update,
[Xperia Z5 Android Development] YasuHamed:
i need help

i remember recently i saw log of the rootkernel script in which if you flash supersu in kernel, it will ask the very next question whether to give FULL RW RIGHTS to /system or not.

now i am using 5.23 and i never get that question...

what am i missing?

---------- Post added at 01:22 PM ---------- Previous post was at 01:21 PM ----------

you could do that also. it similar to back old days when prerooted android 5.1 was possible (prf creator)

(y)
[Xperia Z5 Android Development] sceryavuz:
Hi [MENTION=357342]tobias.waldvogel[/MENTION] and [MENTION=3989065]serajr[/MENTION]

I used v5.23 for 32.3.A.2.33 kernel with 3.10.84-perf-g1016077 common kmodules.

When I flash a zip file with TWRP, it gives "E:Legacy property environment did not initialize successfully. Properties may not be detected."

Zip flashed without any issues and working. What cause this error?
[Xperia Z5 Android Development] whalesplaho:
It happens with TWRP 3.0.2.... Been on ground since Nougat!!!!
[Xperia Z5 Android Development] debbuger:
D:\Minimal ADB and Fastboot\root kernel repack>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: satsuki (Xperia Z5 premium), variant: dsds

- 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

- Install TWRP recovery? [Y/n] Y

Installing TWRP

Compressing TWRP image

- Install DRM fix? [Y/n] Y

- Install busybox? [Y/n] N

- Creating new initramfs

- Creating boot image

- Cleaning up

Done

I can't find boot.img in the same folder. Am I doing something wrong?
[Xperia Z5 Android Development] sceryavuz:
Move rootkernel files into "C:\rootkernel" or "D:\rootkernel" whitespace char cause problem "D:\Minimal ADB and Fastboot\root kernel repack"
[Xperia Z5 Android Development] debbuger:
I tried that also But still Same. So after some tinkering around I found that file is not showing up in Explorer but in Command Prompt the file is present. Flashed it and working.

Thanks for your Help.
[Xperia Z5 Android Development] Berni-0815:
That's right, because this question is only valid if you use superuser.zip, not SuperSU ;)
[Xperia Z5 Android Development] YasuHamed:
twrp via rootscript 5.23 for 32.3.A.2.33 doesn't work. also twrp 3.1 image for this kernel doest not boot.

i used MM kernel to boot in to twrp and root 32.3.A.2.33
[Xperia Z5 Android Development] debbuger:
For me twrp is working on same firmware. [MENTION=5613633]YasuHamed[/MENTION]
[Xperia Z5 Android Development] mobiware:
SD card issue:

I have formatted the external SD card both on my PC and the phone and I have tried both internal and portable options. In both cases, the card has an Android folder on it, which makes me think that it's encrypted. Sure enough I cannot save any pictures to it from the camera and I cannot read it on my PC anymore. Of course the card shows as 0MB in TWRP as well.

This seems like an issue to me. Other members early on mentioned that they had had problems with this, I asked and then I was told that it was resolved. I've read some postings from [MENTION=357342]tobias.waldvogel[/MENTION] to other members to contact Google about it and that it's the secure way to go.

If I format the card as portable it should be able to be read as external, at least from what other boards mention, like in previous versions of Android.

DiskInfo reports the card as Internal Storage (MMCBLK1) when the main phone storage is reported as Internal Storage (MMCBLK0), but the file system is "texfat" (and not "ext4" as the main storage.)

Any input from [MENTION=5613633]YasuHamed[/MENTION], [MENTION=3989065]serajr[/MENTION]?, [MENTION=4675598]shoey63[/MENTION], [MENTION=7749536]Berni-0815[/MENTION] by any chance?

Thanks much,

MW
[Xperia Z5 Android Development] YasuHamed:
sir,

1. i am unable to understand how this is linked with modified kernel. ?

2. can you read that same SD card in different device(s) ?

3. any other sd card in your z5 behaves the same?

the only explaination i can give is that you may have flashed z5 ss kernel but you have dsds device. it happens with dsds hardware when it cannot see sd card if ss kernel if flashed! the device will boot but wont able to see. however even that case the card must be readable via twrp.

---------- Post added at 10:44 AM ---------- Previous post was at 10:37 AM ----------

i tried with superuser and it only ask

- Found superuser.zip. Install? [Y/n] Y
# Make su permissive (Permits any action as su)? [Y/n] N

it never asks do you want to give /system full write access :(

---------- Post added at 11:30 AM ---------- Previous post was at 10:44 AM ----------

i agree, there were two folders in the modules both lest modified 14feb17, the one with time stamp 11:33 works
[Xperia Z5 Android Development] shoey63:
- Formatting external SD Card doesn't encrypt it.

- Android folder is atomically created.

- Texfat is fine. It's Sony's implementation of exfat (for handling large files).

- Always format as portable storage to avoid bugs.

So It seems your real issue is no r/w access, although TWRP shouldn't have an issue with it.

To fix in booted Android,

- Download FX file explorer from Playstore.

- Go to Home > Media Card and open it.

- Press three vertical dots in top right corner.

- Click on Enable Write access.

- Press Next and select SD card.

- Press SELECT at bottom right corner.

You will now have write access.
[Xperia Z5 Android Development] adryanodej:
rootkernel kernel.elf boot.img

kernel.elf : line 1 syntax error: unexpected word

or bash: can`t not open kernel.elf

i cannot use the script, what i do wrong?
[Xperia Z5 Android Development] Berni-0815:
You're right. My fault. Sorry...

---------- Post added at 19:28 ---------- Previous post was at 19:21 ----------

Linux or windows?

For linux the command has to be

./rootkernel.sh kernel.elf boot.img

And the first line of rootkernel.sh has to be changed to

#!/bin/bash

or you have to set a

bash

before the command shown above.
[Xperia Z5 Android Development] adryanodej:
i`m on windows,, i opened a terminal in rootkernel folder.. i think is something that i miss
[Xperia Z5 Android Development] Berni-0815:
Just tested it; works perfect. Possibly you have a corrupt kernel.elf file... Do you extracted it using FlashTool's sin-editor?
[Xperia Z5 Android Development] Duvel999:
Disable Antivirus / Internetsecuity on your Windows laptop.
[Xperia Z5 Android Development] YasuHamed:
the post started under Sony's Z series Project / Z5

this script works with Z series devices ( atleast i have test 3 , Z / Z3 and Z5p ) ( snapdragon)

XPERIA M5 is Mediatek MT6795 Helio X10 device!

I don't think so that RootKernel Script works for those chipsets! i tried with my C5 and it wasn't able to read kernel

the only other way is to keep it running on 5.1 and root it via kingroot

OR install custom roms found in xda OR linage OS / Cynogenmod / Miui

---------- Post added at 07:20 AM ---------- Previous post was at 06:35 AM ----------

if the file path is long and contains folder with dots /.abc/.xyz etc

you may get this error

please paste the rootkernel folder in c:/ and try again
[Xperia Z5 Android Development] adryanodej:
take a look at the printscreen
[Xperia Z5 Android Development] mobiware:
Thanks so much [MENTION=4675598]shoey63[/MENTION]. Great info.

I have done all that, but when I attempt to give the SD card write access in FX, it takes me to an Android screen and I get the following message:

"The selected location is different than the location of this storage..."

Any thoughts?
[Xperia Z5 Android Development] YasuHamed:
sir if your device is ROOTED

can you please install this app and give /system access , reboot and check again

https://play.google.com/store/apps/details?id=nextapp.sdfix&hl=en

just a hunch

---------- Post added at 09:30 AM ---------- Previous post was at 09:29 AM ----------

sir which version of rootkernel is this? and what kernel.elf stands for ?

v5.23 ? v5.22 and kernel.elf of which android version ? .305 / .5.11 ( Android M ) Or .372 / .376 / 2.33 (android N)

please specify
[Xperia Z5 Android Development] adryanodej:
the version of rootkernel is the latest 5.23 and the kernel elf is from latest nougat .378
[Xperia Z5 Android Development] mobiware:
SD Card Inaccessible

Hamed,

Wow. I was just looking at this at the same time that you sent it to me as well!

It is for MM. I'm still looking at similar alternatives.

I still haven't checked your other suggestions about switching SD cards and phones, as I was out of town. I'll respond by tomorrow.

Thanks for all your help,

MW
[Xperia Z5 Android Development] YasuHamed:
it came in kitkat days when google restricted third party access to sdcard

i still use this app in order make it accessible to other file explorers

---------- Post added at 09:49 AM ---------- Previous post was at 09:47 AM ----------

sir i have stock modified kernel already at

https://mega.nz/#F!3FYhTbSC!9MraM-zYNRNMPzmTkSSs9g

log is

- 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
- Install TWRP recovery? [Y/n] Y
Installing TWRP
Compressing TWRP image
- Found superuser.zip. Install? [Y/n] N
- Install DRM fix? [Y/n] Y
- Install busybox? [Y/n] N
- Creating new initramfs
- Creating boot image
- Cleaning up

i am not sure why its not working for u. can you try 5.22 ?
[Xperia Z5 Android Development] adryanodej:
ohh, thank you very much , !!!!

flash it in a few moments see if it`s all good ! thhanks bro!
[Xperia Z5 Android Development] mobiware:
SD Card Inaccessible

It didn't work. Here's a screenshot.

(By the way, I assume the answer to use the 5.22 script was not to me but to adryanodej, right?)

I also tried Root Browser and couldn't change the SD card's permissions.

I am wondering if I should use [MENTION=3989065]serajr[/MENTION]'s script from post #1702. What do you think?
[Xperia Z5 Android Development] YasuHamed:
yes i am sorry for jumbled replies! i tried disabling multiquote but i guess its not working

sir , please tell me did you flash you kernel? i got similar symptoms when i flashed z5 kernel over z5p (dsds) it keeps asking rw permissions and given system explorer FILE COMMANDER was unable to see sdcard at all!!!

---------- Post added at 10:06 AM ---------- Previous post was at 10:05 AM ----------

please put

1. superuser-r59 and phh superuser .apk in your sdcard --- (once you flash superuser, install apk after boot)

2. if you wana use SUPERSU then skip no1.

https://mega.nz/#F!3FYhTbSC!9MraM-zYNRNMPzmTkSSs9g

however i have better battery performance with superuser-r59
[Xperia Z5 Android Development] mobiware:
SD Card Inaccessible

I have flashed the following DSDS firmware for Nougat: E6683_Customized MY_1298-9654_32.3.A.0.376_R1D. The older 5.11 kernel would not matter if it was SS, since it was only used to take the TA backup, right?

I have done exactly what you did before on your phone, but with the exception that I have systemless TWRP on the Z5. And maybe on another note, TWRP doesn't see the SD card either.

So I ran Tobias' script, with dm-verity and Sony-RIC on, DRM fix and then I restored my Dev Keys with flash_dk. I flashed TWRP systemless, then superuser and busybox and made system writable using the instructions from post #5 of your other thread:

https://xdaforums.com/xperia-z5/general/z5-making-writable-32-3-0-372-root-t3551067

I tried those a few times.

I also tried 3 file explorers and tried to give permissions to the SD card. No luck.
[Xperia Z5 Android Development] sceryavuz:
OK, I will try Kingroot on L.

---------- Post added at 10:37 AM ---------- Previous post was at 10:36 AM ----------

Share kernel.sin file with us..
[Xperia Z5 Android Development] YasuHamed:
ok another hunch

I read on xda that if you plan to restore your drmkeys and ta backups, you must set DRM FIX as "NO" in tobias' script. the two together Donot work

so i would suggest if you have put DRMFIX "Y" earlier try making another kenrel with NO

adding to that....
[MENTION=3989065]serajr[/MENTION]

https://xdaforums.com/showpost.php?p=71175804&postcount=2236

has posted this another unoffical script addition to tobias script, to toggle between drm fix and backing up TA.img
[Xperia Z5 Android Development] adryanodej:
i flashed .378 but when i start the phone after 10 second red led flash 3 times and the phone reboots. can`t enter in twrp neither. i forgot to mention i`m on xperia z5 compact . can` you provide me a kernel for 378 xperia z5 compact ?
[Xperia Z5 Android Development] shoey63:
Seems to be some weird bug with Z5 dual. I don't own that variant, so I can't help. Sorry.
[Xperia Z5 Android Development] YasuHamed:
oh no, it was for z5p as mentioned in the file name E6853 noba

if you can send me the kernel i will try making one for u!

you are stuck at bootloops. now worries, flashing right kernel will boot the device
[Xperia Z5 Android Development] adryanodej:
i extracted the kernel from ftf then i flash it and everithing it`s fine.. i`l atach you the kernel to make it for me if you can. thanks a lot

edit. the file is to large so you cand find the kernel here: https://mega.nz/#!PYNmEJiK!6f6NoC9ZvcHu1Im7uKSyM8iNB5iCFbDzB-CsbDRMgc0
[Xperia Z5 Android Development] serajr:
Unoffical 2 is on the track with some new features like optiong to add recovery.img into the ramdisk, also latest PoC fixes (including ua-modem-switcher), but i can't share it yet due some denials which I still need to fix them up (maybe on next weekend)!

And the sdcard issue you're talking about, it's weird, I never faced such issue!
[Xperia Z5 Android Development] YasuHamed:
please find your modified stock kernel at

https://mega.nz/#F!3FYhTbSC!9MraM-zYNRNMPzmTkSSs9g ( 32.3.A.0.378_z5c.img)

details about how to use it

https://xdaforums.com/z5-premium/general/rooted-stock-modified-kernels-32-3-0-t3556874

- 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
- Install TWRP recovery? [Y/n] Y
Installing TWRP
Compressing TWRP image
- Install kcal kernel module? [Y/n] N
- Install DRM fix? [Y/n] Y
- Install busybox? [Y/n] N
- Creating new initramfs
- Creating boot image
- Cleaning up
Done

LOG
[Xperia Z5 Android Development] adryanodej:
yey, it worked, thank you very much ! finaly :))) thanks a lot for your support
[Xperia Z5 Android Development] YasuHamed:
:) i am glad to be help :)