yashsingh1/xdaforums huggingface dataset:
[Sony Cross-Device General] x_one:
just copy any DOUBLECLICKME_ and edit it with some text editor.. It's just bat file.
[Sony Cross-Device General] pattriccio:
will this work only in z1 lollipop cm rom, etc.. or will it also work on z1 with nougat rom?
[Sony Cross-Device General] munjeni:
As I know z1 don't have stock nougat rom. But if you try we will know for sure! :D
[Sony Cross-Device General] DavideSony:
If I download and I try, it work for my z1?
[Sony Cross-Device General] wulfiss:
just download and try by yourself.
[Sony Cross-Device General] fluffi444:
[MENTION=4120742]munjeni[/MENTION]: I played a bit with ownership and permissions of TA.img in tmp folder.

If TA.img is root.root 0777 - ta script is doing nothing regarding chown/chmod.

If TA.img is tad.tad 0000 - ta script is changing successfully to 0770.

TA.img was mounted for both...

Looks like TA.img accepts only changes (from ta script) if ownership is tad.tad.

But if ownership is not tad then the script is not allowed to change anything.

I know this is not much or not needed - but maybe helpfull for futher investigations.
[Sony Cross-Device General] munjeni:
Thats because ta script have tad ownership only and thats expected that tad user can't change things which have owner root. I have solved thing for old devices, ta image is copied but for newer devices I have now no free time to test things from begining, I will do that soon! On old devices tad user is very dangerous since have access to files with selabel block_device which mean tad user is abble to change raw data of the all mmcblk0 partitions, Sony have fixed that by changing tad ownership and group to tad and also mmcblk0p1 which is a ta partition is changed to tad_block_device instead of the general block_device so I will need to investigate further of how to give rights tad user to copy ta.img to the system_data_files and in the same time have permission for losetup...
[Sony Cross-Device General] fluffi444:
Understand and accepted that I know only 0,5% of yours 105% ;)

Thanks for this clear explanation... :good:
[Sony Cross-Device General] Niterain:
Anybody?

Addition: I tried flashing Magisk from recovery but didn't work either. SuperSU seems to be the only root method for PoC...
[Sony Cross-Device General] munjeni:
Is superuser nougat compatible? Booth have nothing related to poc, if it working without poc it will work with poc too
[Sony Cross-Device General] Niterain:
Don't get it wrong, I'm not blaming you, I appreciate your work and used poc since I first unlocked my Xperia.

I was just asking if anybody was successful rooting with alternate methods, since I wasn't.

As far as I know, superuser is nougat compatible. However I'll try again without poc and see.
[Sony Cross-Device General] munjeni:
No prob at all! I had similar problem on aosp 7.1, tried few diferent supersu versions, only one worked for me
[Sony Cross-Device General] wzhy:
Yes, I has report this porblem few weeks ago. Cannot use with magisk, it makes boot loop when boot complete.

Because of something kill tad_service.
[Sony Cross-Device General] RaXelliX:
I might be doing something wrong but for some reason recovery is not working for me. Or maybe it's because my device is not supported? (too new?) I verified that recovery is ok since it was working for me before on a different kernel (also pre modified. Got it and the recovery from here: https://xdaforums.com/x-compact/development/advanced-stock-kernel-twrp-xperia-x-t3464685).

Anyway i made a proper TA backup before BL unlock with this: https://xdaforums.com/crossdevice-dev/sony/universal-dirtycow-based-ta-backup-t3514236 . Placed TA, kernel and recovery to POC directory and ran the bat file. Everything looked ok in log. After flashing it even boots ok but no root access and can't get into recovery. However TA seems to be sucessfully restored since the keys seems ok and FIDO=provisioned so atleast that's working.

Sony Xperia X Compact (model F5321, codename kugo, arm64)

F5321_34.1.A.3.49_R4B stock ROM (last MM build for this phone).

Stock kernel.sin extracted from the above firmware FTF file.

Any ideas?
[Sony Cross-Device General] munjeni:
You can't get root without supersu! About recovery, not all recoveries is copmatible with stock kernel, at least for my z1c newer twrp is not boot with stock kernel but old ones is ok
[Sony Cross-Device General] munjeni:
You must look into dmesg and also in logcat if you didn't found anything dmesg related
[Sony Cross-Device General] anjelz2012:
Work in LineageOs?
[Sony Cross-Device General] RaXelliX:
Yeah i figured as much. If i could get recovery working that would solve the root problem too. Like i said - i ran this exact recovery with the same ROM but previous kernel as the kernel on the link is based on earlier ROM. Yes i know i should always run the kernel from the same ROM but that's not always possible. Infact i was hoping that if POC would work for me i could use the correct kernel and it works except now i can't get recovery working.

