yashsingh1/xdaforums huggingface dataset:
[Sony Cross-Device General] munjeni:
Thanks! First of all, did you tried that kernel without poc to make sure its working ok on your phone?? That is a first thing you need to check before you use that kernel with poc! I can see a ton of strings "failed" and "error" in your dmesg, seems kernel which you have using is not that good? Poc related, I didn't see anything wrong other than that your dmesg apsolutly have nothing related to TAD service, its looks like it didn't runing anyway! What is inside ta log /data/local/tmp/init.ta-log.txt ?

Is Z1C-Advanced-v19.0-gcc-linaro-6.3.1-Kernel.zip from here https://mega.nz/#F!a4RExIaa!H5Ig_vvsVtNp_3vBk8Zr_g!Gp4xGZyb one which you using? I have downloaded that one but seems thats not one which you using since one which I have downloaded contain two ramdisks as you can see in my poc log:

Found boot image with two ramdisks, patching ramdisk.cpio
Extracting ramdisk.cpio...

But on your poc log I can see its single ramdisk kernel https://pastebin.com/gsXuMRp3 . Can you upload here one which you using (unpatched)?
[Sony Cross-Device General] munjeni:
Try wipe dalvik cache and reboot! Also do this https://xdaforums.com/showpost.php?p=72280600&postcount=1433 and reboot. If none of one works than you can try wipe data factory reset which will make all things generated from begining and right.
[Sony Cross-Device General] Shahnewaz:
Yes, kernel without PoC works fine.

init-ta with patched kernel: https://pastebin.com/LX45s8tW

dmesg with unpatched kernel: https://pastebin.com/SUxJDbMR

That is right! The kernel exceeds 10MB limit, so Google Drive link: https://drive.google.com/file/d/0B0l_OwYBtV1NZEFjLUI5Wncxc0E/view?usp=sharing

Anything else, just let me know. :good:
[Sony Cross-Device General] fluffi444:
I guess you misunderstood him. TA Tool is working 100% - He is just mentioning that rooting kills some of his app - like andriod pay and mybe some other banking apps or so.... But this has nothing to do with TA Tool or DRM functions.

Anyway - To do the "DRM-3-folder-wipe" is everytime a good idea :)
[Sony Cross-Device General] munjeni:
Thanks, problem identified, but I can call that more like problem with android since stupid bug like this one:

/init.ta.sh[9]: [COLOR="Red"]cp: not found[/COLOR]

lets say WTF standard command like CP is missing in an modern android, I don't believing realy :) To solve that simple symlink cp to toolbox under /system/bin and you are done, than reboot and magic will happen I am pretty sure. If you can't find CP simple find an busybox and put them to the /system/bin folder and rename them to cp , give perms 755 and you are done, verify command by terminal emulator to be sure command "cp" is working e.g. "cp --help", if it say e.g. command not found you are not done, repeat or ask somebody help you, I can't fix anybody androids thats soo stupid for me sorry
[Sony Cross-Device General] Shahnewaz:
Sorry [MENTION=4120742]munjeni[/MENTION], I'm stuck here.

I installed BusyBox and reboot, tested cp, but the init.ta.sh log remained the same.

Let me know if you need anything.
[Sony Cross-Device General] munjeni:
Realy strange. Can you try, till after poc make recovery prompt, manualy modify ramdisk/init.ta.sh and change line which contain string cp to something like /system/bin/toolbox cp, or if not work change to /sbin/busybox cp
[Sony Cross-Device General] Shahnewaz:
Holy **** it works!

Not sure exactly what you meant, but I just edited the init.ta.sh file on tac_poc's binary folder, made a new boot image and tried it.

Added /system/bin/toolbox in front of cp as you said. Results? It works! But the fight was not over.

init.ta.sh
/init.ta.sh[14]: chown: not found
/init.ta.sh[14]: chmod: not found
Prepare to run ua modem switcher
Run ua modem switcher finished with status 0

Phone worked again, and the Service menu started identifying my device correctly... except the Security Tab. Which was None as before.

The not found errors meant I had to do that for all 3 commands. Did that, and results? SUCCESS!!!

init.ta.sh
Prepare to run ua modem switcher
Run ua modem switcher finished with status 0

And the Security Tab is fixed. Take a look at it now.

Finally, now my bootloader unlocked device completely mimics a bootloader locked device! :victory:

Good things come to those who wait. Many many many thanks to [MENTION=4120742]munjeni[/MENTION] for his absolutely brilliant work! :highfive:
[Sony Cross-Device General] munjeni:
Glad to hear that :)
[Sony Cross-Device General] espaciosalter20:
i'm having exactly the same situation as you were having... i had tried the same things as you but still doesn't work.... i don't know if has to do anything with the fact i had patched my kernel with magisk before tried to patch my kernel with ta_poc... don't know how to take a log of ta_poc so, if anyone could help me, will be very much appreciated...
[Sony Cross-Device General] Shahnewaz:
What kernel are you using? Are you using the same phone and firmware version as me?

Post your init-ta and dmesg log so [MENTION=4120742]munjeni[/MENTION] can take a look.

EDIT: to make a ta_poc log, run command prompt and navigate to the ta_poc folder. Then execute DOUBLECLICKME.bat from there. Your log won't disappear this way, and you can copy-paste it from there.
[Sony Cross-Device General] DHGE:
try to reverse the procedure

I went this way for F8331_Customized DE_1305-9090_41.2.A.2.223_R3D (successfully in first attempt):

- flash stock ROM via Flashtool (before I copied FSC script "39..." to "41..." ) and test it works (I wiped user data here)

- prepare a patched boot image with PoC and my kernel...sin and TA.img and answered all questions with "yes" (hit return each time)

./ta_poc kernel.sin TA.img ramdisk

I am on Debian Stretch.

- flash the resulting boot image with fastboot and test it works. Service menu/Security: keys provided YEAH :D

- flash recovery and from there root with SuperSU (here you could try Magisk) and flash Titanium Backup

- restored my apps with their data via Titanium Backup
[Sony Cross-Device General] espaciosalter20:
any explanation about this? anyway, this worked it! finally i have ta_poc with magisk installed and functional without any error on SERVICE menus... Thanks!
[Sony Cross-Device General] DHGE:
Applying the Magisk patch first made the kernel different from what this PoC expects.
[Sony Cross-Device General] Cerhio:
Can someone post clear instructions? I've searched and searched and nobody posts clear instructions. Can I convert my TA backup ftf to the .img file that is required?
[Sony Cross-Device General] DHGE:
https://xdaforums.com/showpost.php?p=72409786&postcount=1479

I do not know with which procedure you got a TA.ftf if you followed the clear instructions in the backup thread:

"3. TA will be saved as TA-ModelNumber-Serial-Timestamp.img in the backupTA.sh directory."

If you followed other instructions, ask where you found them. Maybe you just rename (in my case not necessary) the ....ftf to ....img
[Sony Cross-Device General] Cerhio:
Wow thank you so much! The problem is I created the TA backup so long ago and lost the original file :( I just have the .ftf file that I was flashing from before because I created the backup so long ago. I guess I'm out of luck but it is just another step I will always have to take in flashing the .ftf file from now on right?

EDIT: NVM! I found the backup. Thank god I just seem to backup everything ;) So I can use this to root, install superuser and latest TWRP?

---------- Post added at 10:45 AM ---------- Previous post was at 10:24 AM ----------

Another question, does PoC completely replace the old method of repacking the stock kernel with dm-verity?

-From what I read, I only need my original ta.img and the kernel from the FW with the POC?

-I can install TWRP right? Can someone tell me where to put the recovery.img?

---------- Post added at 10:52 AM ---------- Previous post was at 10:45 AM ----------

Okay I think I've figured this out:

So I just throw in my kernel.sin from FW, TA.img from TA backup and recovery.img of latest TWRP, run DOUBLECLICKME and then use flashtool to fastboot new_boot.img?

It is that simple right?
[Sony Cross-Device General] DHGE:
- yes

- yes

fastboot flash recovery TWRP.img

- no TWRP and root are extra efforts, just follow the link with the "clear" intructions I gave you in my last post
[Sony Cross-Device General] Cerhio:
Thank you so much for the help but I am now stuck trying to install TWRP by using "fastboot flash recovery recovery.img". (recovery.img is the name of my TWRP file, should this be changed?) If I understand correctly:

-I flashed the latest FW using flashtool and then used it to install the PoC'd kernel which was created using only the kernel.sin of the FW and the TA.img of my Z5C

-I use minimal ADB and first put in "adb devices" and then "fastboot flash recovery recovery.img"

-I turn off my Z5C and then plug it in while I am holding the volume + button and then it installs.

I got to the last part but I cannot access TWRP. I'm supposed to just use Power and Volume - right? I am sorry for these questions but even using the search function gives contradicting instructions. I used a link I found within this post to get the latest version of TWRP but is there any way someone could link the Z5C version of TWRP 3.1 again? I want to make sure it is correct.
[Sony Cross-Device General] Cerhio:
this part confused me. is this a code i'm supposed to enter? i'm using windows 7
[Sony Cross-Device General] DHGE:
Running Windows you just execute the provided batch-file. Hint: look into the file to get an idea what you will do ...

