aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Liu <maliu@mozilla.com>2019-11-12 16:05:34 +0800
committermaliu <max@mxli.us>2019-11-19 17:23:00 +0800
commit70ba8aa9751e89abb107cf598801b072ef39da10 (patch)
treedb81adffe9470f8533d6c6df782dc88e8860ea60
parentImport libwg and redirect dependency to it (diff)
downloadwireguard-android-ml/module.tar.xz
wireguard-android-ml/module.zip
Extract modulesml/module
Signed-off-by: Max Liu <maliu@mozilla.com>
-rw-r--r--app/build.gradle20
-rw-r--r--build.gradle17
-rw-r--r--config/build.gradle46
-rw-r--r--config/consumer-rules.pro0
-rw-r--r--config/proguard-rules.pro21
-rw-r--r--config/src/main/AndroidManifest.xml7
-rw-r--r--config/src/main/java/com/wireguard/config/Attribute.java (renamed from app/src/main/java/com/wireguard/config/Attribute.java)0
-rw-r--r--config/src/main/java/com/wireguard/config/BadConfigException.java (renamed from app/src/main/java/com/wireguard/config/BadConfigException.java)0
-rw-r--r--config/src/main/java/com/wireguard/config/Config.java (renamed from app/src/main/java/com/wireguard/config/Config.java)0
-rw-r--r--config/src/main/java/com/wireguard/config/InetAddresses.java (renamed from app/src/main/java/com/wireguard/config/InetAddresses.java)0
-rw-r--r--config/src/main/java/com/wireguard/config/InetEndpoint.java (renamed from app/src/main/java/com/wireguard/config/InetEndpoint.java)0
-rw-r--r--config/src/main/java/com/wireguard/config/InetNetwork.java (renamed from app/src/main/java/com/wireguard/config/InetNetwork.java)0
-rw-r--r--config/src/main/java/com/wireguard/config/Interface.java (renamed from app/src/main/java/com/wireguard/config/Interface.java)0
-rw-r--r--config/src/main/java/com/wireguard/config/ParseException.java (renamed from app/src/main/java/com/wireguard/config/ParseException.java)0
-rw-r--r--config/src/main/java/com/wireguard/config/Peer.java (renamed from app/src/main/java/com/wireguard/config/Peer.java)2
-rw-r--r--crypto/build.gradle36
-rw-r--r--crypto/consumer-rules.pro0
-rw-r--r--crypto/proguard-rules.pro21
-rw-r--r--crypto/src/main/AndroidManifest.xml7
-rw-r--r--crypto/src/main/java/com/wireguard/crypto/Curve25519.java (renamed from app/src/main/java/com/wireguard/crypto/Curve25519.java)0
-rw-r--r--crypto/src/main/java/com/wireguard/crypto/Key.java (renamed from app/src/main/java/com/wireguard/crypto/Key.java)0
-rw-r--r--crypto/src/main/java/com/wireguard/crypto/KeyFormatException.java (renamed from app/src/main/java/com/wireguard/crypto/KeyFormatException.java)0
-rw-r--r--crypto/src/main/java/com/wireguard/crypto/KeyPair.java (renamed from app/src/main/java/com/wireguard/crypto/KeyPair.java)0
-rw-r--r--libwg/build.gradle4
-rw-r--r--settings.gradle3
-rw-r--r--utility/build.gradle36
-rw-r--r--utility/consumer-rules.pro0
-rw-r--r--utility/proguard-rules.pro21
-rw-r--r--utility/src/main/AndroidManifest.xml7
-rw-r--r--utility/src/main/java/com/wireguard/util/Keyed.java (renamed from app/src/main/java/com/wireguard/util/Keyed.java)0
-rw-r--r--utility/src/main/java/com/wireguard/util/KeyedList.java (renamed from app/src/main/java/com/wireguard/util/KeyedList.java)0
-rw-r--r--utility/src/main/java/com/wireguard/util/NonNullForAll.java (renamed from app/src/main/java/com/wireguard/util/NonNullForAll.java)0
-rw-r--r--utility/src/main/java/com/wireguard/util/SortedKeyedList.java (renamed from app/src/main/java/com/wireguard/util/SortedKeyedList.java)0
33 files changed, 228 insertions, 20 deletions
diff --git a/app/build.gradle b/app/build.gradle
index 7816ea4..ffd0eff 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -61,25 +61,11 @@ android {
}
}
-ext {
- annotationsVersion = '1.1.0'
- appcompatVersion = '1.1.0'
- cardviewVersion = '1.0.0'
- databindingVersion = '3.5.0'
- materialComponentsVersion = '1.0.0'
- jsr305Version = '3.0.2'
- preferenceVersion = '1.1.0'
- streamsupportVersion = '1.7.1'
- threetenabpVersion = '1.2.1'
- // ZXING switched minSdk to 24 so we cannot upgrade to 4.0.2 without following suit.
- // If you choose to upgrade to minSDK 24 then you should also disable Jetifier from
- // gradle.properties.
- zxingEmbeddedVersion = '3.6.0'
- eddsaVersion = '0.3.0'
-}
-
dependencies {
+ implementation project(':config')
implementation project(':libwg')
+ implementation project(':utility')
+ implementation project(':crypto')
implementation "androidx.annotation:annotation:$annotationsVersion"
implementation "androidx.appcompat:appcompat:$appcompatVersion"
diff --git a/build.gradle b/build.gradle
index 125c452..c0de434 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,6 +5,23 @@ allprojects {
}
}
+ext {
+ annotationsVersion = '1.1.0'
+ appcompatVersion = '1.1.0'
+ cardviewVersion = '1.0.0'
+ databindingVersion = '3.5.0'
+ materialComponentsVersion = '1.0.0'
+ jsr305Version = '3.0.2'
+ preferenceVersion = '1.1.0'
+ streamsupportVersion = '1.7.1'
+ threetenabpVersion = '1.2.1'
+ // ZXING switched minSdk to 24 so we cannot upgrade to 4.0.2 without following suit.
+ // If you choose to upgrade to minSDK 24 then you should also disable Jetifier from
+ // gradle.properties.
+ zxingEmbeddedVersion = '3.6.0'
+ eddsaVersion = '0.3.0'
+}
+
buildscript {
ext.kotlin_version = '1.3.50'
diff --git a/config/build.gradle b/config/build.gradle
new file mode 100644
index 0000000..7e1f1e0
--- /dev/null
+++ b/config/build.gradle
@@ -0,0 +1,46 @@
+/*
+ * Copyright © 2019 WireGuard LLC. All Rights Reserved.
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+apply plugin: 'com.android.library'
+apply plugin: 'kotlin-android'
+apply plugin: 'kotlin-android-extensions'
+
+android {
+ compileSdkVersion 29
+ buildToolsVersion "29.0.2"
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+
+ defaultConfig {
+ minSdkVersion 19
+ targetSdkVersion 29
+ consumerProguardFiles 'consumer-rules.pro'
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+}
+
+dependencies {
+ implementation project(":crypto")
+ implementation project(":utility")
+
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
+ implementation "androidx.annotation:annotation:$annotationsVersion"
+ implementation "androidx.appcompat:appcompat:$appcompatVersion"
+ implementation 'androidx.core:core-ktx:1.1.0'
+
+ implementation "com.jakewharton.threetenabp:threetenabp:$threetenabpVersion"
+ implementation "net.sourceforge.streamsupport:android-retrofuture:$streamsupportVersion"
+ implementation "com.google.code.findbugs:jsr305:$jsr305Version"
+}
diff --git a/config/consumer-rules.pro b/config/consumer-rules.pro
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/config/consumer-rules.pro
diff --git a/config/proguard-rules.pro b/config/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/config/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/config/src/main/AndroidManifest.xml b/config/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..f49264e
--- /dev/null
+++ b/config/src/main/AndroidManifest.xml
@@ -0,0 +1,7 @@
+<!--
+ ~ Copyright © 2019 WireGuard LLC. All Rights Reserved.
+ ~ SPDX-License-Identifier: Apache-2.0
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.wireguard.config" />
diff --git a/app/src/main/java/com/wireguard/config/Attribute.java b/config/src/main/java/com/wireguard/config/Attribute.java
index 375acc4..375acc4 100644
--- a/app/src/main/java/com/wireguard/config/Attribute.java
+++ b/config/src/main/java/com/wireguard/config/Attribute.java
diff --git a/app/src/main/java/com/wireguard/config/BadConfigException.java b/config/src/main/java/com/wireguard/config/BadConfigException.java
index 6d41b06..6d41b06 100644
--- a/app/src/main/java/com/wireguard/config/BadConfigException.java
+++ b/config/src/main/java/com/wireguard/config/BadConfigException.java
diff --git a/app/src/main/java/com/wireguard/config/Config.java b/config/src/main/java/com/wireguard/config/Config.java
index 62651b0..62651b0 100644
--- a/app/src/main/java/com/wireguard/config/Config.java
+++ b/config/src/main/java/com/wireguard/config/Config.java
diff --git a/app/src/main/java/com/wireguard/config/InetAddresses.java b/config/src/main/java/com/wireguard/config/InetAddresses.java
index d24c571..d24c571 100644
--- a/app/src/main/java/com/wireguard/config/InetAddresses.java
+++ b/config/src/main/java/com/wireguard/config/InetAddresses.java
diff --git a/app/src/main/java/com/wireguard/config/InetEndpoint.java b/config/src/main/java/com/wireguard/config/InetEndpoint.java
index a442258..a442258 100644
--- a/app/src/main/java/com/wireguard/config/InetEndpoint.java
+++ b/config/src/main/java/com/wireguard/config/InetEndpoint.java
diff --git a/app/src/main/java/com/wireguard/config/InetNetwork.java b/config/src/main/java/com/wireguard/config/InetNetwork.java
index f89322f..f89322f 100644
--- a/app/src/main/java/com/wireguard/config/InetNetwork.java
+++ b/config/src/main/java/com/wireguard/config/InetNetwork.java
diff --git a/app/src/main/java/com/wireguard/config/Interface.java b/config/src/main/java/com/wireguard/config/Interface.java
index 5494442..5494442 100644
--- a/app/src/main/java/com/wireguard/config/Interface.java
+++ b/config/src/main/java/com/wireguard/config/Interface.java
diff --git a/app/src/main/java/com/wireguard/config/ParseException.java b/config/src/main/java/com/wireguard/config/ParseException.java
index c79d1fa..c79d1fa 100644
--- a/app/src/main/java/com/wireguard/config/ParseException.java
+++ b/config/src/main/java/com/wireguard/config/ParseException.java
diff --git a/app/src/main/java/com/wireguard/config/Peer.java b/config/src/main/java/com/wireguard/config/Peer.java
index 37fcfa6..1890c54 100644
--- a/app/src/main/java/com/wireguard/config/Peer.java
+++ b/config/src/main/java/com/wireguard/config/Peer.java
@@ -1,5 +1,5 @@
/*
- * Copyright © 2017-2019 WireGuard LLC. All Rights Reserved.
+ * Copyright © 2019 WireGuard LLC. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
diff --git a/crypto/build.gradle b/crypto/build.gradle
new file mode 100644
index 0000000..52f15f2
--- /dev/null
+++ b/crypto/build.gradle
@@ -0,0 +1,36 @@
+/*
+ * Copyright © 2019 WireGuard LLC. All Rights Reserved.
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+apply plugin: 'com.android.library'
+apply plugin: 'kotlin-android'
+apply plugin: 'kotlin-android-extensions'
+
+android {
+ compileSdkVersion 29
+ buildToolsVersion "29.0.2"
+
+ defaultConfig {
+ minSdkVersion 14
+ targetSdkVersion 29
+
+ consumerProguardFiles 'consumer-rules.pro'
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+}
+
+dependencies {
+ implementation project(":utility")
+
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
+ implementation 'androidx.appcompat:appcompat:1.1.0'
+ implementation 'androidx.core:core-ktx:1.1.0'
+}
diff --git a/crypto/consumer-rules.pro b/crypto/consumer-rules.pro
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/crypto/consumer-rules.pro
diff --git a/crypto/proguard-rules.pro b/crypto/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/crypto/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/crypto/src/main/AndroidManifest.xml b/crypto/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..f176c15
--- /dev/null
+++ b/crypto/src/main/AndroidManifest.xml
@@ -0,0 +1,7 @@
+<!--
+ ~ Copyright © 2019 WireGuard LLC. All Rights Reserved.
+ ~ SPDX-License-Identifier: Apache-2.0
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.wireguard.crypto" />
diff --git a/app/src/main/java/com/wireguard/crypto/Curve25519.java b/crypto/src/main/java/com/wireguard/crypto/Curve25519.java
index 5622fc5..5622fc5 100644
--- a/app/src/main/java/com/wireguard/crypto/Curve25519.java
+++ b/crypto/src/main/java/com/wireguard/crypto/Curve25519.java
diff --git a/app/src/main/java/com/wireguard/crypto/Key.java b/crypto/src/main/java/com/wireguard/crypto/Key.java
index f743ddd..f743ddd 100644
--- a/app/src/main/java/com/wireguard/crypto/Key.java
+++ b/crypto/src/main/java/com/wireguard/crypto/Key.java
diff --git a/app/src/main/java/com/wireguard/crypto/KeyFormatException.java b/crypto/src/main/java/com/wireguard/crypto/KeyFormatException.java
index 5818b4d..5818b4d 100644
--- a/app/src/main/java/com/wireguard/crypto/KeyFormatException.java
+++ b/crypto/src/main/java/com/wireguard/crypto/KeyFormatException.java
diff --git a/app/src/main/java/com/wireguard/crypto/KeyPair.java b/crypto/src/main/java/com/wireguard/crypto/KeyPair.java
index f8238e9..f8238e9 100644
--- a/app/src/main/java/com/wireguard/crypto/KeyPair.java
+++ b/crypto/src/main/java/com/wireguard/crypto/KeyPair.java
diff --git a/libwg/build.gradle b/libwg/build.gradle
index 7457573..843a0d6 100644
--- a/libwg/build.gradle
+++ b/libwg/build.gradle
@@ -11,7 +11,6 @@ android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
-
defaultConfig {
minSdkVersion 21
targetSdkVersion 29
@@ -32,5 +31,6 @@ android {
}
dependencies {
-
+ implementation "androidx.annotation:annotation:$annotationsVersion"
+ implementation "androidx.appcompat:appcompat:$appcompatVersion"
}
diff --git a/settings.gradle b/settings.gradle
index ba5f5dd..e821e7d 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,2 +1,5 @@
include ':app'
include ':libwg'
+include ':config'
+include ':crypto'
+include ':utility'
diff --git a/utility/build.gradle b/utility/build.gradle
new file mode 100644
index 0000000..f4b4e20
--- /dev/null
+++ b/utility/build.gradle
@@ -0,0 +1,36 @@
+/*
+ * Copyright © 2019 WireGuard LLC. All Rights Reserved.
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+apply plugin: 'com.android.library'
+apply plugin: 'kotlin-android'
+apply plugin: 'kotlin-android-extensions'
+
+android {
+ compileSdkVersion 29
+ buildToolsVersion "29.0.2"
+
+ defaultConfig {
+ minSdkVersion 14
+ targetSdkVersion 29
+
+ consumerProguardFiles 'consumer-rules.pro'
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+}
+
+dependencies {
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
+ implementation 'androidx.appcompat:appcompat:1.1.0'
+ implementation 'androidx.core:core-ktx:1.1.0'
+
+ implementation "com.google.code.findbugs:jsr305:$jsr305Version"
+}
diff --git a/utility/consumer-rules.pro b/utility/consumer-rules.pro
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/utility/consumer-rules.pro
diff --git a/utility/proguard-rules.pro b/utility/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/utility/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/utility/src/main/AndroidManifest.xml b/utility/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..01cfcfc
--- /dev/null
+++ b/utility/src/main/AndroidManifest.xml
@@ -0,0 +1,7 @@
+<!--
+ ~ Copyright © 2019 WireGuard LLC. All Rights Reserved.
+ ~ SPDX-License-Identifier: Apache-2.0
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.wireguard.util" />
diff --git a/app/src/main/java/com/wireguard/util/Keyed.java b/utility/src/main/java/com/wireguard/util/Keyed.java
index f31a43a..f31a43a 100644
--- a/app/src/main/java/com/wireguard/util/Keyed.java
+++ b/utility/src/main/java/com/wireguard/util/Keyed.java
diff --git a/app/src/main/java/com/wireguard/util/KeyedList.java b/utility/src/main/java/com/wireguard/util/KeyedList.java
index c116c1d..c116c1d 100644
--- a/app/src/main/java/com/wireguard/util/KeyedList.java
+++ b/utility/src/main/java/com/wireguard/util/KeyedList.java
diff --git a/app/src/main/java/com/wireguard/util/NonNullForAll.java b/utility/src/main/java/com/wireguard/util/NonNullForAll.java
index f179fa4..f179fa4 100644
--- a/app/src/main/java/com/wireguard/util/NonNullForAll.java
+++ b/utility/src/main/java/com/wireguard/util/NonNullForAll.java
diff --git a/app/src/main/java/com/wireguard/util/SortedKeyedList.java b/utility/src/main/java/com/wireguard/util/SortedKeyedList.java
index b144fc8..b144fc8 100644
--- a/app/src/main/java/com/wireguard/util/SortedKeyedList.java
+++ b/utility/src/main/java/com/wireguard/util/SortedKeyedList.java