I know it's not a problem with the ROM or the kernel as they are both 100% stock except for the POC modifications. I will problably have to look into compiling my own recovery based on newest TWRP and then integrate that with POC to see if it works. Maybe there's indeed some incompability with this specific kernel and recovery.

Also wanted to ask - is there a script to pre-root kernel? What about selinux=permissive?
[Sony Cross-Device General] S1gma:
If you have bootloader unlocked, maybe flash recovery using fastboot and leave kernel without recovery integrated?
[Sony Cross-Device General] munjeni:
No scripts curently for prerooting in poc but you can create your own ofcourse. Selinux permisive is no more possible after android 7, without cracking init binary
[Sony Cross-Device General] realtuxen:
As said above why not just flash recovery to fotakernel (fastboot flash recovery twrp.img) and leave it out from kernel? To get into TWRP press power+vol untill phone turns on. That will work fine and you won't have to rely on kernel and recovery image is compatible every time there is an update to either one. Just exclude fotakernel in flashtool when updating and recovery won't be overwritten, or you will have to fastboot flash recovery again.

As another example you don't even need to flash recovery, it can also be booted with 'fastboot boot twrp.img' by now getting into recovery and get root should be the least of your problem. :)

Sorry for sidetracking the thread.
[Sony Cross-Device General] Andrzej_Andrzej:
ta-poc and xperia xa

Hi All?

Has anybody succeeded with this ta_poc and xperia xa f3111 ? Is someone here who did this and it works?
[Sony Cross-Device General] GreyLeshy:
This problem already was, but I do not know whether it was solved.

In Service Menu is not displayed active profile of the modem. With patch DRM-Fix the active profile of the modem is displayed.

The solution was found?

Xperia Z5C /E5823

init.ta.sh
Prepare to run ua modem switcher
Run ua modem switcher finished with status 0
[Sony Cross-Device General] munjeni:
No solution for it. init.uamodemswitcher.sh solved isue last time but now from your log seems its not solved, I don't know and realy I don't care, thats just cosmetic, you can make your own script for many things you need, poc have a lot of capability and you can make your own script you need. I not going to post on xda anymore until somebody give feedback for this https://xdaforums.com/crossdevice-dev/sony/dev-xflasher-command-line-flasher-t2986634, worked hard to give support for flashing newer devices, finished it, and now nobody want to give at least some words which will comfirm that xflasher is working, no support from me sorry :(
[Sony Cross-Device General] levone1:
I'm glad to help, but I have Z1c, which you have too... If I can help in some way, let me know...
[Sony Cross-Device General] shoey63:
Is Z5 recent enough? I will try it.
[Sony Cross-Device General] munjeni:
Added support for latest devices e.g. XZS so Z5 will work too
[Sony Cross-Device General] fluffi444:
I highly respect your work - you know that - But do you think that is the right way to handle this?

People are lazy (including me) - And the most are testing/helping if they have personal interest in the specific project.

xflasher seams to be very powerfull but as well to complicated for most of us (not including me :) )

And more important - I guess most people just do not need it right now. They flash with FlashTool (or official Sonyflasher Emma) and they are done... Even if your Tool looks more powerfull and (if well prepared with scrips) easier to handle, people stay often with tools they know...

"Never change a running system"-like.

Please don't get me wrong! I only do not want to loose you (again) because xflaher projekt seams not as "attractive" to us normal users as wonderfull TA Tool (PoC) was and is....

So - Keep up your outstanding work! :good:
[Sony Cross-Device General] RaXelliX:
Nope no luck. I tried many combinations to get things working including all suggested. I even flashed both the working recovery and working (older kernel by androplus). Then went into recovery and flashed the PoC created stock kernel from there. Upon reboot recovery stopped working. No led during boot, no reaction to pressing vol key but phone itself booted to system.

So whatever makes this revovery work is some special sauce androplus has baked into his kernel and obviously the PoC version is missing this. Just dunno what that something is. Here's the thread: https://xdaforums.com/x-compact/development/advanced-stock-kernel-twrp-xperia-x-t3464685

And notes:

So i assume PoC is doing almost the same exept DRM fix wich is unnessesary and SELinux Permissive wich would only work for Marshmallow if i read munjeni's answer correctly. I assume PoC also loads recovery from FOTAKernel if i choose to include it?
[Sony Cross-Device General] realtuxen:
No poc does not load from fotakernel if you include it. I think you misunderstand. Fotakernel location and poc boot.img have nothing to do with each other. The point was to leave recovery out from poc and use fotakernel to load recovery instead. You do not wait for led to come to enter recovery in fotakernel.

fastboot flash boot pocboot.img

fastboot flash recovery androplustwrp.img

Again leave recovery out from pocboot.img and when you need to enter recovery hold volume down key and power button until recovery appears.

Is this what you did?
[Sony Cross-Device General] shoey63:
Getting this on Z5 mm

-------------------------------------------------------
Xperia Command Line Flasher

by Munjeni @ 2014-2017
-------------------------------------------------------
Device path: \\?\usb#vid_0fce&pid_adde#5&3879604a&0&5#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
Class Description: Universal Serial Bus controllers
Device Instance Id: USB\VID_0FCE&PID_ADDE\5&3879604A&0&5

Timeout happened!

Edit: Haven't tried on N, don't want N on this device. I have z, z3, z5 and X:silly:
[Sony Cross-Device General] RaXelliX:
I held down vol down. I did'nt try vol down+power. Aside from that that was one of the ways i flashed yes.
[Sony Cross-Device General] realtuxen:
Well that's it then. You need to turn on the phone by holding power and vol - untill recovery you flashed to fotakernel with 'fastboot flash recovery twrp.img' appears. You do not wait for any led to turn on in any color. That is for recovery in poc boot.img that you should just leave out because of compability.
[Sony Cross-Device General] munjeni:
Thanks! Can we move to xflasher thread? Did your device loader.sin capable and which configuration you use, loader.sin or noloader? Can you post xflasher.bat which you used?
[Sony Cross-Device General] Andrzej_Andrzej:
constant bootloop

Hi munjeni,

Ja have learnt a bit about android and adb. I have done ta_poc with a few kernels, boot.img(s).

So far no success. New_boot.img creation always went properly. When I flash it with fastboot I always got a bootloop. This is constant bootloop on sony logo. I assume that in order to take proper last_kmsg I need to connect to pc with adb, but when phone is in bootloop the only mode available is fastboot mode. So I tried (I don't know if it is correct) reboot to recovery and take this last_kmsg from recovery. But when I did that I received an error: fastboot boot recovery.img

downloading 'boot.img'...

OKAY [ 0.502s]

booting...

FAILED (remote: oem unlock is false)

finished. total time: 0.515s

I read a guide about bootloop in here: https://xdaforums.com/showthread.php?t=2426426 and it says: " Using ADB BY Samantha

DB can be used to access the phone while booting, be aware that some bootloops make it unable to use ADB since they do not go further then the manufacturer logo. (In new CWM versions it’s possible to use adb)

The only tricky part about using ADB with bootloops is that you have to do it on the right time, this is different from every device, but normally it’s after the manufacturer logo that the partitions get mounted. The easiest way to enter your phone in this part is using a batch script that monitors the state of your device and connects directly when possible.

I use this script for example, called ondemand.bat (requires adb.exe and the 2 dlls)"

But this script is helpful when CWM is installed, but I have TWRP.

So I do not give up trying and learning but if you could advise me what to do and how to take that last_kmsg in spite of these obstacles described above.

regards,
[Sony Cross-Device General] levone1:
Unlock bootloader
[Sony Cross-Device General] Andrzej_Andrzej:
My bootloader is unlocked.
[Sony Cross-Device General] levone1:
Ok... Just checking.
[Sony Cross-Device General] oSandmaNo:
Hello, how does this work exactly? I created new boot image with my TA backup. Flashed it after flashing Stock 291 Mm on my z3. Camera is still showing lot of noise. But x reality and clear audio is present.

I have attached screenshot of the security test menu. Do I have to lock the bootloader?
[Sony Cross-Device General] x_one:
Flash kernel without tapoc and you will see the difference.

With tapoc you have drm key as with locked broader.
[Sony Cross-Device General] oSandmaNo:
Yes, I was on unlocked bootloader, but camera is same after tapoc. That's what I'm asking. Is there anything left for me to do?
[Sony Cross-Device General] fluffi444:
Try this.

Otherwise your TA.img is not ok or already not original anymore.
[Sony Cross-Device General] x_one:
I see coupe errors on your screenshot. I think you need clear drm cert db and reboot. You should have all keys ok.
[Sony Cross-Device General] fluffi444:
LOL. That was in the same second.
[Sony Cross-Device General] x_one:
Yeah.. But using phone is hard to find earlier posts and quote them :)
[Sony Cross-Device General] fluffi444:
WTF! I did exactly the same! Again LOL! :D
[Sony Cross-Device General] oSandmaNo:
Thanks both of you. Unfortunately I'm already in bed now . Have two exams tomorrow :(

I will give this a try tomorrow

Cheers

EDIT: woke up early to try this out. Seems as though it's working as ISO goes up to 12800 now. But the security test still shows as unknown error like in my previous screenshot. :/

EDIT2: ISO does reach 12800 but noise reduction is terrible. It doesn't exist even. I think my TA backup is screwed :(
[Sony Cross-Device General] munjeni:
Your picture confirms that poc sucesfully mounted ta but your ta is definitelly from unlocked bootloader, you can also see that in poc log.
[Sony Cross-Device General] munjeni:
Hi, you need to ask somebody in your device thread! I want to help but last_kmsg on your device have changed name to something diferent so it is no more last_kmsg as in my z1c, so I can help. In global, you must ask somebody to give you name of the last_kmsg, than simple till after bootloop you need to make NEXT boot sucesfull (e.g. you can use recovery which have working adb) thats important since if next boot is not sucesfull than last_kmsg disapears! Remember, after boot loop next boot must be sucesfull in order to have last kernel message! See this link https://sites.google.com/site/zhuow...onandroid60andabovesysfspstoreconsole-ramoops maybe its excatly on your device, I am sorry I realy don't know since my device is old and diferent than your's. Better idea ask somebody in your device forum to give you preciselly path of the last kernel message. Hope this help.
[Sony Cross-Device General] Andrzej_Andrzej:
Thank you very much indeed for your reply. I will do as you advised me.
[Sony Cross-Device General] oSandmaNo:
But but... I took the backup before unlocking my bootloader! I used the dirty cow ta backup tool to extract it without root. After getting my backup I unlocked the bootloader. :( :(

I will try again and paste the log here.
[Sony Cross-Device General] fluffi444:
Just a question to exclude everything possible: Did you bought this phone new? Or used?
[Sony Cross-Device General] oSandmaNo:
Bought it new. It's over 2 years old now :D
[Sony Cross-Device General] fluffi444:
I think we must do step by step trial & error (I have no other idea right now):

- do backup :)

- Flash Full stock 291 FW (with wipe data) and re-flash/re-build your TA-Partionen with your saved and origianl TA.img

(this will lock bootloader automaticly if you have original TA).

- Check then if DRM is working with 100% stock and locked bootloader.
[Sony Cross-Device General] levone1:
script didn't return 0. Any help?

poc log: https://pastebin.com/A7ShC133

boot img attached ...

thanks
[Sony Cross-Device General] munjeni:
This line failed:

if ! $POC init tad file relabelto,execute $SEPOLICY $SEPOLICY NULL >/dev/null 2>&1 ; then exit 1 ; fi

seinjecting: ramdiskbak/sepolicy@0644, saving to: ramdiskbak/sepolicy@0644, source_type: init, target_type: tad
libsepol.policydb_index_others: security: 1 users, 2 roles, 366 types, 0 bools
libsepol.policydb_index_others: security: 1 sens, 1024 cats
libsepol.policydb_index_others: security: 86 classes, 4347 rules, 0 cond rules
[COLOR="Red"]target type tad does not exist[/COLOR]
Could not add rule for perm: relabelto
command ret: 1.
Your script didn't returned 0, please check your script!

As you can see red part, I have no idea why that boot image have no tad, seems no tad compatible or tad label is changed to something stupid :) What is that boot.img, aosp or?
[Sony Cross-Device General] levone1:
Jaguar - AOSP-based, hardened...
[Sony Cross-Device General] munjeni:
You can try remove that line from patch_things.sh
[Sony Cross-Device General] oSandmaNo:
I have uploaded the log from your tool:

https://pastebin.com/WwRTkRFs

Did this. Everything works perfect now!! None of the keys are showing error.

EDIT:

Xreality and noise reduction isn't working :(

As a workaround, for the past few days I was using the Elite kernel with DRM fix. I can see the difference with it being there and being absent
[Sony Cross-Device General] x_one:
If you don't have any errors try clear drm cache again. It should working.
[Sony Cross-Device General] fluffi444:
Now delete those 3 folder again and reboot.
[Sony Cross-Device General] oSandmaNo:
Yes.

That did the trick!

This confirms my TA backup is good.
[Sony Cross-Device General] levone1:
worked, thanks. I deleted every "if...(whatever)... then exit" line from 'patch sepolicy' section ...
[Sony Cross-Device General] Shahnewaz:
Same problem here. Anyone found a solution?

