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

termux-api features hangs on Android 11 when executed from ssh session #109

Open
txoof opened this issue Sep 9, 2020 · 2 comments
Open

Comments

@txoof
Copy link
Sponsor

txoof commented Sep 9, 2020

Problem description
Termux-API implementations hang on execution under Android 11 and do not complete when executed from ssh process

Steps to reproduce
start ssh service:

#!/data/data/com.termux/files/usr/bin/bash
termux-wake-lock
/data/data/com.termux/files/usr/bin/sshd &

ssh to termux device
execute on remote remote host

ssh -p 8022 termux@XXX.XXX.XXX.XXX

from within ssh session
Execute any termux-api command:

$ termux-wifi-connectioninfo
>> no output
$ termux-battery-status
>> no output
$ termux-call-log
>> no output
$ termux-battery-status -h
Usage: termux-battery-status
Get the status of the device battery.

The executables do appear to work when executed from the ssh session and do not crash -- executing them with the -h option produces output as expected.

Expected behavior
Expect to see output from API process

Additional information

$ termux-info                                                       (master) ✗
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://main.termux-mirror.ml/ stable main
# game-repo (sources.list.d/game.list)
deb https://dl.bintray.com/grimler/game-packages-24 games stable
# science-repo (sources.list.d/science.list)
deb https://dl.bintray.com/grimler/science-packages-24 science stable
Updatable packages:
All packages up to date
Android version:
11
Kernel build information:
Linux localhost 4.9.223-g5bded8e40b62-ab6647920 #0 SMP PREEMPT Thu Jul 2 03:22:48 UTC 2020 aarch64 Android

If you are rooted or have access to adb then capture a logcat with logcat -d "*:W", from a adb or root shell.
I am not rooted - Stock android 11 on a Google Pixel 3

@txoof
Copy link
Sponsor Author

txoof commented Sep 9, 2020

When run from the device, and not over SSH, termux-wifi-connectioninfo was returning

"ssid": "<unknown ssid>"

from the device, I executed
$ termux-wifi-scaninfo
and was prompted to permit Termux access to location data by Android 11 - I gave the app permissoin "all the time" and now
termux-wifi-connecitioninfo returns the proper SSID information as expected.

Perhaps this is a permissions issue?

@termux termux deleted a comment Jun 10, 2021
@0Karakurt0
Copy link

Try unlocking your phone, or even just turning on the screen.
I noticed slowdowns and hangups while working with filesystem, but method above worked for me.
Wakelock may be helpful too

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

No branches or pull requests

2 participants