yashsingh1/xdaforums huggingface dataset:
[Xperia Z5 Android Development] Berni-0815:
Yes. I used rootkernel version 5.23 and I put superuser.zip (filedate 23.09.2016) into that directory. Maybe newer versions are not working? Don't know...

Rootkernel V5.23

- Unpacking kernel
Found elf boot image
Kernel version: 3.10.84-perf-g0802f10
Found appended DTB
- Detected vendor: somc (Sony), device: suzuran (Xperia Z5 compact), variant: row
- Unpacking initramfs
- Detected platform: 64-bit
- Detected Android version: 6.0.1 (sdk 23)
- 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
- Found superuser.zip. Install? [Y/n] y
# Make su permissive (Permits any action as su)? [Y/n] y
Adding service entry for superuser
Adjusting SE Linux policy for superuser
- Found xposed-v87-sdk23-arm64.zip. Install? [Y/n] y
- Install DRM fix? [Y/n] y
- Install busybox? [Y/n] y
- Creating new initramfs
- Creating boot image
- Cleaning up
Done

That's all...
[Xperia Z5 Android Development] mhaha:
Thanks for that, unfortunately I did the exact same things as you down to the version number of each tool and selections. I guess I'll try again later repro-ing your config, and if still fails, try what fralik reported to work for him after experiencing the same issues.
[Xperia Z5 Android Development] mobiware:
Install TWRP 3.1.0 instead of 3.0.2 on Xperia Z5

[MENTION=3989065]serajr[/MENTION],

Thanks again for your response. Without meaning to go back and forth, here's where I am (which I included at some point, although it's admittedly too much to remember each person's situation):

I have taken a backup of my TA partition, I have unlocked my bootloader and I have flashed Nougat on my Z5. I have also created kernel.elf on the side from my newly flashed OS (waiting to flash it.)

I believe I need to use the TA with its whole name (including the date) in this script (unlike the ToC one that needs the file renamed.)

