ok, there is definately a problem with the user context of shell execution
to compensate to the lack of file access, i tried to put directly the content of the shell script in the task instead of calling it through the sh command
and it fails on writing on a file which i have rights over
TASKER (without root flag) :
ls -l /sys/class/leds/yellow/blink
-> -rw-rw-rw- root root 4096 2017-10-07 12:15 blink
echo 255 >/sys/class/leds/yellow/blink
-> fail sh: <stdin>[2]: can't create /sys/class/leds/yellow/blink: Permission denied
so i check the user :
id
echo "shell is ${SHELL:-undef}"
-> uid=10148(u0_a148) gid=10148(u0_a148) groups=10148(u0_a148), 3001(net_bt_admin),3002(net bt),3003(inet),9997(everybody),50148(all_a148) context=u:r:untrusted_app:s0:c512,c768
shell is undefined
ADB SHELL :
ps | grep tasker
-> u0_a148 30811 753 2156340 163428 SyS_epoll_ 0000000000 S net.dinglisch.android.taskerm
su - u0_a148
->ok
ls -l /sys/class/leds/yellow/blink
-> -rw-rw-rw- root root 4096 2017-10-07 12:15 blink
echo 255 >/sys/class/leds/yellow/blink
-> OK the led is blinking as what i expect from beginning
id
echo "shell is ${SHELL:-undef}"
-> uid=10148(u0_a148) gid=10148(u0_a148) groups=10148(u0_a148) context=u:r:su:s0
shell is /system/bin/sh
why so much differences between the two environments ? and why so much restrictions for tasker environment ?
i even tried in tasker
su - u0_a148
but it grant root permission (root manager display the "root perm was given to your app" ) WITHOUT the root flag checked in the task
i fear there's little hope for me to run things from tasker with a non-root normally permissive user/environment, so my only hope is to find a way for a permanent global root permission if possible.... but how to do this ?