nohajc / termux-adb

Run adb in Termux without root permissions!
MIT License
391 stars 37 forks source link

no devices #29

Closed Swenlon closed 3 months ago

Swenlon commented 3 months ago

Describe the bug A clear and concise description of what the bug is.

  1. Install termux-app_v0.118.1+github-debug_arm64-v8a.apk on an Android 14 device;
  2. Open the termux application and install termux-adb via $ curl -s https://raw.githubusercontent.com/nohajc/termux-adb/master/install.sh | bash;
  3. After the installation is complete, executing termux-adb devices fails to scan the device, and executing termux-usb -l is always in a blocked state with no output;
  4. Is it possible that the termux-adb downloaded in this way does not match the termux-api version?

To Reproduce termux-adb devices

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

Attach output of the following commands

$ pkg show termux-adb Package: termux-adb Version: 0.2.2-2 Maintainer: nohacj Installed-Size: 6250 kB Depends: brotli, libc++, liblz4, libprotobuf-tadb-core, libusb, termux-api, zlib, zstd Homepage: https://github.com/nohacj/termux-adb Download-Size: 1579 kB APT-Manually-Installed: yes APT-Sources: https://nohajc.github.io termux/extras aarch64 Packages Description: Run adb and fastboot in Termux without root permissions

$ pkg show termux-api Package: termux-api Version: 0.58.0-1 Maintainer: https://github.com/termux Installed-Size: 348 kB Depends: bash, util-linux, termux-am (>= 0.8.0) Homepage: https://wiki.termux.com/wiki/Termux:API Download-Size: 25.0 kB APT-Manual-Installed: yes APT-Sources: https://packages-cf.termux.dev/apt/termux-main stable/main aarch64 Packages Description: Termux API commands (install also the Termux:API app)

Attach contents of the following files (after running with debug logs enabled)

Additional context $ termux-api-start Starting service: Intent { cmp=com.termux.api/.KeepAliveService } Error: Not found; no service started. $ termux-usb -l

logcat|grep -i termux 09-04 09:20:22.699 4093 4093 W bash : type=1400 audit(0.0:10566): avc: granted { execute } for name="termux-api-start" dev="mmcblk0p4" ino=137935 scontext=u:r:untrusted_app_27:s0:c106,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c106,c256,c512,c768 tclass=file app=com.termux 09-04 09:20:22.699 4093 4093 W bash : type=1400 audit(0.0:10567): avc: granted { execute } for name="termux-api-start" dev="mmcblk0p4" ino=137935 scontext=u:r:untrusted_app_27:s0:c106,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c106,c256,c512,c768 tclass=file app=com.termux 09-04 09:20:22.699 4093 4093 W bash : type=1400 audit(0.0:10568): avc: granted { execute_no_trans } for path="/data/data/com.termux/files/usr/bin/termux-api-start" dev="mmcblk0p4" ino=137935 scontext=u:r:untrusted_app_27:s0:c106,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c106,c256,c512,c768 tclass=file app=com.termux 09-04 09:20:22.699 4093 4093 W bash : type=1400 audit(0.0:10569): avc: granted { execute } for name="dash" dev="mmcblk0p4" ino=133599 scontext=u:r:untrusted_app_27:s0:c106,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c106,c256,c512,c768 tclass=file app=com.termux 09-04 09:20:22.703 4093 4093 W termux-api-star: type=1400 audit(0.0:10570): avc: granted { execute } for path="/data/data/com.termux/files/usr/bin/dash" dev="mmcblk0p4" ino=133599 scontext=u:r:untrusted_app_27:s0:c106,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c106,c256,c512,c768 tclass=file app=com.termux 09-04 09:20:23.320 4094 4094 W ziparchive: Unable to open '/data/data/com.termux/files/usr/libexec/termux-am/am.dm': No such file or directory 09-04 09:20:23.436 4094 4094 D AndroidRuntime: Calling main entry com.termux.termuxam.Am 09-04 09:20:23.451 722 1737 W ActivityManager: Unable to start service Intent { cmp=com.termux.api/.KeepAliveService } U=0: not found 09-04 09:20:29.211 4109 4109 W bash : type=1400 audit(0.0:10578): avc: granted { execute } for name="termux-usb" dev="mmcblk0p4" ino=137918 scontext=u:r:untrusted_app_27:s0:c106,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c106,c256,c512,c768 tclass=file app=com.termux 09-04 09:20:29.215 4109 4109 W bash : type=1400 audit(0.0:10579): avc: granted { execute } for name="termux-usb" dev="mmcblk0p4" ino=137918 scontext=u:r:untrusted_app_27:s0:c106,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c106,c256,c512,c768 tclass=file app=com.termux 09-04 09:20:29.215 4109 4109 W bash : type=1400 audit(0.0:10580): avc: granted { execute_no_trans } for path="/data/data/com.termux/files/usr/bin/termux-usb" dev="mmcblk0p4" ino=137918 scontext=u:r:untrusted_app_27:s0:c106,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c106,c256,c512,c768 tclass=file app=com.termux 09-04 09:20:29.215 4109 4109 W bash : type=1400 audit(0.0:10581): avc: granted { execute } for name="bash" dev="mmcblk0p4" ino=133965 scontext=u:r:untrusted_app_27:s0:c106,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c106,c256,c512,c768 tclass=file app=com.termux 09-04 09:20:29.215 4109 4109 W termux-usb: type=1400 audit(0.0:10582): avc: granted { execute } for path="/data/data/com.termux/files/usr/bin/bash" dev="mmcblk0p4" ino=133965 scontext=u:r:untrusted_app_27:s0:c106,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c106,c256,c512,c768 tclass=file app=com.termux 09-04 09:20:29.847 4111 4111 W ziparchive: Unable to open '/data/data/com.termux/files/usr/libexec/termux-am/am.dm': No such file or directory 09-04 09:20:29.962 4111 4111 D AndroidRuntime: Calling main entry com.termux.termuxam.Am

nohajc commented 3 months ago

Have you installed Termux:API too? It is a separate apk which you need for termux-usb to work. https://f-droid.org/packages/com.termux.api/

Swenlon commented 3 months ago

Thank you very much, the problem has been solved; After installing Termux:API, termux-usb -l can indeed scan USB devices, and termux-adb can also devices out of the device; $ termux-usb -l List of devices attached "/dev/bus/usb/001/007"

$ termux-adb devices List of devices attached WGY021B19000130 unauthorized

$ termux-adb devices List of devices attached WGY021B19000130 device