yashsingh1/xdaforums huggingface dataset:
[Sony Cross-Device General] koekoek91:
Ah thanks mate.

I didn't know I had to use a different method to boot into recovery.

Working fine now and shows 3.1.0-0 :)
[Sony Cross-Device General] Hamidreza2010:
I didn't test poc on custom kernel bro

I don't use custom kernel now

---------- Post added at 07:02 AM ---------- Previous post was at 07:00 AM ----------

Bro I do this but I enter to recovery version 3.0 2

But when I use just press volume up repetatly , I enter to your recovery
[Sony Cross-Device General] zohaib0001:
[MENTION=4120742]munjeni[/MENTION]

By using latest version of POC kernel work fine, but in recovery touch is not working.

My device Xperia XZ Dual running android 7.0 nougat and i used official TWRP recovery for XZ.

here are Last_kmsg and dmesg

http://pastebin.com/z8RsN17n Last KMSG

http://pastebin.com/erhMke84 dmesg
[Sony Cross-Device General] shoey63:
Well your PoC kernel with integrated TWRP 3.1.0 is working beautifully then. No more using fota recovery for you ;)

BTW, no need for multiple button smashing to enter TWRP. Press volume up/down once as soon as you see yellow LED.
[Sony Cross-Device General] Hamidreza2010:
Hahaha

It's great bro

Thanks again for your best work

With your recovery, we are update in recovery
[Sony Cross-Device General] shoey63:
What happens if you try to make a backup of, let's say boot and you try to select external sd card with the "select storage" button?

Also, if you make a PoC kernel with it, does it mount and recognise MicroSD card then?
[Sony Cross-Device General] shoey63:
Oops! I use Omnirom 6.0 sources, and there is no love for Honami :( I Will have too look at it later.
[Sony Cross-Device General] zohaib0001:
[MENTION=4675598]shoey63[/MENTION]

can you build 3.1.0 recovery for XZ ?
[Sony Cross-Device General] shoey63:
Here you go https://www.androidfilehost.com/?fid=745425885120713702
[Sony Cross-Device General] Dilesh Perera:
many thanks goes to u bro :angel:

just want to ask you Will it work in recovery partition so that i can boot from hardware keys?
[Sony Cross-Device General] rocker00:
working flawlessly here, thanks a lot shoey :good: :o .
[Sony Cross-Device General] shoey63:
Well I can't test, but if you "fastboot flash recovery recovery.img" it should work. You know the drill, power off then power on holding power plus volume down...

But why not make a PoC kernel with it?
[Sony Cross-Device General] oziris11:
To dare to ask for E6533 (Z3+) . I would be very grateful.
[Sony Cross-Device General] munjeni:
In recovery mode connect adb and do dmesg, one which you posted is not of help since it is not recovery dmesg
[Sony Cross-Device General] Dilesh Perera:
yeahhh it works with hardware keys :)

yes i will make a one with POC soon :D
[Sony Cross-Device General] aiola1982:
[MENTION=4675598]shoey63[/MENTION]

twrp for Z5c would be wonderful
[Sony Cross-Device General] Dilesh Perera:
[MENTION=4675598]shoey63[/MENTION] and [MENTION=4120742]munjeni[/MENTION]

after using new POC my new boot image size is 21,024 kb which is too large to flash . i tried with fastboot and image flash with my twrp 3.0.2 . it fails
[Sony Cross-Device General] munjeni:
You must clenup that custom kernel which you using! For example in some of that which I repacked I found 3 diferent busybox's, so good luck removing them! ;) Maybe better idea, contact author of that kernels and tell/ask him why his kernel contain few busyboxes. You can remove things manualy as soon as first poc pause happen, search and remove busyboxes you no need to save space! One more thing (I told about it already), things not working if you didn't flashed new_boot.img!
[Sony Cross-Device General] Dilesh Perera:
made one with stock kernel and it worked :)

:good::good::good:
[Sony Cross-Device General] munjeni:
No sorry, thats not possible, it was a ton of changes which you can colect byself by reading whole thread, all changes and examples is on this thread
[Sony Cross-Device General] mobiware:
SD Card Accessible?

I read in post #960 from "Niterain" that the SD card is not accessible. I quote the post here: "It works on my Z5 (E6683), but external SD is not detected, just like any other recovery flashed to recovery/FOTAKernel that I've tried so far.

tobias.waldvogel's internal recovery integrated in the kernel is the only one that recognizes and mounts the MicroSD Card...".

That's what I was asking originally in my #5 question. Is that the case?

:confused:
[Sony Cross-Device General] whalesplaho:
Atlast poc works very well with custom.... Told my kernel dev to provide a kernel for me without adding twrp, drm fix and busybox.... i patched kernel with my TA.img and latest recovery and voila.... Aal working good, i can enter recovery with vol- or vol+

Thanks [MENTION=4120742]munjeni[/MENTION] for dis great tool, [MENTION=3989065]serajr[/MENTION] for his hardwork and [MENTION=4675598]shoey63[/MENTION] for latest twrp....
[Sony Cross-Device General] shoey63:
That's one user. Everyone else is having success with latest TWRP, so you can try it with confidence.

---------- Post added at 08:57 PM ---------- Previous post was at 08:17 PM ----------
[Sony Cross-Device General] serajr:
Thanks a lot for all your efforts... you rock :highfive:

Bro, do it when (and only if) you have some spare time, you don't need to bother with that! But I must say that yours just kill "official ones" ("unsupported ones", you know), and that's why we always get anxious on hearing that you're still working on them!

Btw, is there any chance you code it to create a single /system backup image file only? Like the ones you built for z3/c (on the beta fw glory days)! If possible, ofc!!

Also, I would like to express myself about the unfailing cooperation and the tireless support that [MENTION=4120742]munjeni[/MENTION] has dedicated here, as everyone knows, it is simply incredible and worthy of applause!
[Sony Cross-Device General] whalesplaho:
[MENTION=4120742]munjeni[/MENTION] deserves applause like [MENTION=3989065]serajr[/MENTION] said....:highfive::highfive::highfive::highfive::victory::victory:

backing up our TA was just to keep n restore back incase we wanna return our phone to sony service centers & maybe to relock incase we wanna sell our phone..... never knew it ll be useful later in future, now we can mask our TA and tha phone detects it as if tha bootloader never been unlocked.:good:

[MENTION=4675598]shoey63[/MENTION] loving tha TWRP port....no more E:legacy bla bla bla error!!!!:victory::highfive:
[Sony Cross-Device General] aiola1982:
Bootloop at Sony logo
[Sony Cross-Device General] shoey63:
Ok, sorry. Tried to make a hacked version due to lack of sources. Please reflash your working boot.img.

If you care to post a kernel.elf for your device, I will try a different approach.
[Sony Cross-Device General] aiola1982:
Kernel is attached from build 32.3.A.0.376.

The Z5 recovery you postet a few days ago boots to twrp but with black screen all the time. It's the same hardware with different display resolutions (1080p vs. 720p).
[Sony Cross-Device General] shoey63:
Well, yes. I use it in my personal build. But 64 bit system image backups are huge. Well over 4 gigs, so I left it out. The image flash section still has it there though (as well as TA and fota/recovery)

Post your recovery.img if you want, and I will add it. Or I will post an 'how to"

Forgot, you don't have TWRP 3.1.0 lol. Just PM me if yours gets updated and you want extra features. That's assuming I don't do it first ;)

---------- Post added at 04:53 PM ---------- Previous post was at 04:47 PM ----------

Ok cool. Same hardware, but different kernel. Just need to do some tweaking and it should work.
[Sony Cross-Device General] Niterain:
I've tried making a backup of boot to the internal storage but after that, the external sd card is still not selectable/mountable.

I've made a PoC kernel with your recovery integrated and it works perfectly, the external sd card is recognized.

If I got it right, the FOTAkernel recovery uses its own kernel, while the internal recovery uses the actual device's (now PoC) kernel and maybe the TWRP kernel is unable to recognize the external sd card on my Z5...

