yashsingh1/xdaforums huggingface dataset:
[Xperia Z5 Android Development] deboopi2:
In my email I get

I had fernel.elf and system.ext4. Next, how do i do that?. I can't open rootkernel in forder rootkernel_v5.23_Windows_Linux_UNOFFICIAL_2.5_OREO (2)

This is not the same as what I find in this thread.

Where did you find rootkernel_v5.23_Windows_Linux_UNOFFICIAL_2.5_OREO?

What do you want to know, what do you mean by 'How do you that'?

Unzip the rootkernel...f ile and start using the command from p280

---------- Post added at 02:50 PM ---------- Previous post was at 02:33 PM ----------

Problem solved I wasn't using the last version of rootkernel for oreo.
[Xperia Z5 Android Development] nhtu1997:
Sorry. I have a problem

Rootkernel V5.23 (UNOFFICIAL 2.5)

- Unpacking kernel

error: Android boot magic not found

Unknown boot image format

Aborting

How does it fix. Thanks you

---------- Post added at 04:57 PM ---------- Previous post was at 04:52 PM ----------

I have a problem

Rootkernel V5.23 (UNOFFICIAL 2.5)

- Unpacking kernel

error: Android boot magic not found

Unknown boot image format

Aborting

How does fix it?. Thanks you
[Xperia Z5 Android Development] acme64:
is there a way to do the fastboot flash via linux? i can't get any of the drivers to work on windows.
[Xperia Z5 Android Development] zevzek:
It sure is possible, I unlocked the bootloader and flashed system and kernel to my previous phone (xperia z2) using a ubuntu machine with no issues.
[Xperia Z5 Android Development] acme64:
do i need drivers or will ADB pick it up automatically?
[Xperia Z5 Android Development] deboopi2:
Did you extract kernel.elf from kernel.sin with flashtool?
[Xperia Z5 Android Development] nhtu1997:
yes i did it
[Xperia Z5 Android Development] deboopi2:
I do not know what's wrong then.

Did you have problems with the downloaded files?

Maybe someone else can help now.
[Xperia Z5 Android Development] serajr:
[MENTION=4337845]deboopi2[/MENTION] [MENTION=7396026]nhtu1997[/MENTION] [MENTION=5451607]jitz975[/MENTION]

First of all, this thread is not mine, and it was not me who created the drmfix nor ta_poc, I just try to make the tool compatible with the new firmware launched by sony (for the device I own - X Perf, for the record). That said...

- You could share your kernel.sin, so I can try something here

- About Volte, I can not deal with what I do not have (unfortunately this function is not available where I live)
[Xperia Z5 Android Development] acme64:
I did everything using the .75 firmware for the x perf.

But i cannot complete the twrp steps, it always has a write error, cannot mount something. I've used the official twrp release and a supposidly working release twrp-3.1.0-20170312-boot-dora
[Xperia Z5 Android Development] sewalt91:
[MENTION=3989065]serajr[/MENTION]

Does your TWRP version come decryption support for Xperia Z3 Table Compact (scorpion)? I am asking because I tried to use the original 3.0.2 TWRP but it does not come with decryption support so I can not flash anything in recovery. I do not want to disable encryption and normally TWRP supports it out of the box. Any way to replace built-in TWRP with a custom one without breaking the kernel?
[Xperia Z5 Android Development] YasuHamed:
in such cases try this (this will delete/erase your data)

-Go in twrp

-Go in wipe

-Tick "Data"

-And click on "Repair and change file system"

-Click on EXT4 and proceed,

you wont have encryption error and you can flash zips

---------- Post added at 09:02 PM ---------- Previous post was at 08:59 PM ----------

what is your device?

i believe script covers only qcom devices

---------- Post added at 09:12 PM ---------- Previous post was at 09:02 PM ----------

when you have sony's stockrom file (ftf) open it with 7zip and extract system.sin file

goto flashtool , tool, sin editor, select the system.sin file and EXTRACT DATA, it will create another system.ext4 file, this can be open in 7zip

if you don't wana change sin file to elf or .ext4 via FLASHTOOL then you may use the UNSIN ~ SIN v3/v4

https://xdaforums.com/crossdevice-dev/sony/tool-unsin-sin-v3-unpacker-t3128106

just unzip the file, and DRAG any SIN file on the drop it on UnSIN.EXE, it will start dumping .ext4 or .elf in the original folder
[Xperia Z5 Android Development] sabbioso:
Damm i need an easy way :p
[Xperia Z5 Android Development] Stoffl_:
Did you boot up and possibly setup the device after flashing ROM and before flashing kernel/twrp ?

Don't. :)
[Xperia Z5 Android Development] RyTekk:
I don't copy required system files but it works well with v2.1, but on the latest v2.5, the process stucks at "Disabling Sony RIC" (same kernel.elf on both versions).
[Xperia Z5 Android Development] Stoffl_:
Both 2.3 and 2.5 work for me when the required system files are included, no errors in the script.
[Xperia Z5 Android Development] ondrejvaroscak:
No problems on latest .32 firmware with 2.5 either
[Xperia Z5 Android Development] YasuHamed:
the script 2.3&2.5 works SAME for Nougat kernels

the script 2.3&2.5 works same for OREO KERNELS if DEVICE is X

the script 2.3 wont work for OREO and all other devices (XP XZ XZs etc)

the script 2.5 & non X device with OREO will work only if the required files are extracted from system.sin

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

basically script 2.3 was intended to work globally but EXTRA code added to differentiate fstab file for xperia X f5121 and F5122 ONLY!

---------- Post added at 12:51 PM ---------- Previous post was at 12:04 PM ----------

WHICH device sir?

if its z3/z3+/z5/z5 then orginal script works fine!

for X on Oreo (8.0) v2.3 or v2.5 both works (since the fstab file is still in the ramdisk however

for Xperformance, Xcompact, XZc, XZs on Nougat kernel, version 2.5 & placing those files is MUST from system.sin

and last but not least,

for Nougat(7.1.1) all X till Xzs v2.3 works fine
[Xperia Z5 Android Development] Stoffl_:
My post probably wasn't specific enough, I meant serajr's "rootkernel_v5.23_Windows_Linux_UNOFFICIAL_2.3_OREO".

That version works on oreo and XP/XZ. :)
[Xperia Z5 Android Development] YasuHamed:
as I said,

the script unofficial 2.3 is actually working PERFECT all X+ series devices on OREO! Even I am running my kernel baked on this script

however later we found out that fstab file which is missing from ramdisk in Oreo , is actually exists for X (F5121 & F5122) thats why another modification made and script released as 2.5.

now when you patch kernel of OREO of F5121 and F5122 the scripts say, Fstab found and patched no additional files required , (while switching of DM varity)
[Xperia Z5 Android Development] whalesplaho:
Dnt know if i can get help here please.... [MENTION=3989065]serajr[/MENTION]

I flashed a rom with patched boot.img and supersu was used to root. I uninstall supersu, repatched tha boot.img and disable sony ric wen asked. Flash tha new boot n flashed magisk, after reboot when tha fone is bout to enter lockscreen, its freeze and reboots...... Buh i saw dis file in system/su.d/ i deleted it n even leave it but it doesn't have any effects.
[Xperia Z5 Android Development] serajr:
Sorry bro but I can't help out! As you know I'm not an kernel dev, and max I can do here is try to patch rootkernel's script (rootkernel.sh) to get it working onto somc/qcom stock kernel.elf (only)!
[Xperia Z5 Android Development] whalesplaho:
I understand man....

Thanks for yur efforts always.
[Xperia Z5 Android Development] Klaus N.:
Have you already tried osm0sis' flashable script unSU? Here you go: https://xdaforums.com/showpost.php?p=63615067
[Xperia Z5 Android Development] whalesplaho:
Thanks man. I have tried dat and flashed magisk after but says tha boot.img is been patched by another app. I noticed wen I tried to patch tha boot.img with rootkernel is brings option to disable sony ric alone and den install busybox and drm fix n dahs all......
[Xperia Z5 Android Development] Klaus N.:
Have you flashed the boot.img again before? If not, flash the boot.img, then reboot into recovery and try to flash unSU. If it doesn't work, I suggest to flash SuperSU again, let it boot into system. Then reboot again into recovery and flash unSU now. Wipe cache & dalvik/art right after. Reboot into recovery once again and flash the boot.img, then Magisk. I hope, this helps...
[Xperia Z5 Android Development] whalesplaho:
Tried but wont work.... I dnt know what tha dev did to tha boot.img. If i flashed stock patched boot.img, phone will restart after bootanimation... Here is tha rom link!

Thanks brov

https://xdaforums.com/xperia-z5/development/rom-xnz5-p-cxz2-stylev2-4-t3765705
[Xperia Z5 Android Development] ytheekshana:
Please update the twrp
[Xperia Z5 Android Development] YasuHamed:
for z5p there is already twrp3.1.1 is out and working just fine

you may flash it via fastboot commands
[Xperia Z5 Android Development] ytheekshana:
Did that... IMO accessing the twrp in the kernel is easier than that.
[Xperia Z5 Android Development] Evengod:
Rootkernel V5.23 (UNOFFICIAL 2.5)

- Unpacking kernel

Found elf boot image

Kernel version: 3.18.66-perf-g5cd0be2

Found appended DTB

- Detected vendor: somc (Sony), device: dora (Xperia X Performance), variant: row

- Unpacking initramfs

- Detected platform: 64-bit

- Detected Android version: 8.0.0

- Android Oreo requires additional files! Continue? (Say yes to copy) [Y/n] Y

fstab.qcom (copied)

init.rc (patched)

init.qcom.rc (copied and patched)

init.target.rc (copied and patched)

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

Patching fstab in dtb to disable dm-verity

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

Disabling Sony RIC

- force-encrypt is enabled. Disable? (Say yes if you decrypt /data) [Y/n] Y

Disabling force-encrypt

- Install DRM fix? [Y/n] Y

1. DRM fix preload line added successfully!

2. DRM libraries still need to be flashed manually on TWRP recovery before 1st boot!!

System mode, flash: DRM-fix_System_Mode.zip

- All done! Continue? [Y/n] Y

- Creating new initramfs

- Creating boot image

error: could not create ''

- Cleaning up

Done

I've done everything.

But at last has error.(error: could not create '')

How can I get it right?
[Xperia Z5 Android Development] Berni-0815:
In my eyes you are more flexible with TWRP stored in the FOTA-Partition... Your way you always have to create and flash a new kernel...

---------- Post added at 15:56 ---------- Previous post was at 15:54 ----------

No space left on hdd?

Do you have the neccessary rights to write to the used folder? Try to use the script as root...
[Xperia Z5 Android Development] whalesplaho:
What was tha code yhu ran in cmd?

Try like dis;

rootkernel boot.img (replace with yur kernel name) new_boot.img

It should work.
[Xperia Z5 Android Development] Stoffl_:
I see, thanks!

Another question, when I check Service Menu\Security\Fido_Keys the status is "Not provisioned, provision failed"

Now I'm a bit confused...Is that expected or is my drmfix actually not working ?

I don't have any issues, root and magisk work and so forth but I never actually checked that. Or is that just for the TA PoC method ?
[Xperia Z5 Android Development] YasuHamed:
DrmFIX is a name of changing some CODE in KERNEL to give output "1" means keys are working (whenever any sony app checks for drmKeys it take answer from KERNEL), DRMFIX doesn't mean that KEYS are back in place!

it shows the same for me too
[Xperia Z5 Android Development] Stoffl_:
Right, makes sense. Thanks again!
[Xperia Z5 Android Development] mbc07:
If you've backed up your TA partition before unlocking the bootloader then used the "flash_dk" script included in Root Kernel to extract your device key and then flashed the .ta file to your phone, DRM Fix will load your keys from an alternate TA Unit and everything (including FIDO Keys provisioning) will work. If you're getting any kind of FIDO Keys error, then you either didn't flash the device key or it wasn't loaded properly. On that scenario, DRM Fix is able to restore most, but not all of the features, any app dependent of Widevine DRM will likely fail (e.g. Screen Mirroring, Netflix in HD resolution, etc).
[Xperia Z5 Android Development] YasuHamed:
Few pages back [MENTION=3989065]serajr[/MENTION] did mention that munjini's TA PoC doesn't work properly for devices lis X Xp Xz and xz for OREO, but what you are saying is 100% correct