If I were to upgrade TWRP to the newest version, I need to answer N to this script prompt when I run it, then answer N to the prompt for superuser (as it's not fully compatible with version 5.23, per post #2272), flash TWRP manually, boot to TWRP, flash superuser through it and then flash the kernel. After that I need to restore the DRM keys using flash_dk. All this needs to be manual.

The only thing that this script will take care will be to remove dm-verity, deactivate Sony RIC; I don't know what it will do to the encryption permissions which are taken care of through the ToC script. The ToC script is great, gives flexibility and supports a much wider range of phones, but I believe it still needs some work, e.g. issues with the modem, etc. which I do not want to run into and have to modify scripts, due to time constraints.

The only thing I need here is to upgrade the TWRP to 3.1.0 instead of having 3.0.2. I am not sure how to use your "Option 1" above. Are you saying that I need to include the recovery.img file into the rootkernel subdirectory? Would that overwrite the "twrp_common" files? I tend to doubt that. Would it be better to install the 3.0.2 version and then flash the newest version manually? Could I soft-brick the phone though?

Time is precious for all of us, so I hope this is not too involved for you.

Thanks again,

MW
[Xperia Z5 Android Development] serajr:
Sorry bro, I think I was not clear enough. No, including recovery.img file into the rootkernel subdirectory will do nothing. Do this just in case you go for TA PoC!

I think you need to choose between rootkernel or TA PoC.

Rootkernel seems to meet all your needs, but TWRP to 3.1.0, right? So, go for it and choose N for TWRP. Later flash the boot.img (fastboot flash boot boot.img) and also your TWRP to 3.1.0 image (fastboot flash recovery your_twrp_3.1.0.img).
[Xperia Z5 Android Development] f4t1:
when you have a TA backup from your phone, do you still need the drm fix? or can you run the script without, flash TA via flashtool and have all functions?
[Xperia Z5 Android Development] mobiware:
TWRP installation from OTG

Thanks again. I did that and got into TWRP.

1. There was no yellow light. Is there any way to have that?

2. I tried installing superuser.zip in TWRP from an external SD card connect through an OTG cable, as I couldn't mount the card itself when inserted in the phone slot. I got the following message:

"Zip signature verification failed!

Error installing zip file '/usb-otg/superuser.zip'"

How can I get to install it?

I appreciate your time, as always!

Edit: I was able to install superuser.zip through TWRP after I disabled the signature verification. Then I checked root when I rebooted and I am rooted. I went back to TWRP and installed busybox. I am at the point where I need to make superuser permissive. I tried using the instructions on this thread:

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

I didn't succeed. Any ideas on how to have permanent RW access?

Also, how can I access the SD card and make it writable?

Edit: I got to make the system writable by downloading the terminal app and going over the procedure again. I was using ADB at first.
[Xperia Z5 Android Development] mobiware:
Hi there,

How do you flash it to the boot partition? Also, how do you get out of the boot loop?

Thanks,

MW
[Xperia Z5 Android Development] mobiware:
superuser partially compatible with Titanium Backup

I have installed superuser manually through TWRP. I just installed Titanium Backup. It gives me a message that it's more compatible with SuperSU than superuser and that I have to install SuperSU if I run into any problems. So far it works OK. I'll let you know how it goes later on. Good luck.
[Xperia Z5 Android Development] Berni-0815:
Only by including TWRP in the rootkernel. The yellow light is powered by the boot system.
[Xperia Z5 Android Development] bruno$0:
Dear Mr. Tobias. Twrp already released a new version of his recovery. It's will be cool if you add it on your tool. How can i check if i flashed dk.ftf property? I still have an issue: "FIDO Keys not provisioned".
[Xperia Z5 Android Development] pottu221:
Help me please

so when i try to execute rootkernels(unofficial or original it doesnt matter) then it just stops on the detected android version. like so

- Unpacking kernel

Found elf boot image

Kernel version:

Detected vendor: mediatek, device MT6735, variant: MT6735

- unpacking initramfs

- detected platform: 32-bit

- Detected android version: 6.0

and i dont know how to solve this proplem
[Xperia Z5 Android Development] mobiware:
Yellow light in TWRP

Vielen Dank Bernhard!

I flashed TWRP and the other components myself, so that I would have the latest version of it: 3.1.0 instead of 3.0.2 that came with Tobias' script.

If I were to re-run RootKernel and have all the components integrated into the kernel, instead of flashing the pieces myself, do I need to do anything special or just create the new kernel and have it flashed? I know it was mentioned on the OP but it wasn't very clear. Do you know of any more detailed instructions on reflashing kernels?

---------- Post added at 02:24 PM ---------- Previous post was at 02:22 PM ----------

Did you take a backup of your DRM keys originally before you unlocked your bootloader?

If so, did you run flash_dk with the file as a parameter?

If you didn't, here is the command that you need to run in a command prompt window:

1. 'flash_dk TA-ddmmyyyy.img DevKeys.ftf'.

(where ddmmyyy is the date that the TA file with the DRM keys was created by you.)

2. Then move the DevKeys.ftf file into 'c:\Users\YOURNAME\.flashtool\firmwares'.

3. Start Flashtool and click on the lightning bolt.

4. Leave the Flashmode radio button selected and click OK.

5. Under Firmwares, click on the appropriate categories (phone name, etc.) if you have multiple firmwares there, select the DevKeys firmware that you created above and click on the Flash button.

6. Hold the Volume-Down key on your phone and plug the USB cable to your PC. This will flash the DRM keys to your phone. This should show: "FIDO_KEYS : Provisioned" in your service tests/service listing. By the way, you will not need to execute this procedure again after subsequent upgrades.

I hope this helps,

MW
[Xperia Z5 Android Development] Berni-0815:
Gern geschehen. ;)

No. You should have everything you need. If you flashed TWRP by

fastboot flash recovery <your_recovery_image.img>

, the recovery is accessible by pressing volume down before pressing power on. This one is installed in the fota partition and works "parallel" to a TWRP installed in the kernel. This is very important when you are playing with several rom's like LineageOS, which do not have a comfortable recovery like TWRP.
[Xperia Z5 Android Development] mobiware:
Sorry about the multiple post above Berni. I meant the first half for you and the second half for "bruno$0" but it didn't take my edit.
[Xperia Z5 Android Development] mobiware:
Multiple recoveries

Wow! This is pretty interesting. I flashed recovery as you mentioned. I don't have a recovery in my kernel.

I was asking in general, in case I decided to go with the second version of my boot.img. I am still learning. Do I flash the second kernel on top of the first one, or is there a more formal procedure?

I created two of those: one with TWRP, superuser, busybox and all the restrictions removed (dm-veriry, Sony-RIC) which I named boot_TWRP.img but didn't flash.

