yashsingh1/xdaforums huggingface dataset:
[Xperia Z5 Android Development] x_one:
I've tried set manually permisions. Didn't helped..

I don't know if XC is good or not or if it's a reason for satisfaction.. I like my Z3C :) and I don't think that problem with peeling off front panel will be good reason to give replacement. We will see.. :)
[Xperia Z5 Android Development] munjeni:
Thanks! I can see selabel problem:

01-21 20:33:10.074 W/[COLOR="Red"]ta[/COLOR] (16286): type=1400 audit(0.0:2779): [COLOR="Magenta"]avc: denied { read } for path="/system/bin/sh"[/COLOR] dev="mmcblk0p23" ino=1294 scontext=[COLOR="Blue"]u:r:tad:s0[/COLOR] tcontext=[COLOR="Red"]u:object_r:shell_exec:s0[/COLOR] tclass=file [COLOR="Red"]permissive=0[/COLOR] ppid=1 pcomm="init" tgid=1 tgcomm="init"
01-21 20:33:12.167 V/sysmon-dc_watt_limit( 1620): uevent_handler [349] LOCK 0xb6c5806c from 1786
01-21 20:33:12.167 V/sysmon-dc_watt_limit( 1620): uevent_handler mutex 0xb6c5806c GOT by 1786
01-21 20:33:12.179 V/sysmon-dc_watt_limit( 1620): uevent_handler [383] UNLOCK 0xb6c5806c from 1786
01-21 20:33:12.213 E/tadif ( 1502): Failed to connect to tad.

As you can see your android selinux runing in enforcing mode (permisive=0) and we can see that permission is denied to script "ta" since requesting label was r:shell_exec:s0 instead of u:r:tad:s0 ! Curently I can't figure out if script byself have label r:shell_exec:s0 or thing is because script uses #!/system/bin/sh which by default /system/bin/sh have label r:shell_exec:s0. What you can do? You need to make a copy of the busybox and put that copy in the ramdisk /sbin folder and rename to sh for example, so than change ta script line "/system/bin/sh" to "/sbin/sh", but you must label "/sbin/sh" to u:r:tad:s0 and things will work I think. To change label use this command before you make ramdisk:

chown tad.root /ramdiskpath/sbin/sh

chmod 0770 /ramdiskpath/sbin/sh

busybox chcon u:r:tad:s0 /ramdiskpath/sbin/sh

Use busybox from here https://xdaforums.com/showpost.php?p=70330773&postcount=1575
[Xperia Z5 Android Development] munjeni:
This one might work.

Edit:

This one is deleted ;)
[Xperia Z5 Android Development] x_one:
OK. I see that I need to lern much...

Tomorrow after work I'll give my phone to service but I'll try everything after I'll get it back and I'll give freedback here..
[Xperia Z5 Android Development] spyvsspy:
Last Activity: 3rd September 2016 11:52 PM

looks like tobias is still in deep sleep :)
[Xperia Z5 Android Development] sceryavuz:
Anyone who knows in real life?

Maybe he is dead :/
[Xperia Z5 Android Development] bruno$0:
So many drama. This tools works until nougat release. So many MM firmwares without any issue. Give just a little more time and he will (i guess) realsease a new version. For now we already had a drm fix tool and root. For me it's okay.
[Xperia Z5 Android Development] sceryavuz:
I tried some piece of sh!t, then /system is writeable now..

Sony RIC defeated, now TWRP is the main problem..

Try..

download terminal on google play

open terminal

write "su" command and give root permission

then you will see "#"

after that, write this command:

echo 0 > /sys/kernel/security/sony_ric/enable

then you write this command:

mount -o rw,remount /system

if you see "#" again, it worked

but if you see "mount: Operation not permitted" it has not, sorry

After following these steps, root access is working perfectly :)

Proof: https://xdaforums.com/showpost.php?p=70677335&postcount=92
[Xperia Z5 Android Development] acabreram:
Bro how can i get Xposed? It's working on your device?

Z5 compact it's my device
[Xperia Z5 Android Development] fluffi444:
Only to protect the innocent: This kernel is ONLY for Z3C :o

thanks [MENTION=4120742]munjeni[/MENTION] for your help - Even if I do not completly understand why it's working for me without your modifications, but not for [MENTION=3697891]x_one[/MENTION].

Especially as we used the same kernel, modified by me... Or is this also ROM related somehow?

My /system/bin/sh has also label

u:object_r:shell_exec:s0

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

Sorry - Don't know anything about Z5c - I have Z3c with still 6.0.1 FW.
[Xperia Z5 Android Development] munjeni:
In most case your selinux is permissive? Even I don't know if one which I have repacked is working since busybox is 32 bit without pie, did you tried? Is z3c 64 bit?
[Xperia Z5 Android Development] shoey63:
[MENTION=4120742]munjeni[/MENTION]

Z3/Z3C are 32 bit. Z3+/Z5/X and everything going forward are 64bit devices.
[Xperia Z5 Android Development] munjeni:
Thx
[Xperia Z5 Android Development] fluffi444:
Yes - I tried your kernel and its working as well.

And yes - I'm on SELinux permissive. As faar as I understood SELinux is only an Kernel thing?! And therefore I wonder why 2 persons (me and x_one) have different result with the same kernel (and I mean the same img file! - I send him mine for tests) . Howsoever - an 100% answers is maybe not possible anmore bebause x_one has send this phone to service and may get an new one as replacement...

Again - thanks for you work here. Call if you need me to test something.
[Xperia Z5 Android Development] x_one:
Yeah! Quite strange. Devices should have the same hadware and software, even if I use CE1 and fluffi444 uses different customisation.

Support where I've gave my phone is near my work and they said about 5 days for repairing, so I should get it back soon.
[Xperia Z5 Android Development] serajr:
Sony RIC disabler for Nougat

In addition to the instructions in the "DRM Fix Workaround for Nougat" (look for "Disabling Sony RIC")

Enjoy it!
[Xperia Z5 Android Development] rolo143:
There's a new update for Z5C. (32.2.A.5.11)

Does rootkernel method works with this update to install twrp and root?
[Xperia Z5 Android Development] Klaus N.:
It's still mm (6.0.1), and yes, it works with the repacking tool (v5) [MENTION=357342]tobias.waldvogel[/MENTION]

The only thing you have to do before is this
[Xperia Z5 Android Development] P.Fan:
I'm having same problem, did you manage to find a fix?
[Xperia Z5 Android Development] sceryavuz:
No.
[Xperia Z5 Android Development] Dhimas97:
Hello.. I want to ask few question here if anybody know please reply me ?

I don't how to run this script, i read all text mentioned ini OP. I already extract kernel.sin from (.Ftf) that i want and then place it on rootkernel tool folder. Now i want to run the script "rootkernel.cmd" i open it, its just open then close very fast even i can't read it. I don't know how to run this script, its Just i don't understand. Something that we must see is like we choose Y/N, but that never Come to my PC when i run this.

Condition:

Win10

-Run Normal (double click) (not work)

-As admintrator (not work)
[Xperia Z5 Android Development] x_one:
The story is starting over. I've got my device. :)

They gave me brand new body with my old mainboard inside. I thought they will only use new glue strip.

I've flashed img You posted before. It's the same. Wrong simcard, no camera.

But inside logs i can see

01-27 01:08:02.001 W/ta ( 8421): type=1400 audit(0.0:66): avc: denied { search } for name="tmp" dev="mmcblk0p25" ino=513074 scontext=u:r:tad:s0 tcontext=u:object_r:shell_data_file:s0 tclass=dir permissive=0 ppid=1 pcomm="init" tgid=1 tgcomm="init"
01-27 01:08:02.001 W/ta ( 8421): type=1400 audit(0.0:67): avc: denied { execute_no_trans } for path="/sbin/tad_static" dev="rootfs" ino=5469 scontext=u:r:tad:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0 ppid=1 pcomm="init" tgid=1 tgcomm="init"

What does it mean? Kernel can't find tmp folder or TA.img inside?

I'm sure the file was there, checked twice. Another strange thing is that if I understand it should work normal if I don't place TA file.
[Xperia Z5 Android Development] Gewiz:
You'll need kernel.elf instead of kernel.sin. It's mentioned in op how to get it.

