yashsingh1/xdaforums huggingface dataset:
[Xperia Z5 Android Development] Pandemicc:
hi, the instructions are not clear at all. Can anyone help me with this? I want to get this working on my e5803
[Xperia Z5 Android Development] yahyazadeh58:
Finally, I found how I can do it, and I think that it works for whole roms.

After unlocking bootloader, I lock it again by flash tools. By Xperia companion software, I repair the phone software.

By following tutorial, I found the backup file and converted to ftf file:

https://www.youtube.com/watch?v=F0bSsGxFdks

I unlocked the rom by flash tools and by following method I could root it again.

https://xdaforums.com/z3/general/recovery-root-mm-575-291-lb-t3435214

and by following tutorial I found how I can put the DRM function file in the ftf file and converted it to zip for installing from twrp.

https://www.youtube.com/watch?v=wKAvHAOO7FE

I could restore the function of DRM key without ant problem.

And I also by following method I could MOD the D6603 camera:

https://xdaforums.com/crossdevice-dev/sony-themes-apps/mod-cyberian-camera-t3267271

know I have a supper quality camera Z3 D6603
[Xperia Z5 Android Development] Klaus N.:
Nice, but this has nothing to do with Rootkernel tool. Please, post it in the appropriate thread ;)
[Xperia Z5 Android Development] CafeJ:
hello guys , this tool(v5.23) is work on z3c MM(D5833)@23.5.A.1.291,

but I want downgrade use LP@23.4.A.1.232,

I try all tool version ,

in tool version 4.31 & 5.11 &5.23 , I can get newkernel but when I flash it my device just can't boot,

in version 4.51 , I can boot my device , but DRM key dosen't restore , I entering *#*#7378423#*#* > Service tests > Security

I just get 3 lines unknowerror.

any idea for restore DRM KEY on z3c@LP?

sorry for my poor english
[Xperia Z5 Android Development] yahyazadeh58:
Sorry, I just did the work on MM not LP.

additionally, this method jus restore the lost function of DRM not the lost DRM. consequently by entering *#*#7378423#*#* you can see the error message again even by doing my mentioned work.
[Xperia Z5 Android Development] Pandemicc:
Please help me, the instructions are not clear at all. I want to get this working on my e5803. The first post has nothing about installation process.
[Xperia Z5 Android Development] yahyazadeh58:
I do not know if it works on e5803. If you would like to try it. Please just follow the link that I have attached them.
[Xperia Z5 Android Development] chaudhariniket:
Thanks...

Thanks for the wonderful tool. Works flawlessly on E6633 Z5 Dual.

"FIDO Keys Provisioned." :D:good:
[Xperia Z5 Android Development] Pingu13579:
Thank you so much! It worked and I thank God for it!

Since I had backuped the TA-partition for DRM, I was still on Android 5 Lollipop, where your script worked on kernel.elf, but unfortunately I ended up in a bootloop whenever I tried to boot.

Then I found an Android 7 Nougat .ftf-file, flashed it via FlashTool an thus succeeded after flashing boot.img. (I had to enter recovery mode via "adb reboot recovery".)

First, the check for the right device was wrong:

Installing zip file '... .zip'

Checking for MD5 file...

Skipping MD5 check: no MD5 file found

E3004: This package is for device: E6633,E6653,sumire,sumire_dsds; this device is .

E:unknown command [log]

Updater process ended with ERROR: 7

Error installing zip file '....zip'

Updating partition details

It can be changed easily as described here:

https://xdaforums.com/showthread.php?t=2522762

Worked well for me.
[Xperia Z5 Android Development] RaXelliX:
Thanks for rootkernel_v5.23_Windows_Linux_UNOFFICIAL_2.5_OREO

