long, random ideas!
@ticky ooh! this is a tricky one. my first thought is pretty messy, but maybe pieces of it might be usable~
so, shizuku uses the same permission as tasker's adb wifi in order to do privileged actions, which means you can actually use tasker to shut down your stuff too! (it's the "restart" action set to "shutdown")
that doesn't get around the reboot permission issue of course--it just means you might need one fewer puzzle piece to get what you're hoping for
as for the adb permission reset on reboot; save for attaching a pi zero to your quest to accept adb connections, i feel like your best bet probably is to find a way to get autoinput, unfortunately (but i could give you the tasker author's email if you wanted to try that!)
that said, if you don't wanna do that, and are okay with possibly a lot of extra work, another option could be to grab a wireless mouse/keyboard app, sniff its traffic, and then just replay it to simulate the input to shut down maybe? if you can't find any of those, vnc servers or other remote access apps may work too
if you grab a capture from one of those, it might literally only be a matter of redirecting the input file into netcat pointed at localhost in termux
if you find you need to manually start something like this on boot, you could start the activity from tasker on boot--or run apktool d --force-manifest
on the app apk to extract the manifest xml and see what intents you can use to poke at it to script it to start
if you don't want to need to simulate input for all privileged actions, and just want the adb permission on boot, you could also create a set of inputs to enable adb over wifi in dev settings and to screenshot the qr code it tells you to connect with
if you trigger an action like this with an intent from termux:boot (intents can be sent from termux with "am broadcast --user 0 -a net.dinglish.tasker.enable-adb-plz
" or something similar), you can make the script wait for a screenshot to pop up, decode the qr with zbarimg
or something similar, and then use that info to establish a local adb connection
that way, you could just use a normal adb command later with termux:tasker when you want to do something more privileged in general (of course, including shutting down without needing to rely on the existence of any external input at all)
that said, this still relies on still finding an app that would let you script/intercept input
if you can't find any of those, while it's only a slight step-up from having a pi zero, an inputstick might also do the trick since you could use it to script keyboard and mouse inputs to be sent through an actual usb input that looks indistinguishable from using the actual hardware, so it would be guaranteed to do anything you could with an actual keyboard and mouse (and as a bonus, they are also just generally useful for keepass2android reasons if you use that on another phone and need to type a 256 character random password into the nintendo switch or something)