android 14

This commit is contained in:
wanghongenpin
2024-08-27 00:20:02 +08:00
parent 7b89af1401
commit fd663dc61b
3 changed files with 23 additions and 6 deletions

View File

@@ -159,7 +159,9 @@ class ProxyVpnService : VpnService(), ProtectSocket {
.setOngoing(true)
.build()
startForeground(NOTIFICATION_ID, notification)
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
startForeground(NOTIFICATION_ID, notification)
}
}

View File

@@ -130,14 +130,14 @@ class PictureInPicturePlugin : AndroidFlutterPlugin() {
val pIntent: PendingIntent = PendingIntent.getBroadcast(
activity,
if (isRunning) 0 else 1,
Intent(VPN_ACTION),
Intent(VPN_ACTION).apply { setPackage(activity.packageName) },
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) PendingIntent.FLAG_IMMUTABLE else PendingIntent.FLAG_UPDATE_CURRENT
)
val cleanIntent: PendingIntent = PendingIntent.getBroadcast(
activity,
2,
Intent(CLEAN_ACTION),
Intent(CLEAN_ACTION).apply { setPackage(activity.packageName) },
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) PendingIntent.FLAG_IMMUTABLE else PendingIntent.FLAG_UPDATE_CURRENT
)

View File

@@ -19,9 +19,24 @@ allprojects {
rootProject.buildDir = '../build'
subprojects {
afterEvaluate {
android {
compileSdkVersion 34
afterEvaluate { project ->
if (project.extensions.findByName("android") != null) {
Integer pluginCompileSdk = project.android.compileSdk
if (pluginCompileSdk != null && pluginCompileSdk < 31) {
project.logger.error(
"Warning: Overriding compileSdk version in Flutter plugin: "
+ project.name
+ " from "
+ pluginCompileSdk
+ " to 31 (to work around https://issuetracker.google.com/issues/199180389)."
+ "\nIf there is not a new version of " + project.name + ", consider filing an issue against "
+ project.name
+ " to increase their compileSdk to the latest (otherwise try updating to the latest version)."
)
project.android {
compileSdk 31
}
}
}
}
}