I got almost everything working on X Compact on Oreo (firmware version F5321_34.4.A.2.70, 85 is currently not available as Customized NOBA so i had to settle for 70) . Only exception is FIDO Keys but im assuming that's not possible without TA_PoC and TA_PoC is unusable on Oreo since including it in kernel will cause no SIM/emergency mode at startup. So i used DRM Fix instead. Atleast got Widevine and CMK as OK.

Magisk v16 also works and SafetyNet passes. Magisk manager was also present after v16 flash in TWRP so everything ok there. DM Verity is obviously disabled, i have root and encryption seems to be disabled tho this info is missing from settings app now. It only shows that i can encrypt my SD card if i want. Not sure about RIC but i guess i'll find out. Trying to get Xposed working now but this might be a long shot. There's a bug starting with March security patch that causes bootloop and Rovo is yet to fix that plus xposed for Oreo is beta anyway. Trying xposed as magisk module instead...

Again, thanks.
[Xperia Z5 Android Development] zevzek:
I used rootkernel with ta poc to root my xz on latest oreo, got magisk and twrp working easily with safetynet passing with no issues.

Then when I tried magisk systemless xposed module I got into a bootloop, so I had to uninstall the module. Tried rovo89's latest xposed zip and it also caused a bootloop so I had to downgrade xposed to v90-beta2 and it works perfectly.

SafetyNet of course failed but there doesn't seem to be a way to have xposed and safetynet yet.

Oh, and I used ta_poc and all the keys are fine, even FIDO provisioned.

If you also get a bootloop with xposed, try to downgrade it.
[Xperia Z5 Android Development] RaXelliX:
Intresting. I will try Beta2 tho i don't have much faith. Odd that ta_poc worked for you but not me. Can't imagine what i did wrong. Created ta.ftf and flashed it in flash mode in addition to integrating it into kernel with rootkernel script.
[Xperia Z5 Android Development] zevzek:
Oh, but I don't think flashing ta.ftf is necessary for ta poc to work.

I just created a new boot.img using the rootkernel script and flashed it using fastboot
[Xperia Z5 Android Development] retikulum:
Oh wow, I didn't expect that, but this worked for me like a charm. I tried some drm fixes before, but I had soft bricks and so on.

This method here with repacking the kernel + my TA backup + SuperSU works perfectly. All keys are valid again. Very nice! Thank you very much for that one! :victory:

E6653 with Nougat
[Xperia Z5 Android Development] Sierra-Saphir:
Hello everyone

Please help me troubleshooting

I have a Xperia Z3 dual sim D6633 running on Android 4.4.4 (Firmware Version 23.0.1.F.0.96)

Running rootkernel.cmd finished without any errors

I did not include DRM fix and as recommended i let RIC enabled and did not install busybox

But when I flash the Kernel via fastboot flash boot boot.img

My phone goes in Bootloop everytime I turn it on. Theres only the Sony splash screen and then it reboots

I can access TWRP but it doesn't recognize the internal storage.

When exiting TWRP I recieve the message "No OS Installed! Are you sure you wish to power off?"

What's wrong ?? Please help
[Xperia Z5 Android Development] Berni-0815:
I can only guess; but, is the bootloader unlocked?
[Xperia Z5 Android Development] Sierra-Saphir:
Yes the bootloader is unlocked

I could try to relock it and then repeat the unlock process. Would that help?
[Xperia Z5 Android Development] Berni-0815:
NO! AFAIK you are flashing a custom kernel and for that the bootloader MUST be unlocked!

Edit:

Sorry; I've to read your post more careful! Try *#*#service#*#* and have a look to the output. There you can see if your bootloader really is unlocked!

Next guess:

Are you sure you are using the "right" kernel.elf? Extracted from your firmware?

Second try: Use another twrp and flash it to the fota-partition by

fastboot flash recovery <name.img>

Shut down the device; wait 15 seconds; then press volume down and power on to access it
[Xperia Z5 Android Development] koekoek91:
He can't boot his device so he can't do the services check to check if bootloader is unlocked.

He could check with flashtool.