The other one I named boot_NOTWRP which I flashed. It only had the restrictions removed but nothing else in it. I then flashed TWRP 3.1.0 as you mentioned, and then I flashed superuser and busybox manually through TWRP, which I had saved on the phone from before. (I had stored those zip files onto the external SD card which I connected to the phone via an OTG cable originally, but something didn't work right.)

I then restarted the phone, downloaded Terminal from the Play store and ran the su commands that [MENTION=5613633]YasuHamed[/MENTION] mentioned here: https://xdaforums.com/xperia-z5/general/z5-making-writable-32-3-0-372-root-t3551067

This looks good now. I just need to read up on what to do with my SD card, because I think I might have made it unreadable. I think I need to reformat it on my PC and then on my phone again. I also need to look into formatting it with EXT4.

I'll start doing some research on LineageOS as well. Have you tried ROMX by any chance?

Thanks again so much Berni!

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

Thanks [MENTION=4990132]panecondoin[/MENTION],

I was able to use TWRP 3.1.0 actually by flashing it manually instead of using what was in the script (3.0.2). I then flashed superuser and busybox manually through TWRP, and made the system writable through [MENTION=5613633]YasuHamed[/MENTION]'s instructions.

---------- Post added at 03:44 PM ---------- Previous post was at 03:44 PM ----------

Thanks [MENTION=4990132]panecondoin[/MENTION],

I was able to use TWRP 3.1.0 actually by flashing it manually instead of using what was in the script (3.0.2). I then flashed superuser and busybox manually through TWRP, and made the system writable through [MENTION=5613633]YasuHamed[/MENTION]'s instructions.
[Xperia Z5 Android Development] bruno$0:
Yes. I made a backup before unlock it and i made the ftf with it snd flash as you explain.

Exist another thing that can make it don't work? Maybe a full flash with the rom ftf? I made some tests to install magisk. Could this Block something in the process? How can i check if everything is okay?

Thx 4 help me
[Xperia Z5 Android Development] YasuHamed:
i did this way...

1. created one kernel of z5p E6833 of .376 / Android N with all the Tweaks accept Twrp and superuser /supersu (boot0.img)

2. twrp 3.1 as boot1.img

I flashed boot0.img (this kernel's dm varity / sony ric is OFF and DRM FIX is ON

now

while device z5p / z5 is connected in fastboot mode i woke my device by temporarly in twrp3.1

while img file in the adb folder itself

fastboot boot boot1.img

and enter

the device will wake up in 3.1 twrp and won flash any recovery. I flashed my supersu / superuser and REBOOTED

even for extra saftey and just to be sure, i relock my boot via flashtool

later i made my /system folder writable with those commands

now i have rooted phone. with no traces of recovery so if device goes in wrong hands the person has to be clever enough to gain access of my device
[Xperia Z5 Android Development] Berni-0815:
Sorry, I'm a little bit confused now. Is there any question unanswered by me? :confused:
[Xperia Z5 Android Development] mobiware:
I guess I was trying to figure out if I need to flash both kernels, so that I have 2 recoveries. If so, when i flash the second one do I need to clear the cache or select any other options?
[Xperia Z5 Android Development] tanago:
thanks for this tool! :)
[Xperia Z5 Android Development] Berni-0815:
The second flash of a boot.img will overwrite the first one completely. You can normally only have one boot-system in the one and only boot partition. There are ways to create a multi-boot-system, but I don't know more.

If you like to have two recoveries, the first one must be part of the custom kernel, the second one can be flashed into the fota partition by

fastboot flash recovery <name.img>
[Xperia Z5 Android Development] mobiware:
Thanks Berni. I wasn't talking alt a multi-boot system. I was thinking about flashing the other kernel I created that had TWRP, so that I get that yellow light. It's not important. If I do though, do I just flash it with fastboot or do I do anything more special?

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

Bruno,

I'm not sure. I'll try to research more ant magisk. I would try the Rom FTF; that looks promising.

Let us know how that works,

MW
[Xperia Z5 Android Development] Berni-0815:
fastboot flash boot <your-boot-image.img>
[Xperia Z5 Android Development] mobiware:
Prerequisites before flashing a new kernel

Don't I need to wipe data, cache etc?
[Xperia Z5 Android Development] Klaus N.:
No
[Xperia Z5 Android Development] sceryavuz:
Hi [MENTION=357342]tobias.waldvogel[/MENTION] and [MENTION=3989065]serajr[/MENTION]

I have E5603 Xperia M5, I tried rootkernel but device not detected. I have E5603_30.2.A.1.21_1297-4908_R3B.FTF and will send to you required files. There is no kernel.sin file.

Files : https://drive.google.com/drive/folders/0BxK4VsUwefKzRWdJVkV0VTZzMTQ

Please help me, there is no root method. (kingroot etc. not work) How can I do that manually?
[Xperia Z5 Android Development] serajr:
I don't know if your device is compatible with the tool, anyway, you have the

boot.sin

file in your ftf.
[Xperia Z5 Android Development] mobiware:
Having 2 recoveries flashed to phone

Were you able to resolve having 2 recoveries on the phone?
[Xperia Z5 Android Development] YasuHamed:
there were no two recoveries. only one, but i didn't flash it! i just boot my device temporarily with Twrp. and when i rebooted the original tweaked kernel with no twrp booted the stockrom having root access
[Xperia Z5 Android Development] mobiware:
Two recoveries

Can you explain that a little further?

---------- Post added at 11:41 PM ---------- Previous post was at 11:33 PM ----------

Can someone explain that a little more? I think a lot of us will appreciate that. Thanks in advance!

Can you also explain this a bit more? Which step constitutes the compiling of the kernel in the OP?

Thanks for your awesome work!
[Xperia Z5 Android Development] mobiware:
Sounds interesting, nevertheless. Are you using a pocket PC, which you bring with you all the time, lol?
[Xperia Z5 Android Development] YasuHamed:
Xperia Z5p itself is big device to carry :D

want no more responsibility to carry and care device!

but i wana try Mi books

---------- Post added at 06:57 AM ---------- Previous post was at 06:34 AM ----------

well let me begin from beginning

while your z5 running on .376 or .378 (android N)

put supersu or superuser-r259 in your SD CARD

download the ftf file .376 or .378 (2.x GB)

and extract kernel.sin then convert

kernel.sin to kernel.elf (from ftf kernel.sin can be extracted and via flashtool you can convert sin to elf)

now u have 1 file kernel.elf of Android N .376 build

Patch this kernel.elf using v5.23 script accordingly. ( dmvarity OFF / sony RIC OFF / install twrp NO/ drm fix YES / supersu NO

now you have kernel.img (patched kernel.elf to kernel.img) (or boot.img, whatever name you wana give)

from the following link download z5's TWRP 3.1 image (since you did not patch twrp in your patched kernel

https://www.dropbox.com/sh/lficbbcj7qbb1uc/AAA2IPXh0MLOFhoPhAyU3-UIa/z5 (Sumire)?dl=0

ref

https://xdaforums.com/crossdevice-dev/sony/twrp-3-1-0-z5-z5c-z5p-t3571050

download the twrp recovery.img

NOW you have TWO files 1) kernel.img and 2) recovery.img

