tsu
tsu copied to clipboard
Support for AOSP su (without -c argument)
AOSP "su" version never had "-c" flag option, like I see from sources.
I tried not to break compatibility with previous tsu version, while trying to determine AOSP su by --help, or (in case for older android versions) you may explicitly set it like SU_AOSP=1 sudo id
related to https://github.com/cswl/tsu/issues/72
Besides adding support for aosp su binaries - there are plenty fixes I found which I had to fix, sorry for this LARGE pull request... I hope it could be merged to upstream anyway...
- ./scripts/tadb was outdated and not functional - replaced it with
./scripts/adb-termux; it will be good if./scripts/adb-termux-helperwill be included in termux "tsu" package.. @Grimler91 - setting empty LD_PRELOAD breaks my system with linking errors - so setting LD_PRELOAD only if it was already set before;
- tsu added ONLY termux path but no android system path at all, even with -p/-a options - obviously this was error on adding new LD_LIBRARY_PATH logic (PATH was empty if LD_LIBRARY_PATH was set - or this was really intentional?) related to #63
-
-aoption is just unnecessary - it's set by default anyway (if prepend was not requested) - added
/vendor/binto extra syspath - added extra check if /sbin/su exists - not to get error in stderr that binary not exists on trying to check it version
- merged #75
- hope haven't broke anything besides
TODO/NOTES:
- I don't like ~/.suroot home name - maybe it should be named ~/.tsu for consistency, maybe even ~/.termux/tsu. Better if we have less unique names that you should remember...
- I don't see why
~/.termux/tsu/.tmpshould be prepended with. - calling
su -c PATH=x env VARIABLE=y CMD- like I understand - made for cases when we need to find "env" binary? This fails on my aosp su with errorPATH=x executable not found(so I changed it only for aosp) - but I guess PATH=x should be moved after env for other su versions. - Please - review ./scripts/adb-termux-helper variables - I guess most of them are useless.
My proposition - to release next major version (9.0) and rename .suroot to .tsu.
Thanks for you time!