yashsingh1/xdaforums huggingface dataset:
[Sony Cross-Device General] munjeni:
If you don't know how wait for a working version, sorry ask somebody in your device forum. If device not booting you can grab last_kmsg on next boot, for info about how to do it please ask on you device forum, I don't know how since I have z1c
[Sony Cross-Device General] vato4001:
to clarify something:

this mod is just for people who have their original drm keys?

or

for people their need keys who lost their originals?

thank you :)
[Sony Cross-Device General] munjeni:
Please see first post! This is for peoples who have backup of the trim area BEFORE unlocking bootloader! The rest of things is in first post.
[Sony Cross-Device General] vato4001:
ok thank you than this is nothing for me :D i lost them
[Sony Cross-Device General] munjeni:
Yes definitelly!
[Sony Cross-Device General] karamancho:
kernel thread
[Sony Cross-Device General] shoey63:
Hey [MENTION=4120742]munjeni[/MENTION],

First off, I was wrong about /data/local/tmp not retaining data between reboots. It does, and I found a lot of crap in there before applying the tool, so I cleared it out.

Secondly, on Z5 MM, TA.img is NOT being copied from /stuffs as it should.

here is demesg.log

However, manually copying TA.img to /data/local/tmp and changing owner to root:root and permissions to 0777 in TWRP works fine, and survives rebooting.
[Sony Cross-Device General] munjeni:
You log is clear, nothing about failed TA.img copy to destination :(

What mean that?
[Sony Cross-Device General] munjeni:
Well, thats lzma ramdisk which is curently unsuported. Soon I will add suport for lzma archives! And one more thing that kernel contain two ramdisks, one is for android and seccond one is for recovery, curently something like that is not supported on our tool and I am unsure it will even be supported, if case I not find a workaround for that types of boot.img definitelly I will give chance for userscript for booth!
[Sony Cross-Device General] shoey63:
Well the phone was bootlooping, and I hardbooted into recovery and took the log, and yes if you manually copy TA.img to /data/local/tmp, it stays there (on Z5 MM)

Anyway, I will test new build.

---------- Post added at 10:46 PM ---------- Previous post was at 10:21 PM ----------

Stil bootlooping with new version http://pastebin.com/8eHbZded
[Sony Cross-Device General] munjeni:
Nothing about tad in your log! Please use poc only!
[Sony Cross-Device General] munjeni:
Your log is recovery dmesg, you will need to catch last kmsg in case you have a bootloop :)
[Sony Cross-Device General] shoey63:
Doing that bro.

No rootkernel stuffs!

Anyway, reboot phone and I still have DRM keys, providing I copy TA.img manually, one time only. It's good enough for me:)
[Sony Cross-Device General] munjeni:
But please let tool do it since we need to fix that "no copy" ta image thing
[Sony Cross-Device General] xRevengerZee:
Bro please listen to me if possible to avoid all these problems someone make a step by step video of how to do this drm fix thing and to help newbies also avoid all these issues please someone make a video...
[Sony Cross-Device General] munjeni:
Mate, in this time making a video have priority 0, video will be later when all gets fixed, hope somebody have free time to make a video, I have no free time to mess with video (probably adb and many more), wait please!
[Sony Cross-Device General] Soheil_rf:
DRM working but no Signal

Phone : XZ Dual

Version : Android 7 - 39.2.A.0.417

http://pastebin.com/W3KM2WZU
[Sony Cross-Device General] Hamidreza2010:
bro i try to get last_kmsg but always tell me " no such file or directory "

i try with adb and terminal.

i get dmesg

is it useful?
[Sony Cross-Device General] levone1:
Any hope for this? Thanks

http://pastebin.com/pQBi7VNi
[Sony Cross-Device General] xRevengerZee:
As you wish bro i was just suggesting not ordering ?
[Sony Cross-Device General] munjeni:
28 downloads but still two dmesgs only, thank you guys for your contribution, this is a time leaving our poc, I have no more nerves maintaining our poc sorry! Enjoy curent one and fill free to improve userscripts! Don't ask me please anything about it by pm, thanks!
[Sony Cross-Device General] halfvast:
Xperia Z4 Tablet LTE (SGB771)

Nougat (SA)

No signal

My dmesg for test version:

http://pastebin.com/5fgDm1eV

Sorry for taking so much time. This is my first dmesg..
[Sony Cross-Device General] x_one:
Device as always: Z3C fw MM .291

Latest ta poc don't copy ta to /data/system/. No signal.

http://pastebin.com/YDbCAUCz

I've made one more test with method that perfectly working on my device and didn't worked for [MENTION=4962787]fluffi444[/MENTION].

I've compiled poc over elite kernel removing only drmfix from it.

Everything was working fine here. TA.img copied and all keys was fine. It looks like it was problem with slimm rom or byeselinux, but I bet it's byeselinux especially if I'm not wrong script installing byeselinux is patching libs to use it.

My brother should test it tomorrow.
[Sony Cross-Device General] munjeni:
Ok, I will do final version and realy must stop this, a lot of time allready spent with it
[Sony Cross-Device General] zEminho:
What are the odds of this working out in the aosp?

I saw that jerpelea is working in an 8mpx mode but we do not know if it will be work.

I think we will never see a camera usable in roms aosp
[Sony Cross-Device General] munjeni:
This thread is not related to camera, please!
[Sony Cross-Device General] munjeni:
I trust you! I will be revert back to a working one! And some new things implemented to help peoples with diferent boot image and some more. It will be final version.
[Sony Cross-Device General] munjeni:
I will try to fix that if you give me now that kernel image!
[Sony Cross-Device General] munjeni:
Script is not need since tool will copy TA.img to the right place with the right permissions. You might consults with me next time please and not a post things without my knownledge!
[Sony Cross-Device General] Hamidreza2010:
[MENTION=4120742]munjeni[/MENTION] this is my dmesg:
[Sony Cross-Device General] munjeni:
No go for that type of boot.img, its aosp and a lot of work must be done for supporting it! Maybe somedays, not now! With new version you can execute ramdisk script to do something with it (for example to fake that missing file and delete when done)
[Sony Cross-Device General] munjeni:
New version is out and this is last one for next 3 months and maybe more, can't promise. :good:

changelog: added another userscript execution possibility (till after ramdisk extracted, so you have now chance to do something in case error happen). Reverted back working TA.img to the destination copy

Enjoy!
[Sony Cross-Device General] Soheil_rf:
[MENTION=4120742]munjeni[/MENTION]

Thanks for your time

I hope some day you will find out to fix all

Good luck mate
[Sony Cross-Device General] Helmut.Hartmann:
Sorry for my noob question, but can someone explain the right usage of this tool step by step?

Yes, I was reading the readme - but some question still there:

- Must I flash the resulted kernel trough adb or fastboot?

- Must I Copy TA.img still manually to the device?

- Must (or should) I include the provided scricpts (serjar) and how to use (simply copy in the extracted Archive)

- How can I use EliteKernel (what do it means (extract the Kernel with ta tool as mentioned in Post 88)

THX a lot

Ha
[Sony Cross-Device General] munjeni:
[MENTION=6283426]levone1[/MENTION] this is attachment for you only, to understand what you need to do. That scripts helps patching your boot.img, hope it boot after it
[Sony Cross-Device General] munjeni:
1. fastboot

2. no need anymore, latest version doing that job

3. thats optional (if you uses tobias tool than no need, anyway I don't know if compatibility is broken after using booth in the same time, you must chose one or seccond, not recomnded in the same time)

4. don't know realy, I have not tried
[Sony Cross-Device General] levone1:
OK, I'll check it out, thanks.
[Sony Cross-Device General] Helmut.Hartmann:
OK - many thanks for your fast answer!!!

2: Must the Device be at fastboot mode to the PoC Process to copy the TA.IMG to the Device?

First try with boot.img from my miui 8 on Z2 gives a security "none" in the Service display.

Phone: Z2

Bootloader: unlocked Bootloader

TA: Saved with Ta_Tool from original Sony - ROM before unlocked

ROM: MIUI 8 - 16.11.24

Thx

Ha
[Sony Cross-Device General] munjeni:
2. no need to be in fastboot mode! Tool copies your TA.img into ramdisk which later autocopy that TA.img from your ramdisk to the destination
[Sony Cross-Device General] munjeni:
Thats just an example for you to understand how things working, hope I not missing something and hope your patched boot image boot at least after all, you will need to figure out things and eventualy corect something :)
[Sony Cross-Device General] Helmut.Hartmann:
ok - then there must be something wrong with my doing (or my phone/ROM). DMESG -> http://pastebin.com/2GuktADf

thx
[Sony Cross-Device General] munjeni:
Service 'tad_static' (pid 9974) exited with status 1

seems TA.img is not copied to /data/local/tmp? Anyway I not going to fix anything, you and everybody need to figure out things by self, I spent soo much time on it, have no more free time for something like that, hope somebody help you
[Sony Cross-Device General] Helmut.Hartmann:
...anyway, have a lot of thankx for your support. I respect your decision and your work at all! I will find out the issue for myself.

THX
[Sony Cross-Device General] exvargos:
Yeah, because of that issue I reverted to drm-fix through rootkernel. But it keeps happening, so it might be a bug with rootkernel TWRP or something.
[Sony Cross-Device General] Hamidreza2010:
See here bro:

https://xdaforums.com/showpost.php?p=71024950&postcount=310

i have this issue too but didnt found any fix for that

if you find , please let me know

thanks
[Sony Cross-Device General] levone1:
Just reporting back - no success yet. I can't seem to get the scripts to do anything, (they just flash and close), but by reading them, I've gotten the idea to replace sepolicy with fake policy, so tried a few times with boot IMG un/repacker, but same error. I'm going to work some more -- (I'm a newb and don't haveva lot of time), and look more into changing the script according to what you wrote, and keep you posted. If you do have a second to double-check the script, and see if there might be a typo, etc., that would be great. Thanks again.
[Sony Cross-Device General] munjeni:
Hey but you no need ti run script it will not work! You need to just put that scripts in the same folder with poc mate and run poc :)
[Sony Cross-Device General] levone1:
OK. I'll try more. Not at computer now...
[Sony Cross-Device General] levone1:
Success... New boot IMG created, size shows the addition of ta IMG. I added it to my ROM zip (aicp nougat) and dirty-flashed, and everything booted OK. However, I don:'t see any difference in camera or anything else... But good for research anyway... Thanks
[Sony Cross-Device General] exvargos:
? What am I “seeing”? The post in you referenced doesn’t really have to do with what I was talking about. I’ve also mentioned much earlier in this forum that after using ta-poc it seems you don’t get signal until you copy the ta img into the right place, whether that is manually or through the script.
[Sony Cross-Device General] levone1:
So I also am without signal. I see TA.img copied to /data/local/tmp after reboot, permissions 660. I see this post - https://xdaforums.com/crossdevice-dev/sony/poc-real-trim-instead-drm-fix-t3552893/post70988745 - should I try to add that line?

Dmesg:

http://pastebin.com/1eFKPiad
[Sony Cross-Device General] perobot:
Any idea of what steps to follow or what commands to use to apply copy of TA.img to elite kernel V3 for xperia Z3
[Sony Cross-Device General] x_one:
Just run poc over elite kernel with TA.img inside pic folder and when it pause remove drmfix lib from ramdisk/vendor/lib andthen edit ram/init.target.rc find there :libdrmfix.so and remove that.

After that go script.. If it pause again go again.. After it finish you will have elite +TA
[Sony Cross-Device General] munjeni:
Latest version doing thing just fine on stock kernel images.
[Sony Cross-Device General] munjeni:
Your selinux is permissive and you no need to seinject enything! Seems you must put more energy into that! I have done initial things for your type of boot image, the rest you must figure out by self, I simply have no free time for that type of boot image :)
[Sony Cross-Device General] Hamidreza2010:
i have signal and habe ta.img

but cant enter into recovery
[Sony Cross-Device General] mimo.aridi:
Hey munjeni. I have xperia z2 d6503 with unlocked bootloader. Running latest build of Carbon Os rom (nougat 7.1.1) but camera is not working. Can ur tool fix that? But i dont have any backup of TA partition. Thank you for ur help.
[Sony Cross-Device General] munjeni:
Can you type in details what you have doing? Which steps in details? Didn't analysed tobias tool in details but probably he uses permisive mode initialy to get rid of the init denials (my tool don't uses that permisive type, my tool patch only thing which excatly is need for poc, no permissive mode), so maybe skiping some of the tobias tool prompts maybe skeeps something which is esential for that initial permisive mode, just guesing! You will need to look into tobias script and figure out what is skeep (in case you skip some prompts in tobias tool), thats all which I can help you. At least you can try patch my poc diferent way by script.bat (permisive mode):

@echo off

%2 NULL NULL NULL NULL %1/sepolicy@0644 %1/sepolicy@0644 init
if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
%2 NULL NULL NULL NULL %1/sepolicy@0644 %1/sepolicy@0644 tad
if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
%2 NULL NULL NULL NULL %1/sepolicy@0644 %1/sepolicy@0644 kernel
if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )

just make script.bat and put that lines into it, move script into poc folder, run poc and see if it will work.
[Sony Cross-Device General] munjeni:
What? No friend, it will not! :)
[Sony Cross-Device General] Hamidreza2010:
delete
[Sony Cross-Device General] Hamidreza2010:
i do that but didnt work.

bro im noob in script and cant analize that code but this is all thing i was done:

1- fist patch my kernel.sin with your tool

2- put last kernel which patch with your tool in tobais tool and do these: ( see attachment )

Suggestion:

bro i think if you or somebody or ( [MENTION=3989065]serajr[/MENTION] ) can make scripts ( add twrp , add supersu , add xposed ) , we dont need use tobias tool

thanks a lot
[Sony Cross-Device General] munjeni:
I no want to use tobias tool stufs since thats his hard work and my respect to his hard work not allowing me for doing something like that! Try with script.bat from rar archive, extract script.bat to poc folder, do not run script.bat, run poc as always and the rest...
[Sony Cross-Device General] Hamidreza2010:
trying
[Sony Cross-Device General] munjeni:
If not work, I noticed that tobias init script produces boot loog (/bootlog.txt) so if you have a bootloop try to catch up boot log with adb:

adb pull /bootlog.txt
[Sony Cross-Device General] Hamidreza2010:
not worked

here you are my bootlog.txt
[Sony Cross-Device General] munjeni:
Use http://www.pastebin.com please!
[Sony Cross-Device General] Hamidreza2010:
here you are bro

http://pastebin.com/69g3D2b1
[Sony Cross-Device General] munjeni:
Ok, I can see that poc is ok, bug lives inside tobias init script since can't detext volume keys, instead it boots to the normal boot instead of the recovery boot! My sugestion to you is contact tobias and give him that pastebin link and notify him about it!
[Sony Cross-Device General] Hamidreza2010:
ok bro thanks a lot

you cant guide me to fix that?

because i feedback some bug / suggestion to tobias but he didnt reply to me
[Sony Cross-Device General] munjeni:
As per line 57 in your pastebin I clearly can see that your volume key is not 114 and also not 115 , instead its on your device 143, so you will need to modify tobias init script (see folder Android) lines:

# Volume up or reboot recovery: Use internal recovery
if [ $KEY -eq [COLOR="Red"]115[/COLOR] ]; then
echo "Entering internal TWRP Recovery Mode" >> ${LOG_FILE}
start_internal_recovery
fi

# Volume down: Use recovery from fotakernel partition
if [ $KEY -eq [COLOR="Magenta"]114[/COLOR] ] ; then
echo "Entering Recovery Mode" >> ${LOG_FILE}
start_fota_recovery
fi

change red and magenta with volumeup and volumedown key which you can get more info trought your bootlog.txt, change it to a proper value! Definitelly 114 and 115 is not values compatible with your volume up and down buttons. Hope this help. PS be honest next time since definitelly tobias recovery never had chance to be worked without proper values of the your volup and voldown, definitelly it never worked for you. :)
[Sony Cross-Device General] munjeni:
this also need to be changed:

Check for cmdline
if ${BB} grep -q warmboot=${WARMBOOT_RECOVERY} /proc/cmdline; then
echo "Recovery request from cmdline" >> ${LOG_FILE}
start_internal_recovery
fi

to:

# Check for cmdline
if ${BB} grep -q warmboot=${WARMBOOT_RECOVERY} /proc/cmdline; then
echo "Recovery request from cmdline" >> ${LOG_FILE}
start_internal_recovery
fi
[Sony Cross-Device General] ondrejvaroscak:
You can only see differences in camera and other apps, that use Sony's proprietary processing. Camera app without proprietary code uses no DRM keys for it's functionality. This DRM TA fix is hence used for Stock-derived firmwares or where Sony apps (and respective blobs) are used or ported. Usage on AOSP or LineageOS is therefore possible in the future, when Sony processing will be incorporated..

---------- Post added at 02:44 PM ---------- Previous post was at 02:42 PM ----------

There is no difference unless you use Stock ROM.

---------- Post added at 02:46 PM ---------- Previous post was at 02:44 PM ----------

No and no. This fix doesn't fix non working camera apps and for this tool to work, you need TA backup. And only TA Backup of your OWN device.
[Sony Cross-Device General] munjeni:
[MENTION=5096181]Hamidreza2010[/MENTION] you got it?
[Sony Cross-Device General] Hamidreza2010:
sorry bro , my net is very unstable

i,ll try 1 hours later and feedback very soon ;)
[Sony Cross-Device General] Helmut.Hartmann:
OK, after few things tried (another ROM, another Kernel (extracted from ROM (MX.Rom for Z2 (Source Sony 6.0.1 23.5.A.1.291)), copied TA.img manually to /data/local/tmp (set owner /permission) i have no luck with this. no signal and "none" at security....

Sorry for my annoying question about help --> Pastebin: http://pastebin.com/u7mGUx6h

THX
[Sony Cross-Device General] zemetal:
basically, if i don't have a TA.img backup from my phone i can't use the mod, right?
[Sony Cross-Device General] munjeni:
Yes you can't use :(
[Sony Cross-Device General] Hamidreza2010:
bro i start to test it on z5 on nougat.just 2 question:

1- i unpack my kernelx.sin but when i go to ramdisk\data for copy TA.img to that , that path is empty and there is no /data/local/tmp

2- my new boot.img was created.it means i do it successfully? and its will work currectly?

thanks
[Sony Cross-Device General] serajr:
Copy TA.img to the /data/local/tmp of your device (open hidden log above and look at its last blue lines)!
[Sony Cross-Device General] x_one:
[MENTION=4120742]munjeni[/MENTION] I'll write here instead of pm.

It still doesn't work on Z3C with stock MM.

I don't have logcat, got bootloop trying root in system mode (forgot about ric).

I'll make some more tests and i'll post logcat.
[Sony Cross-Device General] aiola1982:
Working great on Z5C Stock MM 32.2.A.5.11
[Sony Cross-Device General] shoey63:
Did you test before attempting root? Or just try everything all at once?
[Sony Cross-Device General] x_one:
I did many tests.

Without any changes, only [MENTION=4120742]munjeni[/MENTION]'s changes.. Not working... :(
[Sony Cross-Device General] zohaib0001:
[MENTION=4120742]munjeni[/MENTION]

I successfully create new_boot.img by using your tool on Xperia XZ Nougat 417 firmware kernel

I did not change any thing from ramdisk, i just patched it with your tool

Now after i flash new boot img my phone hang on sony logo and dont go to further

Please Help !!!
[Sony Cross-Device General] Soheil_rf:
Works great !!!

is there any way to remove warning (unlocked bootloader message) at startup ?
[Sony Cross-Device General] munjeni:
No way removing it since bootloader opens original trim area partition and there is no way to trick bootloader.
[Sony Cross-Device General] munjeni:
Post at least output of the my tool if you were unable to get dmesg & logcat! Use please http://www.pastebin.com for it!
[Sony Cross-Device General] munjeni:
It would be great if you give me your kernel for analyse!
[Sony Cross-Device General] munjeni:
New version is out and that thing is fixed now, you can try now! :)
[Sony Cross-Device General] Soheil_rf:
Ok Tanks

Now i have on more question

my device is XZ dual with lastest fw , I patched my kernel with your awesome tool for DRM , DM-Verify will disabled with flashing SuperSU , how can i disable Sony RIC ?
[Sony Cross-Device General] munjeni:
Till after tool pause go to the ramdisk folder, open init.sony-platform.rc@0750, search for line:

chmod 0640 /sys/kernel/security/sony_ric/enable

add after that line this:

write /sys/kernel/security/sony_ric/enable 0

continue tool and you are done with ric. :) Also you can make an script for it since tool will search for script and execute if script is found, program your script to automate all things you need if you no want everytime to do thing manualy. But do in mind if you disable ric you must disable dmverity too! To disable dmverity open fstab.qcom@0640 and remove red line:

/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1,discard wait[COLOR="Red"],verify[/COLOR]
[Sony Cross-Device General] Soheil_rf:
Please guide me for DM-Verify too.

thank you very much
[Sony Cross-Device General] munjeni:
See post above!
[Sony Cross-Device General] Soheil_rf:
when i Disable dmverify manually , after boot i haven't mobile signal but ric is ok

whats the problem ?
[Sony Cross-Device General] exvargos:
Ignore the following, apparently people don't actually read through forum posts.

That isn't the actual problem (Leave the key as 115), if you check the second to last line of the init file in android folder,

${BB} rm -rf /dev/* ${BOOTIMG} ${TWRP}

He removes the bootimg and twrp zip every time there is a successful boot, so after one boot, those images are gone from the system. Next time you call for recovery, system crashes because the files are missing. If you comment out or remove that file, then twrp works across multiple boots.

I'll post onto tobias's forum to let him know, or at least ask him why he does that.
[Sony Cross-Device General] x_one:
It's for security reason.

And it's not a problem. I've the same in my script and twrp is working every boot. It's everytime refreshed.
[Sony Cross-Device General] exvargos:
Really? I presumed it was a security reason, but wasn't sure.

How is it refreshed every time if the code that copies it onto the boot img is in rootkernel.sh? Before I removed that line, I have never succeeded in successive boots into TWRP that was installed through rootkernel. Furthermore, at least on my end, it's not that the kernel is reading the wrong key and skipping past recovery into normal boot, it detects the right key (led goes orange), then hangs on Sony boot image (Makes it annoying to debug as it never boots along far enough to allow for adb to get bootlog.txt).

Did you install TWRP through rootkernel or flash it separately?

Also I'm running into issues where ta_poc is copying TA.img over onto the phone into the right place, but i get no blobs/error in all the security tests and no signal. I'm working on getting a dsmesg atm. Will try permissions mods as that seemed to have worked for some people in the past here (although with a previous version of ta_poc, there wasn't any issues with the permissions on my TA.img)