Closed Jack-Rickwood closed 4 years ago
Hi Jack, Nice you hear from you. I would appreciate if you can try the stuff and get the features ready. This app is basically a layer above the usb-gadgets for USB mode and wifi drivers for Raspberry-Pi mode (future release & work under development, so won't make any other mentions about it below).
The reply to you question/queries are:
I would love to have this feature on my app. Detecting USB device is connected does require some Kernel/ROM Level tweak or some way to monitor the USB mode of the Android Device. Not sure is such kind of event is broadcasted by OS except USB OTG. Maybe USB device/host guide on Android site can help you. (Maybe we can get some input from the custom rom community and custom kernel community regarding this).
Mouse support will be added if the rubber ducky script support it. It would be a straight forward USB HID protocol emulation code within the app itself. So I kept it on hold for now and will release when a well defined mouse command is made mention by Hak5. Refer: https://github.com/hak5darren/USB-Rubber-Ducky/wiki/Duckyscript
Device identifier is based on the kernel implementation, and no way connected to the app. Probably you need to dig deep into the Android Kernel for how the usb-gadget are configured. For MacOS only trusted devices is allowed only after a user configures the keyboard manually on the MacOS; Windows/Linux I don't think that is the issue in default scenerio. Refer: https://github.com/pelya/android-keyboard-gadget/
Regards, Mayank
USB detection temporary work around will be push to the code. Pre-Oreo devices it will monitor the charging state to determine if USB is connected. This isn't a perfect solution though.
If the first one has a temporary fix, and neither of the other two features are something under rucky's control, is this issue good to close? (I'll look into a proper solution for USB detection when i can)
Actually, @mayankmetha I just noticed that it says this in the android-keyboard-gadget README:
You can check the modification time of file /sys/devices/virtual/hidg/hidg0/dev to know when the USB cable has been plugged into PC, however this does not always work, so it's better to simply check if hid-gadget-test returned an error.
Could we take one of these routes? It even has an example script.
Hi jack, really appreciate the efforts. If you look into the latest Rucky code for future release, I have open sourced the USB detection logic now. For Pre-Oreo devices it could be a possibility of false positives, but for Oreo onwards it works well. I’m not using the hid-gadget-test as the hid logic as it’s not scalable and Rucky uses a scalable logic to support multiple hid layouts.
Issue is still open for the third point emulated identifier for hid, and not the usb issue.
There are three features I am wondering about, and I am willing to take a crack at implementing them myself if you don't have any plan to, however I don't have any experience with android keyboard gadget and how it works (i'm assuming this is the kernel patch this app requires?), and would appreciate a nudge in the right direction about where i can learn how this thing works.