He should try this on both nougat and OREO:good:
[Xperia Z5 Android Development] deboopi2:
I'm trying to prepare rom 41.3.A.2.107 for the Xperia X Performance but now the vendor folder in system.sin is empty, what to do next?
[Xperia Z5 Android Development] babelus:
I'm on Xperia X, started with full wipe and flashing Oreo. Booted stock kernel, verified that DRM keys are missing. Then I used the rootkernel script to create an image with dm-verity and ric disabled along with TA PoC. Booted that image and DRM keys work (FIDO provisioned, no errors). Flashed TWRP and went on to install Magisk. Not sure if this was required, but wiped data, booted into system, went back to TWRP and data was still not mounting. Flashed Magisk 16.0 anyway. Wiped cache/dalvik and booted system. There was no Magisk app, so installed that manually. Magisk install and root was successful, however safetynet is failing.

To sum up: Xperia X + TA PoC works great. Did I do anything wrong that safetynet is failing? Is it because of dm-verity?
[Xperia Z5 Android Development] mbc07:
Magisk needs to place some files on /data partition in order to fully work. If you wiped /data (e.g. factory reset), you deleted those files and thus SafetyNET fails.

TL;DR just reflash Magisk either through TWRP or through Magisk Manager Direct Install method to fix that. Remember to always do that whenever you wipe /data...
[Xperia Z5 Android Development] ondrejvaroscak:
Content of Vendor folder has its own sin file, probably vendor.sin or oem.sin
[Xperia Z5 Android Development] deboopi2:
Hello,

problem solved.

I redownloaded the firmware, extracted the system.sin and converted it now the vendor folder shows data.

I can continue from now on.
[Xperia Z5 Android Development] babelus:
I installed magisk after wiping /data. I did not change anything, but retried the safety net check an hour after my post and it passed. Installed Google pay and I'm allowed to add a card. So it looks like magisk is working properly. Retried safety net check today and it failed. Is this expected behavior? Would I get better results with the drmfix method?
[Xperia Z5 Android Development] mbc07:
AFAICT, using TA PoC or DRM Fix or even using a boot image without any kind of DRM restoration is completely irrelevant to the SafetyNET checks.

What I did that always worked is installing Magisk on top of a "stock" boot image (e.g. Root Kernel patched image) right after wiping /data or after flashing a new FTF.

You can tell you did right if Magisk Manager automatically appears in your app drawer. If it doesn't and you have to manually install the APK, it's very likely you did something wrong...
[Xperia Z5 Android Development] babelus:
So you suggest to install Magisk after wiping /data in TWRP without booting up the system?

I reinstalled Magisk using Magisk Manager and now I'm getting consistent passes in safety net.
[Xperia Z5 Android Development] mbc07:
Whether it's before the first boot or if you reinstall it later through Magisk Manager, doesn't matter, as long as you make sure you install Magisk AFTER wiping /data, SafetyNET will pass...
[Xperia Z5 Android Development] Schrinus:
I seem to be able to create only wrong boot.img files.

I'm on Oreo 41.3.A.2.107 and I even tried to create a kernel with KERNEL_F8331_41.3.A.2.107_CLEAN.img from Rooted Kernels F8331 & F8332 41.3.A.2.107 OREO 05APRIL2018 and my TA.img backup (even created a boot.img without it) - both brings me the "Unkown" in almost everything in Service Info (Also see my thread here with screenshots attached)

I'm writting here because there might be a bug or if I did something wrong and I'd like to know what it is that I might do wrong (and of course I hope for help of the problem in my thread).
[Xperia Z5 Android Development] killeours2:
xperia x performance does not work, always stop "detected android version 8.0.0" (root kernel) https://ibb.co/jrG17H
[Xperia Z5 Android Development] ColdIllyrian:
how are some of you on oreo firmware when there is none for the z5?
[Xperia Z5 Android Development] ch3mn3y:
[MENTION=8692360]Quantumkk123[/MENTION]

Now it's more like thread for any supported device by rootkernel, not just Z5. And as it now supports X, Xc, Xp and XZ as well, and this devices got Oreo, than some people are on Oreo :)
[Xperia Z5 Android Development] ColdIllyrian:
Oh lol I was gonna say thanks for the info appreciate it
[Xperia Z5 Android Development] YasuHamed:
the following steps will enable twrp 3.1.1 2018-08-22 to mount your internal storage.

the following steps will reset your DATA (ERASE APPS, ACCOUNTS, LOGS etc)

in twrp, goto WIPE ---> advance wipe ---> check the box next to DATA ----> change FILE SYSTEM ----> select EXT4

Twrp will format and change the filesystem.

now flash MAGISK, you will not receive any errors and later you will pass the SAFETY NET test

---------- Post added at 12:57 PM ---------- Previous post was at 12:55 PM ----------

i am on magisk 16.1 over 5.6.3 magisk handler - device F5122 and I always pass the test!

---------- Post added at 01:01 PM ---------- Previous post was at 12:57 PM ----------

https://xdaforums.com/xperia-xz/how-to/rooted-kernels-f8332-41-3-2-588-0-t3748987

if you try the kernels created in this post? please ?

and let me know ? if possible?

---------- Post added at 01:02 PM ---------- Previous post was at 01:01 PM ----------

you might be using the wrong script version

take the rootkernel script v5.23-unofficial2.5 from here and try again! you will have success!

https://xdaforums.com/showpost.php?p=74724162&postcount=2793

---------- Post added at 01:04 PM ---------- Previous post was at 01:02 PM ----------

this error came when i did something like

rootkernel kernel.elf

but it works when i do

rootkernel kernel.elf boot.img