Seems to me like his system partition is wiped some how (since TWRP says: no OS installed).
[Xperia Z5 Android Development] Berni-0815:
Hmmm, my idea was that he

is

able to boot with original bootimage...

Then he should flash a full version with flashtool and then repeat his steps...
[Xperia Z5 Android Development] koekoek91:
Yes im afraid flashing a clean firmware will be the only solution.

I don't have any other ideas.

[MENTION=9262701]Sierra-Saphir[/MENTION] are you able to connect your phone into flashmode with flashtool?
[Xperia Z5 Android Development] YasuHamed:
script 5.23 goes to Z5(family) for Nougat it doesnt support your kernel.

see the script is MISSING the DM VARITY switching off line. this means DM varity is ACTIVE and your repack kernel. hence you will always get BOOTLOOPS unless you switchoff DmVARITY

more over since you are on KK (4.4.4) its easily rootable via kingroot and later superSU can be replaced! butttt for criousity sake

can you try the same with script 4.5 ?? and paste the log here!

https://xdaforums.com/attachment.php?attachmentid=3772141&d=1465036639

1. if you are stuck at BLACK Screen, hold power+volume up button until 3 jerks (it will shutdown the device for you to connect in flashmode/fastboot mode)

2. if you get bootloops then apply drm fix and try again and in case any issues, always try no1

3. also i missed the part about SuperSU ? are you flashing superSu via TWRP ?
[Xperia Z5 Android Development] ch3mn3y:
[MENTION=9262701]Sierra-Saphir[/MENTION]

Why don't You use custom kernel with Root? Or if You want to stay with stock one (but why You unlocked bootloader?) just use towelroot apk and XZDualRecovery.

Not sure what You are looking for on Z5 forum with Xperia Z3. This devices are totally different and even if this script could work with 5.1 and 6.0 firwares of Z3 I'm 100% sure it won't work with KitKat.
[Xperia Z5 Android Development] Sierra-Saphir:
Thanks for your replies

[MENTION=239351]bernie[/MENTION]-0815

Yes I extracted Kernel.sin from my ftf-file and converted it with flashtool --> sin editor to Kernel.elf

(exactly what "Method 1" in post #1 says)

I reflashed my ftf now and did the check. Service Info says "Bootloader unlocked: Yes"

Thanks for mentioning that it might depend on the script version. I will do the tset with 4.5 later

How do I switch off DmVARITY ? I didn't find it in the script there's only Sony RIC

Edit:

I should have read more carefully. You said the line is missing in the script so ofcourse I can't find it

On my first try I added DRM fix. It went in bootloop so i tried again without DRM fix. But bootloop as well :(

The screenshot is from second try

Yes I want to flash SuperSU via TWRP

I did not find any custom kernel for D6633 with this firmware. Do you have one?

XZDualRecovery uses TWRP version 2.8 and I did not find a way to update it to 3.x

Also towelroot is the way that flashtool uses (and so I tried first) It didn't work. I think there was a "Device not supported" message or something like that

Google brought me to this thread and I didn't notice that it's posted in Z5 forum before I did the first try

But if you take a look at the changelog in post #1

"v4.41 - added support for Z3"

Also the script finished with no errors and it recognized that this is a Z3 kernel not a Z5 (you can see the output of rootkernel.cmd in the attachement in my first post)
[Xperia Z5 Android Development] Sierra-Saphir:
Update:

Partial success :)

Running the v4.5 script worked fine (output as screenshot in the attchement)

Great thanks to YasuHamed for that

There are no more bootloops with this boot.img. I can boot into system as well as in TWRP

But there's one issue remaining. TWRP still has no access to internal storage.

I can't browse it in file manager and when exiting thers this "No OS installed" message

I tried both, with and without DRM fix

Any solutions for that?
[Xperia Z5 Android Development] YasuHamed:
I am glad i was help,

ONE MAJOR ADDITION, about the DM varity point! I forgot that GOOGLE started using DM VARITY since Android 5.1. so more likely its not there in 4.4.4 , as you can see even SCRIPT 4.51 couldn't find DM VARITY so it skipped the line

1. script 5.23 was focused on Nougat for Z5 family hence its not carrying older modifications! , so z4+ and below devices don't work

2. script 4.5x was the last known scripts that works for z2 z3 and z3+ family

hence even both script don't see DM VARITY but the repacking of RAMDISK is different and device gets bootloops

about Twrp,

1. DON'T Embed TWRP by SCRIPT, press N and leave it. since the script is using YUGA twrp (xperia Z c6602/c6603) and cannot properly handle Encryption/decryption of internal storage due to advances in SONY ENCRYPTIONS

2. take the twrp from

https://androidfilehost.com/?fid=962187416754471464

REFERENCE POST https://xdaforums.com/z3/development/z3-twrp-2-8-7-0-d6603-t3273996

...

and flash it via adb (install minimal adb and fastboot , put twrp3.2.1 on desktop (name it twrp.img) then connect you device in FASTBOOT MODE (blue LED) , and flash ( read description given in the post)

now try going in side TWRP and see if it removes that decryption error of internal storage!
[Xperia Z5 Android Development] Berni-0815:
Don't use SuperSU! Use superuser.zip instead and install the app phh's superuser afterwards!
[Xperia Z5 Android Development] Sierra-Saphir:
Hi sorry for answering late. I was very busy the last two days and did not have much time for testing

What are the differences between SuperSU and Superuser? Why should I rather use Superuser than SuperSU?

Ok I did some testing now.

As you told me I downloaded naylik's TWRP image.

In the referring post there are several warnings NOT to use newer versions of this build with stock roms because it will break the rom.

So I took the latest version which works with stock rom (2016-12-23)

As you said I pressed N when I was asked for TWRP in rootkernel script and flashed the Kernel

I flashed twrp.img as described in naylik's post (Tried both methods recovery as well as FOTAKernel)

But when booting up there's no LED shining and I can't boot into TWRP

Next I tried the same with stock kernel but ofcourse this doesn't work, too

Last, just for testing, I flashed the kernel with TWRP embedded by rootkernel AND flashed twrp.img

But also no success. It either boots into rootkernels TWRP with no access to the filesystem or it hangs on Sony emblem with orange LED shining

I also tried fastboot boot twrp.img

TWRP boots and I get access to the filesystem but that's only half the job

How do I build a kernel with naylik's TWRP embedded? Can I add it to the sources of rootkernel script and just run rootkernel.cmd?
[Xperia Z5 Android Development] YasuHamed:
you were doing right!

press N , and don't include TWRP into kernel

flash twrp from https://androidfilehost.com/?fid=962187416754471464 as "fastboot flash recovery twrp.img" (infastboot mode)

remove cable , when device is turned off, press POWER+volume down key (keep pressing), until you are FORCED to twrp (new twrp are like that)

try
[Xperia Z5 Android Development] Sierra-Saphir:
O.K. so now I downloaded twrp_z3_2018-03-28.img form given link

I ran rootkernel script again

Disable Sony RIC --> NO

Install TWRP --> NO

Install busybox --> NO

Install DRM fix --> NO

I connected my phine in fastbootmode and ran commands

fastboot flash boot boot.img

fastboot flash recovery twrp.img

But when I press and hold PWR + VOL DOWN I don't get into TWRP. Instead Android boots in Safe Mode

What is wrong?
[Xperia Z5 Android Development] Klaus N.:
To enter TWRP

1. Turn your device off

2. Push <power> + <vol-> together, and when you recognize a vibration, release the <power> button (but keep <vol-> pressed until TWRP starts)

But when you repack the kernel, I'd suggest to say "Y" when asked to disable Sony RIC (otherwise you are not able to mount /system r/w via TWRP), and also say "Y" to install the DRM fix.
[Xperia Z5 Android Development] Sierra-Saphir:
Still booting Safe Mode instead of TWRP
[Xperia Z5 Android Development] Berni-0815:
Because the developer of SuperSU gave his source code to an untrustworthy company!
[Xperia Z5 Android Development] Sierra-Saphir:
Thanks Bernhard

So now there's something I've found out. The output of rootkernel.cmd says my Kernel is version 3.4.0-perf-g7c8b3cb

But in \Android\twrp_common_kmodulesdirectory there are only

3.10.49-per-g83fc9bc | 3.10.84-perf-g4a67e86 | 3.10.84-perf-g19d6d92

Could this be the reason why it's not working properly?

But if yes I'm wondering why there aren't any errors when I run the script

Where do I get the correct files for 3.4.0-perf-g7c8b3cb ?
[Xperia Z5 Android Development] Klaus N.:
Please, do some research in this thread. That question has already been answered some time ago ;)
[Xperia Z5 Android Development] YasuHamed:
well the issue is not fixing the folder names! he was able to flash the twrp given in the script but that twrp is for YUGA and unable to decrypt internal partition

thats why i had been trying him to flash latest version.
[Xperia Z5 Android Development] zyxel25:
After following this guide with TA my device which is XZ Dual, bootloops after the xperia logo? help please :(
[Xperia Z5 Android Development] YasuHamed:
when you say

fastboot flash boot boot.img

fastboot flash recovery twrp.img

i am assuming that BOTH img FILES are situated at

C:\Program Files\Minimal ADB and Fastboot

with those EXACT FILE NAMES (cAsE sEnsiTiVe) otherwise these commands doing nothing

also if you wana force boot twrp

just type fastboot boot twrp.img (while device is in fastboot mode) (this command doesn't flash recovery, its just temp boot) for you to do your things!

look at your screen and after few seconds of sony logo, TWRP MUST APPEAR !

---------- Post added at 07:52 AM ---------- Previous post was at 07:47 AM ----------

paste log here, lets see what exaclty happened when you ran the script !
[Xperia Z5 Android Development] Berni-0815:
IMHO the files have to be placed in the directory where he starts the commands.... Since I'm working with linux, I always do those things in a directory named Tmp in my home directory.

cd ~/Tmp

I place the files there and eveything is fine...

Edit:

Working with windows AFAIK the files don't have to be case sensitive...
[Xperia Z5 Android Development] Sierra-Saphir:
Yes the files are stored in adb / fastboot directory cAsE sEnSiTiVe named boot.img and twrp.img

fastboot boot twrp.img works with proper decryption

But isn't there a way to install correct TWRP permanetly? To patch it into the Kernel instead of the wrong YUGA TWRP?
[Xperia Z5 Android Development] Berni-0815:
The answer is given in the post you quoted... :p
[Xperia Z5 Android Development] Sierra-Saphir:
I'm sorry but I don't really know what you mean. In the post I quoted are three commands:

fastboot flash boot boot.img --> flashing boot.img works properly but depending on the options I chose either with missing or with broken (wrong) TWRP

fastboot flash recovery twrp.img --> twrp.img is stored cAsE sEnSiTiVe correct in correct folder

--> output of command is successful but my phone will NOT boot into TWRP (I don't know why but PWR + VOL DOWN always gives me Android Safe MODE and NOT recovery)

--> I tried several combinations: press and hold both keys, release one key but keep pressing the other, repeatly press and release the keys during boot, .... but I always end up in Android Safe Mode

fastboot boot twrp.img --> boots TWRP with full access to filesystem. But it's only temporarily booted. I want to install TWRP permanently

Since neither fastboot flash recovery twrp.img nor fastboot flash FOTAKernel twrp.img

work for me I want to create one single file boot.img using rootkernel.cmd including recovery but exchange the broken TWRP with the version which has working decryption

Does anyone know how to change the TWRP which is included in boot.img (or which files I have to change before running the script) ?
[Xperia Z5 Android Development] zyxel25:
it's ok now, I dunno what happened I just flashed magisk V16.3 via TWRP after flashing via fastboot the newly created kernel and the bootloop is gone thanks :)
[Xperia Z5 Android Development] Berni-0815:
That's what I meant. If this is not working for you, I can't help any more; sorry... :crying:
[Xperia Z5 Android Development] YasuHamed:
only [MENTION=3989065]serajr[/MENTION] can answer that! for v5.23 onwards

however for 4.51 , tobias is not more updating and left script supporting z5 perfectly till last stockrom by sony!

anways I never embeded twrp in kernel for my z5,

you should be able to flash twrp outside the script and must able to boot with one of the combinations

1. power button and volume down HOLD when device is powered off , until you are taken to twrp

2. on sony logo pressing volume up / volume down simultaneously until you see twrp

3. on sony logo when pink LED appears, touching randomly on screen and / or volume up / down keys
[Xperia Z5 Android Development] Sierra-Saphir:
Option 2: Thanks. Did not try this one

Option 3: There is no pink LED (and so for any other color)

But right now I can't try option 2 because I'm facing a big issue. I think I did something very stupid

Yesterday I did some research on google and there was one site where I read that Sony kernels (at least the elder ones and mine was built back in 2014)

can't access FOTAKernel partition when bootloader is unlocked except there's extract_elf_ramdisk utility installed in the kernel.

And because there was no way to enter TWRP I assumed that extract_elf_ramdisk might be missing (not installed by rootkernel script or whatever)

So I did some testing. I flashed back everything to original with flashtool and my ftf, flashed TWRP to FOTAKernel and relocked the bootloader

I know this sounds very stupid and I could have known before that it won't work but I thought it was worth a try (now I know it's just nonsense)

Now I have a big problem to unlock the bootloader again. Everytime I try I get error message Command did not succeed

I tried both flashtool and fastboot

I also reflashed ftf twice with all wipe options ticked - still the same

I recognized that flashtool is reading a wrong IMEI from my phone. The number is almost the same but the last digit should be a 3 and flashtool reads 4 (why??)

I tried unlock codes for the right IMEI and for the IMEI that flashtool reads. But none of them works. Everytime "Command did not succed"

Servicemenu says: Bootloader unlock allowed: Yes

So the boot loader was unlocked properly and relocked again. I did that before when I was using rootkernel v5.23 and got into bootloop.

Re-unlocking worked fine after that so why can't I re-unlock now?

Edit:

SOLVED

Just forget about it. I don't know why I had this problem but after waiting 3 hours I just tried again and it worked properly

Bootloader is unlocked again
[Xperia Z5 Android Development] Entropy512:
Z4 Tablet - busybox and touchscreen don't play nice

Long time, no post... Haven't run a rooted device in over two years. (Yup, basically retired for the time being - doing more yocto than Android these days)

For those trying to do a dm-verity/RIC disable on a stock kernel repack for the Z4 Tablet using this tool - saying "yes" to installing busybox is what kills the touchscreen. Not sure why, busybox isn't that important to me so I'm probably not going to have the time to track down why.

I suspect this is related to why early TWRP builds apparently had broken touchscreen too.

Edit: Attempting to flash magisk with the modified kernel results in a system that will eventually shut down with a blinking red LED and then reboot. Googling isn't too helpful here - is this how a system behaves when ric is tripping? It is, believe it or not, not something I've ever actually tripped before. I sort-of recall seeing someone posting last night that there was some sort of init ordering issue involving magisk and when ric_enable is written with 0 - but I was half asleep at 1 AM so I could be barking up the wrong tree.

If shutdown with a blinking red LED is a sign of RIC somehow being re-enabled (despite no evidence of it other than a possible timing issue...), then I know where to start looking. If it's not - what is this a sign of? It's not something I remember ever seeing before.