From b64dd245a0062d88e00bd6ef818c7478424df827 Mon Sep 17 00:00:00 2001 From: Mygod Date: Sat, 4 Jan 2020 17:29:58 +0800 Subject: [PATCH 1/5] Fixes #2391 --- .../com/github/shadowsocks/plugin/OptionsCapableActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/src/main/java/com/github/shadowsocks/plugin/OptionsCapableActivity.kt b/plugin/src/main/java/com/github/shadowsocks/plugin/OptionsCapableActivity.kt index bc184bcc34..300701dbbf 100644 --- a/plugin/src/main/java/com/github/shadowsocks/plugin/OptionsCapableActivity.kt +++ b/plugin/src/main/java/com/github/shadowsocks/plugin/OptionsCapableActivity.kt @@ -30,7 +30,7 @@ import androidx.appcompat.app.AppCompatActivity */ abstract class OptionsCapableActivity : AppCompatActivity() { protected fun pluginOptions(intent: Intent = this.intent) = try { - PluginOptions(intent.getStringExtra(PluginContract.EXTRA_OPTIONS)) + PluginOptions("", intent.getStringExtra(PluginContract.EXTRA_OPTIONS)) } catch (exc: IllegalArgumentException) { Toast.makeText(this, exc.message, Toast.LENGTH_SHORT).show() PluginOptions() From a9ef6bc98707a33ed08837a7cabfcdab99abbe0c Mon Sep 17 00:00:00 2001 From: Mygod Date: Thu, 9 Jan 2020 17:34:29 +0800 Subject: [PATCH 2/5] Ensure #2391 is fixed --- .../java/com/github/shadowsocks/plugin/PluginOptionsTest.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugin/src/test/java/com/github/shadowsocks/plugin/PluginOptionsTest.kt b/plugin/src/test/java/com/github/shadowsocks/plugin/PluginOptionsTest.kt index e3f46fbbb1..6c46cd4e6c 100644 --- a/plugin/src/test/java/com/github/shadowsocks/plugin/PluginOptionsTest.kt +++ b/plugin/src/test/java/com/github/shadowsocks/plugin/PluginOptionsTest.kt @@ -36,6 +36,12 @@ class PluginOptionsTest { Assert.assertEquals(true, o3 == o4) } + @Test + fun nullValues() { + val o = PluginOptions("", "a;b;c;d=3") + Assert.assertEquals(true, o == PluginOptions("", o.toString())) + } + @Test fun escape() { val options = PluginOptions("escapeTest") From 5fe3ff77c82e627f12ee0058d270c48ed716b760 Mon Sep 17 00:00:00 2001 From: Mygod Date: Thu, 9 Jan 2020 17:35:52 +0800 Subject: [PATCH 3/5] Bump plugin version code --- plugin/CHANGES.md | 2 ++ plugin/gradle.properties | 4 ++-- plugin/src/main/AndroidManifest.xml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugin/CHANGES.md b/plugin/CHANGES.md index 427556899b..f0546d8c2f 100644 --- a/plugin/CHANGES.md +++ b/plugin/CHANGES.md @@ -1,3 +1,5 @@ +* 1.3.2: + * Fix first key-value pair disappearing with null value. (#2391) * 1.3.1: * New theme resource `Theme.Shadowsocks.Immersive` for better Android Q-esque translucent navigation bars. This is an opt-in feature. diff --git a/plugin/gradle.properties b/plugin/gradle.properties index f70e6fcf0d..809eaf873a 100644 --- a/plugin/gradle.properties +++ b/plugin/gradle.properties @@ -1,6 +1,6 @@ GROUP=com.github.shadowsocks -VERSION_NAME=1.3.1 -VERSION_CODE=11 +VERSION_NAME=1.3.2 +VERSION_CODE=12 POM_ARTIFACT_ID=plugin POM_NAME=Shadowsocks Plugin diff --git a/plugin/src/main/AndroidManifest.xml b/plugin/src/main/AndroidManifest.xml index 54659b6313..c43ea02c9d 100644 --- a/plugin/src/main/AndroidManifest.xml +++ b/plugin/src/main/AndroidManifest.xml @@ -3,6 +3,6 @@ + android:value="1.3.2"/> From 31cb7a0d80ae3e728f304fcd597d7734563df8ba Mon Sep 17 00:00:00 2001 From: Mygod Date: Thu, 9 Jan 2020 22:28:44 +0800 Subject: [PATCH 4/5] Update dependencies --- build.gradle | 2 +- core/build.gradle | 4 ++-- detekt.yml | 21 ++++++++++++++++++--- mobile/build.gradle | 4 ++-- plugin/CHANGES.md | 3 +++ plugin/build.gradle | 2 +- tv/build.gradle | 2 +- 7 files changed, 28 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 4a2562a1f7..1332e61b3f 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ buildscript { sdkVersion = 29 compileSdkVersion = 29 lifecycleVersion = '2.2.0-rc03' - junitVersion = '4.12' + junitVersion = '4.13' androidTestVersion = '1.2.0' androidEspressoVersion = '3.2.0' versionCode = 4080750 diff --git a/core/build.gradle b/core/build.gradle index ed06cb69b1..aa670a8577 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -49,7 +49,7 @@ androidExtensions { } def coroutinesVersion = '1.3.3' -def roomVersion = '2.2.2' +def roomVersion = '2.2.3' def workVersion = '2.2.0' dependencies { api project(':plugin') @@ -64,7 +64,7 @@ dependencies { api 'com.crashlytics.sdk.android:crashlytics:2.10.1' api 'com.google.code.gson:gson:2.8.6' api 'com.google.firebase:firebase-analytics:17.2.1' - api 'com.google.firebase:firebase-config:19.0.4' + api 'com.google.firebase:firebase-config:19.1.0' api 'dnsjava:dnsjava:2.1.9' api "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion" api "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$coroutinesVersion" diff --git a/detekt.yml b/detekt.yml index 09706d4318..857213ecf8 100644 --- a/detekt.yml +++ b/detekt.yml @@ -1,4 +1,4 @@ -# https://github.com/arturbosch/detekt/blob/1.1.1/detekt-cli/src/main/resources/default-detekt-config.yml +# https://github.com/arturbosch/detekt/blob/1.3.1/detekt-cli/src/main/resources/default-detekt-config.yml comments: active: false @@ -14,9 +14,11 @@ complexity: includeStaticDeclarations: false ComplexMethod: active: true - threshold: 10 + threshold: 15 ignoreSingleWhenExpression: false ignoreSimpleWhenEntries: false + ignoreNestingFunctions: false + nestingFunctions: run,let,apply,with,also,use,forEach,isNotNull,ifNull LabeledExpression: active: false ignoredLabels: "" @@ -245,6 +247,7 @@ naming: parameterPattern: '[a-z][A-Za-z0-9]*' privateParameterPattern: '[a-z][A-Za-z0-9]*' excludeClassPattern: '$^' + ignoreOverridden: true EnumNaming: active: true excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" @@ -337,6 +340,8 @@ potential-bugs: active: true HasPlatformType: active: true + ImplicitDefaultLocale: + active: true InvalidRange: active: true IteratorHasNextCallsNextMethod: @@ -345,6 +350,8 @@ potential-bugs: active: true LateinitUsage: active: false + MapGetWithNotNullAssertionOperator: + active: true MissingWhenCase: active: false RedundantElseInWhen: @@ -354,7 +361,7 @@ potential-bugs: UnreachableCode: active: true UnsafeCallOnNullableType: - active: false + active: true UnsafeCast: active: false UselessPostfixExpression: @@ -387,6 +394,12 @@ style: active: true imports: '' forbiddenPatterns: "" + ForbiddenMethodCall: + active: true + methods: '' + ForbiddenPublicDataClass: + active: true + ignorePackages: '*.internal,*.internal.*' ForbiddenVoid: active: true ignoreOverridden: true @@ -453,6 +466,8 @@ style: UnnecessaryAbstractClass: active: true excludeAnnotatedClasses: "dagger.Module" + UnnecessaryAnnotationUseSiteTarget: + active: true UnnecessaryApply: active: true UnnecessaryInheritance: diff --git a/mobile/build.gradle b/mobile/build.gradle index a88c3b6c13..a553a95a9e 100644 --- a/mobile/build.gradle +++ b/mobile/build.gradle @@ -60,8 +60,8 @@ androidExtensions { dependencies { implementation project(':core') - implementation 'androidx.browser:browser:1.2.0-rc01' - implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta3' + implementation 'androidx.browser:browser:1.2.0' + implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4' implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion" implementation 'com.google.android.gms:play-services-vision:19.0.0' implementation 'com.google.firebase:firebase-ads:18.3.0' diff --git a/plugin/CHANGES.md b/plugin/CHANGES.md index f0546d8c2f..8822244663 100644 --- a/plugin/CHANGES.md +++ b/plugin/CHANGES.md @@ -1,5 +1,8 @@ * 1.3.2: * Fix first key-value pair disappearing with null value. (#2391) + * Dependency updates: + - `com.google.android.material:material:1.1.0-rc01`; + - `org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.61`. * 1.3.1: * New theme resource `Theme.Shadowsocks.Immersive` for better Android Q-esque translucent navigation bars. This is an opt-in feature. diff --git a/plugin/build.gradle b/plugin/build.gradle index 9be6e15d2f..d6ff629c94 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -57,7 +57,7 @@ mavenPublish { dependencies { api 'androidx.core:core-ktx:1.1.0' api 'androidx.drawerlayout:drawerlayout:1.1.0-alpha03' // https://android-developers.googleblog.com/2019/07/android-q-beta-5-update.html - api 'com.google.android.material:material:1.1.0-beta02' + api 'com.google.android.material:material:1.1.0-rc01' api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion" testImplementation "junit:junit:$junitVersion" androidTestImplementation "androidx.test:runner:$androidTestVersion" diff --git a/tv/build.gradle b/tv/build.gradle index af8845b98e..a949e8cff8 100644 --- a/tv/build.gradle +++ b/tv/build.gradle @@ -56,7 +56,7 @@ android { dependencies { implementation project(':core') implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation "androidx.leanback:leanback-preference:1.1.0-alpha02" + implementation 'androidx.leanback:leanback-preference:1.1.0-alpha03' } apply plugin: 'com.google.gms.google-services' From 0118802ff43c0247622d86bc3e9f0e40242d3f8c Mon Sep 17 00:00:00 2001 From: Mygod Date: Thu, 9 Jan 2020 22:39:39 +0800 Subject: [PATCH 5/5] Add missing changes --- plugin/CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin/CHANGES.md b/plugin/CHANGES.md index 8822244663..6e32d37ec2 100644 --- a/plugin/CHANGES.md +++ b/plugin/CHANGES.md @@ -1,6 +1,7 @@ * 1.3.2: * Fix first key-value pair disappearing with null value. (#2391) * Dependency updates: + - `androidx.core:core-ktx:1.1.0`; - `com.google.android.material:material:1.1.0-rc01`; - `org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.61`. * 1.3.1: