This library serves to consolidate all necessary code to facilitate a backend for automation purposes on Android devices. The OpenCV Android SDK is being imported from this OpenCV Android SDK repo. Currently, this library can do the following:
- Uses
MyAccessibilityServiceto programmatically execute gestures andMediaProjectionServiceto acquire screenshots forImageUtilsto perform image processing operations on. BotServicehandles the display and movement of the floating overlay button to start and stop program execution.- Handles connection with Discord and Twitter APIs with
DiscordUtilsandTwitterUtilsrespectively. - Loads in a
settings.jsonfile withJSONParserto be further processed in the primary project. - Saves a text log of messages with
MessageLog. - Displays a persistent status notification informing the user via
NotificationUtils. - Any messages that needs to be sent from this library to the primary project can be done with the
EventBuslibrary using theJSEventandStartEventevent classes. ScreenStateReceivergracefully stops the bot when the device screen turns off to prevent gestures from being dispatched on a sleeping device.
To test changes to this library locally without publishing to JitPack:
-
Change the versionName to include "-SNAPSHOT" in
gradle/libs.versions.toml:- Update
app-versionNameto include "-SNAPSHOT" (e.g.,app-versionName = "2.1.1-SNAPSHOT"). - This will ensure gradle will always pull the latest version from the local repository for your app to use.
- Update
-
Publish to Maven Local (from the library root directory):
./gradlew publishToMavenLocal
# Or on Windows:
gradlew.bat publishToMavenLocal
# You can then confirm the local publication by looking in your local Maven repository (typically located at `C:\Users\username\.m2\repository`).
# If we continue with the example from above, there will be 5 files generated in the 2.1.1-SNAPSHOT folder:
# - automation_library-2.1.1-SNAPSHOT.aar
# - automation_library-2.1.1-SNAPSHOT.module
# - automation_library-2.1.1-SNAPSHOT.pom
# - automation_library-2.1.1-SNAPSHOT-sources.jar
# - maven-metadata-local.xml- In your app's
build.gradle.kts, add Maven Local repository:
allprojects {
repositories {
maven { url "https://www.jitpack.io" }
mavenLocal() // Add this line for local testing. Make sure it is above every other repository.
google()
mavenCentral()
}
}- Add the dependency to your app:
dependencies {
// If you are using a local version, you will need to use the -SNAPSHOT version here.
implementation("com.github.steve1316:automation_library:2.1.1-SNAPSHOT")
}The library will be loaded from your local Maven repository (typically ~/.m2/repository or C:\Users\username\.m2\repository).
// Project-level build.gradle
allprojects {
repositories {
maven { url 'https://www.jitpack.io' }
}
}
// App-level build.gradle
dependencies {
implementation("com.github.steve1316:android-cv-automation-library:Tag")
}
- Create a Wiki and create a page for each class in the
utilsfolder, explaining what each of them do in a broad scope and what they offer to the project that will be using them.