It works with stock kernels, but that kind of defeats the purpose. I was really hoping to use it with custom kernels to get the benefits of both DRM keys (camera quality) and F2FS support.
[Sony Cross-Device General] munjeni:
What the same problem you have? There is no DOUBLECLICKME_JB.bat file, its soo old version if you have DOUBLECLICKME_JB.bat file
[Sony Cross-Device General] Shahnewaz:
Same problem as in same error. infflate returned: -3

I know the file he used is old, but I'm using the latest version. I'm trying to use the same kernel he tried as well.

I extracted the boot.img from Z1C-Advanced-v19.0-gcc-linaro-6.3.1-Kernel.zip, copied my TA backup and put both in the ta_poc folder. Edited the DOUBLECLICKME file to add the names, and ran. Result is the same error as [MENTION=5862263]karamancho[/MENTION].
[Sony Cross-Device General] munjeni:
Ramdisk from that boot image is lzma which poc didn't support, only gziped ramdisks is supported, I am soo lazy to implement sorry

Edit:

ok, in next version I will implement user interaction on this so you will have chance to manually extract this

Edit:

New version done! Now everybody have chance to manually extract ramdisk.cpio from out/boot.img-ramdisk.gz in case it is not .gz, use 7zip for it to manualy extract , rename to ramdisk.cpio and put in the same folder with poc, press any key when done, done
[Sony Cross-Device General] FakeMobile:
hey , there a new DRMFIX that poc can't remove.

and install recovery for kagura (xperia xz) and boot to it with the key up when boot up make a bug that you can't touch anything in recovery

(fastboot boot to recovery seems to work fine and you can touch without problems)
[Sony Cross-Device General] munjeni:
You are free to modify script for drmfix removal thats so easy!
[Sony Cross-Device General] FakeMobile:
and about the recovery ? touch not working
[Sony Cross-Device General] munjeni:
Not all recoveries like stock based kernel, so you will need to find and get an working recovery compatible with kernel which you using with poc. Me to had problem finding compatible recovery, only one worked for my z1c and it was two level oldest version but only one which worked. Anyway you can watch dmesg and log for getting idea why touch not working & submit patch to twrp guys who maintain twrp!
[Sony Cross-Device General] karamancho:
can confirm that this new method works with advanced kernel 19

* works as in I followed the steps and got a new_boot.img without any errors but I can't flash it right now as I need a fully working phone in the next weeks (I don't have a backup device) and I can't risk a bootloop, no signal or anything else...
[Sony Cross-Device General] Shahnewaz:
Just flashed the new_boot.img as [MENTION=5862263]karamancho[/MENTION] wanted on my Z1 Compact... and the results are a mixed bag!

So what works:

Updates from Sony's Software Update

Anything not mentioned in...

What doesn't work:

Phone! It says "Invalid Card - Emergency Calls only"

A mysterious "Android Pay" administrator has appeared, although my device does not pass safetynet.

Take a look at the screenshots. And keep in mind it's running [MENTION=5008080]sharonliu[/MENTION]'s Advanced-Kernel with Data and Cache partitions in F2FS. So not everything is stock. FW version is 14.6.A.1.236

The "None" is from Service Menu -> Service Tests -> Security.
[Sony Cross-Device General] munjeni:
And most important things you didn't provided:

1. poc log (http://www.pastebin.com it)

2. dmesg (http://www.pastebin.com it)

3. its your TA.img and not from any other phone?

Give me that and I can help, without that I don't care ;)

EDIT:

Forgot to say, poc seems will not gona work from F2FS, so result was trim area is not mounted right. You can try to provide me 3 things as per my reguest and I will try to get it if possible.
[Sony Cross-Device General] Shahnewaz:
Oops, my bad. Here you go boss:

poc log: https://pastebin.com/gsXuMRp3

dmesg log: https://pastebin.com/WgwrtVC4

Yep, it is my TA backup. I don't have any other phone, only older backups for older FW versions. Using them soft-bricks my device.

If you can get it to work for F2FS that would be absolutely amazing! Makes the bootloader unlock completely worth it.

Let me know if I can help further. :good:
[Sony Cross-Device General] DarkSilentSC:
I can confirm that I was able to get PoC to work using E6883. Basically allows me to have TWRP as well as all TA-required features, but it's too bad that once you root it, most apps and features are basically inaccessible. Magisk seemed to help a bit, but I never seen Android Pay to work properly after that.