connect your device z5 Sumire in FLASHMODE and via FLASHTOOL, flash the kernel

once done, disconnect the cable

now open Minimal ADB and Fastboot (command prompt) (if you don't have this installed then download it from https://devs-lab.com/download-minimal-adb-fastboot-tool.html)

place the twrp recovery.img at "C:\Program Files (x86)\Minimal ADB and Fastboot1.x"

-connect your xperia in FASTBOOT mode (blue LED)

-now in command prompt window of adb type "fastboot devices" ( without quotes)

it will show you device connect ID

now type

fastboot boot recovery.img

and enter

it will send and execute img file

look at your z5 screen. DEVICE will immediately boot in twrp 3.1 (temp boot in twrp)

flash your supersu and reboot your device in system!

since you already had flashed the patched kernel and now u just flashed supersu zip , the device will boot having root access but no twrp.

HOWEVER

if you flash supersu via script only v5.23 , you don't have to do all this and forget about twrp at all!

but then many user have reported batter drain issues if superSU is patched in to kernel

the trick of temporary booting twrp is pretty safe and cover many devices having unlocked bootloader! i have tried this method with

XIAOMI Redmi 3 and XIAOMI Mi MAX
[Xperia Z5 Android Development] bruno$0:
Now i was able to install magisk and pogo / android pay is working again, but i keeps getting fido_keys: not provisioned.

I already flashed the ftf with my keys as you told me.

How can i check if i have the "DRM" partition on my device? Ps. I'm using the 5.22 version from this tool. Maybe need to use the 5.23 version???

Thx
[Xperia Z5 Android Development] mobiware:
No TWRP installed

OK. So basically you don't have a TWRP installed on the phone in case someone gets a hold of it and boots in it. You get into TWRP through connecting to your PC every time you need it. That sounds interesting. I was wondering if there are any issues someone can report on that would only be resolved by a flashed recovery. I am not that advanced myself but you can tell us. If not, that's great.

---------- Post added at 03:57 PM ---------- Previous post was at 03:34 PM ----------

Tobias in the OP wrote:

"What should I do if there is an update to this script?

First check if you really need to run this update by checking the changelog. E.g. if it says binary for Linux fixed and you are using Windows then probably you don't care. If you did not change your Android version then all you have to do is to update the kernel package with fastboot flash boot. If you do not use the automatic SuperSU integration then you have to reinstall SuperSU in TWRP.

.

.

.

Recompiling the kernel is not required as only the init ramdisk needs to be modified."

Can someone explain that a little more? I think a lot of us will appreciate it! Thanks again.

---------- Post added at 03:57 PM ---------- Previous post was at 03:57 PM ----------

When I ran flash_dk, it restored my FIDO. If you followed the instructions I sent you, then I am wondering if it has to do with the kernel you are using. Did you have yours modified or did you download the one from MEGA as you mentioned before? I will try to write some detailed instructions on how to do the whole thing, which has worked for me. I haven't installed Magisk though so that might be throwing the whole thing off. I would look at post #2188 and/or ask shoey.
[Xperia Z5 Android Development] YasuHamed:
I am always against installing recovery in to kernel. because anyone can switch-off my mobile and goto recovery and can access my /data /system ( i dont do encryption to saving battery) and sdcard also

i don't want to install SuperSU directly in to kernel because then

1. i wont be able to update via playstore if supersu is embedded in to kernel

2. battery drain is relatively high

so what is the 3rd option?

its boot twrp via fastboot to your device and

1. flashing supersu or superuser

this way whenever i boot my device! there is no recovery and my work is done
[Xperia Z5 Android Development] mobiware:
Boot into TWRP from ADB

OK. I had done all that which you are showing here, prior to your post if you look back. (It's irrelevant though). The only thing that I have different is that I have TWRP installed on the FOTA partition.

What I was asking was that you get into TWRP through connecting to your PC every time you need it, right? In other words you don't have it installed on the FOTA partition, right?
[Xperia Z5 Android Development] youvedone:
Tried rootkernel with 32.3.A.2.33 for z5 Compact:

- 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
[Xperia Z5 Android Development] youvedone:
hm.. that did work before 7.. what I have in mind.

But the combination with rootkernel did work every time. And it is such a comfortable way to integrate.

With a fastboot and recovery.img I had somethimes problem to have a working combination. (don't know exactly why.. but.. )
[Xperia Z5 Android Development] mobiware:
When I go into Settings | Storage I get a black screen (with the soft buttons on the bottom showing) and the phone is crawling. After awhile sometimes I see how much storage I have and sometimes the service comes back and asks if I want to Close Settings or Wait. Can I tell what's going on with my SD Card? I formatted it on my PC and then I formatted it again on the phone for MTP. Could that be the problem, where the SD Card has become part of the internal storage somehow (despite the way I've formatted it)?
[Xperia Z5 Android Development] sceryavuz:
Extract system.sin file

Extract data with Flashtool -> Sin Editor

You have system.ext4 file now (5.2GB or bigger)

Use Ext2Read to open system.ext4 file

Save this folder into your desktop "/lib/modules"

Create a folder named "3.10.84-perf-g1016077" into twrp_common_kmodules

Copy required files into this folder..

core_ctl.ko

ecryptfs.ko

kscl.ko

mhl_sii8620_8061_drv.ko

texfat.ko
[Xperia Z5 Android Development] youvedone:
nice.. have done that. If some would have the folder to integrate it:

3.10.84-perf-g1016077-zipped-folder
[Xperia Z5 Android Development] sceryavuz:
Here is the twrp_common_kmodules for 3.10.84-perf-g1016077 kernel.

Extracted from Generic GLOBAL system.sin
[Xperia Z5 Android Development] yahya47:
Why I can't get to recovery mode in my Sony z82
[Xperia Z5 Android Development] Nyuubi:
Has anyone tried to use this tool on the fw 3.22 ? Does it still work?
[Xperia Z5 Android Development] Hamidreza2010:
bro is 3.1 or still 3.0.2 ?
[Xperia Z5 Android Development] sceryavuz:
Yes. Here : https://xdaforums.com/xperia-z5/general/ftf-e6603-33-53-83-google-drive-patched-t3581463

These are kmodules not twrp itself. We have to compile new build and put into twrp_common for 3.1.0

I think, 3.0.2 works good, 3.1.0 did not provide much..