Migrate tunnel related classes to tunnel/ Gradle module

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya 2020-03-09 19:00:14 +05:30
parent fd573f6c1c
commit adc613d801
42 changed files with 76 additions and 44 deletions

4
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "app/tools/wireguard-tools"]
path = app/tools/wireguard-tools
[submodule "tunnel/tools/wireguard-tools"]
path = tunnel/tools/wireguard-tools
url = https://git.zx2c4.com/wireguard-tools

View File

@ -65,51 +65,21 @@ android {
}
}
}
externalNativeBuild {
cmake {
path 'tools/CMakeLists.txt'
}
}
}
ext {
annotationsVersion = '1.1.0'
appcompatVersion = '1.1.0'
cardviewVersion = '1.0.0'
coreKtxVersion = '1.2.0'
constraintLayoutVersion = '1.1.3'
coordinatorLayoutVersion = '1.1.0'
databindingVersion = '3.6.0'
fragmentVersion = '1.2.2'
materialComponentsVersion = '1.1.0'
jsr305Version = '3.0.2'
kotlinVersion = '1.3.70'
preferenceVersion = '1.1.0'
streamsupportVersion = '1.7.1'
threetenabpVersion = '1.2.2'
// 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(":tunnel")
implementation "androidx.annotation:annotation:$annotationsVersion"
implementation "androidx.appcompat:appcompat:$appcompatVersion"
implementation "androidx.cardview:cardview:$cardviewVersion"
implementation "androidx.constraintlayout:constraintlayout:$constraintLayoutVersion"
implementation "androidx.coordinatorlayout:coordinatorlayout:$coordinatorLayoutVersion"
implementation "androidx.core:core-ktx:$coreKtxVersion"
implementation "androidx.databinding:databinding-runtime:$databindingVersion"
implementation "androidx.databinding:databinding-runtime:$agpVersion"
implementation "androidx.fragment:fragment:$fragmentVersion"
implementation "androidx.preference:preference:$preferenceVersion"
implementation "com.google.android.material:material:$materialComponentsVersion"
implementation "com.google.code.findbugs:jsr305:$jsr305Version"
implementation "com.jakewharton.threetenabp:threetenabp:$threetenabpVersion"
implementation "com.journeyapps:zxing-android-embedded:$zxingEmbeddedVersion"
implementation "net.sourceforge.streamsupport:android-retrofuture:$streamsupportVersion"
implementation "net.sourceforge.streamsupport:android-retrostreams:$streamsupportVersion"
implementation "net.i2p.crypto:eddsa:$eddsaVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
}

View File

@ -73,14 +73,6 @@
</intent-filter>
</receiver>
<service
android:name=".backend.GoBackend$VpnService"
android:permission="android.permission.BIND_VPN_SERVICE">
<intent-filter>
<action android:name="android.net.VpnService" />
</intent-filter>
</service>
<service
android:name=".QuickTileService"
android:icon="@drawable/ic_tile"

View File

@ -6,9 +6,31 @@ allprojects {
}
buildscript {
ext {
annotationsVersion = '1.1.0'
appcompatVersion = '1.1.0'
cardviewVersion = '1.0.0'
collectionVersion = '1.1.0'
coreKtxVersion = '1.2.0'
constraintLayoutVersion = '1.1.3'
coordinatorLayoutVersion = '1.1.0'
agpVersion = '3.6.1'
fragmentVersion = '1.2.2'
materialComponentsVersion = '1.1.0'
jsr305Version = '3.0.2'
kotlinVersion = '1.3.70'
preferenceVersion = '1.1.0'
streamsupportVersion = '1.7.1'
threetenabpVersion = '1.2.2'
// 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 {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.70'
classpath "com.android.tools.build:gradle:$agpVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
repositories {
google()

View File

@ -1 +1,2 @@
include ':app'
include ':tunnel'

30
tunnel/build.gradle Normal file
View File

@ -0,0 +1,30 @@
apply plugin: 'com.android.library'
android {
buildToolsVersion '29.0.3'
compileSdkVersion 29
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName '1.0'
}
externalNativeBuild {
cmake {
path 'tools/CMakeLists.txt'
}
}
}
dependencies {
api "net.sourceforge.streamsupport:android-retrofuture:$streamsupportVersion"
api "net.sourceforge.streamsupport:android-retrostreams:$streamsupportVersion"
api "com.google.code.findbugs:jsr305:$jsr305Version"
implementation "androidx.annotation:annotation:$annotationsVersion"
implementation "androidx.collection:collection:$collectionVersion"
implementation "com.jakewharton.threetenabp:threetenabp:$threetenabpVersion"
}

View File

@ -0,0 +1,17 @@
<!--
~ Copyright © 2017-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.android.tunnel">
<application>
<service
android:name="com.wireguard.android.backend.GoBackend$VpnService"
android:permission="android.permission.BIND_VPN_SERVICE">
<intent-filter>
<action android:name="android.net.VpnService" />
</intent-filter>
</service>
</application>
</manifest>