Don't open the rootkernel.cmd. You have to execute the command "rootkernel <extracted kernel> boot.img" in the rootkernel folder via command prompt. If you don't know "command prompt", just google it.
[Xperia Z5 Android Development] Dhimas97:
I thought the tools just need kernel.elf [MENTION=7861286]Gewiz[/MENTION] I try run cmd on that folder with shift+right click - cmd, just with kernel.elf the boot.img showed up but it's just 1 kb. I understand now thankyou so much bro [MENTION=7861286]Gewiz[/MENTION]
[Xperia Z5 Android Development] TreepZ:
TWRP Won't install

Hi there.. I have a question.

It doesn't seem to add TWRP to the boot.img.. Any idea why? It doesn't seem to find the modules for some reason..

-Emil
[Xperia Z5 Android Development] mele80:
No, it doesnt work yet...
[Xperia Z5 Android Development] TheTecXpert:
Hey guys..

I'll make this simple..

Those of you with unlocked bootloaders and who are struggling to get their xperia z5 e6653 rooted on 7.0 nougat (.327) kindly +1 a reply to this post. I will show you how to root your device in less than 1 minute.. The tutorials on the web are vague, misleading and obviously posted by people who expect others to decipher their half arsed attempts at providing accurate info and files...

As a friendly warning, please do not follow the tutorial found on youtube.. The zip file provided isnt even the right fricken one.
[Xperia Z5 Android Development] piponxs:
Problem is in DRM fix not root
[Xperia Z5 Android Development] venkat kamesh:
Rootkernel latest update - nougat workaround

Hello guys

I had just updated to Nougat on my Xperia Z5 Dual

i want to get DRM fix, Disable Ric and few

I spent some time on the tool

Gone trough [MENTION=3989065]serajr[/MENTION] workaround ... interesting

I had added everything over tool it self.. ( Only TWRP left, may take time )

Download :

View attachment rootkernel_Windows_Linux-Only_nougat.zip

Changelog:-

*Dm-verify

*Enable Debug on boot ( new option added for my use. hope you will too)

*RIC

*DRM fix with busybox

Logcat of my kernel when i used....!

C:\Users\venkat kamesh\Desktop\kamesh backup\android\z5 backup\latest rootkernel>[COLOR="Red"]rootkernel kernel.elf boot.img[/COLOR]
- Unpacking kernel
Found elf boot image
Kernel version: 3.10.84-perf-gda8446f
Found appended DTB
- Detected vendor: somc (Sony), device: sumire (Xperia Z5), variant: dsds
- Unpacking initramfs
- Detected platform: 64-bit
- Detected Android version: 7.0 (sdk 24)
- dm-verity is enabled. Disable? (Say yes if you modify /system) [Y/n] Y
Disabling dm-verity
- Enable adb Debug? [Y/n] Y
- Sony RIC is enabled. Disable? [Y/n] Y
Disabling Sony RIC
- Install TWRP recovery? [Y/n] N
- Install DRM fix with BusyBox? [Y/n] Y
- Creating new initramfs
- Creating boot image
- Cleaning up
Done

Instructions:-

*Note only for Nougat... even if it work on lesser versions of nougat.. you will get bootloop

- Copy your kernel.elf to the root folder

- double click on double_click.bat file or apply below code in cmd

rootkernel <extracted kernel> boot.img

- continue the process ( TWRP N )

- Then finally result boot.img = Flash it trough fastboot

Now put your phone into fastboot mode (Volume Up + connect USB) and then run:

To test it without actually flashing it:

fastboot boot boot.img

For flashing it:

fastboot flash boot boot.img

Good luck

Regards

VK
[Xperia Z5 Android Development] Hamidreza2010:
Ahhaaa

Its great

will test as soon as get free time

thanks again bro

Edit: And wait for recovery dear
[Xperia Z5 Android Development] josephnero:
[MENTION=4433143]venkat kamesh[/MENTION]

thanks a lot.works well on E6633

might be unrelated to your tool and problem with something else but device doesn't boot.flashing another kernel works though
[Xperia Z5 Android Development] munjeni:
[MENTION=8023946]DanielMode[/MENTION] try with old flashtool 0.9.18.1 and pm me please if it working!
[Xperia Z5 Android Development] munjeni:
Guys, [MENTION=3059405]steom[/MENTION] and me ...worked hard two days to get my trim area loop PoC fully working under selinux enforce mode, today we spent 6 hard hours solving all selinux related denials, finaly this is a result:

WORKING!!!!! WELL DONE!!!!!

Fingers Crossed! ;)
[Xperia Z5 Android Development] fluffi444:
Guys. Great work! Much appreciated!

If this works we have a full DRM solution with UB.

Outstanding.
[Xperia Z5 Android Development] venkat kamesh:
nothing Failed

testing (unstable)
[Xperia Z5 Android Development] serajr:
You just rock \m/
[Xperia Z5 Android Development] Klaus N.:
I just want to say "thank you" to ALL developers and contributors working on this tool, to get it working on Nougat - awesome :good::good::good:
[Xperia Z5 Android Development] munjeni:
[MENTION=8023946]DanielMode[/MENTION] DK.ta which you flash is for drm keys and not fido keys, to get fido and other keys like one from locked bootloader, restore your locked trim area or solution two wait for my tool, I'm working on solution!
[Xperia Z5 Android Development] schuberth777:
The original tools works perfectly with latest official MM (F5321_34.1.A.3.49_R4B_Singapore Generic_1304-8438) for X Compact, just made a supersu-d kernel (SR3-SuperSU-v2.79-SR3-20170114223742), made the device keys from TA backup and everything is OK!

All keys are enabled, camera is workig, FIDO keys show as provisioned.

I only ran into trobule with xposed integration. It didn't work when included into the boot image, and manually installing it caused a boot loop.

So I made a new boot image without integrating xposed and the xposed apk finally recognized that the framework is installed.

Just in case anyone else hits this problem.

m(__)m
[Xperia Z5 Android Development] steom:
munjeni "PoC"

Bootloader unlocked!

Full SElinux enforced!

Full DRM with own TA.img backup!

Xperia X Compact F5321.
[Xperia Z5 Android Development] DanielMode:
[MENTION=4120742]munjeni[/MENTION]

but why my Fido_keys not provisioned. on my device :(

and how can i restore my TA Backup on other way ??

btw: i'm trying to flash the DK.ftf i extracted from my TAbackup.img
[Xperia Z5 Android Development] munjeni:
Search please, xda contain ton of posts related to "how to restore trim area"! You can do that for example by temporary booting an recovery and with adb shell upload trim area to the / and use dd command to reflash trim area partition, just an example.
[Xperia Z5 Android Development] DanielMode:
yes i know...but most of them talking first to go back to stock kernel and thats not what i want...i need a solution to stay on Advanced Stock Kernel and TWRP for Xperia X Compact ;)
[Xperia Z5 Android Development] shoey63:
If you have created and successfully flashed DK.ftf you should have all keys provisioned, including Fido after flashing that kernel. If Fido keys are not provisioned you have either

A) Not successfully flashed DK.ftf

B) Created DK.ftf with a TA.img which already has the keys deleted. For example one taken on an unlocked (or unlocked and relocked) bootloader.

You need the ORIGINAL TA.img that was backed up before the bootloader was first unlocked.
[Xperia Z5 Android Development] DanielMode:
take a look at my post #1869 thats the log file of flashing my DK.ftf thats was 100% taken of my device before boottloader got unlocked !!
[Xperia Z5 Android Development] shoey63:
Yup, successfully flashed. When and how did you backup your TA.img?
[Xperia Z5 Android Development] DanielMode:
at the day when i got the device brand new by using this tool
[Xperia Z5 Android Development] shoey63:
Could be the kernel then. Try making your own kernel with dm verity disabled and DRM fix included.
[Xperia Z5 Android Development] DanielMode:
i could, but the device is running well as i instaled everthing how i like and the Fido_Keys not that important like the DRM's

so i"'ll keep it like it is now...may if i'm getting bored in the future i'll try to fix it from 99% right now to 100% ;)

thx u for taking your time of my prob dude !!
[Xperia Z5 Android Development] anjelz2012:
Does not work on my z5 premium, stays on the SONY logo
[Xperia Z5 Android Development] rajdeep312:
Plz share your patched boot file for e6683
[Xperia Z5 Android Development] venkat kamesh:
hmm found your reason

just because of lib nothing more ;) if you add it works

Let me update tool guys ;)
[Xperia Z5 Android Development] rajdeep312:
I don't have ftf file plz share patched file for e6683
[Xperia Z5 Android Development] whalesplaho:
Check general section.... Its there!!!
[Xperia Z5 Android Development] rajdeep312:
Not working properly x-plore unable to write on system even with disabled sony ric
[Xperia Z5 Android Development] whalesplaho:
i avnt heard anyone having dat issue....
[Xperia Z5 Android Development] venkat kamesh:
Rootkernel for nougat [root/recovery/drm]

Hello guys

previously here you can see my update

https://xdaforums.com/showpost.php?p=70773116&postcount=1861

In that update of tool DRM/ dr-verity/ adb debug/ Disable RIC was done..!

For few devices it caused stuck on sony logo and now fixed for all nougat

Changelog:-

- drm fix, dr-verity, adb debug, disable RIC (Thanks [MENTION=3989065]serajr[/MENTION] for your workaround )

- working busybox support

- convert bin2text of file_context ( thanks bro [MENTION=4120742]munjeni[/MENTION] for your tool )

- latest systemless SuperSu supported ( no more fail on flash )

- After creating a final image. it creates a Flash file ( to make work easy )

- Good news for Xperia Z5 family --- We had working TWRP on nougat ( FOTA partition )

Download:- rootkernel_only-nougat_Windows_Linux.zip

Instructions:-

Note:- only for Nougat

How to drm fix, dr-verity, adb debug, disable RIC fixes

- Download the above tool and extract

- Place your latest nougat kernel.elf in root folder of tool

- double click on double_click.cmd and follow all instructions

- After all you get an flash file Flashable_TWRP_nougat.zip

- if you are on nougat .. reboot and temp flash kernel which had TWRP

ex:- i had flashed Marshmallow kernel using fastboot ( it was configured with TWRP)

Take your TWRP config kernel into root folder and open cmd

Turn your Device to flastboot mode apply this code

fastboot boot <your twrp config kernel.img>

and turn on to twrp and flash the Flashable_TWRP_nougat.zip and reboot ....

* Tada done :p

How to Flash TWRP (Only for Z5) Thanks to [MENTION=3037651]zacharias.maladroit[/MENTION] for FOTA kernel built

- turn off device and Enter fastboot mode

- Double click on z5_twrp-kernel.cmd

- it take a while and done..!

- to enter Recovery turn off device and press - ( power button + volume down ), after vibrate leave it

- tada you will enter to TWRP

How to Flash SuperSu

- For xperia Z5 users -

turn off device and press - ( power button + volume down ), after vibrate leave it

Download latest SuperSu zip and Flash it ( you will get no errors as it was already fixed with boot.img)

Reboot Tada done...!

-For Other nougat devices -

Since there is no FOTA recovery ( will try to build one when i am free )

you need to temp run old twrp kernel

Turn your Device to flastboot mode apply this code ( make sure you should be on this tool built boot.img else supersu give error)

fastboot boot <your twrp config kernel.img>

when you get into recovery Flash latest SuperSu zip and reboot

Tada done...!

Thanks to [MENTION=3989065]serajr[/MENTION] for the workaround

Thanks to [MENTION=4120742]munjeni[/MENTION] for this filecont tool to convert bin2txt

Thanks [MENTION=5800804]balrajs99[/MENTION] i had come trough your thread about Fota-recovery ... until i got no idea about it haha

So finally a required Tool is Done...!

Dont forget to mention me if i helped you :p
[Xperia Z5 Android Development] YasuHamed:
WHILE running rootkernel, i said Y to sony RIC and later when i open init.sony-platform.rc@0750, the line was already there.

i flashed everything and did this little checkup given at

https://xdaforums.com/showpost.php?p=70677335&postcount=92

long story short

I have rooted device running on N with drm fix installed, sony ric and dm varity off.

