yashsingh1/xdaforums huggingface dataset:
[Xperia Z5 Android Development] Latiosman:
I got my first sony phone (bought from second hand), and I checked that it was already unlocked. I dont want to miss any function, so I ended up in this topic.

I read it twice... but I need some guidance.

I cant do method 1 coz I dont have a .ftf. But I am not sure about method 2.

1) It starts saying "Run your favourite recovery and connect via". Can I run the TWRP that it is already installed in the phone? and connect via what?

2) where do I have to introduce the code "adb -d shell" ? In CMD of windows? or in some software like fasttool, android studio?...

3) which kernel do I have to use to make sure that it is compatible with this method? the stock kernel? where to dowload it?

?
[Xperia Z5 Android Development] Chito307:
C:\Users\Chito\Downloads\New folder (2)>rootkernel kernel.elf boot.img

- Unpacking kernel

Found elf boot image

Kernel version: 3.10.84-perf-g4a67e86

Found appended DTB

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

- Unpacking initramfs

- Detected platform: 64-bit

- Detected Android version: 6.0.1

- 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 busybox? [Y/n] Y

- Found xposed-v85-sdk23-arm64.zip. Install? [Y/n] Y

- Install DRM fix? [Y/n] Y

- Creating new initramfs

- Creating boot image

- Cleaning up

Done

phone does not boot with latest beta i reflashed last kernel made with stable build and phone boots
[Xperia Z5 Android Development] russel5:
[MENTION=5978083]Chito307[/MENTION] try repack your kernel with lastest beta, but without xposed
[Xperia Z5 Android Development] tobias.waldvogel:
Please try beta8. This should fix the issue. ;) Once again, thanks for taking the time for testing.
[Xperia Z5 Android Development] tobias.waldvogel:
Did you already install something to the /system partition? If yes please don't select the corresponding option. E.g. if you have installed xposed already before you must uninstall it or not select it in the script

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] ric69:
I have Xposed installed before and [no] in the script , 4 red leds too :silly:
[Xperia Z5 Android Development] Chito307:
thanks tobias.waldvogel and russel5, it was the fact that i did not uninstall xposed before the flash however now latest beta gives could not stat errors?

error: could not stat 'ramdisk/charger@0644__lnk__'

error: could not stat 'twrp_root/etc/mke2fs.conf@0644'

I tried two different computers too and same error..

Also I cannot pass safetynetchecks still with beta 7... I uninstalled xposed before flashing boot.img and successfully booted and disabled supersu 2.74 and xposed v85 in xposed installer... Perhaps some leftover files from last xposed? I disabled sony ric and dm verity in rootkernel command if that has anything to do with it.
[Xperia Z5 Android Development] iMessa:
Why?!?!? Help please!
[Xperia Z5 Android Development] zacharias.maladroit:
[MENTION=357342]tobias.waldvogel[/MENTION]

Looks like you're really doing some kind of magical work - not sure how or why but folks on the Z5c thread reported minimal drain (e.g. 1% per 8hours; 4-5 hours SOT + 12% only battery used)

with your latest beta (that one includes the libdrmfix.so, right ?) !

Keep up the amazing work :good:

Can anyone share a repackaged stock kernel of beta8 to try something out for me ?

(e.g. via PM)

I'd like to get my hands on the ramdisk and see whether similar results can be had with a custom kernel

Thank you !
[Xperia Z5 Android Development] osm0sis:
Hi! Things seem like they're in a good place right now with the mod in general so I wanted to bring this up again. Any idea how to get unpackelf.c working with the linked Xperia Z and Xperia C4 images in the quote above? I tried just removing the e_phnum check but there was a segfault for one of the images. :)

Any way to get it to automatically extract whatever's present without any further commandline options? If you don't want to change the default, maybe add "-a" option?
[Xperia Z5 Android Development] RyTekk:
I'm using your kernel with repack beta7, there're nothing changes for me.
[Xperia Z5 Android Development] anjelz2012:
C:\Users\DENIS ULLOA\Desktop\RepackKernel\rootkernel_v5.0beta8>rootkernel kernel.elf beta8xpo.img TA.img

- Unpacking kernel

Found elf boot image

Kernel version: 3.10.84-perf-g4a67e86

Found appended DTB

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

- Unpacking initramfs

- Detected platform: 64-bit

- Detected Android version: 6.0.1

- 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

error: could not stat 'twrp_root/etc/mke2fs.conf@0644'

- Install busybox? [Y/n] Y

- Found SuperSU.zip. Install? [Y/n] Y

Stripping SuperSU app

Adding service entry for SuperSU