i cant think of anything else :(
[Xperia Z5 Android Development] BaDKaRmA:
C:\Flashtool\New folder>rootkernel kernel.elf boot.img

Rootkernel V5.23

- Unpacking kernel

Found elf boot image

Kernel version: 3.18.66-perf-geeac20e

Found appended DTB

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

- Unpacking initramfs

- Detected platform: 64-bit

- Detected Android version: 8.0.0

Not going ahead of this! What might be the problem?
[Xperia Z5 Android Development] Schrinus:
Yeah, I tried it with those clean kernels - 41.3.A.2.99 and 41.3.A.2.107 - and both work fine when I flash them as they are, but when I take them to create a kernel with my TA.img backup (and even without) it shows me the "Unknown" status everywhere.

But I ran into three other problem about 2-3 hours ago and I might have to try another Oreo StockROM or (temporarily) downgrade.

(when I think about it that I read many weeks to make sure I learn everything for when I buy the Xperia XZ and now in worst case I might have to search for another smartphone...)

Edit: I had to downgrade to Nougat, because of too many problems (which still haven't all been solved with Nougat. On Marshmallow they would all be solved, but I don't want to stay on Marshmallow...)
[Xperia Z5 Android Development] Berni-0815:
You're using the wrong version of the tool! Use the version from this post (maybe there are newer versions availabe), then it should work:

./rootkernel.sh kernel.elf boot.img

Rootkernel V5.23 (UNOFFICIAL 2.5)

- Unpacking kernel
Found elf boot image
Kernel version: 3.18.66-perf-geeac20e
Found appended DTB
- Detected vendor: somc (Sony), device: kagura (Xperia XZ), variant: row
- Unpacking initramfs
- Detected platform: 64-bit
- Detected Android version: 8.0.0
- Android Oreo requires additional files! Continue? (Say yes to copy) [Y/n] y
fstab.qcom (copied)
init.rc (patched)
init.qcom.rc (copied and patched)
init.target.rc (copied and patched)
- dm-verity is enabled. Disable? (Say yes if you modify /system) [Y/n] y
Patching fstab in dtb to disable dm-verity
- Sony RIC is enabled. Disable? [Y/n] y
Disabling Sony RIC
- force-encrypt is enabled. Disable? (Say yes if you decrypt /data) [Y/n] y
Disabling force-encrypt
- Install DRM fix? [Y/n] y
1. DRM fix preload line added successfully!
2. DRM libraries still need to be flashed manually on TWRP recovery before 1st boot!!
System mode, flash: DRM-fix_System_Mode.zip
- All done! Continue? [Y/n] y
- Creating new initramfs
- Creating boot image
- Cleaning up
Done
[Xperia Z5 Android Development] YasuHamed:
you are using the Tobais version of script

use [MENTION=3989065]serajr[/MENTION]'s script

https://xdaforums.com/showpost.php?p=74724162&postcount=2793

---------- Post added at 09:19 PM ---------- Previous post was at 09:17 PM ----------

few pages before [MENTION=3989065]serajr[/MENTION] did mention that OREO kernels for some reason [MENTION=968468]munji[/MENTION]ni's TA.img restoration as DRM fix doesn't work....

but it does work fine on Nougat

I have myself downgraded to N since oreo is generally slower in response on social apps and hangs occasionally!
[Xperia Z5 Android Development] Schrinus:
Yeah, I did downgrade to Android N too, but I'm afraid I'm have one of those Sony ROMs where flashing Xposed Framework causes a bootloop. So I'll have to try another ROM, I just hope they're not all the same...

And unfortunately that is mandatory for me as I need two modules... One of them work on MM (at least an unofficial/partial fixed version), the other one I have yet to test (though it's not crashing so it's a start).
[Xperia Z5 Android Development] YasuHamed:
the Xposed never worked with my device on N or O

however to be honest I never used Xposed to I can live without it.

Magisk with few battery saving modes are ok for me ...
[Xperia Z5 Android Development] Berni-0815:
A little request to some of you: Please don't quote a whole text (even with another full-quote in it!); please shorten the text to the necessary parts.... ;)

This makes it easier to read.

Thanks! :good:
[Xperia Z5 Android Development] 搁浅被注册了:
XPERIA XZ lost network

XPERIA XZ lost network in TA PoC option with lastest 41.3.A.2.107 will happen, try many times but all the same problem
[Xperia Z5 Android Development] YasuHamed:
the TA POC option of drmfix under OREO is Doubtfull!

few pages before, serajr did mention that!
[Xperia Z5 Android Development] hanymedic:
Dear, First of all thanks for your efforts.

now, i am trying to use Rootkernel V5.23 but once using the command "rootkernel.cmd kernel.elf boot.img" i got stuck in the "Sony RIC is enabled. Disable Y or N? and once pressing Y or N i got stuck...

i am using Sony XZP with FW 471A12145

thanks a lot
[Xperia Z5 Android Development] DHGE:
First of: don't full quote.

I got also stuck. I work under Debian Stretch.

I had to chmod +x all the executables. It also helps to invoke the script with "bash ..."

Assuming you do not run a free operating system: Try to move the script to a path with a short name and no spaces in the pathname.
[Xperia Z5 Android Development] YasuHamed:
instead of

"rootkernel.cmd kernel.elf boot.img"

use this line

"rootkernel kernel.elf boot.img"
[Xperia Z5 Android Development] hanymedic:
It worked with me once putting the fstab.qcom, init.qcom.rc, init.target.rc in the filesystem_files

But once flashing the patched kernel, it stuck in the boot and after some trials, i figured that it is due to the dm-verity disabling.

As if i choose not to disable the dm-verity (dm-verity is enabled. Disable? (Say yes if you modify /system) [Y/n] = N), the patched kernel boots smoothly; but still can't install SuperSu :)
[Xperia Z5 Android Development] YasuHamed:
SuperSU abandoned in may 2017

Try magisk
[Xperia Z5 Android Development] yahyazadeh58:
Hi,

I have a D66033 with unlock bootloader. its DRM key gone. could you please exxplain simply how I can restore the function of DRM key. I confused.

I previously used another method :https://xdaforums.com/crossdevice-dev/sony/xperia-z1-z2-z3-series-devices-drm-t2930672

but it did not work.

after installing, my phone did not boot up.