Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for AOSP su (without -c argument) #79

Open
wants to merge 15 commits into
base: v8
Choose a base branch
from
Open

Conversation

vgavro
Copy link

@vgavro vgavro commented May 20, 2021

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

@vgavro
Copy link
Author

vgavro commented May 20, 2021

related to #72

vgavro added 5 commits May 20, 2021 14:19
…t if prepend is not set); fixed bug with not adding android sys path in tsu and ignoring both -p/-a options (it was depended on LD_LIBRARY_PATH for some reason... - looks like misprint while adding some LD_LIBRARY_PATH logic); (possibly both related to pull#63); creating TMPDIR (merged pull#75); aosp su: fixed reseting PATH inside su
@vgavro
Copy link
Author

vgavro commented May 21, 2021

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-helper will 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 Fix -a being ignored #63
  • -a option is just unnecessary - it's set by default anyway (if prepend was not requested)
  • added /vendor/bin to 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 Create TMPDIR if it does not exist #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/.tmp should 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 error PATH=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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant