nohajc / termux-adb

Run adb in Termux without root permissions!
MIT License
311 stars 32 forks source link

Adb server cannot start #3

Closed NHdut closed 1 year ago

NHdut commented 1 year ago

How to fix air? Please help

~ $ ./termux-adb cannot connect to daemon at tcp:5037: Connection refused error: adb server didn't start, check the log: /data/data/com.termux/files/usr/tmp/adb.10233.log

nohajc commented 1 year ago

Hi, I need more information.

Please re-run with RUST_LOG=debug ./termux-adb and provide contents of /data/data/com.termux/files/usr/tmp/adb.10233.log and /data/data/com.termux/files/usr/tmp/termux-adb.10233.log.

Also the output of pkg show android-tools and adb version.

NHdut commented 1 year ago

This sir.

~ $ adb --version Android Debug Bridge version 1.0.41 Version 31.0.3p1-android-tools Installed as /data/data/com.termux/files/usr/bin/adb

~ $ pkg show android-tools Package: android-tools Version: 31.0.3p1-7 Maintainer: @termux Installed-Size: 7786 kB Depends: brotli, libc++, liblz4, libprotobuf, libusb, zlib, zstdHomepage: https://developer.android.com/ Download-Size: 1368 kB APT-Manual-Installed: yes APT-Sources: https://mirrors.hit.edu.cn/termux/apt/termux-main stable/main aarch64 Packages Description: Android platform tools

NHdut commented 1 year ago

Screenshot_20221128-214610 And this log from /data/data/com.termux/files/usr/tmp/termux-adb.10232.log

No log from /adb. 10232

nohajc commented 1 year ago

Try with cat instead of logcat. Logcat always displays Android logs (not the file you pass as a command-line argument).

Or better yet, copy the log file from your phone and open it in a normal text editor. It might be longer with the debug verbosity.

Thanks.

NHdut commented 1 year ago

Screenshot_20221129-005758

I'm sorry sir, i'm a beginner. This is the contents of the log.
This is all I got

nohajc commented 1 year ago

It's ok. There really isn't much in you case though. That means the program must have crashed pretty early.

Can you tell me which device you use and the Android version? If there's a chance I can replicate the problem, I could get more information. Or maybe I can prepare a custom debug build...

Btw, just as a sanity check: If you run adb start-server normally without termux-adb, does it start successfully?

NHdut commented 1 year ago

I use devices sony xperia XZ3 with android 10. Ok sir, thanks you. Yes sir, it runs without termux-adb. In my devices sony xperia XZ, termux-adb its running with android 8.

nohajc commented 1 year ago

Thank you for the information!

It may take some time before I get back to you. I'm thinking about couple of possibilities, one of which is a redesign of termux-adb actually.

I suspected my initial approach might prove a bit fragile. It seems I cannot really predict how it will behave on different devices.

Anyway, there is one last thing you can try that could be useful. See if there's any difference when you run termux-adb without any connected devices. In case it starts, you can connect the device later. It should get auto-detected.

NHdut commented 1 year ago

Thanks before, but No problem sir, don't work too hard.

I have tried it and the result is the same sir.

VovkaSOL commented 1 year ago

Hi, thanks @nohajc for wonderful project, i have same problem with same versions $ adb --version Android Debug Bridge version 1.0.41 Version 31.0.3p1-android-tools Installed as /data/data/com.termux/files/usr/bin/adb ~ $ pkg show android-tools Package: android-tools Version: 31.0.3p1-7

RUST_LOG=debug ./termux-adb cannot connect to daemon at tcp:5037: Connection refused error: adb server didn't start, check the log: /data/data/com.termux/files/usr/tmp/adb.10188.log$ cat /data/data/com.termux/files/usr/tmp/termux-adb.10188.log cannot connect to daemon at tcp:5037: Connection$ RUST_LOG=debug ./termux-adb cannot connect to daemon at tcp:5037: Connection refused

if i see logcat, i see error msg: 12-01 10:31:27.960 11900 11900 F linker : CANNOT LINK EXECUTABLE "./termux-adb": "/data/data/com.termux/files/usr/lib/libtermux-exec.so" is 64-bit instead of 32-bit but i have 64 bit device and download termux-adb-v0.1.4-aarch64.tar.gz 64 bit binaries.

But if i run with 32 bit archive https://github.com/nohajc/termux-adb/releases/download/v0.1.4/termux-adb-v0.1.4-armv7.tar.gz $ ./termux-adb CANNOT LINK EXECUTABLE "./termux-adb": "/data/data/com.termux/files/usr/lib/libtermux-exec.so" is 64-bit instead of 32-bit is see this error msg in termux terminal (instead logcat)

my phone is (adb getprop):

May be this information help you

nohajc commented 1 year ago

Hi, if you run file libadbhooks.so and compare it to file $(which adb), does it say 64-bit in both cases?

Anyway, if you tried both 32 and 64, it might be a problem with the Termux installation. I saw there were some reports with the same error message concerning libtermux-exec.so in the past.

VovkaSOL commented 1 year ago

@nohajc

file libadbhooks.so libadbhooks.so: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, with debug_info, not stripped

file $(which adb) /data/data/com.termux/files/usr/bin/adb: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /system/bin/linker64, stripped

in termux lib dir: file libtermux-exec.so libtermux-exec.so: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, stripped

all files 64 bit

but logcat msg: CANNOT LINK EXECUTABLE "./termux-adb": "/data/data/com.termux/files/usr/lib/libtermux-exec.so" is 64-bit instead of 32-bit 12-01 12:49:58.137 24914 24914 F linker : CANNOT LINK EXECUTABLE "./termux-adb": "/data/data/com.termux/files/usr/lib/libtermux-exec.so" is 64-bit instead of 32-bit 12-01 15:07:10.237 6772 6772 F linker : CANNOT LINK EXECUTABLE "./termux-adb": "/data/data/com.termux/files/usr/lib/libtermux-exec.so" is 64-bit instead of 32-bit 12-01 15:07:54.979 6850 6850 F linker : CANNOT LINK EXECUTABLE "./termux-adb": "/data/data/com.termux/files/usr/lib/libtermux-exec.so" is 64-bit instead of 32-bit

error same: ./termux-adb cannot connect to daemon at tcp:5037: Connection refused

Termux downloaded from google play

nohajc commented 1 year ago

Ok, from what I can find, libtermux-exec is a package which solves compatibility of shell script shebangs (e.g. #!/bin/sh) on Android. It uses library injection to do that. My project also uses library injection so there could be some unexpected interference.

Can you try what happens if you run the following with the 64-bit release? LD_PRELOAD="" ./termux-adb

Oh, anyway, Termux from Google Play is deprecated as far as I know. I don't even know if you can make it work with the Termux API extension which is also a requirement.

Try Termux from F-Droid if you can. I only ever tested with that version. I should probably update the README.

VovkaSOL commented 1 year ago

after reinstall Termux from f-droid i can't see errors in logcat, logcat msg: 12-02 10:36:42.428 19917 19917 W bash : type=1400 audit(0.0:2766): avc: granted { execute } for name="termux-adb" dev="sdc40" ino=5152900 scontext=u:r:untrusted_app_27:s0:c5,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c5,c257,c512,c768 tclass=file 12-02 10:36:42.432 19917 19917 W termux-adb: type=1400 audit(0.0:2770): avc: granted { execute } for path="/data/data/com.termux/files/usr/lib/libtermux-exec.so" dev="sdc40" ino=5137759 scontext=u:r:untrusted_app_27:s0:c5,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c5,c257,c512,c768 tclass=file 12-02 10:36:42.440 19917 19917 W termux-adb: type=1400 audit(0.0:2771): avc: granted { execute } for name="adb" dev="sdc40" ino=5140861 scontext=u:r:untrusted_app_27:s0:c5,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c5,c257,c512,c768 tclass=file 12-02 10:36:42.440 19917 19917 W termux-adb: type=1400 audit(0.0:2772): avc: granted { execute } for name="termux-usb" dev="sdc40" ino=5141213 scontext=u:r:untrusted_app_27:s0:c5,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c5,c257,c512,c768 tclass=file 12-02 10:36:42.446 540 2592 I BufferQueueProducer: com.termux/com.termux.app.TermuxActivity#0 queueBuffer: fps=16.40 dur=1158.63 max=621.26 min=13.46 12-02 10:36:42.444 19920 19920 W termux-adb: type=1400 audit(0.0:2773): avc: granted { execute } for name="adb" dev="sdc40" ino=5140861 scontext=u:r:untrusted_app_27:s0:c5,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c5,c257,c512,c768 tclass=file

but server not work: RUST_LOG=debug ./termux-adb cannot connect to daemon at tcp:5037: Connection refused error: adb server didn't start, check the log: /data/data/com.termux/files/usr/tmp/adb.10261.log ~ $ RUST_LOG=debug ./termux-adb cannot connect to daemon at tcp:5037: Connection refused error: adb server didn't start, check the log: /data/data/com.termux/files/usr/tmp/adb.10261.log ~ $ cat /data/data/com.termux/files/usr/tmp/termux-adb.10261.log cannot connect to daemon at tcp:5037: Connection refused

if i start adb start-server

but adb devices empty when i connected 2 phones Dogee S88(Termux) and Xiaomix Poco X3 (adb debug on)

cat adb.10261.log --- adb starting (pid 18950) --- adb I 12-02 10:26:31 18950 18950 main.cpp:63] Android Debug Bridge version 1.0.41 adb I 12-02 10:26:31 18950 18950 main.cpp:63] Version 31.0.3p1-android-tools adb I 12-02 10:26:31 18950 18950 main.cpp:63] Installed as /data/data/com.termux/files/usr/bin/adb adb I 12-02 10:26:31 18950 18950 main.cpp:63] adb I 12-02 10:26:31 18950 18950 auth.cpp:417] adb_auth_init... adb I 12-02 10:26:31 18950 18950 auth.cpp:220] User key '/data/data/com.termux/files/home/.android/adbkey' does not exist... adb I 12-02 10:26:31 18950 18950 auth.cpp:64] generate_key(/data/data/com.termux/files/home/.android/adbkey)... adb I 12-02 10:26:31 18950 18950 auth.cpp:152] loaded new key from '/data/data/com.termux/files/home/.android/adbkey' with fingerprint 7FB598F316748E96D03897B708EFE685CBC397608D5D5FB18EEB11D02330AE82 adb I 12-02 10:26:31 18950 18950 auth.cpp:392] adb_auth_inotify_init... adb server killed by remote request --- adb starting (pid 20050) --- adb I 12-02 10:41:01 20050 20050 main.cpp:63] Android Debug Bridge version 1.0.41 adb I 12-02 10:41:01 20050 20050 main.cpp:63] Version 31.0.3p1-android-tools adb I 12-02 10:41:01 20050 20050 main.cpp:63] Installed as /data/data/com.termux/files/usr/bin/adb adb I 12-02 10:41:01 20050 20050 main.cpp:63] adb I 12-02 10:41:01 20050 20050 auth.cpp:417] adb_auth_init... adb I 12-02 10:41:01 20050 20050 auth.cpp:152] loaded new key from '/data/data/com.termux/files/home/.android/adbkey' with fingerprint 7FB598F316748E96D03897B708EFE685CBC397608D5D5FB18EEB11D02330AE82 adb I 12-02 10:41:01 20050 20050 auth.cpp:392] adb_auth_inotify_init...

VovkaSOL commented 1 year ago

when i connect xiaomi to PC i see notification and accept key, but if i connect Xiaomi to Termux Phone i can't see notification with key

nohajc commented 1 year ago

Thanks for all the information. It already looks like this issue is quite common. I'm not sure about the exact cause but there is a way to make my code more reliable and possibly eliminate problems like this.

I plan to work on a redesign over the holidays so let's see...

nohajc commented 1 year ago

Hi all, I released a major update today. Can you check if it fixes the issue with adb server start? Thanks!

https://github.com/nohajc/termux-adb/releases/tag/v0.2.0

VovkaSOL commented 1 year ago

Hi friend, good job, but i can't install new release. After install termux and termux api from fdroid i run:

~ $ curl -s https://raw.githubusercontent.com/nohajc/termux-adb/master/install.sh | bash Get:1 https://packages.termux.dev/apt/termux-main stable InRelease [14.0 kB] Get:2 https://packages.termux.dev/apt/termux-main stable/main aarch64 Packages [479 kB] Fetched 493 kB in 2s (213 kB/s) Reading package lists... Done Reading package lists... Done Building dependency tree... Done Calculating upgrade... Done The following packages have been kept back: bash dpkg The following packages will be upgraded: apt ca-certificates command-not-found coreutils curl dash debianutils dialog dos2unix ed findutils gawk gpgv grep gzip inetutils less libandroid-support libc++ libcap-ng libcrypt libcurl libevent libexpat libgcrypt libgmp libgnutls libgpg-error libiconv libidn2 liblz4 liblzma libmpfr libnettle libnghttp2 libssh2 libtirpc libunistring lsof nano ncurses openssl pcre2 procps psmisc readline sed tar termux-am-socket termux-exec termux-keyring termux-licenses termux-tools unbound unzip util-linux xz-utils zlib 58 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. Need to get 15.6 MB of archives. After this operation, 4813 kB of additional disk space will be used. Get:1 https://packages.termux.dev/apt/termux-main stable/main aarch64 libiconv aarch64 1.17 [556 kB] Get:2 https://packages.termux.dev/apt/termux-main stable/main aarch64 libandroid-support aarch64 28-3 [10.9 kB] Get:3 https://packages.termux.org/apt/termux-main stable/main aarch64 libc++ aarch64 25b [221 kB] Get:4 https://packages.termux.dev/apt/termux-main stable/main aarch64 libgmp aarch64 6.2.1-2 [320 kB] Get:5 https://packages.termux.dev/apt/termux-main stable/main aarch64 coreutils aarch64 9.1-2 [739 kB] Get:6 https://packages.termux.dev/apt/termux-main stable/main aarch64 findutils aarch64 4.9.0-2 [241 kB] Get:7 https://packages.termux.dev/apt/termux-main stable/main aarch64 libgpg-error aarch64 1.46 [106 kB] Get:8 https://packages.termux.dev/apt/termux-main stable/main aarch64 libgcrypt aarch64 1.10.1-1 [427 kB] Get:9 https://packages.termux.dev/apt/termux-main stable/main aarch64 zlib aarch64 1.2.13 [60.1 kB] Get:10 https://packages.termux.dev/apt/termux-main stable/main aarch64 gpgv aarch64 2.4.0 [175 kB] Get:11 https://packages.termux.dev/apt/termux-main stable/main aarch64 pcre2 aarch64 10.42 [856 kB] Get:12 https://packages.termux.dev/apt/termux-main stable/main aarch64 grep aarch64 3.8-1 [122 kB] Get:13 https://packages.termux.dev/apt/termux-main stable/main aarch64 ca-certificates all 1:2022.10.11-1 [121 kB] Get:14 https://packages.termux.dev/apt/termux-main stable/main aarch64 openssl aarch64 1:3.0.7 [1575 kB] Get:15 https://packages.termux.dev/apt/termux-main stable/main aarch64 libcurl aarch64 7.87.0 [964 kB] Get:16 https://packages.termux.dev/apt/termux-main stable/main aarch64 curl aarch64 7.87.0 [185 kB] Get:17 https://packages.termux.dev/apt/termux-main stable/main aarch64 libnghttp2 aarch64 1.51.0 [96.0 kB] Get:18 https://packages.termux.dev/apt/termux-main stable/main aarch64 libssh2 aarch64 1.10.0-2 [182 kB] Get:19 https://packages.termux.dev/apt/termux-main stable/main aarch64 libnettle aarch64 3.8.1 [391 kB] Get:20 https://packages.termux.dev/apt/termux-main stable/main aarch64 libunistring aarch64 1.1 [521 kB] Get:21 https://packages.termux.dev/apt/termux-main stable/main aarch64 libidn2 aarch64 2.3.4 [103 kB] Get:22 https://packages.termux.dev/apt/termux-main stable/main aarch64 libevent aarch64 2.1.12-2 [199 kB] Get:23 https://packages.termux.dev/apt/termux-main stable/main aarch64 libexpat aarch64 2.5.0 [81.7 kB] Get:24 https://packages.termux.dev/apt/termux-main stable/main aarch64 unbound aarch64 1.17.0 [604 kB] Get:25 https://packages.termux.dev/apt/termux-main stable/main aarch64 libgnutls aarch64 3.7.8 [690 kB] Get:26 https://packages.termux.dev/apt/termux-main stable/main aarch64 liblz4 aarch64 1.9.4 [85.5 kB] Get:27 https://packages.termux.dev/apt/termux-main stable/main aarch64 liblzma aarch64 5.4.0 [177 kB] Get:28 https://packages.termux.dev/apt/termux-main stable/main aarch64 xz-utils aarch64 5.4.0 [63.3 kB] Get:29 https://packages.termux.dev/apt/termux-main stable/main aarch64 sed aarch64 4.9 [117 kB] Get:30 https://packages.termux.dev/apt/termux-main stable/main aarch64 termux-am-socket aarch64 1.5.0 [15.7 kB] Get:31 https://packages.termux.dev/apt/termux-main stable/main aarch64 dash aarch64 0.5.12 [65.2 kB] Get:32 https://packages.termux.dev/apt/termux-main stable/main aarch64 libmpfr aarch64 4.1.1-2 [255 kB] Get:33 https://packages.termux.dev/apt/termux-main stable/main aarch64 ncurses aarch64 6.3-5 [512 kB] Get:34 https://packages.termux.dev/apt/termux-main stable/main aarch64 readline aarch64 8.2.1 [233 kB] Get:35 https://packages.termux.dev/apt/termux-main stable/main aarch64 gawk aarch64 5.2.1 [738 kB] Get:36 https://packages.termux.dev/apt/termux-main stable/main aarch64 gzip aarch64 1.12-1 [78.8 kB] Get:37 https://packages.termux.dev/apt/termux-main stable/main aarch64 less aarch64 608 [97.1 kB] Get:38 https://packages.termux.dev/apt/termux-main stable/main aarch64 procps aarch64 3.3.17-2 [142 kB] Get:39 https://packages.termux.dev/apt/termux-main stable/main aarch64 psmisc aarch64 23.6 [41.0 kB] Get:40 https://packages.termux.dev/apt/termux-main stable/main aarch64 tar aarch64 1.34-1 [338 kB] Get:41 https://packages.termux.dev/apt/termux-main stable/main aarch64 termux-exec aarch64 1:1.0 [3708 B] Get:42 https://packages.termux.dev/apt/termux-main stable/main aarch64 libcap-ng aarch64 2:0.8.3 [35.1 kB] Get:43 https://packages.termux.dev/apt/termux-main stable/main aarch64 util-linux aarch64 2.38.1 [765 kB] Get:44 https://packages.termux.dev/apt/termux-main stable/main aarch64 dialog aarch64 1.3-20220728-0 [98.2 kB] Get:45 https://packages.termux.dev/apt/termux-main stable/main aarch64 termux-tools all 1.34.1 [28.0 kB] Get:46 https://packages.termux.dev/apt/termux-main stable/main aarch64 termux-keyring all 3.10 [35.2 kB] Get:47 https://packages.termux.dev/apt/termux-main stable/main aarch64 termux-licenses all 2.0-3 [52.2 kB] Get:48 https://packages.termux.dev/apt/termux-main stable/main aarch64 apt aarch64 2.5.4 [965 kB] Get:49 https://packages.termux.dev/apt/termux-main stable/main aarch64 libcrypt aarch64 0.2-5 [8720 B] Get:50 https://packages.termux.dev/apt/termux-main stable/main aarch64 command-not-found aarch64 2.1.0-2 [211 kB] Get:51 https://packages.termux.dev/apt/termux-main stable/main aarch64 debianutils aarch64 5.7 [19.0 kB] Get:52 https://packages.termux.dev/apt/termux-main stable/main aarch64 dos2unix aarch64 7.4.3 [60.3 kB] Get:53 https://packages.termux.dev/apt/termux-main stable/main aarch64 ed aarch64 1.18 [39.4 kB] Get:54 https://packages.termux.dev/apt/termux-main stable/main aarch64 inetutils aarch64 2.4 [246 kB] Get:55 https://packages.termux.dev/apt/termux-main stable/main aarch64 libtirpc aarch64 1.3.3 [122 kB] Get:56 https://packages.termux.dev/apt/termux-main stable/main aarch64 lsof aarch64 4.96.4 [103 kB] Get:57 https://packages.termux.dev/apt/termux-main stable/main aarch64 nano aarch64 7.1 [219 kB] Get:58 https://packages.termux.dev/apt/termux-main stable/main aarch64 unzip aarch64 6.0-9 [115 kB] Fetched 15.6 MB in 7s (2127 kB/s) (Reading database ... 4112 files and directories currently installed.) Preparing to unpack .../libiconv_1.17_aarch64.deb ... Unpacking libiconv (1.17) over (1.16-3) ... Setting up libiconv (1.17) ... (Reading database ... 4113 files and directories currently installed.) Preparing to unpack .../libandroid-support_28-3_aarch64.deb ... Unpacking libandroid-support (28-3) over (28-2) ... Setting up libandroid-support (28-3) ... (Reading database ... 4113 files and directories currently installed.) Preparing to unpack .../libc++_25b_aarch64.deb ... Unpacking libc++ (25b) over (23b-3) ... Setting up libc++ (25b) ... (Reading database ... 4113 files and directories currently installed.) Preparing to unpack .../libgmp_6.2.1-2_aarch64.deb ... Unpacking libgmp (6.2.1-2) over (6.2.1) ... Setting up libgmp (6.2.1-2) ... (Reading database ... 4113 files and directories currently installed.) Preparing to unpack .../coreutils_9.1-2_aarch64.deb ... Unpacking coreutils (9.1-2) over (9.0) ... Setting up coreutils (9.1-2) ... (Reading database ... 4113 files and directories currently installed.) Preparing to unpack .../findutils_4.9.0-2_aarch64.deb ... Unpacking findutils (4.9.0-2) over (4.8.0) ... Setting up findutils (4.9.0-2) ... (Reading database ... 4113 files and directories currently installed.) Preparing to unpack .../libgpg-error_1.46_aarch64.deb ... Unpacking libgpg-error (1.46) over (1.43) ... Setting up libgpg-error (1.46) ... (Reading database ... 4113 files and directories currently installed.) Preparing to unpack .../libgcrypt_1.10.1-1_aarch64.deb ... Unpacking libgcrypt (1.10.1-1) over (1.9.4) ... Setting up libgcrypt (1.10.1-1) ... (Reading database ... 4115 files and directories currently installed.) Preparing to unpack .../zlib_1.2.13_aarch64.deb ... Unpacking zlib (1.2.13) over (1.2.11-5) ... Setting up zlib (1.2.13) ... (Reading database ... 4115 files and directories currently installed.) Preparing to unpack .../gpgv_2.4.0_aarch64.deb ... Unpacking gpgv (2.4.0) over (2.3.4) ... Setting up gpgv (2.4.0) ... (Reading database ... 4115 files and directories currently installed.) Preparing to unpack .../pcre2_10.42_aarch64.deb ... Unpacking pcre2 (10.42) over (10.39-2) ... Setting up pcre2 (10.42) ... (Reading database ... 4117 files and directories currently installed.) Preparing to unpack .../grep_3.8-1_aarch64.deb ... Unpacking grep (3.8-1) over (3.7-2) ... Setting up grep (3.8-1) ... (Reading database ... 4115 files and directories currently installed.) Preparing to unpack .../ca-certificates_1%3a2022.10.11-1_all.deb ... Unpacking ca-certificates (1:2022.10.11-1) over (1:2021-10-26-0) ... Setting up ca-certificates (1:2022.10.11-1) ... (Reading database ... 4110 files and directories currently installed.) Preparing to unpack .../openssl_1%3a3.0.7_aarch64.deb ... Unpacking openssl (1:3.0.7) over (1.1.1l) ... Setting up openssl (1:3.0.7) ...

Configuration file '/data/data/com.termux/files/usr/etc/tls/openssl.cnf' ==> File on system created by you or by a script. ==> File also in package provided by package maintainer. What would you like to do about it ? Your options are: Y or I : install the package maintainer's version N or O : keep your currently-installed version D : show the differences between the versions Z : start a shell to examine the situation The default action is to keep your current version. openssl.cnf (Y/I/N/O/D/Z) [default=N] ? Configuration file '/data/data/com.termux/files/usr/etc/tls/openssl.cnf' ==> File on system created by you or by a script. ==> File also in package provided by package maintainer. What would you like to do about it ? Your options are: Y or I : install the package maintainer's version N or O : keep your currently-installed version D : show the differences between the versions Z : start a shell to examine the situation The default action is to keep your current version. openssl.cnf (Y/I/N/O/D/Z) [default=N] ? Installing new version of config file /data/data/com.termux/files/usr/etc/tls/openssl.cnf ... (Reading database ... 4144 files and directories currently installed.) Preparing to unpack .../libcurl_7.87.0_aarch64.deb ... Unpacking libcurl (7.87.0) over (7.81.0) ... Setting up libcurl (7.87.0) ... (Reading database ... 4157 files and directories currently installed.) Preparing to unpack .../curl_7.87.0_aarch64.deb ... Unpacking curl (7.87.0) over (7.81.0) ... Setting up curl (7.87.0) ... (Reading database ... 4157 files and directories currently installed.) Preparing to unpack .../libnghttp2_1.51.0_aarch64.deb ... Unpacking libnghttp2 (1.51.0) over (1.46.0) ... Setting up libnghttp2 (1.51.0) ... (Reading database ... 4157 files and directories currently installed.) Preparing to unpack .../libssh2_1.10.0-2_aarch64.deb ... Unpacking libssh2 (1.10.0-2) over (1.10.0) ... Setting up libssh2 (1.10.0-2) ... (Reading database ... 4157 files and directories currently installed.) Preparing to unpack .../libnettle_3.8.1_aarch64.deb ... Unpacking libnettle (3.8.1) over (3.7.3) ... Setting up libnettle (3.8.1) ... (Reading database ... 4160 files and directories currently installed.) Preparing to unpack .../libunistring_1.1_aarch64.deb ... Unpacking libunistring (1.1) over (0.9.10-5) ... Setting up libunistring (1.1) ... (Reading database ... 4162 files and directories currently installed.) Preparing to unpack .../libidn2_2.3.4_aarch64.deb ... Unpacking libidn2 (2.3.4) over (2.3.2) ... Setting up libidn2 (2.3.4) ... (Reading database ... 4164 files and directories currently installed.) Preparing to unpack .../libevent_2.1.12-2_aarch64.deb ... Unpacking libevent (2.1.12-2) over (2.1.12) ... Setting up libevent (2.1.12-2) ... (Reading database ... 4164 files and directories currently installed.) Preparing to unpack .../libexpat_2.5.0_aarch64.deb ... Unpacking libexpat (2.5.0) over (2.4.2) ... Setting up libexpat (2.5.0) ... (Reading database ... 4164 files and directories currently installed.) Preparing to unpack .../unbound_1.17.0_aarch64.deb ... Unpacking unbound (1.17.0) over (1.13.2-1) ... Setting up unbound (1.17.0) ... (Reading database ... 4164 files and directories currently installed.) Preparing to unpack .../libgnutls_3.7.8_aarch64.deb ... Unpacking libgnutls (3.7.8) over (3.6.16-1) ... Setting up libgnutls (3.7.8) ... (Reading database ... 4164 files and directories currently installed.) Preparing to unpack .../liblz4_1.9.4_aarch64.deb ... Unpacking liblz4 (1.9.4) over (1.9.3) ... Setting up liblz4 (1.9.4) ... (Reading database ... 4168 files and directories currently installed.) Preparing to unpack .../liblzma_5.4.0_aarch64.deb ... Unpacking liblzma (5.4.0) over (5.2.5-1) ... Setting up liblzma (5.4.0) ... (Reading database ... 4171 files and directories currently installed.) Preparing to unpack .../xz-utils_5.4.0_aarch64.deb ... Unpacking xz-utils (5.4.0) over (5.2.5-1) ... Setting up xz-utils (5.4.0) ... (Reading database ... 4171 files and directories currently installed.) Preparing to unpack .../archives/sed_4.9_aarch64.deb ... Unpacking sed (4.9) over (4.8-2) ... Setting up sed (4.9) ... (Reading database ... 4171 files and directories currently installed.) Preparing to unpack .../termux-am-socket_1.5.0_aarch64.deb ... Unpacking termux-am-socket (1.5.0) over (1.02) ... Setting up termux-am-socket (1.5.0) ... (Reading database ... 4172 files and directories currently installed.) Preparing to unpack .../dash_0.5.12_aarch64.deb ... Unpacking dash (0.5.12) over (0.5.11.5) ... Setting up dash (0.5.12) ... (Reading database ... 4172 files and directories currently installed.) Preparing to unpack .../libmpfr_4.1.1-2_aarch64.deb ... Unpacking libmpfr (4.1.1-2) over (4.1.0) ... Setting up libmpfr (4.1.1-2) ... (Reading database ... 4172 files and directories currently installed.) Preparing to unpack .../ncurses_6.3-5_aarch64.deb ... Unpacking ncurses (6.3-5) over (6.2.20200725-6) ... Setting up ncurses (6.3-5) ... (Reading database ... 4176 files and directories currently installed.) Preparing to unpack .../readline_8.2.1_aarch64.deb ... Unpacking readline (8.2.1) over (8.1.1) ... Setting up readline (8.2.1) ... (Reading database ... 4178 files and directories currently installed.) Preparing to unpack .../gawk_5.2.1_aarch64.deb ... Unpacking gawk (5.2.1) over (5.1.1) ... Setting up gawk (5.2.1) ... (Reading database ... 4182 files and directories currently installed.) Preparing to unpack .../gzip_1.12-1_aarch64.deb ... Unpacking gzip (1.12-1) over (1.11-3) ... Setting up gzip (1.12-1) ... (Reading database ... 4180 files and directories currently installed.) Preparing to unpack .../archives/less_608_aarch64.deb ... Unpacking less (608) over (590) ... Setting up less (608) ... (Reading database ... 4180 files and directories currently installed.) Preparing to unpack .../procps_3.3.17-2_aarch64.deb ... Unpacking procps (3.3.17-2) over (3.3.17-1) ... Setting up procps (3.3.17-2) ... (Reading database ... 4180 files and directories currently installed.) Preparing to unpack .../psmisc_23.6_aarch64.deb ... Unpacking psmisc (23.6) over (23.4) ... Setting up psmisc (23.6) ... (Reading database ... 4180 files and directories currently installed.) Preparing to unpack .../tar_1.34-1_aarch64.deb ... Unpacking tar (1.34-1) over (1.34) ... Setting up tar (1.34-1) ... (Reading database ... 4180 files and directories currently installed.) Preparing to unpack .../termux-exec_1%3a1.0_aarch64.deb ... Unpacking termux-exec (1:1.0) over (1:0.9) ... Setting up termux-exec (1:1.0) ... (Reading database ... 4180 files and directories currently installed.) Preparing to unpack .../libcap-ng_2%3a0.8.3_aarch64.deb ... Unpacking libcap-ng (2:0.8.3) over (1:0.8.3-pre1-0) ... Setting up libcap-ng (2:0.8.3) ... (Reading database ... 4180 files and directories currently installed.) Preparing to unpack .../util-linux_2.38.1_aarch64.deb ... Unpacking util-linux (2.38.1) over (2.37.2-1) ... Setting up util-linux (2.38.1) ... (Reading database ... 4187 files and directories currently installed.) Preparing to unpack .../dialog_1.3-20220728-0_aarch64.deb ... Unpacking dialog (1.3-20220728-0) over (1.3-20211214-0) ... Setting up dialog (1.3-20220728-0) ... (Reading database ... 4187 files and directories currently installed.) Preparing to unpack .../termux-tools_1.34.1_all.deb ... Unpacking termux-tools (1.34.1) over (0.155) ... Setting up termux-tools (1.34.1) ...

Configuration file '/data/data/com.termux/files/usr/etc/motd' ==> File on system created by you or by a script. ==> File also in package provided by package maintainer. What would you like to do about it ? Your options are: Y or I : install the package maintainer's version N or O : keep your currently-installed version D : show the differences between the versions Z : start a shell to examine the situation The default action is to keep your current version. *** motd (Y/I/N/O/D/Z) [default=N] ? dpkg: error processing package termux-tools (--configure): end of file on stdin at conffile prompt Errors were encountered while processing: termux-tools E: Sub-process /data/data/com.termux/files/usr/bin/dpkg returned an error code (1)

Phone not rooted.

nohajc commented 1 year ago

This is strange. Did you try to re-run? Because this looks like user interruption of the upgrade process (apt upgrade is run before installing termux-adb).

Make sure you run it in interactive shell and you should be able to choose what to do with the configuration files. (I mean, it could fail if you tried to run it as individual command using ssh as opposed to starting the shell session first and running install.sh inside it).

As a workaround, you could also disable the upgrade.

Just comment line 4 here and execute the modified script: https://github.com/nohajc/termux-adb/blob/master/install.sh (or run manually everything from line 5 till the end)

VovkaSOL commented 1 year ago

I repeat this behavior three times(clean all data for termux and reinstall termux). I create video: https://cloud.mail.ru/public/ApRN/Lv68C7gh3

manual run modified install.sh: ~/.../downloads/Telegram $ bash install.sh Reading package lists... Done Building dependency tree... Done Reading state information... Done gnupg is already the newest version (2.4.0). wget is already the newest version (1.21.3-4). The following packages will be upgraded: coreutils 1 upgraded, 0 newly installed, 0 to remove and 59 not upgraded. Need to get 739 kB of archives. After this operation, 73.7 kB of additional disk space will be used. Get:1 https://packages.termux.dev/apt/termux-main stable/main aarch64 coreutils aarch64 9.1-2 [739 kB] Fetched 739 kB in 2s (362 kB/s) (Reading database ... 4237 files and directories currently installed.) Preparing to unpack .../coreutils_9.1-2_aarch64.deb ... Unpacking coreutils (9.1-2) over (9.0) ... Setting up coreutils (9.1-2) ... Repo already installed Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package termux-adb done! ~/.../downloads/Telegram $ pkg install termux-adb Checking availability of current mirror: ok Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package termux-adb

NHdut commented 1 year ago

Screenshot_20221222-205739 Halo sir . On my device Sony Speria Xz3 , the latest version that was released still does not run. Finally I decided to downgrade my android version, from android 10 to android 9. And now ADB can run. Thanks for the hard work, sir.

nohajc commented 1 year ago

@NHdut The new version installs into system path so if you run ./termux-adb it's still the old one from current directory. You should just run termux-adb without specifying any path.

nohajc commented 1 year ago

@VovkaSOL Something's not right. It should have added the custom repository.

You can also download https://github.com/nohajc/nohajc.github.io/blob/master/dists/termux/extras/binary-aarch64/termux-adb_0.2.0-4_aarch64.deb?raw=true

And install it with dpkg -i termux-adb_0.2.0-4_aarch64.deb.

nohajc commented 1 year ago

@VovkaSOL Anyway, the following commands from the script should do the job. So I'm not sure what's the matter if you only disabled the line with apt upgrade.

mkdir -p $PREFIX/etc/apt/sources.list.d
echo -e "deb https://nohajc.github.io termux extras" > $PREFIX/etc/apt/sources.list.d/termux-adb.list
wget -qP $PREFIX/etc/apt/trusted.gpg.d https://nohajc.github.io/nohajc.gpg
apt update
apt install termux-adb
nohajc commented 1 year ago

I'm closing this for inactivity. As far as I can tell, the issue has been resolved. Feel free to open a new issue if you think otherwise.