- Found xposed-v85-sdk23-arm64.zip. Install? [Y/n] Y

- Install DRM fix? [Y/n] Y

- Creating new initramfs

error: could not stat 'ramdisk/charger@0644__lnk__'

- Creating boot image

- Cleaning up

Done

C:\Users\DENIS ULLOA\Desktop\RepackKernel\rootkernel_v5.0beta8>
[Xperia Z5 Android Development] Chito307:
I'm having the same problem :(
[Xperia Z5 Android Development] charlie460:
Getting the same errors as the last two posters reported.
[Xperia Z5 Android Development] Mastermagnus:
Hello, I tried the beta8 on my Xperia Z5 Compact phone with Generic Latin American 32.2.A.0.224 firmware, but my phone gets stuck on a boot loop after flashing the kernel. I get the following errors when patching the kernel, maybe that has something to do with it?

- Unpacking kernel
Found elf boot image
Kernel version: 3.10.84-perf-g4a67e86
Found appended DTB
- Detected vendor: somc (Sony), device: suzuran (Z5C), variant: row
- Unpacking initramfs
- Detected platform: 64-bit
- Detected Android version: 6.0.1
- dm-verity is enabled. Disable? (Say yes if you modify /system) [Y/n] Y
Disabling dm-verity
- Sony RIC is enabled. Disable? [Y/n] N
- Install TWRP recovery? [Y/n] Y
Installing TWRP
Compressing TWRP image
error: could not stat 'twrp_root/etc/mke2fs.conf@0644'

- Install busybox? [Y/n] Y
- Found SuperSU-v2.74-2-20160519174328.zip. Install? [Y/n] Y
Stripping SuperSU app
Adding service entry for SuperSU
- Install DRM fix? [Y/n] Y
- Creating new initramfs
error: could not stat 'ramdisk/charger@0644__lnk__'

- Creating boot image
- Cleaning up
Done
[Xperia Z5 Android Development] tobias.waldvogel:
I'm currently a few days at the beach but I will implement this middle/end of next week ;)

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] GryTEcHoG:
Just wanted to say thanks for your great work and beta8 worked fine in my Z3+ which solved my battery drain issues also.
[Xperia Z5 Android Development] paulo_andre:
Just followed the guide and was able to build a custom kernel for my Z3 tablet compact and Z1 compact.

However, Z1 compact (amami) is not supported, so no DRM fix and no TWRP... could you add support for it?

Or, an even better solution would be to add support for real recovery, both my devices support that and it would make a lot easier to update TWRP.
[Xperia Z5 Android Development] Mastermagnus:
Please, can anyone tell me how to fix these could not stat errors? I want to root my device with this kernel so I get the drm fix.

- Install TWRP recovery? [Y/n] Y
Installing TWRP
Compressing TWRP image
error: could not stat 'twrp_root/etc/mke2fs.conf@0644'

- Install busybox? [Y/n] Y
- Found SuperSU-v2.74-2-20160519174328.zip. Install? [Y/n] Y
Stripping SuperSU app
Adding service entry for SuperSU
- Install DRM fix? [Y/n] Y
- Creating new initramfs
error: could not stat 'ramdisk/charger@0644__lnk__'
[Xperia Z5 Android Development] Frontier3:
Has anyone had a problem getting rw access to system? I tried with 4 different root explorer programs and tried installing kingroot and none of them will get rw access.

The other root functions I tried seemed to work, although honestly without system rw there isn't much point and I'm starting over from scratch.

Wondering if anyone else ran into this or has a solution.
[Xperia Z5 Android Development] erveemoskovic:
Did you do this when patching your kernel?

- 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
[Xperia Z5 Android Development] shoey63:
Correct. Need to disable Sony RIC to get R/W access to /system.
[Xperia Z5 Android Development] Chito307:
Can anybody comfirm getting Android pay working with beta 7?
[Xperia Z5 Android Development] DiMithras:
I can confirm it working on beta 8, beta 7 has errors for facebook, NFC, pay and some other apps
[Xperia Z5 Android Development] canazaroxes:
Hi, i have Z5 rooted with TWRP and Androplus Kernel v32b, i can flash this kernel via recovery?

How do I do?
[Xperia Z5 Android Development] zacharias.maladroit:
beta8 is failing for me at the following stage,

both custom kernels (boot.img) and kernel.elf

anybody else ?
[Xperia Z5 Android Development] KbaB.BroS:
No issues for me, I've even ran it on your custom kernel from Z5 Premium. Maybe try re-downloading the tool or the kernels?

Which OS do you use? I can confirm it working on Windows, I haven't had much luck with Linux because I get binary errors when trying to run the tool.
[Xperia Z5 Android Development] tobias.waldvogel:
Does this happen on Windows or Linux?
[Xperia Z5 Android Development] tobias.waldvogel:
Thanks for testing :)
[Xperia Z5 Android Development] tobias.waldvogel:
This is always a little bit tricky as I don't have these devices. But I will try to add support for it and get back to you for testing.
[Xperia Z5 Android Development] zacharias.maladroit:
I get this error both on Windows 10 and Linux based OS

chmod +x bootimage

should fix the binary error on Linux
[Xperia Z5 Android Development] Chito307:
THis happens on Windows for me I have not re-downloaded beta 8 if you have updated it recently I will retest when I get home later
[Xperia Z5 Android Development] Mastermagnus:
It happens on Windows 10, I'm using beta8.
[Xperia Z5 Android Development] erveemoskovic:
[MENTION=357342]tobias.waldvogel[/MENTION],

I packed my kernel with beta8 and the latest SuperSU-v2.76-20160630161323.zip. Did a "fastboot flash boot boot_32.2.A.0.224.img" and now my device is stuck at the Sony logo :'(

I can get in to TWRP, but can't get past the Sony logo. It should come up with the crypto device unlock keypad but it doesn't.

I flashed the boot.img I created with beta7 and the device still does not boot.

Any idea what could be the cause?

Update: I created a kernel with 5.0b7 and dm-verity and RIC OFF and now the device boots, phiew! Does that mean my /system is modified somehow?
[Xperia Z5 Android Development] RyTekk:
dm-verity is a f**king pain in the *ss, you had better shut it down.

---------- Post added at 12:16 PM ---------- Previous post was at 12:14 PM ----------

Do you mean FC message when running Facebook? I'm feeling pain with Facebook FC on my kernel and can't find the wrong thing.
[Xperia Z5 Android Development] erveemoskovic:
Well yes and no. I don't want/need to modify /system so I want the added layer of security.

I build 4 kernels with DM and RIC on, with either option off and one with both options off. My device only boots when I flash a boot image with at least DM off. So something on my /system changed and I have no clue how or what.

I know I entered TWRP before the problem begun and swiped to accept at the first question "mount system read/write?". But I didn't change anything really in that session. I only tried to mount /data (put a check in the checkbox) to see if I could mount /data but it failed because /data is encrypted on my phone.

Could that have somehow change something on my /system?
[Xperia Z5 Android Development] tobias.waldvogel:
Encrypting does not change anything on your system partition. Usually would only be done by the recovery.

My device was also encrypted and I had several changes to the system partition:

- kcal kernel module

- keyboard layout file for my bluetooth media buttion

For the keyboard layout checked the source code and figured out that you can place it also in /data/system/devices/keylayout instead of /system/usr/lib/keylayout. The kcal module went into the bootimage. If you create a directory install in directory where you run the script you will be asked if you want to include the contents. Kernel modules go to lib/modules/

So finally I managed to live without changes to system and just reflashed system from the original ftf. Afterwards my phone boot perfectly well with dm-verity on and Sony RIC (and with /data encrypted of course)

So you might just try to reflash only /system with flash tool.
[Xperia Z5 Android Development] RyTekk:
Then I have a question? Why did you do unlock bootloader while you don't wanna change system? There're no reasons to unlock BL that I can find from you.
[Xperia Z5 Android Development] tobias.waldvogel:
I don't want to modify /system but I want to change the boot image. This is precisely what this script does. For booting a modified boot image you need to unlock the bootloader.

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] erveemoskovic:
Exactly that.
[Xperia Z5 Android Development] RyTekk:
I didn't ask you but thanks for the answer. Btw, do you have an own kernel? I heard that you even intended to build an own toolchain.

Then you don't use a stock kernel? If the answer is yes then I will have understood, you're like me.
[Xperia Z5 Android Development] erveemoskovic:
Then you don't understand. I use the stock kernel.

If you read and understand the first post then you know this mod doesn't rebuild the kernel or anything. It "just" recreates the bootloader with some extra script-foo around it to quote: "in order to make it rootable and adds TWRP recovery as well."

And quote: "Recompiling the kernel is not required as only the init ramdisk needs to be modified"

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

Thanks for the tip! Flashed system sin only, then flashed the boot.img created with beta8 (DM and RIC not disabled) and my device boots now, YAY :laugh: Thanks.
[Xperia Z5 Android Development] RyTekk:
LOL :laugh:

I don't think there're any devs can touch the bootloader, at least on Z5. This tool does unpack boot.img or kernel.elf to modify ramdisk (you can't do anything to zImage, this is the thing that OP mentioned "no need to rebuild"). Then I have a question again, you don't modify system, you don't run a custom kernel, so what do you do with an unlocked BL?
[Xperia Z5 Android Development] erveemoskovic:
Yes yes, bootloader, ramdisk, whatever. I need my bootloader unlocked to flash the modified image created by this script. Afterwards I have a stock system with secure stock r/o system partition (and DM and RIC) but with TWRP and systemless Root and systemless Xposed.

That was my last post about this all. If you still don't get it that's too bad. If you don't need or want it, go somewhere else. Let's get back to what it's all about.
[Xperia Z5 Android Development] metzner:
Z3+ dual sim (latest MM rom) works with this script. Thank you so much...even restored my TA backup which I did before UB :)
[Xperia Z5 Android Development] s8m:
This is happening to me on Windows 10 too. Any help would be most appreciated!

http://i.imgur.com/mevk0rc.png
[Xperia Z5 Android Development] s8m:
I installed a Linux guest in VirtualBox and was able to create the boot.img successfully. For whatever reason Ubuntu didn't work but Antergos did (Antergos is a way better distro anyway imo).
[Xperia Z5 Android Development] deepongi:
im getting an error with beta8

to what could it be related?
[Xperia Z5 Android Development] tobias.waldvogel:
As there are some other users reporting the same issue I would like to further analyze it. Unfortunately I cannot reproduce it. Would you mind to try beta9? It will not solve the issue, but give some more details in order to fix it.
[Xperia Z5 Android Development] tobias.waldvogel:
Could you try beta9 as well? It will give us the error code why stat failed. Then I will be able to fix it. I cannot reproduce it unfortunately.
[Xperia Z5 Android Development] deepongi:
error: could not stat 'twrp_root/etc/mke2fs.conf@0644, reason: 132'

yeah, its strange. thats ^^ with beta9
[Xperia Z5 Android Development] tobias.waldvogel:
Beta9 should work now on Xperia Z and Xperia C4 images. At the end I did not add the -a option because then I don't know how to name them. But you can add always -k -r -d and if the DTB is not available it will just be ignored. ;)
[Xperia Z5 Android Development] tobias.waldvogel:
132 means EOVERFLOW. The file in question does have a zero date value. That seems to cause the problem. I will implement an alternative implementation for lstat and get back to you. It shouldn't take long ...
[Xperia Z5 Android Development] zacharias.maladroit:
beta9 seems to work (well, the repacking part),

haven't had the chance to test it yet since I'm on RR ROM

Did I use the syntax correctly ?

Thank you !
[Xperia Z5 Android Development] s8m:
On Windows 10, I get the same "reason: 132" error on beta 9:

error: could not stat 'twrp_root/etc/mke2fs.conf@0644, reason: 132'

and

error: could not stat 'ramdisk/charger@0644__lnk__, reason: 132'
[Xperia Z5 Android Development] Klaus N.:
Can't confirm; beta 9 works flawlessly on win 10 with the kernel.elf I've repacked (variant: row). I'm only a user, but maybe it has something to do with the variant, e.g. dsds?
[Xperia Z5 Android Development] xasbo:
Getting the same. Windows 10 x64. Running from c:\rootkernel with an administrator console.

Using kernel_S1-SW-LIVE-F936-PID1-0006-MMC.elf from E6653_Customized SG_1298-3672_32.2.A.0.224_R6C as the source kernel.

Sounds like [MENTION=357342]tobias.waldvogel[/MENTION] has it figured out. [MENTION=4898998]Klaus N.[/MENTION], are you not integrating TWRP?
[Xperia Z5 Android Development] Klaus N.:
I've said "yes" to all, twrp included.

But I took the kernel.elf by

- extracting the rom.ftf with 7zip

- extracted the kernel.sin from above with sin extractor of FlashTool

and put the kernel.elf into the rootkernel folder
[Xperia Z5 Android Development] xasbo:
Curious. Similar for me - I had downloaded the FTF via FlashTool/XperiaFirm and the kernel.sin was already on-disk waiting for me. Just used the SIN extractor to get the ELF. *shrug*

I decided I was going with AndroPlus anyway, so I switched back to v5b7 just to get TWRP flash-able, and now I'm all set.
[Xperia Z5 Android Development] tobias.waldvogel:
Could you try beta10? It looks like a time zone issue, this is why it may have shown up only to particular users.

I am using now an alternative implementation for file time related parts in Windows which should address this issue.
[Xperia Z5 Android Development] s8m:
That did the trick - it's working now. Well done!
[Xperia Z5 Android Development] deepongi:
+1 i confirm working also. good work!
[Xperia Z5 Android Development] Chito307:
great job [MENTION=357342]tobias.waldvogel[/MENTION] everything compiled successfully! :) however i still cannot pass safetynetchecks wirh xposed v86 installed and disabled, super su stable 2.76 hidden and disabled, sony ric on, dm verity off, twrp, and busybox installed :(
[Xperia Z5 Android Development] camaro322hp:
I used this tool on my Z5C with the latest 224 firmware and the process works great. However, due to certain issues I am having with MM, I would like to go back to the LP firmware 200. I believe I found a place to download a reliable copy of the 200 LP firmware. The OP seems to indicate this will work with LP. So my question is - can anyone give any guidance on what versions of stuff (tobias script, supersu, etc) should be used with the 200 firmware? Thank you for any input you can offer.
[Xperia Z5 Android Development] .corrupt.:
Is there an update on the Threema issue?
[Xperia Z5 Android Development] Masoud.Ser:
[MENTION=357342]tobias.waldvogel[/MENTION]

hi

Does it work v.51 on new fw32.2.A.0.253 for make kernel?
[Xperia Z5 Android Development] allayarov.i:
Everything seem to be ok except TWRP. I think new kernel modules (for 3.10.84-perf-gf1cfa5f) should be added in order to include recovery. I asked guys from Xperia Z5 Compact thread upload module files.

Attached new kernel modules for rootkernel. I think it will be useful for Tobi. :o

Patched kernel http://xdaforums.com/showpost.php?p=67716814&postcount=312
[Xperia Z5 Android Development] russel5:
[MENTION=357342]tobias.waldvogel[/MENTION], hi again. trying your last beta with xposed and still have some issue on official z3c MM.575 (we have beta concept firmware and custom kernel with xposed works very well on it)

* i can't change my screen brightness, it's always on top (even if i change screen settings)

* when i block my phone, screen not turn off, ie i see low-light on black screen

* when i unblock my phone, sometimes after that my touch not work, sometimes phone just reboot

* when i apply xposed modules and reboot phone, got bootloop sometimes

Some logs for you, i hope you find a solution. Thanks.

P.S. Last systemless xposed v86 now works on my phone, with previous version i always have bootloop.
[Xperia Z5 Android Development] tobias.waldvogel:
I extracted them already together ;) They are now included along with some other minor changes in 5.0 rc1

If we don't have any new issues then I think we are ready to release 5.0
[Xperia Z5 Android Development] tobias.waldvogel:
Just to be sure: my script is designed to work with the _original_ xposed zip, _not_ with the modified systemless version. My script has an its own systemless implementation.
[Xperia Z5 Android Development] KbaB.BroS:
Download the file attached from [MENTION=5550858]allayarov.i[/MENTION], unpack it and move it to this directory in the rootkernel folder:

Android\twrp_common_kmodules

TWRP recovery should work now
[Xperia Z5 Android Development] Mastermagnus:
I patched the kernel with the latest version and there were no boot loops, but recovery mode doesn't work :(
[Xperia Z5 Android Development] Chito307:
Safetynet still finds this systemless method however I even tried a full wipe :(
[Xperia Z5 Android Development] osm0sis:
Nice work!! Just tried out bootimg.exe from RC1 and it handled all the newer ELF files I threw at it.

There's still some weirdness with a couple older ones people have sent my way, however. They throw a "error: Section header size not 40". Any idea what that is about? From what I understand they should contain a zImage, ramdisk and RPM.img, which was Sony's predecessor to dtb.img, so you'd think they'd unpack similarly.

Xperia S: [attachment removed]

Xpera U: [attachment removed]

Thanks for your ongoing time and efforts! One unpackelf to rule them all? :D
[Xperia Z5 Android Development] SovPanda:
Oh interesting, I been flashing your systemless on another thread, been flashing that systemless and been having system ui crashed on Xperia x lockscreen. Imma try the one included
[Xperia Z5 Android Development] russel5:
Bro, your script not add systemless xposed, only original. You should know that and i used original xposed in custom kernel.
[Xperia Z5 Android Development] tobias.waldvogel:
I had a look in the logs and there is a crash in touchscreend, which explains the symptoms you mentioned.

Could you create one more logcat and also run "adb -d shell dmesg >dmesg.txt" and provide me the file?
[Xperia Z5 Android Development] tobias.waldvogel:
It seems that I can reproduce this issue on my tablet Z2. That will make it easier to look at it.