yashsingh1/xdaforums huggingface dataset:
[Sony Cross-Device General] munjeni:
[MENTION=5928100]up2dateneurosis[/MENTION] I have told about problems related to tobias tool about twrp init script! For me it not working too! I have post a solution, just go back some pages and read about it

[MENTION=3989065]serajr[/MENTION] is this working for you? For me ok! Let me know

DOUBLECLICK.bat

@echo off

mshta javascript:alert("Chose your kernel!");close();
set dialog="about:<input type=file id=FILE><script>FILE.click();new ActiveXObject
set dialog=%dialog%('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(FILE.value);
set dialog=%dialog%close();resizeTo(0,0);</script>"
for /f "tokens=* delims=" %%p in ('mshta %dialog%') do set "kernel=%%p"

mshta javascript:alert("Chose your TA.img!");close();
set dialog="about:<input type=file id=FILE><script>FILE.click();new ActiveXObject
set dialog=%dialog%('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(FILE.value);
set dialog=%dialog%close();resizeTo(0,0);</script>"
for /f "tokens=* delims=" %%p in ('mshta %dialog%') do set "ta=%%p"

ta_poc "%kernel%" "%ta%" ramdisk
pause
[Sony Cross-Device General] serajr:
Just worked like a cham!! :highfive: I said you're insane!!

Very clever idea.
[Sony Cross-Device General] x_one:
[MENTION=4120742]munjeni[/MENTION], latest changes are working for me. TA.img isn't deleted inside /stufs/TA.img

I wonder if you make script as init for running twrp from ramdisk with will copy ta.img to destination and remove from /stufs and then run normal init?
[Sony Cross-Device General] munjeni:
I told about it! Tobias init scripts is not universal! It is ok for some devices but not for all since nodes need to be changed and vendor folder deleted (solution for z1c). I have a bootloop if vendor is a folder! I have no free time to play with since there is no easy "universal" solution, every model have specific things. Probably making an native app to read infos from kernel somehow would be a solution (don't know if even that is posible on boot time)

Update: I think the best idea would be making an script to extract an device specific and allready working recovery.img instead of hardcoding init script

Update: I can remove stufs from tobias init script like vendor stufs, like nodes, like booting fota recovery, leave only internal recovery, if you need it I can do!
[Sony Cross-Device General] x_one:
But I thought about ta.sh script as init script.. No twrp, no vendor.
[Sony Cross-Device General] munjeni:
Thats a good idea!
[Sony Cross-Device General] x_one:
Maybe then you need less sepolicy injections.
[Sony Cross-Device General] esps:
Hi all, I follow this thread so close, I have a XZ Dual and I really really want to try PoC lol... But I had read so much ? and maybe is gonna be so noob, but I need a intensive reply instructions ? can be posible [MENTION=4120742]munjeni[/MENTION] ??.

Thanks in advance

Enviado desde mi F8332 mediante Tapatalk
[Sony Cross-Device General] munjeni:
It still will need injecting shell_data_file, rootfs and some more I think...
[Sony Cross-Device General] munjeni:
Haha on my z1c it makes new_boot.img by using /dev/block/platform/msm_sdcc.1/by-name/boot parameter as a kernel :) It would be usefull for using from ramdisk
[Sony Cross-Device General] munjeni:
New version is out, implemented file browse dialog for kernel and ta so you no need to rename kernel and edit doubleclick script anymore, just select kernel and ta from dialog, hope it work on your windows version, enjoy!
[Sony Cross-Device General] fluffi444:
File picker is working on Win7 ULT 64bit - rest is like it was before.
[Sony Cross-Device General] levone1:
Any progress on function with AOSP, etc? I've been following along as best I can, and trying new versions, etc, but no change yet.
[Sony Cross-Device General] munjeni:
Its allready done for aosp, just try and let me know!

New version is out, fixed scripts isues on linux and arm and ofcorse the same for windows, booth ok now!
[Sony Cross-Device General] fluffi444:
Tested ta_poc.arm on my Z3C (32Bit) with following result (see pic)

Start script. Files are having full perms etc

#!/system/bin/sh -x
./tmp/ta/ta_poc.arm /tmp/ta/boot.img /tmp/ta/TA.img /tmp/ta/ramdisk

But maybe I missed something?
[Sony Cross-Device General] munjeni:
I have used it directly without startup script.. Try it directly from /data/local/tmp/ta_poc.arm blabla, do not use /tmp since its symlink so maybe cause trouble... Do not use sh and no argument x, just poc directly
[Sony Cross-Device General] levone1:
OK, I'll try again. I still have custom script bat and ramdisk bat from you before - I guess no need for those now? I tried today with a couple of different script combinations/modifications, but no success... Maybe I'll delete everything and start fresh with new version and let you know...
[Sony Cross-Device General] munjeni:
Forget old scripts! Use poc and scripts from poc.
[Sony Cross-Device General] whalesplaho:
[MENTION=4120742]munjeni[/MENTION] good job... Gonna try out new version with custom kernel.... I hope tha twrp freeze issue is solved now!
[Sony Cross-Device General] fluffi444:
mmm the same...unfortunately
[Sony Cross-Device General] munjeni:
Seems missing busybox on your system?
[Sony Cross-Device General] fluffi444:
Actually not - but I have a not common busybox installation (was made by EliteKernel)

I have:

/vendor/bin/busybox (1.23.1) with all symlinks from tools to busybox

and additionally I made one symlink in

/system/xbin/busybox linked to /vendor/bin/busybox (but no further symlinks)

Made the symlink in /system/xbin/ because some apps are only looking in xbin for busybox

Will try an aditional busybox full installation in xbin... but must stop for today.

But busybox seams to be working - see pic.

Also out of folder /data/local/tmp
[Sony Cross-Device General] whalesplaho:
Are we suppose to run dis code after flashing tha patched kernel or what?

[MENTION=4120742]munjeni[/MENTION] latest versiOn with file picker works well on windows 10 and patched custom kernel.....Just still freezes on entering twrp.
[Sony Cross-Device General] Dilesh Perera:
hi [MENTION=4120742]munjeni[/MENTION]

thanks for ur work!

i did try POC for my Z2. with Elite kernel as well as Stock Kernel. by checking service/security i get all OKAY and no issue there. but when i check with image enhancement there's no difference with OFF/ X reality or Super Vivid mods . meaning DRM not working. of course i have my TA preserved before unlocked my BL. am i missing anything here :)
[Sony Cross-Device General] xRevengerZee:
I just tested it tonight on my z2 existenz rom elite kernel all working perfect can u tell me what steps u made and share with me stock kernel please so I can help you
[Sony Cross-Device General] Dilesh Perera:
i just used my TA in the POC folder as well as the Elite/stock kernel image and execute double click me. and flashed the new boot image through TWRP.

:cowboy:

missing anything ?
[Sony Cross-Device General] xRevengerZee:
How did u flash the boot.img throw twrp? You should do it with flashtool or fastboot also please can you share stock kernel with me?
[Sony Cross-Device General] Dilesh Perera:
TWRP select Image to flash and flashed.

ok i will do a new one from latest POC and use fastboot and reply you with status. and kernel :) give me little time . i will PM u . at office now
[Sony Cross-Device General] xRevengerZee:
Take you're time and pm me if u need help I'll help you
[Sony Cross-Device General] x_one:
If your keys are OK it's working for sure.

Check album one again.

Change to vivid colors. Find image with blue and red and after you open it wait a bit looking on the photo.
[Sony Cross-Device General] Dilesh Perera:
yes my keys are okay.

i have checked many times and i can say its not working with image enhancment for me . but when i use old DRM fix i can clearly see the difference while changing the Vivid/ x reality to Off
[Sony Cross-Device General] fluffi444:
Delete

/data/credmgr

/data/DRM

/data/mediadrm

And reboot

EDIT

And don't be afraid to do so.

Those data will be re-created after reboot but now with new DRM data from your original TA.img.
[Sony Cross-Device General] Dilesh Perera:
now works well :) thanks guys
[Sony Cross-Device General] munjeni:
I have told about that I not going to support twrp from tobias, his script have bugs and as per my twrp init script https://xdaforums.com/showpost.php?p=71157611&postcount=679 you can clearly see that is is device specific, fill free to modify for your device! Please stop reporting about twrp!
[Sony Cross-Device General] munjeni:
If all keys and things is reported ok its ok than, its seems false feeling. I even never noticed any diferencie between camera on unlocked bootloader
[Sony Cross-Device General] munjeni:
New version is out! Please do not touch scripts! If scripts is not in unix/utf8 and have whitespaces than poc reports error 32512 since catch that bad whitespaces from scripts, anyway thats crazy, but I have fixed it with new version, tested on linux and android all ok now! Have done some fine error checking in poc source code so it will report more error if errors ocoure..
[Sony Cross-Device General] 2ddssa:
In the experiment(aosp and similar), kernel of LineageOS 14.1 patch successfully. Mobile network is not work. dmesg

IMEI I had removed from the log
[Sony Cross-Device General] munjeni:
On line 1137 error is (init: Service exec 1 (/init.ta.sh) does not have a SELinux domain defined.)

Can you give me unpatched kernel?
[Sony Cross-Device General] 2ddssa:
in zip archive
[Sony Cross-Device General] munjeni:
That os have specific file contexts stems, I have added support now for it, can you try this one?
[Sony Cross-Device General] 2ddssa:
same error in 1102 line
[Sony Cross-Device General] munjeni:
Will investigate on it
[Sony Cross-Device General] munjeni:
Can you try this two and tell me about booth?
[Sony Cross-Device General] levone1:
Tried new version with AOSP N kernel and new boot img is same size as original. All output shows success, except at the end it says something like 'dt not found, probably zimage already has dt appended'.

I can post dmesg if you want - I just thought maybe that info will tell you something...
[Sony Cross-Device General] whalesplaho:
It shows dat too on custom kernel like SunKernel and still works... Seems it does dat if yhu aint using kernel.elf.
[Sony Cross-Device General] levone1:
OK. I'll check it out...
[Sony Cross-Device General] whalesplaho:
Waiting for yur feedback.....
[Sony Cross-Device General] piggarello:
ok...latest version works on XZ NOUGAT, but only with androplus kernel V21..all keys OK. with stock kernel keys are OK but problem with calls (whn i call phone reboot)..

So..also androplus has drm fix, but when i use it phone says fido keys not provisioned and last reset shows 1970 date..with TA_POC fido keys are provisioned and it shows the real last reset date..

that's all, hope it helps..

thank you munjeni!!
[Sony Cross-Device General] 2ddssa:
First test same, second test:

line 1067 [ 12.540483] init: Starting service 'exec 1 (/init.ta.sh)'...

line 1082 [ 12.624879] init: Service 'exec 1 (/init.ta.sh)' (pid 316) exited with status 0

no network
[Sony Cross-Device General] darekesp:
U working on restore of DRM after unlock bootloader, do we have root without unlock the devices, it's possible on new xperia?

Tap Tap z XZ
[Sony Cross-Device General] x_one:
You don't need root to take backup using Dirtycow method..
[Sony Cross-Device General] darekesp:
I'm asking about root not a backup... Please read carefully. Maybe they working on root without unlock bootloader...

Tap Tap z XZ
[Sony Cross-Device General] levone1:
No sim and no change in camera.
[Sony Cross-Device General] whalesplaho:
Maybe [MENTION=4120742]munjeni[/MENTION] ll help.... Using tha latest poc?
[Sony Cross-Device General] x_one:
Oh I see. My mistake. But it's thread about Trim Area and restoring keys if you have unlocked bootloader. You have to search in your device forum.
[Sony Cross-Device General] darekesp:
On this time is silence. Maybe Trim Area guys can do root without unlock. I'm waiting

Tap Tap z XZ
[Sony Cross-Device General] munjeni:
Hey but thats not a error!
[Sony Cross-Device General] munjeni:
That's totaly imposible since you can't modify system partition and you can't modify boot partition on locked bootloader!
[Sony Cross-Device General] munjeni:
Without dmesg I can't fix since don't know what is going on :)
[Sony Cross-Device General] darekesp:
So it's big difrence of XZ and Z1 in system and root? Oh ok I understand and thx for info

Tap Tap z XZ
[Sony Cross-Device General] munjeni:
You must do this https://xdaforums.com/showpost.php?p=71208170&postcount=751
[Sony Cross-Device General] munjeni:
New one might work finaly
[Sony Cross-Device General] piggarello:
Quote:

Originally Posted by piggarello

ok...latest version works on XZ NOUGAT, but only with androplus kernel V21..all keys OK. with stock kernel keys are OK but problem with calls (whn i call phone reboot)..

So..also androplus has drm fix, but when i use it phone says fido keys not provisioned and last reset shows 1970 date..with TA_POC fido keys are provisioned and it shows the real last reset date..

that's all, hope it helps..

thank you munjeni!!

You must do this https://xdaforums.com/sho...&postcount=751

made it but all is OK only if i use your POC...Thanks again

