termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.24k stars 3.04k forks source link

am command not working with tsu binary #5282

Closed BEACHEADVN closed 4 years ago

BEACHEADVN commented 4 years ago

Problem description I run am command in Termux •Code: $ am (it work) Or $ su :/data/data/com.termux/files/home # am (it work) But $ tsu am (it not work)

Additional information •android 10 •security path 2020-04-05 •device: Mi5s •OS: Havoc

Grimler91 commented 4 years ago

What error do you get?

basilgello commented 4 years ago

tsu has been seriously overhauled recently. The move from v2.3 to v8.2 broke -c flag in favor or sudo:

sudo am ...

Also environment variables HOME, TERM and LD_LIBRARY_PATH are set by tsu / sudo.

Grimler91 commented 4 years ago

Here's the upstream tsu issue: https://github.com/cswl/tsu/issues/59

BEACHEADVN commented 4 years ago

Thank you.

BEACHEADVN commented 4 years ago

Will this error be fixed soon?

cswl commented 4 years ago

Well tsu doesn't pass the whole stuff with --preserve-environment anymore..

This behaviour lines with linux su where you actually switch user including home dir..
You can also run one off single commands with sudo now... and it preserves PATH and adds SUDO_ env variables...

Should mention this one help...or write a man page ..

I also didnt include /system/**/bin but since the issue it brings is only relevant on LD_LIBRARY_PATH.. I could add it back on LD_PRELOAD ..

Also @Grimler91 do you know how to get fresh environment variables in Termux.. before Termux adds it own?

ghost commented 4 years ago

Termux constructs environment from scratch, you can't get "fresh" variables.

cswl commented 4 years ago

Well this is what I got on adb shell env .. Most stuff looks static..and CLASSPATH is already added..

_=/system/bin/env
ANDROID_DATA=/data
LOGNAME=shell
HOME=/
ENC_EMULATED_STORAGE_TARGET=/storage/enc_emulated
TERM=xterm-256color
SHELL=/system/bin/sh
ANDROID_BOOTLOGO=1
ANDROID_ASSETS=/system/app
BOOTCLASSPATH=/     ##omitted for breverity
ASEC_MOUNTPOINT=/mnt/asec
MC_AUTH_TOKEN_PATH=/efs
ANDROID_SOCKET_adbd=13
HOSTNAME=localhost
EXTERNAL_STORAGE=/sdcard
ANDROID_STORAGE=/storage
USER=shell
TMPDIR=/data/local/tmp
PATH=/sbin:/system/sbin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin
SYSTEMSERVERCLASSPATH=/system/framework/services.jar:/system/framework/ethernet-service.jar:/system/framework/wifi-service.jar:/system/framework/com.android.location.provider.jar:/system/framework/hqm.jar:/system/framework/hcm.jar
ANDROID_ROOT=/system
DOWNLOAD_CACHE=/data/cache
Grimler91 commented 4 years ago

@BEACHEADVN Does tsu work as expected after upgrading to 8.5.1?

BEACHEADVN commented 4 years ago

@BEACHEADVN Does tsu work as expected after upgrading to 8.5.1?

No, tsu (8.5.1-1) not work.

cswl commented 4 years ago

Strange.. can you open a issue in https://github.com/cswl/tsu With tsu --dbg output..

@BEACHEADVN Does tsu work as expected after upgrading to 8.5.1?

No, tsu (8.5.1-1) not work.

BEACHEADVN commented 4 years ago

Strange.. can you open a issue in https://github.com/cswl/tsu With tsu --dbg output..

@BEACHEADVN Does tsu work as expected after upgrading to 8.5.1?

No, tsu (8.5.1-1) not work.

Does anyone have this problem besides me? maybe I edited the rom so I got the error. Do you still want to check for errors?