For specific devices (recovery version, sources, key-combinations) look into the specific forum.

Read my [Guide]:

adb reboot recovery

ta_poc crafts a boot image - not a recovery!

fastboot flash boot boot.img
[Sony Cross-Device General] Cerhio:
Yes, I looked inside which is what confused me the most. The code didn't seem to make an sense.

Ah so there is no way to install twrp? Well that's disappointing. I did exactly what your instructions said and nothing happened. I used that exact code to create a boot image and fastbooted it but nothing happened. Usually when I would flash a kernel with twrp, I was able to boot to twrp BT pressing down on the volume + button until the light flickered on. Isn't that how this one works?

Just FYI, I'm only stuck at flashing the boot image and bringing up TWRP. That's all I need help with. I'm not sure why nobody knows how to do this properly. The instructions you gave me did absolutely nothing.
[Sony Cross-Device General] Cerhio:
IT WORKS! Everyone says just press power + volume down but they don't explain what happens. You press volume down first and then the power button and hold them until the phone vibrates BUT you continue holding until the LED turns on. Loaded up no problem! I'm just in the middle of the first restart ;)

THANK YOU ALL!
[Sony Cross-Device General] shoey63:
Just built a TWRP 3.1.1 for Amami/Z1C users. https://www.androidfilehost.com/?fid=817550096634773960

Probably wont work with POC due to selinux things but good to have on the recovery/FOTAKernel partition ;)
[Sony Cross-Device General] levone1:
What's new in 3.1.1? Thanks
[Sony Cross-Device General] shoey63:
https://twrp.me/site/update/2017/05/19/twrp-3.1.1-0-released.html
[Sony Cross-Device General] Klaus N.:
[MENTION=4675598]shoey63[/MENTION]

Only if you find the time and if it's possible, ofc.:

It'd be great, if you also could build one for the Z1 (Honami).

Thanks in advance :good:
[Sony Cross-Device General] Shahnewaz:
Okay, I'm back again with another problem on a clean install of stock 236 firmware.

Only installed SuperSU and Advanced-Kernel v19. No F2FS migration yet.

I've patched the kernel and flashed it to my phone. It works, however the security tab seems to be "None".

Only this time the init.ta.sh was fixed like we discussed before.

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

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

boot-log: https://pastebin.com/dJN2m9m6

init.ta-log:

init.ta.sh
Prepare to run ua modem switcher
Run ua modem switcher finished with status 0

Not sure what I did last time that made it work, but when it did work, boot time (at the Sony logo) was significantly longer.
[Sony Cross-Device General] Cerhio:
So does magisk work with this?
[Sony Cross-Device General] Prior_Ori:
Xperia Z working?
[Sony Cross-Device General] Shahnewaz:
So far I've tried re-flashing the ROM, retrying the patch and even re-locking the bootloader to make sure I have the correct keys. But nothing seems to fix the "None" security tab. Anyone who is successful with the patch, can you tell me the steps to replicate it? [MENTION=4120742]munjeni[/MENTION] can you take a look? Thanks a lot.
[Sony Cross-Device General] munjeni:
Everything right in your log! I am suggest try poc without anything first (mean without root, mods, etc), if not work I simply have no free time for this anymore, working on another tools. Tool is fully customisable so if you need something make your own script, modify, do whatever
[Sony Cross-Device General] Shahnewaz:
Well. I figured out what was causing the problem. poc on Advanced Kernel only works properly when Data and Cache is migrated to F2FS. I guess it's just something with the kernel.
[Sony Cross-Device General] munjeni:
Poc is asolutly unrealted to partition type! If your kernel is designed for f2fs than it use f2fs, poc can do nothing with it. :) I am glad you have figured out
[Sony Cross-Device General] Cerhio:
does it?
[Sony Cross-Device General] koekoek91:
It doesn't for me. Tried multiple versions of Magisk but I am not able to get root with it.

Using SuperSU works fine for me though.
[Sony Cross-Device General] whalesplaho:
but it works with rootkernel so it shoud also work with ta_poc....
[Sony Cross-Device General] koekoek91:
Maybe it should work, but it doesn't work for me and for another guy I know magisk also not working with ta_poc :p
[Sony Cross-Device General] PhonerX:
I have tested and for me Magisk works perfectly with ta_poc. The important thing is to follow the procedure for patching the kernel.

First of all, ta_poc (DOUBLECLICKME.bat) should be used as before on stock kernel to include drm keys, disable RIC, fix DRM.

Then the kernel that has been made with ta_poc has to be processed through rootkernel.bat made by tobias.waldvogel answering Yes for disabling Sony RIC and No for TWRP, DRM fix and Busybox.

The Kernel boot.img, that is made by following these steps, has drm keys, is compatible with Magisk and does not cause reboots.
[Sony Cross-Device General] levone1:
I noticed a couple of things -

There's no option for 'trim area', or 'recovery' in restore menu, and there's no option for 'boot' partition when fleshing img...
[Sony Cross-Device General] DHGE:
https://twrp.me/FAQ/

and there esp. TWRP Commandline Guide

Inside the ZIP-files you use there are scripts that hopefully "do the right thing".

You flash images with fastboot.

Manipulating/Restoring can be done via dd on the command line and in case of the trim area they should. Of course you could wrap your restore script (a one-liner) and TA.img in a ZIP-file and process that in TWRP. Don't let that ZIP-file get lost - in the wild that can multi-brick other devices.
[Sony Cross-Device General] Emilen942702:
I'm not getting it.

ta_poc doesn't create a kernel but a boot.img right ?

And how can you process that boot.img through rootkernel.bat, which only takes kernel.elf as an arg ?

Running Xperia Z5 stock 32.3.A.2.33 and not managing to install Magisk (image mount failed) with the boot.img from poc and twrp recovery

Thanks
[Sony Cross-Device General] shoey63:
Rootkernel can unpack boot.img as well as kernel.elf

Eg: rootkernel new_boot.img boot.img (or whatever you like to name them)
[Sony Cross-Device General] Emilen942702:
Thanks for your answer.

I didn't knew that.

Hi,

I followed your instructions using Stock 32.3.A.2.33 and I still can't install Magisk. DRM Keys are successfully restored.

The installation does not show any error, I have Magisk Manager but it says "Magisk not installed. Not rooted"

Any ideas ?

Thanks
[Sony Cross-Device General] shoey63:
Well in that case, try this one https://www.androidfilehost.com/?fid=817550096634780280

---------- Post added at 09:25 PM ---------- Previous post was at 09:20 PM ----------

OK. Try this https://www.androidfilehost.com/?fid=745425885120742869

Edit: The recovery images may or may not work with PoC, but should work fine if Flashed to FOTAKernel partition.
[Sony Cross-Device General] PhonerX:
Hi,

Sorry for the question, but have you gone into TWRP and flashed magisk zip before installing the Magisk manager?

If yes, I am out of ideas why it does not work for you.
[Sony Cross-Device General] Emilen942702:
Yes that's exactly what I did :(

That's fine.
[Sony Cross-Device General] munjeni:
Seems wrong magisk installed!? I never tried magisk and have no idea what is use of it so can't help with it
[Sony Cross-Device General] PhonerX:
You can't use e.g Google Pay and have unlocked bootloader or root at the same time if you do not have Magisk.

I am using the one from the first post here and just following the instructions it works:

https://xdaforums.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445

Maybe there is an old su installation that needs to be completely removed?
[Sony Cross-Device General] munjeni:
Don't know realy! I had problem to find "booting" supesu installation, only one worked for me, with the rest which I tried no one worked, caused boot loop! So maybe same thing is happening to magisk, have no idea realy.
[Sony Cross-Device General] newguyknowsnothing:
Wow I tried it and my Z2 booted with new kernel created by the tool. I checked and my phone said: Bootloader unlock allowed: Yes and all the keys are active. Does this mean my bootloader is locked or it is still unlocked with TA fully functional?

Thanks for the tool anw, now the great features are back!!
[Sony Cross-Device General] shoey63:
It means the tool is working perfectly. Phone is tricked into thinking bootloader is locked with DRM keys intact.

In reality, bootloader is still unlocked ?
[Sony Cross-Device General] newguyknowsnothing:
Okay I understand now,thanks!! :D:D Also, when it comes to installing recovery, the tool said put the recovery to the same direction with /ta_poc. I did that but the tool did not recognised Twrp.img ? So how can I have recovery attched to the new kernel?

P/s: I'm a newbie :P so I am kinda confused :D:D
[Sony Cross-Device General] RaXelliX:
From what others have told me here previosly you need to flash recovery separately so it can survive future kernel flashes. Otherwise flashing an updated kernel in the future would remove the recovery.

Also booting into the recovery is difficult at best and there are no clear cut instructions. Initially i thought it was not working at all.

Then i discovered the best way to test this is to first power off the phone. Then press and hold VOL Down and then press and hold Power button. If you see the Sony logo pop up first then it will likely boot into recovery. If you see the warning triangle about unlocked bootloader then likely it did not work.

It's also possible to boot into recovery during restart but that requires very precise timing on the buttons or you have to wait and hold the buttons nearly an entire boot cycle for it to reboot and go into recovery.

Less than perfect i know.

BTW: Use commandline and fastboot.exe to flash the recovery:

fastboot flash recovery c:\twrp.img

(or other location where your recovery is. Use quotes if there are spaces in the path like "C:\my recovery\twrp.img"). Phone needs to be connected over ADB to PC for this to work. ADB is at C:\adb assuming you've installed flashtool and appropriate drivers but i assume you know this?

EDIT: Forget about the part about yellow triangle. Your Z2 does not have this warning. Newer Xperias (like my X Compact) have this and it's really annoying. It is displayed on every boot if you've unlocked the bootloader and thus far no one has found a way to disable it.
[Sony Cross-Device General] shoey63:
Rename Twrp.img to recovery.img and run it again. It should get integrated. So after flashing new_boot.img you can access TWRP by pressing volume up or down during the boot sequence, when you see the LED turn on.
[Sony Cross-Device General] newguyknowsnothing:
Thank you for the very detailed instruction, but I used [MENTION=4675598]shoey63[/MENTION] 's medthod and it succeeded !!!

Thanks guys for helping me out ! My phone is awesome now, UB with DRM working well and TWRP, I can do anything I want now !!!
[Sony Cross-Device General] Klaus N.:
Thanks mate, I can confirm it works :good:
[Sony Cross-Device General] Kianush:
Hey guys, I know that this is wrong to ask but but there are a lot of pages to look for...so can someone please explain how to use this ta_poc?!

I have my kernel named boot.img and my ta backup named ta-f5321.img and I also need to have twrp on my phone, but i really dont know how to work this out...

Im not that noob but Im still a little noob!
[Sony Cross-Device General] Ikzy:
Hey kianush, in the x compacts forums there is a detailed tutorial how to unlock, root and ta_pc your device. Cheers :)
[Sony Cross-Device General] Cerhio:
So why the **** wouldn't you respond to my question and say that it works? Are you just trying to be an asshole to newbies?
[Sony Cross-Device General] whalesplaho:
Hahahahahahahahahahaha..... Asshole??? I answered yhu i said it works with rootkernel so it shud work with ta_poc. Itd answered in a plain text cos i havent tried with poc so cant concluded.
[Sony Cross-Device General] Cerhio:
Yes thank you for those detailed instructions on how you got something to work that nobody else can. You are such a nice guy right?
[Sony Cross-Device General] whalesplaho:
Wait.... If its instructions it easy!!

I believe yhu can patch boot image with rootkernel???

Follow dis thread; https://xdaforums.com/xperia-z5/development/safetynet-stock-kernel-twrp-magisk-t3621133

But later, i flash magisk v13 updated version from tha thread.
[Sony Cross-Device General] icaruswalks:
Is there a guide on how to use this tool for complete neophytes? I have an Xperia Z5P e6853 and want to upgrade to Nougat.

Edit: Can I follow the instructions in this link for Z5P?
[Sony Cross-Device General] levone1:
Extract rar file to some directory > copy your kernel and TA img to pc (and recovery if you want - recovery file has to be in TA_poc directory and named 'recovery') > double click "double click me" file > follow prompts.

When done, flash new_boot img as kernel.
[Sony Cross-Device General] chadgauth:
It looks like munjeni's account was disabled. I hope it's not because of the cruel post above. But does anyone have the latest copy of ta_poc.rar? I just unlocked my phone and ran into a roadblock getting the file now...
[Sony Cross-Device General] mark manning:
Sorry to drop in guys but had to do a slight cleaning. I know that conversation was a few days ago but lets make sure we keep it civil in here please

Thread cleaned
[Sony Cross-Device General] RaXelliX:
Here you go (see attachment).
[Sony Cross-Device General] fluffi444:
Do you have any inforamtion why munjeni's account is disabled? Why is OP completely away?
[Sony Cross-Device General] shoey63:
It's probably due to ungrateful xz premium users using his newflasher tool. It's the only way they can flash, as flashtool won't work for their devices.
[Sony Cross-Device General] oziris11:
This is not the latest version.
[Sony Cross-Device General] RaXelliX:
Yeah i was afraid of that. What's the difference between versions?
[Sony Cross-Device General] oziris11:
You can see for yourself.:o
[Sony Cross-Device General] andTab:
Yup. Yours shows as having a virus.
[Sony Cross-Device General] oziris11:
135 people did not complain.:confused: