Przeglądaj źródła

Chore: update dependencies

kr328 4 lat temu
rodzic
commit
3397cdd95f

+ 1 - 1
build.gradle.kts

@@ -35,7 +35,7 @@ subprojects {
 
 
     extensions.configure<BaseExtension> {
     extensions.configure<BaseExtension> {
         val minSdkVersion = 21
         val minSdkVersion = 21
-        val targetSdkVersion = 30
+        val targetSdkVersion = 31
         val buildVersionCode = 204014
         val buildVersionCode = 204014
         val buildVersionName = "2.4.14"
         val buildVersionName = "2.4.14"
         val defaultDimension = "feature"
         val defaultDimension = "feature"

+ 7 - 3
common/src/main/java/com/github/kr328/clash/common/compat/Intents.kt

@@ -3,9 +3,13 @@ package com.github.kr328.clash.common.compat
 import android.app.PendingIntent
 import android.app.PendingIntent
 import android.os.Build
 import android.os.Build
 
 
-fun pendingIntentFlags(flags: Int, immutable: Boolean = false): Int {
-    return if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M && immutable) {
-        flags or PendingIntent.FLAG_IMMUTABLE
+fun pendingIntentFlags(flags: Int, mutable: Boolean = false): Int {
+    return if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) {
+        if (Build.VERSION.SDK_INT > 30 && mutable) {
+            flags or PendingIntent.FLAG_MUTABLE
+        } else {
+            flags or PendingIntent.FLAG_IMMUTABLE
+        }
     } else {
     } else {
         flags
         flags
     }
     }

+ 2 - 2
gradle/wrapper/gradle-wrapper.properties

@@ -1,6 +1,6 @@
 distributionBase=GRADLE_USER_HOME
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-all.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
 zipStorePath=wrapper/dists
-distributionSha256Sum=a8da5b02437a60819cad23e10fc7e9cf32bcb57029d9cb277e26eeff76ce014b
+distributionSha256Sum=00b273629df4ce46e68df232161d5a7c4e495b9a029ce6e0420f071e21316867

+ 5 - 5
gradlew

@@ -1,7 +1,7 @@
 #!/bin/sh
 #!/bin/sh
 
 
 #
 #
-# Copyright ? 2015-2021 the original authors.
+# Copyright © 2015-2021 the original authors.
 #
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # you may not use this file except in compliance with the License.
@@ -32,10 +32,10 @@
 #       Busybox and similar reduced shells will NOT work, because this script
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
 #       requires all of these POSIX shell features:
 #         * functions;
 #         * functions;
-#         * expansions ?$var?, ?${var}?, ?${var:-default}?, ?${var+SET}?,
-#           ?${var#prefix}?, ?${var%suffix}?, and ?$( cmd )?;
-#         * compound commands having a testable exit status, especially ?case?;
-#         * various built-in commands including ?command?, ?set?, and ?ulimit?.
+#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+#         * compound commands having a testable exit status, especially «case»;
+#         * various built-in commands including «command», «set», and «ulimit».
 #
 #
 #   Important for patching:
 #   Important for patching:
 #
 #

+ 1 - 0
service/src/main/java/com/github/kr328/clash/service/clash/module/DynamicNotificationModule.kt

@@ -29,6 +29,7 @@ class DynamicNotificationModule(service: Service) : Module<Unit>(service) {
         .setOnlyAlertOnce(true)
         .setOnlyAlertOnce(true)
         .setShowWhen(false)
         .setShowWhen(false)
         .setContentTitle("Not Selected")
         .setContentTitle("Not Selected")
+        .setForegroundServiceBehavior(NotificationCompat.FOREGROUND_SERVICE_IMMEDIATE)
         .setContentIntent(
         .setContentIntent(
             PendingIntent.getActivity(
             PendingIntent.getActivity(
                 service,
                 service,

+ 1 - 0
service/src/main/java/com/github/kr328/clash/service/clash/module/StaticNotificationModule.kt

@@ -23,6 +23,7 @@ class StaticNotificationModule(service: Service) : Module<Unit>(service) {
         .setColor(service.getColorCompat(R.color.color_clash))
         .setColor(service.getColorCompat(R.color.color_clash))
         .setOnlyAlertOnce(true)
         .setOnlyAlertOnce(true)
         .setShowWhen(false)
         .setShowWhen(false)
+        .setForegroundServiceBehavior(NotificationCompat.FOREGROUND_SERVICE_IMMEDIATE)
         .setContentIntent(
         .setContentIntent(
             PendingIntent.getActivity(
             PendingIntent.getActivity(
                 service,
                 service,

+ 3 - 3
settings.gradle.kts

@@ -19,8 +19,8 @@ dependencyResolutionManagement {
             val kotlin = "1.5.31"
             val kotlin = "1.5.31"
             val golang = "1.0.4"
             val golang = "1.0.4"
             val coroutine = "1.5.2"
             val coroutine = "1.5.2"
-            val coreKtx = "1.6.0"
-            val activity = "1.3.1"
+            val coreKtx = "1.7.0"
+            val activity = "1.4.0"
             val fragment = "1.3.6"
             val fragment = "1.3.6"
             val appcompat = "1.3.1"
             val appcompat = "1.3.1"
             val coordinator = "1.1.0"
             val coordinator = "1.1.0"
@@ -28,7 +28,7 @@ dependencyResolutionManagement {
             val viewpager = "1.0.0"
             val viewpager = "1.0.0"
             val material = "1.4.0"
             val material = "1.4.0"
             val appcenter = "4.3.1"
             val appcenter = "4.3.1"
-            val serialization = "1.3.0"
+            val serialization = "1.3.1"
             val kaidl = "1.15"
             val kaidl = "1.15"
             val room = "2.3.0"
             val room = "2.3.0"
             val multiprocess = "1.0.0"
             val multiprocess = "1.0.0"