Anyway, thank you for TWRP 3.1.0.
[Sony Cross-Device General] munjeni:
I have plan to make new tool, sin to zip (flashable) convertor! Anybody help me out figure 7z source code? I have not much nervs :) reading huge 7z source code, only which I know it support ext4, and also found that it reads dirs,files,symlinks,owner,group...etc, only which is missing (but curently need) is selabel of the directories,files,symlinks. It would be great if somebody figure out reading selabel of the things from ext4 with 7z!
[Sony Cross-Device General] fluffi444:
Tried this already. This is not working if integrated in Kernel with PoC. It behaves same like Russel5's 3.0.3.0 version...

But if flashed it to FOTA is works as usual...as well as 3.0.3.0 from Russel5.

They are containing some file which munjeni has already delared as "strange" - PoC is modifying them but didnt work integrated in kernel.

file_contexts.bin (not in yours)

init.real (not in yours)

init linked to sbin/init_sony (not in yours)

This is not in your Z2 recovery - looks like you and russel5 are compiling not the same way...

As faar as I know Z2/Z3/Z3c are quite the same actually...

Actually this all is not that important...

But if you have the time I would love to see your Z3c Recovery img... I bet this works with PoC.

EDIT

Just found out that there was an attempt to build Z3c official recovery on jenkins build bot

https://jenkins.twrp.me/job/z3c-prod/

But as it looks like it ran into errors and was not build.

build/core/product_config.mk:227: *** _nic.PRODUCTS.[[device/sony/z3c/omni_z3c.mk]]: "device/sony/shinano-common/platform_omni.mk" does not exist. Stop.
[Sony Cross-Device General] munjeni:
Anybody have idea why line in conv.sh (echo $line | sed 's/Path = //g') cause whole process sooooo slowwww ?? Is it busybox isue or WTH is going with it? Tried on mingw and getting the same
[Sony Cross-Device General] Joad:
hi , i used PoC and got in bootloop in boot animation . my phone xperia x f5122 android 7 .311 build .

here log please help . thanks

http://pastebin.com/i27xTsYu
[Sony Cross-Device General] munjeni:
1. kernel is stock or custom?

2. is that log last_kmsg or normal dmesg?
[Sony Cross-Device General] josephnero:
[MENTION=6351145]ondrejvaroscak[/MENTION]