PS. with androplus is also much simple...it's already patched...and it's also a good kernel... (maybe i will never relock bootloader...!!:))
[Sony Cross-Device General] levone1:
Will post...
[Sony Cross-Device General] munjeni:
Hey sorry, found one bug which I forgot to change, it made my z1c with no sim, hope some devices had no sim too, new version is out and its solved!
[Sony Cross-Device General] levone1:
http://pastebin.com/tC19eY4B from aosp-based MM rom

Although I see new version of poc today... I'll try again.
[Sony Cross-Device General] munjeni:
That's soo late log and I can't see needed things, I need your log till after you boot your device
[Sony Cross-Device General] levone1:
OK, sorry. I purposely cut it off because I forgot to get it after reboot, and it was so long. I'll do another. Thanks

---------- Post added at 12:30 PM ---------- Previous post was at 11:35 AM ----------

http://pastebin.com/drRE2685

This one is N

Thanks
[Sony Cross-Device General] munjeni:
I can't see anything about tad, anything about denied, anything about init.ta, apsolutly nothing! Can you give more details, what kernel you trying to use, what problem you have, more details please! Is it working before poc?
[Sony Cross-Device General] levone1:
Sorry [MENTION=4120742]munjeni[/MENTION], I accidentally posted the log from before poc - everything good then. I wanted to have before and after to compare. Problem is that after flashing new boot IMG, I get no message, (main, system, dmesg, etc.), just blank, and no sim service and still bad camera. Here's boot imgs. I'll post original first, and new boot in next post.

Thanks
[Sony Cross-Device General] Klaus N.:
[MENTION=4120742]munjeni[/MENTION]

With the latest version of today (only tested with Win10 until now), I can confirm, it works with my Z5 (E6653), running 32.3.A.0.376 Nougat stock firmware, it works flawlessly.

Awesome work, thanks alot for your tireless efforts!

(With the last 2 versions before, I always got errors)
[Sony Cross-Device General] munjeni:
1. rom name?

2. rom version?

3. kernel is from that rom?

4. did you used only poc?

I didn't see anything strange, it patches without problem
[Sony Cross-Device General] whalesplaho:
How can i check dis please??
[Sony Cross-Device General] Klaus N.:
If your question is related to the attachement, just type into the dialer: *#*#7378423#*#*, choose "Service Tests", then "Security"
[Sony Cross-Device General] jugglerpl:
How install recovery with poc?
[Sony Cross-Device General] whalesplaho:
Yeah dahs what i meant.... Same thing like yurs!
[Sony Cross-Device General] xvit096:
new boot img has been created. Do I just have to flash the new boot img using fastboot? or do I have to copy ta.img to my device as well?
[Sony Cross-Device General] munjeni:
[MENTION=4962787]fluffi444[/MENTION] please try new version http://munjeni.myiphost.com/ta_poc.rar
[Sony Cross-Device General] munjeni:
In your dmesg log I saw that selinux denied writes to ric, see line 1873 and 1784 in your pastebin http://pastebin.com/u7zMsaQQ

[ 18.667149] type=1400 audit(12588239.319:7): avc: denied { write } for pid=1 comm="init" name="enable" dev="securityfs" ino=13637 scontext=u:r:init:s0 tcontext=u:object_r:securityfs:s0 tclass=file permissive=0 ppid=0 pcomm="swapper/0"

You must patch sepolicy more, here is example how you can do it https://xdaforums.com/showpost.php?p=70955889&postcount=47

that could be done with this:

nougat_ta_poc init securityfs file write %1/sepolicy@0644 %1/sepolicy@0644 NULL
[Sony Cross-Device General] Soheil_rf:
How can i use it? Is it script?

I'm not very good with scripts

Can you be more clear to me ,please
[Sony Cross-Device General] munjeni:
Make empty script.bat and write this on it:

@echo off

nougat_ta_poc init securityfs file write %1/sepolicy@0644 %1/sepolicy@0644 NULL

Put script.bat in the same folder with my poc, run poc and watch whats going on.

Do in mind it will solve only "write" permission to securityfs , for furher details look into your dmesg and my post about it to understand what you need further
[Sony Cross-Device General] Soheil_rf:
Its awesome mate , but still when i Disable RIC , mobile signal gone

Update : After many kernal felashing , mobile signal is normal and got random reboots

log after reboot : http://pastebin.com/5CQC54Kb

Update 2: seems like problem is Root Explorer app, uninstalled it and using solid explorer, so far everything's works great
[Sony Cross-Device General] :
Nice, I'll try this on my stock 5.1.1

Edit: got an error and I see no logs

opening kernel_mm_F5321_34.1.A.3.49.sin.elf

unable to open kernel_mm_F5321_34.1.A.3.49.sin.elf

Kernel dump tool returned an error!
[Sony Cross-Device General] gr8st:
Hi fluffi444,

Since we're both using elite kernel, can you confirm this is the correct method so I don't soft brick?

1. Place your own TA.img in unrared ta_poc folder

2. Place boot_Z3c.img from elite kernel in unrared ta_poc folder

3. Edit "DOUBLECLICKME_MM.bat" with kernel name (e.g. mm_ta_poc boot_Z3c.img TA.img ramdisk)

4. Run "DOUBLECLICKME_MM.bat"

5. Take newly made "new_boot.img", rename to boot_Z3c.img, place it back along with META-INF folder of elite kernal and zip it all together

6. Place your TA.img in /data/local/tmp

7. Flash your newly modified elite kernel zip (from step 5) in recovery

Also do you mind sharing unmodifed elite kernel "boot_Z3c.img" with DRM fix removed? I'm not sure how to do it. Thanks

Thanks to [MENTION=4120742]munjeni[/MENTION] as well, hope I can finally get around safety net

---------- Post added at 10:26 PM ---------- Previous post was at 10:22 PM ----------

I believe you have to edit the bat script you're using (either nougat or MM) with the name of your own kernel. For example mine is "boot_Z3c.img" so bat script should be "mm_ta_poc boot_Z3c.img TA.img ramdisk".
[Sony Cross-Device General] chinmoy32:
Please tell me how do you get to the second image page ??

Which code or what shows those info ???
[Sony Cross-Device General] gr8st:
Go to service menu by typing *#*#7378423#*#* in dialer

Then Service tests > Security

If it's worked, it should show [Key OK] by each key, no unknown errors.
[Sony Cross-Device General] :
Alright thanks, it worked and got a new file= new_boot.img, flashed and everything went perfectly. So that's the only thing I needed to flash right?

I'm not sure how to check if it works, I don't think the Xperia C3 has any DRM keys lost when unlocking.
[Sony Cross-Device General] gr8st:
You also have to place your TA.img in /data/local/tmp. To check if the fix worked, see my instructions above.
[Sony Cross-Device General] :
I tried and still no data connection. A restore of the TA and Kernel fixed it, and I checked the /tmp folder but there's originally nothing inside.

I was using the TA from TWRP backup which was named as ta.emmc.win, I just changed it to TA.img and then changed back.

Added TA.img to the /tmp folder, didn't work. Used ta.emmc.win, didn't work either. Both times I rebooted.

Edit, what's the permission for the file? Could it have changed after the script was done?
[Sony Cross-Device General] gr8st:
I don't think you can backup TA through recovery effectively. You're suppose to use this tool. Or if you have a newer device this tool .

Redo the process with the TA.img you get from that and it should work.
[Sony Cross-Device General] :
Doesn't work, I guess Lollipop had some differences with MM
[Sony Cross-Device General] chinmoy32:
Mine shows all key is OK and active and I am on the new 376 FW of Z5 E6683 DSDS

Bootloader unlocked , patched kernel stock 376 with DRM FIX and SU 2.79

Image enhancement is working and camera NR is also working.

At the bootloader section it is saying that the loader is locked and unlocking is allowed like in a brand new set.

My point is what is the difference between DRM fix and PoC ??
[Sony Cross-Device General] :
Okay I got it to work, then I realised I don't have my TA.img from before I unlocked my bootloader. Bye bye DRM keys :3
[Sony Cross-Device General] mbgheban:
Working good on Z5 Compact 5.11 firmware using also [MENTION=3989065]serajr[/MENTION] scripts.

Root (SuperSu), xposedframework - working with no issues.
[Sony Cross-Device General] ondrejvaroscak:
SafetyNet API

Hi, unlocking bootloader triggers SafetyNet to fail, therefore lot of banking and other apps fail to run. DRM fix we used in kernels were of course unable to do anything about it. Since this PoC simulates locked bootloader, does it also fool SafetyNet to perceive bootloader as locked, therefore allowing security enabled apps to run?

Can someone running this PoC check and install SpardaSecureApp from Google Store? If ti would run, it would be a great news. If it fails, it shows only black or white screen and does not react. It is a security app of bank I need to use...

However, I would like to congrat and thank the devs for this in fact simple and therefore genius solution :)
[Sony Cross-Device General] munjeni:
Just flash with fastboot
[Sony Cross-Device General] xvit096:
[MENTION=4120742]munjeni[/MENTION] thanks mate! I shall try later.