[Sony Cross-Device General] serajr:
Thank you bro!

Trying to take a step forward to help you out, after fixing the denial you mentioned, I got some more ones, as you can see below:

[U]dmesg 1:[/U]
audit(21047906.409:6): avc: denied { write } for pid=480 comm="busybox" name="tmp" dev="mmcblk0p54" ino=587522 scontext=u:r:init:s0 tcontext=u:object_r:shell_data_file:s0 tclass=dir permissive=0 ppid=479 pcomm="ta" pgid=479 pgcomm="ta"

[U]dmesg 2:[/U]
audit(21051784.369:5): avc: denied { add_name } for pid=477 comm="busybox" name="TA.img" scontext=u:r:init:s0 tcontext=u:object_r:shell_data_file:s0 tclass=dir permissive=0 ppid=476 pcomm="ta" pgid=476 pgcomm="ta"

[U]dmesg 3:[/U]
audit(21052295.439:5): avc: denied { create } for pid=476 comm="busybox" name="TA.img" scontext=u:r:init:s0 tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0 ppid=475 pcomm="ta" pgid=475 pgcomm="ta"

[U]dmesg 4:[/U]
audit(21052640.409:5): avc: denied { write open } for pid=478 comm="busybox" path="/data/local/tmp/TA.img" dev="mmcblk0p54" ino=587523 scontext=u:r:init:s0 tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0 ppid=477 pcomm="ta" pgid=477 pgcomm="ta"
audit(21052640.409:6): avc: denied { remove_name } for pid=478 comm="busybox" name="TA.img" dev="mmcblk0p54" ino=587523 scontext=u:r:init:s0 tcontext=u:object_r:shell_data_file:s0 tclass=dir permissive=0 ppid=477 pcomm="ta" pgid=477 pgcomm="ta"
audit(21052640.409:7): avc: denied { setattr } for pid=479 comm="busybox" name="TA.img" dev="mmcblk0p54" ino=587523 scontext=u:r:init:s0 tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0 ppid=477 pcomm="ta" pgid=477 pgcomm="ta"
audit(21052640.409:8): avc: denied { setattr } for pid=480 comm="busybox" name="TA.img" dev="mmcblk0p54" ino=587523 scontext=u:r:init:s0 tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0 ppid=477 pcomm="ta" pgid=477 pgcomm="ta"

[U]dmesg 5:[/U]
audit(21053067.509:5): avc: denied { ioctl } for pid=628 comm="tad_static" path="/data/local/tmp/TA.img" dev="mmcblk0p54" ino=587523 ioctlcmd=1260 scontext=u:r:tad:s0 tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0 ppid=1 pcomm="init" pgid=1 pgcomm="init"

I've fixed them one-by-one, by adding the blue lines/words into the script:

if [ ! -z $SEPOLICY ]; then
ui_print "\nfound $SEPOLICY"
ui_print "patching $SEPOLICY"
if ! $POC init rootfs file relabelfrom,relabelto,create,write,unlink,setattr,execute_no_trans $SEPOLICY $SEPOLICY NULL ; then exit 1 ; fi
if ! $POC init tad file relabelto,execute $SEPOLICY $SEPOLICY NULL ; then exit 1 ; fi
if ! $POC tad tad capability dac_override $SEPOLICY $SEPOLICY NULL ; then exit 1 ; fi
if ! $POC tad rootfs filesystem associate $SEPOLICY $SEPOLICY NULL ; then exit 1 ; fi
if ! $POC tad rootfs file execute,execute_no_trans $SEPOLICY $SEPOLICY NULL ; then exit 1 ; fi
if ! $POC tad shell_data_file dir getattr,search,write,add_name $SEPOLICY $SEPOLICY NULL ; then exit 1 ; fi

if ! $POC tad shell_data_file file getattr,setattr,create,open,write,read[B][COLOR="Blue"],ioctl[/COLOR][/B] $SEPOLICY $SEPOLICY NULL ; then exit 1 ; fi

if ! $POC tad sysfs file getattr,open,read $SEPOLICY $SEPOLICY NULL ; then exit 1 ; fi
if ! $POC kernel tad fd use $SEPOLICY $SEPOLICY NULL ; then exit 1 ; fi
if ! $POC kernel shell_data_file file getattr,setattr,open,write,read $SEPOLICY $SEPOLICY NULL ; then exit 1 ; fi

[COLOR="Blue"][B]if ! $POC init shell_data_file dir write,add_name,remove_name $SEPOLICY $SEPOLICY NULL ; then exit 1 ; fi
if ! $POC init shell_data_file file create,write,open,setattr $SEPOLICY $SEPOLICY NULL ; then exit 1 ; fi[/B][/COLOR]

else
ui_print "\nError, no sepolicy!"
exit 1
fi

TA.img copied SUCCESSFULLY and everything working flawlessly :highfive:

dmesg after all fixes above (just in case)