Closed JiriKalvoda closed 1 year ago
As a workaround, you can get the Termux user id by using echo $UID
in a normal Termux shell and use proot-distro login
with the --user
option to essentially pass the UID though into proot. You could even make that one command with proot-distro login --user $(echo $UID)
.
I made the branch uid-env to fix this, but I can't test this right now, because I can't get a distro that has a new enough python version to work in my x86_64 android emulator.
You can test it if you want, use python3 -m build
to build it.
The env variable TGUI_PY_UID
can contain an alternative UID to check against, and the library displays a warning if this is the case. TGUI_PY_UID_NOWARN
can be set to any value to suppress the warning.
I found that alpine also has python 3.10 and tested it, but for me the am
command the library uses always segfaults, so the plugin doesn't connect.
I have some issues with build the package (but I thing is is bug in proot /tmp
dir emulation (or capacity?))
I replace the only edited file direct in /usr/lib/python3.10/site-packages/termuxgui/
and everithing working correctly (as is documented in README) with only one small bug: it pront the warning twice:
jiri@samet:~/termux-gui-python-bindings/tutorial(uid-env)$ TGUI_PY_UID=10343 python helloworld.py
WARNING: Socket UID to check taken from environment variable TGUI_PY_UID
Set TGUI_PY_UID_NOWARN to suppress this message.
WARNING: Socket UID to check taken from environment variable TGUI_PY_UID
Set TGUI_PY_UID_NOWARN to suppress this message.
Than you for very quick fix.
Ah, it's printed twice because the UID is checked for 2 sockets. But that shouldn't really be a problem. Does suppressing the warning work?
But that shouldn't really be a problem.
Yes, it is not problem.
Does suppressing the warning work?
Yes, suppressing is working well.
Solved long time ago.
I would like to use termux-gui from arch linux running in proot in Termux. However there is some problem with UID checking of connection socket.
More precisely. Function
_check_user
in begin ofconnection.py
file don't working properly. Value ofgetuid()
refer to current user of arch in proot, but socket uid is uid of android user (Termux application). The rest of application (the part I try) work very good even behind proot.Maybe easy fix of this problem will be adding some possibility how to tell what is right UID of Termmux app (for example thought environment variables).