android-usb-gadget icon indicating copy to clipboard operation
android-usb-gadget copied to clipboard

Can it be accessed by terminal emulators like termux ?

Open rexackermann opened this issue 1 year ago • 3 comments

I am sorry, if this is not the right place to ask this question.

I was using a ducky program that required the usb-gadget-test. Every time I ran the script I needed to manually turn on and off the hid toogle which can be annoying. Is it possible to do it dirrectly using a command that I can put in the script that will,

Turn on hid Run script(send keypress or whatever) Turn of hid

??

Thanks in advance.

rexackermann avatar Dec 31 '23 19:12 rexackermann

Turn on hid ls /sys/class/udc > /config/usb_gadget/keyboard/UDC Turn off hid echo > /config/usb_gadget/keyboard/UDC

Sucareto avatar Feb 22 '24 06:02 Sucareto

Turn on hid ls /sys/class/udc > /config/usb_gadget/keyboard/UDC Turn off hid echo > /config/usb_gadget/keyboard/UDC

Thanks a lot for the reply but it is not working. The keyboard dir itself does not exist.

rexackermann avatar Feb 26 '24 12:02 rexackermann

Turn on hid ls /sys/class/udc > /config/usb_gadget/keyboard/UDC Turn off hid echo > /config/usb_gadget/keyboard/UDC

Thanks a lot for the reply but it is not working. The keyboard dir itself does not exist.

The keyboard directory is created by the android-usb-gadget,You first need to create the Mouse & Keyboard Gadget in app. If you want to complete gadget creation in termux, you can refer to the script here. By the way, I wrote a complete script here.

Sucareto avatar Feb 26 '24 16:02 Sucareto