I am monitoring battery drainage on wifi and mobile data
[Xperia Z5 Android Development] serajr:
That's why I said to answer N for everything but dm-verity. The OP's tool, as it is, can disable ric actually, but for MM kernel only.
[Xperia Z5 Android Development] anjelz2012:
I tried the script update in my Z5P, twrp does not work and then try to install supersu through another twrp, and throws me error
[Xperia Z5 Android Development] acabreram:
For Z5 Compact it's another twrp.img? Thanks!
[Xperia Z5 Android Development] TexHuk 3:
Thank you! All works on Z5C, replaced only rekaveri for your machine.
[Xperia Z5 Android Development] acabreram:
Hi bro!

Could you be a little more specific about where I have to replace the files? or folder? :confused:

thanks!!

---------- Post added at 11:02 AM ---------- Previous post was at 10:54 AM ----------

nevermind

it' s replace recovery right??
[Xperia Z5 Android Development] TexHuk 3:
The only thing that did took rekaveri of our apparatus and replaced in the program folder rekaveri from Z5 (naturally renamed z5_twrp)

Go into rekaveri necessary to shut down the device by holding the power button and the volume down.

Sequence :

-Patch boot (put in a folder with the program kernel elf.)

-Set boot flashtool or the adb

-not leaving fastboot apply z5_twrp-kernel
[Xperia Z5 Android Development] acabreram:
Thanks bro!!

working like a charm!!:good:
[Xperia Z5 Android Development] venkat kamesh:
TWRP Stock nougat kernel.sin

Hello guys i had finally built my own TWRP for xperia Z5 device running nougat

Who else need working TWRP please tag my name in post

and provide your stock mm kernels ( for ramdisk ) ... i had Only MM sources to build

-- > tag me

-- > Device model / number ( ex:- xperia Z5 E6683 / xperia Z5 compact )

-- > mm related Stock Kernel.sin file (Download file)

so i will provide new TWRP for your nougat roms

Regards

VK
[Xperia Z5 Android Development] YasuHamed:
use stock modified mm kernel having twrp for temp start
[Xperia Z5 Android Development] munjeni:
Niugat related only... I don't know maybe you didn't noticed but seinject tool from OP is not working for nougat selinux, if you remove -q parameter yiu will see that ;)
[Xperia Z5 Android Development] zemetal:
A little bit of info pls, does it work on z4/z3+? Thx :fingers-crossed:
[Xperia Z5 Android Development] serajr:
Exactly what we've already talked about! :good:
[Xperia Z5 Android Development] anjelz2012:
[MENTION=4433143]venkat kamesh[/MENTION] Thanks for you work!

-- > Xperia Z5 Premium E6853

-- > kernel.sin 32.2.A.5.11

https://mega.nz/#!vRYVXDQT!ENFDea6pRBK8WRsyjjvdlcicpA32tPSUs6HRsKgGqbE
[Xperia Z5 Android Development] devilmaycry2020:
Hi all

After read many guide posted here i realize that there is no twrp on nougat at this time, right?
[Xperia Z5 Android Development] shoey63:
No TWRP integrated into kernel, but you can flash TWRP to recovery (FOTAKernel) partition.

After that enter TWRP from powered off state by holding power plus volume down, then release power upon vibration, and then release volume down.
[Xperia Z5 Android Development] russel5:
bootimg_v2

Hello guys. As you all know the old bootimg tool not work with new sepolicy (can't use seinject) and you are can't inject twrp in new kernels with android 7.0.

Today i'm compiled new bootimg_v2 with new seinject support for sepolicy 7.0 and 7.1.1

Check it on sepolicy from official omni-7.1.1 and check it on sepolicy from X Compact .266

As you see in attached screenshots with old bootimg and new sepolicy we are had an error, but with new bootimg and new sepolicy we are had a success.

I'm not able to test this, because i'm had Z3C, but may be someone of dev users can.

Glad to help you, guys.

P.S. this tool only for Linux, NOT work with old sepolicy 6.0

And sry for my English ;)
[Xperia Z5 Android Development] josephnero:
[MENTION=4433143]venkat kamesh[/MENTION]

https://mega.nz/#!1VtxzQAA!pMMYrpnZpxv59MfzPiSv2Kh6RxH9-5UCdf5gByRluQQ

E6633/Z5dual

Thanks a lot for the hard work