safety check fails
[Sony Cross-Device General] zohaib0001:
[QUOTE [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 !!![/QUOTE]

[MENTION=4120742]munjeni[/MENTION]

Here is XZ Dual Nougat _ 417 Firmware patched boot.img and Kernel.sin

I also used your updated tool but result is same

Download Link
[Sony Cross-Device General] Hamidreza2010:
[MENTION=4120742]munjeni[/MENTION] its work great on z5 dual sim

its very good if , tool copy ta.img automatic to phone not by manual ( or patch in kernel if been )

thanks again
[Sony Cross-Device General] gr8st:
[MENTION=6351145]ondrejvaroscak[/MENTION] [MENTION=3844251]josephnero[/MENTION]

Can confirm it passing SafetyNet! Tested with stock z3c kernel with magisk v11. It didn't work before this fix.

Once you install magisk, you have to:

Open magisk manager

Enable magisk hide

Reboot

Then toggle (off then on) magisk hide setting again (important)

Check if it passes

Note if you have xposed installed you have to disable (and reboot it) first. Also note magisk v11 is buggy and can result in randomn restarts, but it's a start.

Otherwise the fix works, thanks [MENTION=4120742]munjeni[/MENTION] . Hopeful this allows stock camera blobs to be used with nougat.
[Sony Cross-Device General] x_one:
Does thid poc work on z3c stock for you?
[Sony Cross-Device General] fluffi444:
It you test this all with EliteKernel there are some additional things to mention:

Install "Root Validator" and see if somewhere SU was installed.

EliteKernel is SELinux permissive by default. SafetyNet needs enforcing.

Note that some "bad" apps like SuHide app, Magisk Manager, Xposed Installer itself can be a reason as well.

But we should stop this here. This is an "Prove of Concept" Thread for TA Tool.

And not how to bypass SafetyNet and whats needed or not for any specific phone/kernel...

EDIT

OK - saw that you wrote "stock kernel" - sorry...
[Sony Cross-Device General] gr8st:
Thanks for the reply. Yeah I tested with stock kernel because I was afraid using Elite kernel (which already has DRM fix) would result in soft brick.

Can you share the modded Elite Kernel that you mention earlier with DRM fix removed from vendor/lib and in init.target.rc "export LD_PRELOAD"?

I looked at this one, but it seems not to be altered:

https://drive.google.com/file/d/0Bx1QvE4qnmn6YTVfWU9WT3Vxb0U/view

Yes, this is not SafetyNet bypass thread, but this was the main appeal of this fix for me (and others too it appears). Guess what, it works too (see my edited post above)! :highfive: Ok, I'll stop now :angel:

Thanks again

---------- Post added at 04:13 AM ---------- Previous post was at 04:11 AM ----------

Yeah works great! Going to test custom kernel next.
[Sony Cross-Device General] fluffi444:
I really like to show the way to do it than provide ready-to-use solutions :o

This is very easy! De-compress kernel with TA Toll - stopp in the middle where it says "now you can change ramdisk"

- Delete file /vendor/lib/libdrmfix.so

- Got back to ramdisk root dir: Open init.target.rc

And change

on post-fs
export LD_PRELOAD libNimsWrap.so:libdrmfix.so

to

on post-fs
export LD_PRELOAD libNimsWrap.so

Save and done... Go back to TA Tool and repack stuff...

This is the original one.
[Sony Cross-Device General] x_one:
What the! What fw do you have, pure stock or custom?
[Sony Cross-Device General] zohaib0001:
[MENTION=1881378]Soheil_rf[/MENTION]

I read your reply that you patched XZ Dual 417 kernel and its worked for you

Bro please tell me how you achieve that, because i try 100 time this tool on XZ Dual 417 kernel, i just patched my kernel.sin and did not change any thing from ramdisk

But after flash new_boot.img my phone hang on sony logo and do not go further
[Sony Cross-Device General] Soheil_rf:
Are you disable DM-Verify with script?
[Sony Cross-Device General] DavideSony:
This couldn't work on previous Xperia like z1? Using this would be good, because with this REAL drm fix we can use every room, right? Moreover, this could work con z5 too? Only one thing needed is marshmallow or nougat, right?
[Sony Cross-Device General] munjeni:
Marchmalow and nougat is working good, but who know maybe it work for older too
[Sony Cross-Device General] zohaib0001:
[MENTION=1881378]Soheil_rf[/MENTION]

i try both with disable and with out disable and both time Bootloop

Even i flash supersu.zip and again bootloop

Please help where i am wrong why my device getting bootloop after flash patched boot.img

i try without change any thing

i try with disable DM-Verify with SupperSU.zip

i try with disable DM-Verify with scripit

i try with disable RIC with scripit

i try 100 times but every time hang to sony logo
[Sony Cross-Device General] gr8st:
I'm running latest AOXP rom .291 fw, it was stock kernel from that I used first.

Now I'm trying EliteKernel and while the PoC DRM fix is working, it's not passing SafetyNet anymore with magisk method. I even tried changing SE linux to enforcing but it still fails. There must be more changes to Elite causing it to fail :crying:
[Sony Cross-Device General] munjeni:
Do you mind to post your dmesg to http://www.pastebin.com so we can see what is going on?
[Sony Cross-Device General] munjeni:
Hey thanks a lot for you time doing that for extending our tool! :good: Do you have idea why TA.img is not copied to the destination folder /data/local/tmp ? I have tried with an loop like:

while [ ! -d /data/local/tmp ]; do
sleep 1
done
${BB} cp -fr /stufs/TA.img /data/local/tmp/TA.img

but it still fail and there is no log about fail. ta script is executed on "fs" which seems is a time when data partition is not mounted, don't know how safe is making mount for data partition on "fs", still have no solution for this
[Sony Cross-Device General] zohaib0001:
Please tell me how and where i can get this file "dmesg" ???
[Sony Cross-Device General] Soheil_rf:
Are you using your own TA.img?

I haven't any bootloop like you

Fresh install Rom may helped (wipe data)

---------- Post added at 03:16 PM ---------- Previous post was at 03:13 PM ----------

adb shell dmesg
[Sony Cross-Device General] munjeni:
Make sure to push TA.img with adb to the your device /data/local/tmp and here is no guesing, only dmesg can solve your problem! Use adb too to get your dmesg
[Sony Cross-Device General] Joad:
its stock with already have drm keys but in process of Poc they got removed succesfully .

dmesg log .
[Sony Cross-Device General] munjeni:
But since you had boot loop dmesg is not need, need last kmsg! For thing how to get last kmsg please do not ask since our thread allready have few pages related to it, simple search
[Sony Cross-Device General] Joad:
is this correct log ?

http://pastebin.com/rvgz0Z93
[Sony Cross-Device General] serajr:
I think it's a busybox issue (not sure about it).

I know you need this part in the code:

| sed 's/Path = //g'

Output:

[COLOR="Blue"][B]lost+found[/B][/COLOR]
Folder = +
Size =
Packed Size =
Mode = drwx------
Modified =
Created =
Accessed =
iNode = 11
Links = 2
Symbolic Link =
Characteristics = NOATIME EXTENTS
User = 0
Group = 0

But try removing that part, you will see a much faster output (whole log.log > ± 17 seconds):

echo $line

Output:

[B][COLOR="Red"]Path = [/COLOR][/B][COLOR="Blue"][B]lost+found[/B][/COLOR]
Folder = +
Size =
Packed Size =
Mode = drwx------
Modified =
Created =
Accessed =
iNode = 11
Links = 2
Symbolic Link =
Characteristics = NOATIME EXTENTS
User = 0
Group = 0

I really don't know why

echo | sed

together is causing this slowness!
[Sony Cross-Device General] munjeni:
Null pointer dereference but not much details, have no idea can't help sorry, try stock kernel instead of that custom
[Sony Cross-Device General] munjeni:
serajr

I found thing on google, busybox thing seems not a isue, isue is using external tools in loop so it gets opened in child proces, so for example if loop contain e.g 3000 lines it will open e.g awk in 3000 child processess, that's a thing which cause our soo slow processing. :) I had the same isue in patch_things related to drmfix removal so I ended with native thing string removal which I integrated into ta_poc. I just played with log.log, have no way to get sin to zip converter now since labels is missing in log.log :( Log.log is generated with 7z list function, output is prety usefull and easily can be converted to update_script lines but sadly 7z did't prints that selabels which we need too :(

On linux I can make a tool prety easy. Can we run recovery in qumu? If that is possible we can make special small recovery just for mounting that ext4 for printing out all files, dirs, symlinks, selabels...etc, or maybe modifying 7z for that purpose, hmm I had look into 7z source code, seems its missing/not implemented :( If somebody have good idea how we can read selabels of the files,folders...etc from an ext4 filesystem under windows let me know please!

Im not on pc now but will show you updated conv.sh just to show you what I wanted with it, its almost 50 percent of conveter done, only missing that slowness and that selabels of the files, the rest can be easily created with that script and 7z, maybe somebody get better idea
[Sony Cross-Device General] Surge1223:
Just use getfilecon recursively, or in combination with setfilecon

For ex

if [ ! -f "/data/system/theme" ]; then
mkdir /data/system/theme
chown 1000.1000 /data/system/theme
chmod 0755 /data/system/theme
TARGET=/data/system/theme
$SETFILECON $(echo $GETFILECON /data/system/theme|sed 's/$TARGET//g') /data/system/theme
else
$SETFILECON $(echo $GETFILECON /data/system/theme|sed 's/$TARGET//g') /data/system/theme
fi

I'm using setfilecon here, but you could use getfilecon instead to get the selabel etc, also here I sed out the path, but you could alternatively make it recursively give you labels.
[Sony Cross-Device General] munjeni:
Seems you misunderstand what I want? I am working on a sin to flashable zip converter on a windows machine. Sin to ext4 is done, now need to get a list of all files from ext4 including selabels, list of files can get easily using 7z, but only list of the selabels is missing. How can I use getfilecon under windows? I think thats imposible
[Sony Cross-Device General] munjeni:
serajr see atachment, its almost done :) If I uncomment line (mode=`echo $mode | chmod_format`) script become sooo slowwww , and one more thing we have missing selabels to make thing fully functional :(

selabel lines in updater-script only is missing :( , need to be something like for fully functional converter:

run_program("/tmp/busybox", "chcon", "-h", "u:object_r:system_file:s0", "/system/bin/cut");

Log.log is generated with command:

./7z.exe -slt l system.sin.ext4 > log.log

The rest is easy also, e.g. extract all files from ext4, make zip, upload META-INF ...blabla, prety easy :) If we manage that symlinks somehow tool is almost done :)

Edit:

Slowness solved with new script, also right permisions converter is done:

end_of_file=0
line_nr=0
lm=0
path=""
mode=""
symlink=""
user=""
group=""
tmode=0

mkdir -p META-INF/com/google

while IFS='' read -r line; do
if [ $line_nr -ge 24 ]; then
if [ $lm -le 14 ]; then
lm=$(($lm + 1))
[ $lm -eq 1 ] && [ "$line" == "" ] && break

line=${line/'\'/'/'}
line=${line/'\'/'/'}
line=${line/'\'/'/'}
line=${line/'\'/'/'}
line=${line/'\'/'/'}
line=${line/'\'/'/'}
line=${line/'\'/'/'}
line=${line/'\'/'/'}
line=${line/'\'/'/'}
line=${line/'\'/'/'}
line=${line/'\'/'/'}
line=${line/'\'/'/'}
line=${line/'\'/'/'}
line=${line/'\'/'/'}
line=${line/'\'/'/'}
line=${line/'\'/'/'}
line=${line/'\'/'/'}
line=${line/'\'/'/'}
line=${line/'\'/'/'}
line=${line/'\'/'/'}

if [ $lm -eq 1 ]; then
path=${line/'Path = '/'/system/'}
fi

if [ $lm -eq 5 ]; then
mode=${line/'Mode = '/''}
tmode=0
case "$mode" in
?r????????*) tmode=$(($tmode + 400)) ;;
esac
case "$mode" in
??w???????*) tmode=$(($tmode + 200)) ;;
esac
case "$mode" in
???x??????*) tmode=$(($tmode + 100)) ;;
esac
case "$mode" in
???s??????*) tmode=$(($tmode + 4100)) ;;
esac
case "$mode" in
???S??????*) tmode=$(($tmode + 4000)) ;;
esac
case "$mode" in
????r?????*) tmode=$(($tmode + 40)) ;;
esac
case "$mode" in
?????w????*) tmode=$(($tmode + 20)) ;;
esac
case "$mode" in
??????x???*) tmode=$(($tmode + 10)) ;;
esac
case "$mode" in
??????s???*) tmode=$(($tmode + 2010)) ;;
esac
case "$mode" in
??????S???*) tmode=$(($tmode + 2000)) ;;
esac
case "$mode" in
???????r??*) tmode=$(($tmode + 4)) ;;
esac
case "$mode" in
????????w?*) tmode=$(($tmode + 2)) ;;
esac
case "$mode" in
?????????x*) tmode=$(($tmode + 1)) ;;
esac
case "$mode" in
?????????t*) tmode=$(($tmode + 1001)) ;;
esac
case "$mode" in
?????????T*) tmode=$(($tmode + 1000)) ;;
esac
fi

if [ $lm -eq 11 ]; then
symlink=${line/'Symbolic Link = '/''}
fi

if [ $lm -eq 13 ]; then
user=${line/'User = '/''}
fi

if [ $lm -eq 14 ]; then
group=${line/'Group = '/''}
if [ "$symlink" != "" ]; then
echo "symlink(\"$symlink\", \"$path\");"
echo "run_program(\"/tmp/busybox\", \"chown\", \"-h\", \"$user.$group\", \"$path\");"
else
echo "set_perm($user, $group, 0$tmode, \"$path\");"
fi
fi
fi
[ $lm -eq 15 ] && lm=0
fi
line_nr=$(($line_nr + 1))
done < log.log > META-INF/com/google/updater-script
[Sony Cross-Device General] serajr:
Mate this is insane and absolutely fantastic. updater-script beautifully generated with more than 6k lines on less than 20 secs, also every perm/symlink... wow!

Tool is on its right track, and could not be on better hands!!