(Plugin Name)
PURPOSE AND CAPABILITIES
A Basic Example App that can be taken and refactored into any kind of ATAK project. This project was created as part of a series on YouTube called Starting an ATAK Project
STATUS
Released
POINT OF CONTACTS
If you would like to contact RIIS about potentially starting an ATAK project contact Godfrey (below). If you want to report something that's broken open an issue or if you want to fix something open a PR.
RIIS
- Godfrey Nolan ([email protected])
- Zain Raza ([email protected])
PORTS REQUIRED
n/a
EQUIPMENT REQUIRED
EQUIPMENT SUPPORTED
COMPILATION
We recommend you watch the YouTube series if you're newer and then look at these instructions to better understand what we're trying to accomplish
- If you haven’t already to the release page of ATAK-CIV
- Download
atak-civ-sdk-4.6.x.x.zip - extract the zip wherever
- Go inside the
atak-civ-sdk-4.6.x.xdirectory - make a directory called
plugins - Go into
atak-civ-sdk-4.6.x.x/plugins - Clone this repo into
atak-civ-sdk-4.6.x.x/plugins - Change directory into the “plugintemplate” open a terminal and run the following:
keytool -genkeypair -dname "CN=Android Debug,O=Android,C=US" -validity 9999 -keystore debug.keystore -alias androiddebugkey -keypass android -storepass android -keyalg RSAkeytool -genkeypair -dname "CN=Android Release,O=Android,C=US" -validity 9999 -keystore release.keystore -alias androidreleasekey -keypass android -storepass android -keyalg RSA - Open Android Studio and enter the following in your
local.propertiesand fill out the paths of the keystores you just generated:
# the sdk.dir should be automatically assigned to the path of your Android Studio SDK
# for the paths, if you are on mac or linux please use / instead of \\
sdk.dir=<ANDROID_SDK_PATH>
takDebugKeyFile=<ABSOLUTE_PLUGIN_PATH>\\debug.keystore
takDebugKeyFilePassword=android
takDebugKeyAlias=androiddebugkey
takDebugKeyPassword=android
takReleaseKeyFile=<ABSOLUTE_PLUGIN_PATH>\\release.keystore
takReleaseKeyFilePassword=android
takReleaseKeyAlias=androidreleasekey
takReleaseKeyPassword=android
- NOTE: Do not upgrade gradle. In “File > Project Structure” on the “Project” tab, make sure the Gradle Plugin Version is "4.2.2" and then Gradle Version is "6.9.1" or other errors will arise
- Open the
<PLUGIN-NAME>/app/build.gradlefile by set the Project Files view to “Project”, expand the app directory and click thebuild.gradlefile. On line 16 there should be a line of code that we need to change since the def function is not properly scoped to be used later in the build script.
// app/build.gradle
// Original function signature
def getValueFromPropertiesFile = { propFile, key ->
// New function signature
ext.getValueFromPropertiesFile = { propFile, key ->- Go to "File > Settings > Build, Execution, Deployment > Build Tools > Gradle > Gradle JDK" and make sure you are using Java 11, if you don't have it, install it.
- Resync and rebuild, should work
- Open the Run Configurations dropdown menu and select "Edit Configurations".
- Set "Launch Options > Launch dropdown" selector to the value "Nothing" and press the Apply button
- Set “Name” to “plugin new install”
- In the top left of the “Run/Debug Configurations” Window, click the “Copy Configuration” icon or press “CTRL/CMD+D”
- Go into that new config and set “Name” to “plugin reinstall”
- Go to “Before Launch > Add > Run External Tool”
- In the “External Tools” Window click “Add”
- Set Name to “reinstall (whatever plugin name is) plugin”
- Set “Tool Settings > Program” to
adb - Set “Tool Settings > Arguments:
uninstall com.atakmap.android.plugintemplate.pluginNOTE YOU NEED TO CHANGE THIS IF YOU REFACTOR YOUR PACKAGE NAME - Set “Tool Settings > Working Directory” to your project root directory. For me it was
/home/zain/Documents/Tutorial/atak-civ-sdk-4.6.0.5/atak-civ/plugins/plugintemplate - Untick “Advanced Options > Synchronize files after execution”
- Save, apply and exit out of all of the config menus
- NOTE - The “app reinstall” configuration will be useful for debugging so you don’t need to constantly reinstall the app to see changes made on your plugin, you will be using it every time after the first time run
- Towards the bottom left, click on the "Build Variants" tab and change the "Active Build Variant" from "milDebug" to “civDebug".
- Build and rerun, test with the ATAK app in the ATAK release you cloned. check the "Plugins" menu in the side drawer and the plugin name should be listed.
DEVELOPER NOTES