diff --git a/README.md b/README.md index 7acd0f03..dc85bac0 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ A V2Ray client for Android [![API](https://img.shields.io/badge/API-17%2B-yellow.svg?style=flat)](https://developer.android.com/about/versions/jelly-bean#android-4.2) -[![Kotlin Version](https://img.shields.io/badge/Kotlin-1.3.40-blue.svg)](https://kotlinlang.org) +[![Kotlin Version](https://img.shields.io/badge/Kotlin-1.4.0-blue.svg)](https://kotlinlang.org) [![GitHub commit activity](https://img.shields.io/github/commit-activity/m/2dust/v2rayNG)](https://github.com/2dust/v2rayNG/commits/master) [![CodeFactor](https://www.codefactor.io/repository/github/2dust/v2rayng/badge)](https://www.codefactor.io/repository/github/2dust/v2rayng) [![GitHub Releases](https://img.shields.io/github/downloads/2dust/v2rayNG/latest/total?logo=github)](https://github.com/2dust/v2rayNG/releases) diff --git a/V2rayNG/app/build.gradle b/V2rayNG/app/build.gradle index 9ac68172..3c906e29 100644 --- a/V2rayNG/app/build.gradle +++ b/V2rayNG/app/build.gradle @@ -62,14 +62,13 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'com.android.support.constraint:constraint-layout:1.1.3' - testImplementation 'junit:junit:4.12' + testImplementation 'junit:junit:4.13' implementation project(':dpreference') + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.2.2" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.2.2" // 1.3.x has compile error: - // More than one file was found with OS independent path 'META-INF/proguard/coroutines.pro' + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9" // Android support library implementation "com.android.support:support-v4:$supportLibVersion" @@ -79,12 +78,14 @@ dependencies { implementation "com.android.support:preference-v7:$supportLibVersion" implementation "com.android.support:recyclerview-v7:$supportLibVersion" implementation "com.android.support:multidex:1.0.3" + implementation 'com.android.support.constraint:constraint-layout:2.0.1' + // DSL implementation "org.jetbrains.anko:anko-sdk15:$ankoVersion" implementation "org.jetbrains.anko:anko-support-v4:$ankoVersion" implementation "org.jetbrains.anko:anko-appcompat-v7:$ankoVersion" implementation "org.jetbrains.anko:anko-design:$ankoVersion" - implementation 'com.google.code.gson:gson:2.8.5' + implementation 'com.google.code.gson:gson:2.8.6' implementation 'io.reactivex:rxjava:1.3.4' implementation 'io.reactivex:rxandroid:1.2.1' implementation 'com.tbruyelle.rxpermissions:rxpermissions:0.9.4@aar' @@ -94,7 +95,6 @@ dependencies { implementation 'me.dm7.barcodescanner:zxing:1.9.8' implementation 'com.github.jorgecastilloprz:fabprogresscircle:1.01@aar' implementation 'com.beust:klaxon:3.0.1' - implementation 'com.android.support:multidex:1.0.3' implementation(name: 'libv2ray', ext: 'aar') //implementation(name: 'tun2socks', ext: 'aar') diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/service/V2RayVpnService.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/service/V2RayVpnService.kt index 6dc41713..823776a1 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/service/V2RayVpnService.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/service/V2RayVpnService.kt @@ -32,7 +32,8 @@ class V2RayVpnService : VpnService(), ServiceControl { * * Source: https://android.googlesource.com/platform/frameworks/base/+/2df4c7d/services/core/java/com/android/server/ConnectivityService.java#887 */ - private val defaultNetworkRequest by lazy @RequiresApi(Build.VERSION_CODES.P) { + @delegate:RequiresApi(Build.VERSION_CODES.P) + private val defaultNetworkRequest by lazy { NetworkRequest.Builder() .addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) .addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED) @@ -41,7 +42,8 @@ class V2RayVpnService : VpnService(), ServiceControl { private val connectivity by lazy { getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager } - private val defaultNetworkCallback by lazy @RequiresApi(Build.VERSION_CODES.P) { + @delegate:RequiresApi(Build.VERSION_CODES.P) + private val defaultNetworkCallback by lazy { object : ConnectivityManager.NetworkCallback() { override fun onAvailable(network: Network) { setUnderlyingNetworks(arrayOf(network)) diff --git a/V2rayNG/build.gradle b/V2rayNG/build.gradle index 9f066fb1..7b3fdbb2 100644 --- a/V2rayNG/build.gradle +++ b/V2rayNG/build.gradle @@ -7,7 +7,7 @@ buildscript { maven { url 'https://maven.google.com' } } dependencies { - classpath 'com.android.tools.build:gradle:3.1.3' + classpath 'com.android.tools.build:gradle:4.0.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" // NOTE: Do not place your application dependencies here; they belong diff --git a/V2rayNG/dpreference/build.gradle b/V2rayNG/dpreference/build.gradle index 09d2240c..36a9e314 100644 --- a/V2rayNG/dpreference/build.gradle +++ b/V2rayNG/dpreference/build.gradle @@ -19,7 +19,7 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - testImplementation 'junit:junit:4.12' + testImplementation 'junit:junit:4.13' implementation "com.android.support:support-annotations:$supportLibVersion" - implementation 'com.google.code.gson:gson:2.7' + implementation 'com.google.code.gson:gson:2.8.6' } diff --git a/V2rayNG/gradle.properties b/V2rayNG/gradle.properties index 44823400..ee67f2c2 100644 --- a/V2rayNG/gradle.properties +++ b/V2rayNG/gradle.properties @@ -14,7 +14,7 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryErro # org.gradle.parallel=true #Fri Jun 02 14:08:42 CST 2017 ankoVersion=0.10.8 -kotlinVersion=1.3.40 +kotlinVersion=1.4.0 supportLibVersion=28.0.0 buildToolsVer=29.0.3 compileSdkVer=29