diff --git a/README.md b/README.md index 84111544..d387b31e 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ A V2Ray client for Android, support [Xray core](https://github.com/XTLS/Xray-core) and [v2fly core](https://github.com/v2fly/v2ray-core) [![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.4.10-blue.svg)](https://kotlinlang.org) +[![Kotlin Version](https://img.shields.io/badge/Kotlin-1.5.10-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 b1cd20d3..029a7603 100644 --- a/V2rayNG/app/build.gradle +++ b/V2rayNG/app/build.gradle @@ -70,26 +70,26 @@ dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') testImplementation 'junit:junit:4.13' - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" - implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9" + // Androidx + implementation 'androidx.constraintlayout:constraintlayout:2.0.4' + implementation "androidx.legacy:legacy-support-v4:1.0.0" + implementation "androidx.appcompat:appcompat:1.3.0" + implementation "com.google.android.material:material:1.4.0" + implementation "androidx.cardview:cardview:1.0.0" + implementation "androidx.preference:preference:1.0.0" + implementation "androidx.recyclerview:recyclerview:1.2.1" + implementation 'androidx.multidex:multidex:2.0.1' // Androidx ktx - implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0' - implementation 'androidx.lifecycle:lifecycle-livedata:2.0.0' + implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' + implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1' - // Android support library - implementation "androidx.legacy:legacy-support-v4:$supportLibVersion" - implementation "androidx.appcompat:appcompat:$supportLibVersion" - implementation "com.google.android.material:material:$supportLibVersion" - implementation "androidx.cardview:cardview:$supportLibVersion" - implementation "androidx.preference:preference:$supportLibVersion" - implementation "androidx.recyclerview:recyclerview:$supportLibVersion" - implementation 'androidx.multidex:multidex:2.0.0' - implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + //kotlin + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" + implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1" - // DSL implementation 'com.tencent:mmkv-static:1.2.7' implementation 'com.google.code.gson:gson:2.8.6' implementation 'io.reactivex:rxjava:1.3.4' @@ -103,7 +103,6 @@ dependencies { implementation 'com.blacksquircle.ui:language-json:2.0.0' implementation(name: 'libv2ray', ext: 'aar') - //implementation(name: 'tun2socks', ext: 'aar') } buildscript { diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/RoutingSettingsFragment.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/RoutingSettingsFragment.kt index 6b401fe3..b798edd2 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/RoutingSettingsFragment.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/RoutingSettingsFragment.kt @@ -45,7 +45,7 @@ class RoutingSettingsFragment : Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - val content = defaultSharedPreferences.getString(arguments!!.getString(routing_arg), "") + val content = defaultSharedPreferences.getString(requireArguments().getString(routing_arg), "") et_routing_content.text = Utils.getEditable(content!!) setHasOptionsMenu(true) @@ -59,7 +59,7 @@ class RoutingSettingsFragment : Fragment() { override fun onOptionsItemSelected(item: MenuItem) = when (item.itemId) { R.id.save_routing -> { val content = et_routing_content.text.toString() - defaultSharedPreferences.edit().putString(arguments!!.getString(routing_arg), content).apply() + defaultSharedPreferences.edit().putString(requireArguments().getString(routing_arg), content).apply() activity?.toast(R.string.toast_success) true } @@ -88,7 +88,7 @@ class RoutingSettingsFragment : Fragment() { // .addCategory(Intent.CATEGORY_DEFAULT) // .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP), requestCode) // } catch (e: Exception) { - RxPermissions(activity!!) + RxPermissions(requireActivity()) .request(Manifest.permission.CAMERA) .subscribe { if (it) @@ -102,7 +102,7 @@ class RoutingSettingsFragment : Fragment() { fun setDefaultRules(): Boolean { var url = AppConfig.v2rayCustomRoutingListUrl - when (arguments!!.getString(routing_arg)) { + when (requireArguments().getString(routing_arg)) { AppConfig.PREF_V2RAY_ROUTING_AGENT -> { url += AppConfig.TAG_AGENT } diff --git a/V2rayNG/build.gradle b/V2rayNG/build.gradle index 7615c167..c48f83fb 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:4.1.0' + classpath 'com.android.tools.build:gradle:4.2.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" // NOTE: Do not place your application dependencies here; they belong diff --git a/V2rayNG/gradle.properties b/V2rayNG/gradle.properties index d155321c..c8f22982 100644 --- a/V2rayNG/gradle.properties +++ b/V2rayNG/gradle.properties @@ -13,11 +13,10 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryErro # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true #Fri Jun 02 14:08:42 CST 2017 -kotlinVersion=1.4.10 -supportLibVersion=1.0.0 +kotlinVersion=1.5.10 buildToolsVer=30.0.2 compileSdkVer=30 -kotlin.incremental=true targetSdkVer=30 +kotlin.incremental=true android.useAndroidX=true android.enableJetifier=true diff --git a/V2rayNG/gradle/wrapper/gradle-wrapper.properties b/V2rayNG/gradle/wrapper/gradle-wrapper.properties index 845192ee..85117198 100644 --- a/V2rayNG/gradle/wrapper/gradle-wrapper.properties +++ b/V2rayNG/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip