-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a236c7
commit b0f349c
Showing
11 changed files
with
249 additions
and
19 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
app/src/main/aidl/io/github/cloudburst/cliptype/IUsbRootService.aidl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
package io.github.cloudburst.cliptype; | ||
|
||
interface IUsbRootService { | ||
boolean hidCapable(); | ||
String devPath(); | ||
boolean gadgetExists(); | ||
boolean canWrite(); | ||
List<String> enabledGadgets(); | ||
void typeUsb(String text); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/sh | ||
|
||
# Source: https://github.com/tejado/android-usb-gadget/blob/master/app/src/main/assets/usbGadgetProfiles/MouseKeyboard | ||
|
||
CONFIGFS_DIR="/config" | ||
GADGETS_PATH="${CONFIGFS_DIR}/usb_gadget" | ||
|
||
GADGET="keyboard" | ||
GADGET_PATH=${GADGETS_PATH}/${GADGET} | ||
|
||
CONFIG_PATH="$GADGET_PATH/configs/c.1/" | ||
STRINGS_PATH="$GADGET_PATH/strings/0x409/" | ||
|
||
mkdir -p $CONFIG_PATH | ||
mkdir -p $STRINGS_PATH | ||
|
||
mkdir -p $GADGET_PATH/functions/hid.keyboard | ||
cd $GADGET_PATH/functions/hid.keyboard | ||
|
||
# HID protocol (according to USB spec: 1 for keyboard) | ||
echo 1 > protocol | ||
# device subclass | ||
echo 1 > subclass | ||
# number of bytes per record | ||
echo 8 > report_length | ||
|
||
# writing report descriptor | ||
echo -ne \\x05\\x01\\x09\\x06\\xa1\\x01\\x05\\x07\\x19\\xe0\\x29\\xe7\\x15\\x00\\x25\\x01\\x75\\x01\\x95\\x08\\x81\\x02\\x95\\x01\\x75\\x08\\x81\\x03\\x95\\x05\\x75\\x01\\x05\\x08\\x19\\x01\\x29\\x05\\x91\\x02\\x95\\x01\\x75\\x03\\x91\\x03\\x95\\x06\\x75\\x08\\x15\\x00\\x25\\x65\\x05\\x07\\x19\\x00\\x29\\x65\\x81\\x00\\xc0 > report_desc | ||
|
||
#mkdir -p $GADGET_PATH/functions/hid.mouse | ||
#cd $GADGET_PATH/functions/hid.mouse | ||
# | ||
## HID protocol (according to USB spec: 2 for mouse) | ||
#echo 2 > protocol | ||
## device subclass | ||
#echo 1 > subclass | ||
## number of bytes per record | ||
#echo 4 > report_length | ||
# | ||
## writing report descriptor | ||
#echo -ne \\x05\\x01\\x09\\x02\\xa1\\x01\\x09\\x01\\xa1\\x00\\x05\\x09\\x19\\x01\\x29\\x05\\x15\\x00\\x25\\x01\\x95\\x05\\x75\\x01\\x81\\x02\\x95\\x01\\x75\\x03\\x81\\x01\\x05\\x01\\x09\\x30\\x09\\x31\\x09\\x38\\x15\\x81\\x25\\x7F\\x75\\x08\\x95\\x03\\x81\\x06\\xc0\\xc0 > report_desc | ||
# | ||
|
||
cd $GADGET_PATH | ||
echo 0x046a > idVendor | ||
echo 0x002a > idProduct | ||
|
||
cd $STRINGS_PATH | ||
echo "cloudburst" > manufacturer | ||
echo "ClipType" > product | ||
echo "42" > serialnumber | ||
|
||
cd $CONFIG_PATH | ||
echo 100 > MaxPower | ||
mkdir -p strings/0x409 | ||
echo "Configuration" > strings/0x409/configuration | ||
|
||
ln -s ${GADGET_PATH}/functions/hid.keyboard $CONFIG_PATH/hid.keyboard | ||
#ln -s ${GADGET_PATH}/functions/hid.mouse $CONFIG_PATH/hid.mouse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
|
||
<style name="WorkingDialog" parent="@android:style/Theme.Material.Dialog"> | ||
<item name="android:dialogCornerRadius">16dp</item> | ||
</style> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
|
||
<style name="WorkingDialog" parent="@android:style/Theme.Material.Dialog"> | ||
<item name="android:dialogCornerRadius">16dp</item> | ||
<item name="android:background">@android:color/system_neutral1_900</item> | ||
<item name="android:color">@android:color/system_neutral1_10</item> | ||
</style> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
|
||
<style name="WorkingDialog" parent="@android:style/Theme.Material.Dialog"> | ||
<item name="android:background">@android:color/system_neutral1_10</item> | ||
</style> | ||
</resources> |