termux / termux-packages

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

[Bug]: Termux-API `termux-clipboard-get` / `termux-clipboard-set` not working #18746

Closed AntonPieper closed 9 months ago

AntonPieper commented 10 months ago

Problem description

The teemux-clipboard-get and termux-clipboard-set commands hang forever. They do not return. I have already tried the fix on #16411 (chmod 400 $PREFIX/libexec/termux-am/am.apk), but since the newest Android 14 update, this did not work for me.

What steps will reproduce the bug?

Run the newest version of android 14 and then run (after installing Termux:API and termux-api):

termux-clipboard-get

What is the expected behavior?

It should not hang and get / set the clipboard.

System information

termux-info:

Termux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=17353
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://mirror.sjtu.edu.cn/termux/termux-main/ stable main
# x11-repo (sources.list.d/x11.list)
deb https://mirror.sjtu.edu.cn/termux/termux-x11/ x11 main
Updatable packages:
All packages up to date
termux-tools version:
1.39.6
Android version:
14
Kernel build information:
Linux localhost 5.10.177-android13-4-00003-ga7208022a7ea-ab10815828 #1 SMP PREEMPT Fri Sep 15 16:40:54 UTC 2023 aarch64 Android
Device manufacturer:
Google
Device model:
Pixel 7 Pro
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.api versionCode:51
com.termux.styling versionCode:31
alexfarseer commented 10 months ago

Yeah, everyone is having this problem after the December security patch for Android 14. But I managed to find a workaround. Get the latest build of Termux-API from here: https://github.com/termux/termux-api/actions/runs/6717239830

That build will only work with the GitHub version of Termux. And use termux-api-start. That will start the keep alive service and api commands will not hang anymore.

More details here: https://github.com/termux/termux-api/issues/638#issuecomment-1846747826

Ghulammustafanoon commented 10 months ago

Helo i ned termux whatsapp command plz tell.me 93134828122my nbr

licy183 commented 9 months ago

Hello. I've noticed that the linked issue in termux-api is fixed now. So is this issue also fixed?

Ping @2096779623 I don't have an Android 14 device. Could you please test this?

agnostic-apollo commented 9 months ago

Closed as per https://github.com/termux/termux-api/issues/638#issuecomment-1868383070

2096779623 commented 9 months ago

Hello. I've noticed that the linked issue in termux-api is fixed now. So is this issue also fixed?

Ping @2096779623 I don't have an Android 14 device. Could you please test this?

~ $ termux-api-start
Starting service: Intent { cmp=com.termux.api/.KeepAliveService }
~ $ termux-clipboard-set a
~ $ time termux-clipboard-set a

real    0m0.238s
user    0m0.011s
sys     0m0.012s
~ $ time termux-clipboard-get
a
real    0m0.458s
user    0m0.016s
sys     0m0.009s
Installed termux plugins:
com.termux.api versionCode:51