yashsingh1/xdaforums huggingface dataset:
[Xperia Z5 Android Development] reloaded000:
Hi,

When using the tool for Z5 compact 32.3.A.2.33, there's the following that occurs:

- Unpacking kernel

Found elf boot image

Kernel version: 3.10.84-perf-g1016077...

.....

.....

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

This was not an issue with 32.3.A.0.378. With 32.3.A.0.378, I also got:

- Install kcal kernel module? [Y/n]

This was not given as an option in 32.3.A.2.33.

After all of the steps that worked with 32.3.A.0.378, 32.3.A.2.33 is being reported as not rooted.
[Xperia Z5 Android Development] WanderMax:
does the Android security patch update affect the kernel and root?
[Xperia Z5 Android Development] Berni-0815:
Please read before writing. Your question is answered several times... :cool:
[Xperia Z5 Android Development] Frank J:
Have you found the compiled kcal module as yet? I'm also looking for it
[Xperia Z5 Android Development] sceryavuz:
People are so lazy..
[Xperia Z5 Android Development] YasuHamed:
use this script

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

it doesn't give twrp errors

also I will agree with [MENTION=7749536]Berni-0815[/MENTION]

please read post thoroughly and you will save so much of your waiting time.

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

To My understanding the ROLE of security patch is irrelevant or minimal once after you have rooted device. (specially via flashing modified kernels)

Android security patches are designed to protect system from hackers if they try to gain /system access

once you have altered the kernel and have SuperSU installed basically the key of the door for /system folder is now in the pocket of superSU and only supersu grants permission to /system folder

However one can argue that since most of the attacks are designed to bypass secuirty patches so even on rooted device security patch will play role

moreover i do agree that most of the savvy user wants to be on latest security patch.
[Xperia Z5 Android Development] WanderMax:
Any plan to support XC?

Thanks.
[Xperia Z5 Android Development] serajr:
It's not easy supporting devices that I don't own. Anyway, tool is already compatible, just ignore "unsupported/untested" messages!!

For TWRP you can always flash it to the FotaKernel partition (fastboot flash recovery your_device_recovery.img).
[Xperia Z5 Android Development] anjelz2012:
What is the solution for the problem of wi-fi that manages to connect but it costs that there is transmission of data? This happens in the last updates of the mod have z5p E68553
[Xperia Z5 Android Development] YasuHamed:
I have Z5P, and X,

I personally guarantee that this script works for BOTH

Also i have created patched kernels for Z5 and Z5c for many members over the last 12 months and it worked for them.

so the answers is YES

---------- Post added at 11:04 AM ---------- Previous post was at 11:01 AM ----------

i did not understand the question fully. but if wifi signal is not giving you access to the net, z5 will constantly be switching to data on and off.

so its best to switch data off once you have wifi connectivity

furthermore , i didnt get any such error (ever) in any build

---------- Post added at 11:08 AM ---------- Previous post was at 11:04 AM ----------

[MENTION=3989065]serajr[/MENTION]

your script works for X perfectly FINE

i even manage to re-instate TA.IMG (by skipping drmfix question) and it worked just fine!

however on X you cannot embed twrp, it always gives loops,

on X, power button and volume down key must be held together until u have PINK LED. ( i.e if you have flashed recovery to fotakernel partition)

embeded twrp with the script and pressing volume up/down key always softbrick device OR gives bootloops

trivia. the X was released on android 6 so the dirty cow script worked!
[Xperia Z5 Android Development] sceryavuz:
Hi [MENTION=3989065]serajr[/MENTION],

Some people report a bug, SafetyNet does not work. "SafetyNet Failed: CTS profile mismatch" I searched on the internet, magisk hide and suhide tried but not work. Did you try SafetyNet?
[Xperia Z5 Android Development] Janzomaster:
Hi there, I have a problem with (re)gaining root.

I'm using a z5c and have used the script before with getting a working "phh superuser" root.

Now, I updated to 32.3.A.2.33 doing a full wipe.

I flashed the .ftf with FlashTool and the used the rootkernel script as follows:

./rootkernel.sh kernel.elf kernel-patched.elf
Rootkernel V5.23

- Unpacking kernel
Found elf boot image
Kernel version: 3.10.84-perf-g1016077
Found appended DTB
- Detected vendor: somc (Sony), device: suzuran (Xperia Z5 compact), variant: row
- Unpacking initramfs
- Detected platform: 64-bit
- Detected Android version: 7.0
- dm-verity is enabled. Disable? (Say yes if you modify /system) [Y/n] n
- Sony RIC is enabled. Disable? [Y/n] n
- Skipping TWRP recovery. No kernel modules for 3.10.84-perf-g1016077 available
- 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
- Install DRM fix? [Y/n] n
Skipping drmfix
- Install busybox? [Y/n] n
- Creating new initramfs
- Creating boot image
- Cleaning up
Done

superuser.zip downloaded today from http://superuser.phh.me/superuser.zip

I flashed the kernel using "fastboot flash boot kernel-patched.elf"

Now, when I try to use a root-dependent app, e.g. TitaniumBackup, no root access is deteced.

Firing up "phh's superuser" app adds an notification telling me "su binary outdated", when I tap on the notification, it takes me to the superuser app without giving me any options what to do.

Using SuperSU works.

What am I doing wrong?
[Xperia Z5 Android Development] Berni-0815:
I say "Y" to every of these questions.
[Xperia Z5 Android Development] Janzomaster:
Doesn't help - and as I said, SuperSU works just fine.
[Xperia Z5 Android Development] ksnmia:
modifying ramdisk contents not getting reflected

Hi,

I want to modify the contents of the ramdisk on my xperia z5 E6653 5.1.1 Android phone.

I extracted the kernel.elf file from the kernel.sin as mentioned, and added a method in the rootkernel.sh which would just my version of init.rc into the ramdisk folder (the original init.rc + 1 setprop call in on boot method). I'm calling this function right in the beginning after the detect_android function, so that the remaining changes to the init.rc in the subsequent methods does not get affected.

I tried by putting a "setprop log.ksnmia 1" in the on boot function inside init.rc,

but a getprop does not show that this attribute is being set. Although when I unpack this boot.img(Using Android Kitchen tools unpackimg.sh) the init.rc file in the ramdisk folder shows the setprop is there, which means that even though the ramdisk modification was made(not usre how successfully) the result was not seen.

Can you please help me with the ramdisk modification step and how I can make the init.rc changes to the boot.img, it will be great help!

Phone - Xperia z5

Model - E6653

Android Version - 5.1.1

Build Number - 32.0.A.5.12

Kernel Version - 3.10.49
[Xperia Z5 Android Development] sceryavuz:
Click this : https://xdaforums.com/showpost.php?p=71655368&postcount=2375

Download and extract for TWRP, "~\Android\twrp_common_kmodules"

DELETE superuser.zip file, PATCH your kernel (all Y except root) WITHOUT ROOT.

Open TWRP, then flash superuser.zip

Then open Google Play, download phh superuser app for root management.
[Xperia Z5 Android Development] Janzomaster:
Thanks for your answer - but what am to I do with the kmodules? Is it just to get TWRP working?

/edit 1:

figured it out, thanks

/edit 2:

I'm bricked :eek: stuck at sony-logo
[Xperia Z5 Android Development] sceryavuz:
I don't use kcal, not important for me. You complain about superuser, so this is the solution for working TWRP.
[Xperia Z5 Android Development] Janzomaster:
So, I ended up bricking my device.

This is how I got here:

I had a working

encrypted

Android with rootkernel + SuperSU. Because of the battery drain, I wanted to get phh's superuser. I downloaded the kmodules from here https://xdaforums.com/showpost.php?p=71655368&postcount=2375 and add them to the rootkernel-folder. I then ran rootkernel (no to everything except TWRP) and then booted to TWRP. I set TWRP to have write access to /system. With no access to storage, as for the encryption, I did nothing there and restarted the phone. Then I got stuck at the sony logo.

I can still use fastboot, tried flash kernels with different options chosen with rootkernel, no help.

What can I do to get my phone working again? Preferably without wiping everything, as I also can't find a TWRP with proper decryption support for my phone, thus I can't do backups.

Can I just reflash the rom with FlashTool, without wiping everything, or will that alter the encryption so it's not recoverable?
[Xperia Z5 Android Development] Klaus N.:
Has anyone got it to work with the Xperia Z1 (honami)? TWRP and busybox isn't important for me, only the drm fix and picking up the already flashed DK.ftf.

Thanks in advance!
[Xperia Z5 Android Development] sceryavuz:
Honami not included.

Try PoC : https://xdaforums.com/crossdevice-dev/sony/poc-real-trim-instead-drm-fix-t3552893

or

Try that : https://xdaforums.com/crossdevice-dev/sony/xperia-z1-z2-z3-series-devices-drm-t2930672

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

You have to sure before the procedure done. Flash stock FTF withOUT select any wipe options. Backup your data and decrypt your phone.

Then flash FTF with all wipe options selected like there. Flash TWRP included kernel. Then flash Magisk, better interface than phh. Magisk already has phh solution.
[Xperia Z5 Android Development] altvolt74:
off topic didyou guys know what file i have to edit to allow theming in android os ...for example if i use andro plus kernel everthing its fine then if i patch my kerne or stock kernel system ui force close

i have patch service jar but just system ui force close on stock kernel
[Xperia Z5 Android Development] Klaus N.:
Thanks for your reply!

As already mentioned: I only want it to pick up the ta. Btw, the drm fix here works, but it doesn't pick up the already flashed ta (DK.ftf).

PoC would be an option. I also tried that, but after flashing the result (new_boot.img), the service menu > security shows "none", so it doesn't find the ta, too.

Your 2nd tip isn't an option for me, because I want to use my ta backup.
[Xperia Z5 Android Development] azndan2:
When I use this with my Z4 tablet (32.3.A.2.33_R1D), it boots up but there is no touch screen functionality. Any ideas?

---------- Post added at 09:37 PM ---------- Previous post was at 09:18 PM ----------

I have this same problem :(
[Xperia Z5 Android Development] dape16:
If you have a backup of your TA partition you can use this guide:

https://xdaforums.com/z4-tablet/general/guide-nougat-drm-fix-root-twrp-sgp771-t3555265
[Xperia Z5 Android Development] sceryavuz:
Patch services jar and delete all odex files. Wipe dalvik and cache.. System UI gives fc because of that..

https://xdaforums.com/crossdevice-dev/sony-themes-apps/guide-disable-signature-verification-t3549952
[Xperia Z5 Android Development] altvolt74:
indeed i done that patch service.jar core.jar and AppOpsService still have force close in fact the patch works i can see lucky patcher describe that is already patch also using the modded system.ui but only if im using andro plus kerne and some older kernel but as soon i flash stock kernel patch whit the tool provide here had system force close perhaps the tool doesnt patch DM-Verity or there missing commands

also im stock deodexed even if clear cache or wipe the entire phone doest work (nougat latest .33)
[Xperia Z5 Android Development] azndan2:
The problem is that I don't have the TA backup :(
[Xperia Z5 Android Development] nreuge:
Did you find anything? It has obviously smthg to do with the kernel...

I can use your XZs SystemUI port only with the latest AndroPlus kernel (but unfortunately it breaks Sony soundenhancements...)

With Stock patched or Zach kernel, SystemUI FC...
[Xperia Z5 Android Development] freaky2xd:
is there a way to set SElinux to enforcing?
[Xperia Z5 Android Development] p1e9t9e2r:
this tool works for my Z5 premium on android 6, thank you for your excellent work!

as we know official update (for now the newest version is 32.3.A.2.33) has already be published, will this tool be also updated to support android 7?
[Xperia Z5 Android Development] dermaze:
Hello,

I gave it a try when the Nougat FW came out and it worked just fine with E5823_32.3.A.2.33_1298-1220_R5D.ftf on my z5 compact.

There's some additional work, you've got to extract your kernel modules. [MENTION=5813612]sceryavuz[/MENTION] has described it nicely here.

But then you can enjoy all the newest and brightest. ;)
[Xperia Z5 Android Development] osm0sis:
Hey guys!

I'm ​in the process of adding Sony SIN packaging/signature unpacking support to my Android Image Kitchen (AIK) with [MENTION=4120742]munjeni[/MENTION]'s excellent tool and I was curious if you could tell me if I need to add AnyKernel2 (AK2) support as well.

So I guess what I'm asking is, do image dumps of the device partitions ever contain the SIN headers? Or are they always ELF, and SIN is just a packaging for Sony's firmware tools?
[Xperia Z5 Android Development] KuJIbKA:
Hey! Got a question on restoring DRM keys on my Z3 Tablet Compact. Before unlocking BL I have backed up TA partition with Backup-TA tool 9.11 which created one zip file with 6 files in it:

1. TA.blk

2. TA.img

3. TA.md5

4. TA.serial

5. TA.timestamp

6. TA.version

Do I need only TA.img file for restoring DRM keys or I need to convert the complete zip into one .img file somehow? If I place only TA.img into root/data/local/tmp keys are not OK- [unknown error][Active] says security test in service tests.
[Xperia Z5 Android Development] shoey63:
AFAIK, the stock boot.img is always in elf format. If you dd the boot partition or back it up in TWRP, then extract it in your kitchen or rootkernel, it will always say elf image detected. FlashTool by Androxyde or official Sony version must convert it to elf before flashing.
[Xperia Z5 Android Development] osm0sis:
Perfect! Thanks! One less thing in the to-do! :cyclops:

Automated SIN support will be in AIK v2.8, I'm just waiting on Chainfire to finalize the new on-device Pixel signature process so I can include it as well. :good: :)

@ mention me if you need anything.
[Xperia Z5 Android Development] WanderMax:
any method to set seLinux?
[Xperia Z5 Android Development] KuJIbKA:
Please disregard my previous message - fount it out. Needed to use flash_dk to create DK.ftf file.
[Xperia Z5 Android Development] p1e9t9e2r:
um....is there anyway to use this tool in making a kernel which can pass safetynet (both basic integrity and CTS) on android 7?

on android 6 it is possible as long as I don't install busybox into kernel, but that doesn't work on android 7...
[Xperia Z5 Android Development] zzcat:
Problem with script

Sorry for slightly OT post, probably a Windows issue not strictly about the rootkernel script, but Dr. Google can't give me any guidance on my problem, so here goes:

Running the script in Windows 10 with parameters as in OP (.\rootkernel kernel.elf boot.img).

On PowerShell and cmd.exe, when it gets to the interactive prompts [Y/n], I can't input any response. All I can do is ^C until terminate batch file.

Maybe some issue with my configuration? Although other batch files are running fine...

If anyone else encountered this problem and has a solution, please post here or PM me, thanks!
[Xperia Z5 Android Development] Cerhio:
I want to use the rootkernel script for my Z5C

-Which rootkernel script do I use? Unofficial with the extra stuff or the Rootkernel for Nougat from January 29th. I am not sure which one is up to date or if I can just use the normal one in the first post.

-So TWRP is now usable? Is it better to flash it after or to integrate it? Can someone link me to good instructions for the recommended option?

-Is Magick compatible? Are there good instructions on how to install it?

Thank you so much.

---------- Post added at 01:49 AM ---------- Previous post was at 01:49 AM ----------

Is this the preferred rootkernel script for the Z5C?

---------- Post added at 01:50 AM ---------- Previous post was at 01:49 AM ----------

Or is it this one?
[Xperia Z5 Android Development] Cerhio:
Can someone post step-by-step instructions of the proper way of adding all this fancy stuff to nougat? I've read practically every single post here and I can't tell what is up to date and what isn't.
[Xperia Z5 Android Development] sceryavuz:
Sony Latest Nougat Update "32.3.A.2.33" Kitakami Devices

kernel : 3.10.84-perf-g1016077

Supported rootkernel : Google Drive

KCal Module (flash via TWRP, 32.3.A.2.33) : Google Drive

Xperia Z3+.................Ivy
Xperia Z4 Tablet...........Karin
Xperia Z4 Tablet Wi-Fi.....Karin_windy
Xperia Z5..................Sumire
Xperia Z5 Compact..........Suzuran
Xperia Z5 Premium..........Satsuki

How to use?

Extract into "C:"

Open rootkernel folder

Press SHIFT, right mouse click, open command prompt/window here

UnSIN your kernel.sin file, and copy kernel.elf file into "C:\rootkernel"

Type this and continue..

rootkernel.cmd kernel.elf boot.img

[MENTION=5142944]Cerhio[/MENTION]
[Xperia Z5 Android Development] Prior_Ori:
Hello friends! And on Xperia ZR it is possible to use this mod? Android 5.1.1 stock. I tried the latest version - it just closes the window and clears all the data.

I would like to drm fix and disable ric. Thanx!
[Xperia Z5 Android Development] Klaus N.:
Here you go! Just open the .tar file with e.g. 7zip or WinRAR, and flash the boot.img in fastboot mode with

fastboot flash boot boot.img
[Xperia Z5 Android Development] zzcat:
Trying to run in bash on Windows 10, get the following:

root@Z:/mnt/c/rootkernel# ./rootkernel.sh kernel.elf boot.img

Rootkernel V5.23

- Unpacking kernel

./rootkernel.sh: line 257: ./bootimg: cannot execute binary file: Exec format error

./rootkernel.sh: line 263: ./bootimg: cannot execute binary file: Exec format error

Unknown boot image format

Aborting

root@Z:/mnt/c/rootkernel#

Any ideas?
[Xperia Z5 Android Development] Hiku:
You should run ./rootkernel.exe instead.
[Xperia Z5 Android Development] zzcat:
I only tried running rootkernal.sh in bash because when I run rootkernel.cmd (I think that's what you mean--there is no rootkernel.exe, only the batch file which calls rootkernel.sh) from Windows command line, when it gets to prompting for Y/n, it won't respond to keyboard input. So I have to ctrl-c my way out of it. It builds boot.img but I have no way of knowing what parameters are used (e.g., include twrp, skip drm fix, etc.).

Since no one else seems to have this problem I guess it has something to do with my Win configuration, but no idea how to solve the problem. :confused:
[Xperia Z5 Android Development] shoey63:
You are overcomplicating things. Just open a command prompt in the extracted rootkernel folder and type

rootkernel kernel.elf(or whatever you named the extracted elf) boot.img

and follow the prompts.

For Linux it is

bash rootkernel.sh kernel.elf boot.img
[Xperia Z5 Android Development] zzcat:
Thanks for your advice. But actually I've been doing exactly what you suggest, multiple times without success.

Typing "rootkernel kernel.elf boot.img" in cmd or PowerShell, the script runs, but when it prompts for user input, it becomes unresponsive. In other words, if I type "y" or "n," nothing happens. When I hit ^C, it returns a weird string "ILL" and moves to the next prompt. The only prompt that will accept user input is the last one--"Terminate batch file?"
[Xperia Z5 Android Development] sceryavuz:
Then why you try so much? Send kernel.elf to us and say what features want. We can do it for you..
[Xperia Z5 Android Development] zzcat:
Awesome, I will do that. After I sleep!:p
[Xperia Z5 Android Development] netaccs:
Finally what modules I should use to have twrp with rootkernel ?

I have folder 3.10.84-perf-g1016077 with files inside using this from General. I also copy the files in to

main folder of rootkernel and have:

Skipping TWRP recovery. No kernel modules for 3.10.84-perf-g1016077 available
[Xperia Z5 Android Development] WanderMax:
dk.ftf flash failed with new flashtool.

if no drm fix in kernel, flash dk.ftf with old flashtool cannot make fido key right.

why??
[Xperia Z5 Android Development] sceryavuz:
https://xdaforums.com/showpost.php?p=72499233&postcount=2563
[Xperia Z5 Android Development] WanderMax:
any method to add load recovery from FOTAkernel (https://github.com/jackfagner/twrp-sony-recovery-boot-script)?

as xc only has recovery img file, I don't know how to make recovery img file to rootkernel-used files, cannot embed into bootimg.

any help?
[Xperia Z5 Android Development] sceryavuz:
[MENTION=424805]zzcat[/MENTION]

Google Drive : zzcat.img

Flash Magisk via TWRP : Magisk.zip
[Xperia Z5 Android Development] netaccs:
How to enter in to recovery ?

Trying volume down + power button - nothing

trying power button + power up - also nothing, boot in to android.

pp found it:

Restart your phone and press the volume key up as soon as the LED switches to yellow

Using this guide, but still no root access. So I wanna try to flash SuperSu manually from recovery.
[Xperia Z5 Android Development] sceryavuz:
-TWRP : Vol Down + Power, after Sony Logo release keys, Yellow Light then Press Vol Up, It turns Orange then TWRP will open

You can use TWRP 3.1.1.0 : https://drive.google.com/drive/folders/0BxKcqvQU0FNMb3pyYjlPMTZGdjQ?usp=sharing

fastboot.exe flash recovery twrp_recovery.img

Use Magisk or SuperSU for Root, also in google drive.
[Xperia Z5 Android Development] netaccs:
Can I use this twrp 3.1.1.0 for Nougat7 ?

Should I install twrp from last guide (using Sony Latest Nougat Update "32.3.A.2.33" Kitakami Devices kernel : 3.10.84-perf-g1016077)

rootkernel kernel.elf boot.img

and then :

fastboot.exe flash recovery twrp_recovery.img

and finally

fastboot flash boot boot.img

Sorry, but I don't know what after what to start :/

I run:

rootkernel.cmd kernel.elf boot.img

Rootkernel V5.23

- Unpacking kernel

Found elf boot image

Kernel version: 3.10.84-perf-g1016077

Found appended DTB

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

- Unpacking initramfs

- Detected platform: 64-bit

- Detected Android version: 7.0

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

Disabling dm-verity

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

Disabling Sony RIC

- Install TWRP recovery? [Y/n] N

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

- Install DRM fix? [Y/n] Y

- Install busybox? [Y/n] N

- Creating new initramfs

- Creating boot image

- Cleaning up

Done

D:\install\gsm\z5 compact\root_twrp_nougat7>fastboot flash boot boot.img

target reported max download size of 536870912 bytes

sending 'boot' (14488 KB)...

OKAY [ 0.515s]

writing 'boot'...

OKAY [ 0.294s]

finished. total time: 0.816s

D:\install\gsm\z5 compact\root_twrp_nougat7>fastboot.exe flash recovery twrp_recovery.img

target reported max download size of 536870912 bytes

sending 'recovery' (17992 KB)...

OKAY [ 0.636s]

writing 'recovery'...

OKAY [ 0.266s]

finished. total time: 0.910s

Also when I install Magisk and run it in Android it says go to play store.

When I select it, the google store says:

not found

I see that there is problem

https://xdaforums.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445/page3
[Xperia Z5 Android Development] netaccs:
This is the first phone I was unable to root :/
[Xperia Z5 Android Development] sceryavuz:
Try SuperSU, stop spamming.

First flash boot.img then supersu..

https://s3-us-west-2.amazonaws.com/supersu/download/zip/SuperSU-v2.82-201705271822.zip
[Xperia Z5 Android Development] rolo143:
Guess I don't want to wait a year either. :p

btw I read the changelog I just didn't know what was new in TWRP 3.0.2 but I already check it on twrp page.

thanks:)