Skip to content

Commit a958e08

Browse files
committed
Initial commit
0 parents  commit a958e08

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+4167
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

COPYING

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
APRS-TAK
2+
3+
Leverages APRSDroid to send/receive CoT over APRS

app/build.gradle

Lines changed: 294 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,294 @@
1+
////////////////////////////////////////////////////////////////////////////////
2+
//
3+
// PLUGIN_VERSION is the common version name when describing the plugin.
4+
// ATAK_VERSION is for the version of ATAK this plugin should be compatible
5+
// with some examples include 3.11.0, 3.11.0.civ 3.11.1.fvey
6+
//
7+
////////////////////////////////////////////////////////////////////////////////
8+
9+
buildscript {
10+
11+
ext.PLUGIN_VERSION = "1.0"
12+
ext.ATAK_VERSION = "4.8.1"
13+
14+
def takdevVersion = '2.+'
15+
16+
ext.getValueFromPropertiesFile = { propFile, key ->
17+
if(!propFile.isFile() || !propFile.canRead())
18+
return null
19+
def prop = new Properties()
20+
def reader = propFile.newReader()
21+
try {
22+
prop.load(reader)
23+
} finally {
24+
reader.close()
25+
}
26+
return prop.get(key)
27+
}
28+
29+
def getProperty = { name, defValue ->
30+
def prop = project.properties[name] ?:
31+
getValueFromPropertiesFile(project.rootProject.file('local.properties'), name)
32+
return (null == prop) ? defValue : prop
33+
}
34+
35+
def urlKey = 'takrepo.url'
36+
37+
ext.isDevKitEnabled = { ->
38+
return getProperty(urlKey, null) != null
39+
}
40+
41+
ext.takrepoUrl = getProperty(urlKey, 'http://localhost/')
42+
ext.takrepoUser = getProperty('takrepo.user', 'invalid')
43+
ext.takrepoPassword = getProperty('takrepo.password', 'invalid')
44+
ext.takdevPlugin = getProperty('takdev.plugin', "${rootDir}/../../atak-gradle-takdev.jar")
45+
46+
repositories {
47+
google()
48+
mavenCentral()
49+
mavenLocal()
50+
maven {
51+
url "https://jitpack.io"
52+
}
53+
maven {
54+
url = takrepoUrl
55+
credentials {
56+
username = takrepoUser
57+
password = takrepoPassword
58+
}
59+
}
60+
}
61+
dependencies {
62+
classpath 'com.android.tools.build:gradle:4.0.2'
63+
if(isDevKitEnabled()) {
64+
classpath "com.atakmap.gradle:atak-gradle-takdev:${takdevVersion}"
65+
} else {
66+
classpath files(takdevPlugin)
67+
}
68+
}
69+
}
70+
71+
allprojects {
72+
repositories {
73+
mavenCentral()
74+
google()
75+
mavenCentral()
76+
mavenLocal()
77+
maven {
78+
url "https://jitpack.io"
79+
}
80+
}
81+
}
82+
83+
apply plugin: 'com.android.application'
84+
apply plugin: 'atak-takdev-plugin'
85+
86+
// Attempt to get a suitable version name for the plugin based on
87+
// either a git or svn repository
88+
def getVersionName() {
89+
try {
90+
def stdout = new ByteArrayOutputStream()
91+
exec {
92+
commandLine 'git', 'rev-parse', '--short=8', 'HEAD'
93+
standardOutput = stdout
94+
}
95+
def describe = stdout.toString().trim()
96+
println("versionName[git]: $describe")
97+
return describe
98+
} catch (Exception ignored) {
99+
println("error occured, using revision of 1")
100+
return 1
101+
}
102+
}
103+
104+
105+
// Attempt to get a suitable version code for the plugin based on
106+
// either a git or svn repository
107+
def getVersionCode() {
108+
try {
109+
new ByteArrayOutputStream().withStream { os ->
110+
def result = exec {
111+
executable = 'git'
112+
args = ['show', '-s', '--format=%ct']
113+
standardOutput = os
114+
ignoreExitValue = true
115+
}
116+
117+
def outputAsString = os.toString()
118+
ext.revision = "$outputAsString".toInteger()
119+
120+
println("version[git]: $revision")
121+
}
122+
} catch (Exception ignored) {
123+
println("error occured, using revision of 1")
124+
ext.revision = 1
125+
}
126+
127+
return revision
128+
}
129+
130+
131+
android {
132+
compileSdkVersion 26
133+
buildToolsVersion "29.0.2"
134+
135+
dexOptions {
136+
jumboMode = true
137+
}
138+
139+
lintOptions {
140+
checkReleaseBuilds true
141+
// Or, if you prefer, you can continue to check for errors in release builds,
142+
// but continue the build even when errors are found:
143+
abortOnError true
144+
}
145+
146+
signingConfigs {
147+
debug {
148+
def kf = getValueFromPropertiesFile(project.rootProject.file('local.properties'), 'takDebugKeyFile')
149+
def kfp = getValueFromPropertiesFile(project.rootProject.file('local.properties'), 'takDebugKeyFilePassword')
150+
def ka = getValueFromPropertiesFile(project.rootProject.file('local.properties'), 'takDebugKeyAlias')
151+
def kp = getValueFromPropertiesFile(project.rootProject.file('local.properties'), 'takDebugKeyPassword')
152+
153+
if (kf == null) {
154+
throw new GradleException("No signing key configured!")
155+
}
156+
157+
storeFile file(kf)
158+
if (kfp != null) storePassword kfp
159+
if (ka != null) keyAlias ka
160+
if (kp != null) keyPassword kp
161+
}
162+
release {
163+
def kf = getValueFromPropertiesFile(project.rootProject.file('local.properties'), 'takReleaseKeyFile')
164+
def kfp = getValueFromPropertiesFile(project.rootProject.file('local.properties'), 'takReleaseKeyFilePassword')
165+
def ka = getValueFromPropertiesFile(project.rootProject.file('local.properties'), 'takReleaseKeyAlias')
166+
def kp = getValueFromPropertiesFile(project.rootProject.file('local.properties'), 'takReleaseKeyPassword')
167+
168+
if (kf == null) {
169+
throw new GradleException("No signing key configured!")
170+
}
171+
172+
storeFile file(kf)
173+
if (kfp != null) storePassword kfp
174+
if (ka != null) keyAlias ka
175+
if (kp != null) keyPassword kp
176+
}
177+
}
178+
179+
buildTypes {
180+
debug {
181+
debuggable true
182+
matchingFallbacks = ['sdk']
183+
}
184+
185+
release {
186+
minifyEnabled true
187+
proguardFile 'proguard-gradle.txt'
188+
signingConfig signingConfigs.release
189+
matchingFallbacks = ['odk']
190+
}
191+
}
192+
193+
flavorDimensions "application"
194+
195+
productFlavors {
196+
mil {
197+
getIsDefault().set(true)
198+
dimension "application"
199+
manifestPlaceholders = [atakApiVersion: "com.atakmap.app@" + ATAK_VERSION + ".MIL"]
200+
}
201+
civ {
202+
dimension "application"
203+
manifestPlaceholders = [atakApiVersion: "com.atakmap.app@" + ATAK_VERSION + ".CIV"]
204+
}
205+
aus {
206+
dimension "application"
207+
manifestPlaceholders = [atakApiVersion: "com.atakmap.app@" + ATAK_VERSION + ".AUS"]
208+
}
209+
nzl {
210+
dimension "application"
211+
manifestPlaceholders = [atakApiVersion: "com.atakmap.app@" + ATAK_VERSION + ".NZL"]
212+
}
213+
prt {
214+
dimension "application"
215+
manifestPlaceholders = [atakApiVersion: "com.atakmap.app@" + ATAK_VERSION + ".PRT"]
216+
}
217+
nor {
218+
dimension "application"
219+
manifestPlaceholders = [atakApiVersion: "com.atakmap.app@" + ATAK_VERSION + ".NOR"]
220+
}
221+
hun {
222+
dimension "application"
223+
manifestPlaceholders = [atakApiVersion: "com.atakmap.app@" + ATAK_VERSION + ".HUN"]
224+
}
225+
bel {
226+
dimension "application"
227+
manifestPlaceholders = [atakApiVersion: "com.atakmap.app@" + ATAK_VERSION + ".BEL"]
228+
}
229+
swe {
230+
dimension "application"
231+
manifestPlaceholders = [atakApiVersion: "com.atakmap.app@" + ATAK_VERSION + ".SWE"]
232+
}
233+
natosof {
234+
dimension "application"
235+
manifestPlaceholders = [atakApiVersion: "com.atakmap.app@" + ATAK_VERSION + ".NATOSOF"]
236+
}
237+
gbr {
238+
dimension "application"
239+
manifestPlaceholders = [atakApiVersion: "com.atakmap.app@" + ATAK_VERSION + ".GBR"]
240+
}
241+
gov {
242+
dimension "application"
243+
// GOV builds are just CIV api builds with additional information in the strings file
244+
manifestPlaceholders = [atakApiVersion: "com.atakmap.app@" + ATAK_VERSION + ".CIV"]
245+
}
246+
can {
247+
dimension "application"
248+
manifestPlaceholders = [atakApiVersion: "com.atakmap.app@" + ATAK_VERSION + ".CAN"]
249+
}
250+
}
251+
252+
packagingOptions {
253+
exclude 'META-INF/INDEX.LIST'
254+
}
255+
256+
sourceSets {
257+
main {
258+
259+
// It is strongly encouraged that plugin developers do not modify the archiveBaseName, version code logic and version
260+
// name logic to provide for consistency within the community.
261+
setProperty("archivesBaseName", "ATAK-Plugin-" + rootProject.name + "-" + PLUGIN_VERSION + "-" + getVersionName() + "-" + ATAK_VERSION)
262+
defaultConfig.versionCode = getVersionCode()
263+
defaultConfig.versionName = PLUGIN_VERSION + " (" + getVersionName() + ") - [" + ATAK_VERSION + "]"
264+
}
265+
266+
gov.java.srcDirs 'src/gov/java'
267+
gov.assets.srcDir 'src/gov/assets'
268+
gov.res.srcDir 'src/gov/res'
269+
270+
// Move the build types to build-types/<type>
271+
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
272+
// This moves them out of them default location under src/<type>/... which would
273+
// conflict with src/ being used by the main source set.
274+
// Adding new build types or product flavors should be accompanied
275+
// by a similar customization.
276+
debug.setRoot('build-types/debug')
277+
release.setRoot('build-types/release')
278+
279+
}
280+
281+
defaultConfig {
282+
minSdkVersion 21
283+
ndk {
284+
abiFilters "armeabi-v7a", "arm64-v8a", "x86"
285+
}
286+
}
287+
}
288+
289+
290+
dependencies {
291+
implementation fileTree(dir: 'libs', include: '*.jar')
292+
implementation 'com.paulmandal.atak:libcotshrink:1.0.2'
293+
//implementation 'com.google.protobuf:protobuf-lite:3.0.1'
294+
}

app/key.jks

4.17 KB
Binary file not shown.

app/proguard-gradle.txt

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
-dontskipnonpubliclibraryclasses
2+
-dontshrink
3+
-dontoptimize
4+
5+
############### ACRA specifics
6+
# we need line numbers in our stack traces otherwise they are pretty useless
7+
-renamesourcefileattribute SourceFile
8+
-keepattributes SourceFile,LineNumberTable
9+
10+
-applymapping <atak.proguard.mapping>
11+
-repackageclasses atakplugin.PluginTemplate
12+
13+
-keepattributes *Annotation*
14+
-keepattributes Signature, InnerClasses
15+
16+
17+
-keep class * implements android.os.Parcelable {
18+
public static final android.os.Parcelable$Creator *;
19+
}
20+
21+
-keepclassmembers class **.R$* {
22+
public static <fields>;
23+
}
24+
25+
# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
26+
-keepclassmembers enum * {
27+
public static **[] values();
28+
public static ** valueOf(java.lang.String);
29+
}
30+
31+
32+
33+
# Preserve all native method names and the names of their classes.
34+
-keepclasseswithmembernames class * {
35+
native <methods>;
36+
}
37+
38+
-keepclassmembers class * {
39+
@org.simpleframework.xml.* *;
40+
}
41+
42+
43+
# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
44+
-keepclassmembers enum * {
45+
public static **[] values();
46+
public static ** valueOf(java.lang.String);
47+
}
48+
49+
50+
51+
-keep class * extends transapps.maps.plugin.tool.Tool {
52+
}
53+
-keep class * implements transapps.maps.plugin.lifecycle.Lifecycle {
54+
}
55+
56+
# overcome an existing bug in the gradle subsystem (3.5.x)
57+
-keep class module-info
58+

app/src/main/AndroidManifest.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.atakmap.android.aprstak.plugin">
3+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
4+
5+
6+
<application
7+
android:allowBackup="false"
8+
android:icon="@drawable/aprs"
9+
android:label="@string/app_name"
10+
android:description="@string/app_desc"
11+
12+
android:theme="@style/AppTheme" >
13+
<meta-data android:name="plugin-api" android:value="${atakApiVersion}"/>
14+
<meta-data android:name="app_desc" android:value="@string/app_desc"/>
15+
16+
<activity android:name="com.atakmap.app.component">
17+
<intent-filter android:label="@string/app_name">
18+
<action android:name="com.atakmap.app.component" />
19+
</intent-filter>
20+
</activity>
21+
22+
</application>
23+
24+
</manifest>

app/src/main/assets/aprs.png

3.44 KB
Loading

0 commit comments

Comments
 (0)