Skip to content

Commit 3dc3fd9

Browse files
author
Alon Blayer-Gat
committed
gradle: 8.4, agp 8.3.0-alpha09, kotlin 1.9.10, lint errors
Signed-off-by: Alon Blayer-Gat <[email protected]>
1 parent 827495b commit 3dc3fd9

File tree

7 files changed

+21
-29
lines changed

7 files changed

+21
-29
lines changed

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77

88
tasks {
99
wrapper {
10-
gradleVersion = "8.3"
11-
distributionSha256Sum = "591855b517fc635b9e04de1d05d5e76ada3f89f5fc76f87978d1b245b4f69225"
10+
gradleVersion = "8.4"
11+
distributionSha256Sum = "3e1af3ae886920c3ac87f7a91f816c0c7c436f276a6eefdb3da152100fef72ae"
1212
}
1313
}

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[versions]
2-
agp = "8.2.0-beta06"
3-
kotlin = "1.9.0"
2+
agp = "8.3.0-alpha09"
3+
kotlin = "1.9.10"
44

55
[libraries]
66
androidx-activity-ktx = "androidx.activity:activity-ktx:1.8.0"
@@ -19,7 +19,7 @@ desugarJdkLibs = "com.android.tools:desugar_jdk_libs:2.0.3"
1919
google-material = "com.google.android.material:material:1.10.0"
2020
jsr305 = "com.google.code.findbugs:jsr305:3.0.2"
2121
junit = "junit:junit:4.13.2"
22-
kotlinx-coroutines-android = "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.0"
22+
kotlinx-coroutines-android = "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3"
2323
zxing-android-embedded = "com.journeyapps:zxing-android-embedded:4.3.0"
2424

2525
[plugins]

gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=591855b517fc635b9e04de1d05d5e76ada3f89f5fc76f87978d1b245b4f69225
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
3+
distributionSha256Sum=3e1af3ae886920c3ac87f7a91f816c0c7c436f276a6eefdb3da152100fef72ae
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
145145
case $MAX_FD in #(
146146
max*)
147147
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
148-
# shellcheck disable=SC3045
148+
# shellcheck disable=SC2039,SC3045
149149
MAX_FD=$( ulimit -H -n ) ||
150150
warn "Could not query maximum file descriptor limit"
151151
esac
152152
case $MAX_FD in #(
153153
'' | soft) :;; #(
154154
*)
155155
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
156-
# shellcheck disable=SC3045
156+
# shellcheck disable=SC2039,SC3045
157157
ulimit -n "$MAX_FD" ||
158158
warn "Could not set maximum file descriptor limit to $MAX_FD"
159159
esac
@@ -202,11 +202,11 @@ fi
202202
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203203
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204204

205-
# Collect all arguments for the java command;
206-
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
207-
# shell script including quotes and variable substitutions, so put them in
208-
# double quotes to make sure that they get re-expanded; and
209-
# * put everything else in single quotes, so that it's not re-expanded.
205+
# Collect all arguments for the java command:
206+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207+
# and any embedded shellness will be escaped.
208+
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209+
# treated as '${Hostname}' itself on the command line.
210210

211211
set -- \
212212
"-Dorg.gradle.appname=$APP_BASE_NAME" \

ui/src/main/java/com/wireguard/android/Application.kt

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
*/
55
package com.wireguard.android
66

7-
import android.content.Context
8-
import android.content.Intent
97
import android.os.Build
108
import android.os.StrictMode
119
import android.os.StrictMode.ThreadPolicy
@@ -39,6 +37,7 @@ import kotlinx.coroutines.launch
3937
import kotlinx.coroutines.runBlocking
4038
import java.lang.ref.WeakReference
4139
import java.util.Locale
40+
import kotlin.system.exitProcess
4241

4342
class Application : android.app.Application() {
4443
private val futureBackend = CompletableDeferred<Backend>()
@@ -49,18 +48,6 @@ class Application : android.app.Application() {
4948
private lateinit var toolsInstaller: ToolsInstaller
5049
private lateinit var tunnelManager: TunnelManager
5150

52-
override fun attachBaseContext(context: Context) {
53-
super.attachBaseContext(context)
54-
if (BuildConfig.MIN_SDK_VERSION > Build.VERSION.SDK_INT) {
55-
val intent = Intent(Intent.ACTION_MAIN)
56-
intent.addCategory(Intent.CATEGORY_HOME)
57-
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
58-
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
59-
startActivity(intent)
60-
System.exit(0)
61-
}
62-
}
63-
6451
private suspend fun determineBackend(): Backend {
6552
var backend: Backend? = null
6653
if (UserKnobs.enableKernelModule.first() && WgQuickBackend.hasKernelSupport()) {

ui/src/main/java/com/wireguard/android/QuickTileService.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55
package com.wireguard.android
66

7+
import android.annotation.SuppressLint
78
import android.app.PendingIntent
89
import android.content.Intent
910
import android.graphics.Bitmap
@@ -51,6 +52,7 @@ class QuickTileService : TileService() {
5152
return ret
5253
}
5354

55+
@SuppressLint("StartActivityAndCollapseDeprecated")
5456
override fun onClick() {
5557
when (val tunnel = tunnel) {
5658
null -> {

ui/src/main/java/com/wireguard/android/updater/SnackbarUpdateShower.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
package com.wireguard.android.updater
77

8+
import android.annotation.SuppressLint
89
import android.content.Intent
910
import android.net.Uri
1011
import android.view.View
@@ -22,6 +23,7 @@ import kotlinx.coroutines.delay
2223
import kotlinx.coroutines.flow.launchIn
2324
import kotlinx.coroutines.flow.onEach
2425
import kotlinx.coroutines.launch
26+
import kotlin.system.exitProcess
2527
import kotlin.time.Duration.Companion.seconds
2628

2729
class SnackbarUpdateShower(private val fragment: Fragment) {
@@ -95,6 +97,7 @@ class SnackbarUpdateShower(private val fragment: Fragment) {
9597
}
9698
}
9799

100+
@SuppressLint("UnsafeImplicitIntentLaunch")
98101
fun attach(view: View, anchor: View?) {
99102
val snackbar = SwapableSnackbar(fragment, view, anchor)
100103
val context = fragment.requireContext()
@@ -164,7 +167,7 @@ class SnackbarUpdateShower(private val fragment: Fragment) {
164167
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
165168
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
166169
context.startActivity(intent)
167-
System.exit(0)
170+
exitProcess(0)
168171
}.show()
169172
}
170173
}

0 commit comments

Comments
 (0)