Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlin migration & boot options #40

Merged
merged 2 commits into from
Oct 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,7 @@ captures/

# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml
.idea/

# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
Expand Down
1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

116 changes: 0 additions & 116 deletions .idea/codeStyles/Project.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/compiler.xml

This file was deleted.

25 changes: 0 additions & 25 deletions .idea/jarRepositories.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/misc.xml

This file was deleted.

13 changes: 0 additions & 13 deletions .idea/runConfigurations.xml

This file was deleted.

10 changes: 10 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 33
Expand All @@ -23,6 +24,11 @@ android {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

buildFeatures {
viewBinding true
}

}

dependencies {
Expand All @@ -34,6 +40,10 @@ dependencies {
implementation 'androidx.viewpager2:viewpager2:1.0.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'

implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
Expand Down
10 changes: 9 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,28 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.tjado.usbgadget">

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity android:name=".MainActivity" android:configChanges="orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<receiver android:name=".BootConfiguration">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application>

</manifest>
1 change: 0 additions & 1 deletion app/src/main/assets/usbFunctionProfiles/CCID
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh

GADGET="ccid"
GADGET_PATH="____gadgetPath____"

cd $GADGET_PATH/configs/
Expand Down
1 change: 0 additions & 1 deletion app/src/main/assets/usbFunctionProfiles/CTAP
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh

GADGET="ctap"
GADGET_PATH="____gadgetPath____"

cd $GADGET_PATH/configs/
Expand Down
1 change: 0 additions & 1 deletion app/src/main/assets/usbFunctionProfiles/Keyboard
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh

GADGET="keyboard"
GADGET_PATH="____gadgetPath____"

cd $GADGET_PATH/configs/
Expand Down
1 change: 0 additions & 1 deletion app/src/main/assets/usbFunctionProfiles/Mouse
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh

GADGET="mouse"
GADGET_PATH="____gadgetPath____"

cd $GADGET_PATH/configs/
Expand Down
1 change: 0 additions & 1 deletion app/src/main/assets/usbFunctionProfiles/UVC
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh

GADGET="camera"
GADGET_PATH="____gadgetPath____"

cd $GADGET_PATH/configs/
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/assets/usbGadgetProfiles/CCID
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
CONFIGFS_DIR="/config"
GADGETS_PATH="${CONFIGFS_DIR}/usb_gadget"

GADGET="ccid3"
GADGET="____gadgetName____"
GADGET_PATH=${GADGETS_PATH}/${GADGET}

CONFIG_PATH="$GADGET_PATH/configs/c.1/"
Expand All @@ -27,6 +27,7 @@ echo "42" > serialnumber

cd $CONFIG_PATH
echo 30 > MaxPower
mkdir -p strings/0x409
echo "Configuration" > strings/0x409/configuration

ln -s ${GADGET_PATH}/functions/ccid.usb0 $CONFIG_PATH/ccid.usb0
3 changes: 2 additions & 1 deletion app/src/main/assets/usbGadgetProfiles/CTAP
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
CONFIGFS_DIR="/config"
GADGETS_PATH="${CONFIGFS_DIR}/usb_gadget"

GADGET="ctap3"
GADGET="____gadgetName____"
GADGET_PATH=${GADGETS_PATH}/${GADGET}

CONFIG_PATH="$GADGET_PATH/configs/c.1/"
Expand Down Expand Up @@ -42,6 +42,7 @@ echo "42" > serialnumber

cd $CONFIG_PATH
echo 30 > MaxPower
mkdir -p strings/0x409
echo "Configuration" > strings/0x409/configuration

ln -s ${GADGET_PATH}/functions/hid.usb0 $CONFIG_PATH/hid.usb0
3 changes: 2 additions & 1 deletion app/src/main/assets/usbGadgetProfiles/Empty
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
CONFIGFS_DIR="/config"
GADGETS_PATH="${CONFIGFS_DIR}/usb_gadget"

GADGET="gadget_${RANDOM}"
GADGET="____gadgetName____"
GADGET_PATH=${GADGETS_PATH}/${GADGET}

CONFIG_PATH="$GADGET_PATH/configs/c.1/"
Expand All @@ -24,4 +24,5 @@ echo "42" > serialnumber

cd $CONFIG_PATH
echo 120 > MaxPower
mkdir -p strings/0x409
echo "Configuration" > strings/0x409/configuration
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
CONFIGFS_DIR="/config"
GADGETS_PATH="${CONFIGFS_DIR}/usb_gadget"

GADGET="keyboard"
GADGET="____gadgetName____"
GADGET_PATH=${GADGETS_PATH}/${GADGET}

CONFIG_PATH="$GADGET_PATH/configs/c.1/"
Expand Down Expand Up @@ -50,6 +50,7 @@ echo "42" > serialnumber

cd $CONFIG_PATH
echo 120 > MaxPower
mkdir -p strings/0x409
echo "Configuration" > strings/0x409/configuration

ln -s ${GADGET_PATH}/functions/hid.keyboard $CONFIG_PATH/hid.keyboard
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/assets/usbGadgetProfiles/UVC
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
CONFIGFS_DIR="/config"
GADGETS_PATH="${CONFIGFS_DIR}/usb_gadget"

GADGET="uvc"
GADGET="____gadgetName____"
GADGET_PATH=${GADGETS_PATH}/${GADGET}

CONFIG_PATH="$GADGET_PATH/configs/c.1/"
Expand Down
Loading