From d53a3828b12daead9c898bea12c9a1497d07366f Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Tue, 21 Jan 2025 08:55:34 +0600 Subject: [PATCH] Address some deprecations --- app/build.gradle.kts | 5 ++++- .../extension/util/ExtensionInstallActivity.kt | 1 + .../eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt | 2 ++ buildSrc/src/main/kotlin/mihon/buildlogic/Commands.kt | 10 +++++----- gradle.properties | 1 - 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 926f0df2f..c6812df4a 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -101,7 +101,10 @@ android { } create("dev") { // Include pseudolocales: https://developer.android.com/guide/topics/resources/pseudolocales - resourceConfigurations.addAll(listOf("en", "en_XA", "ar_XB", "xxhdpi")) + androidResources { + @Suppress("UnstableApiUsage") + localeFilters += listOf("en", "en_XA", "ar_XB", "xxhdpi") + } dimension = "default" } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallActivity.kt index 37ac84e44..a300ba2ea 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallActivity.kt @@ -25,6 +25,7 @@ class ExtensionInstallActivity : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + @Suppress("DEPRECATION") val installIntent = Intent(Intent.ACTION_INSTALL_PACKAGE) .setDataAndType(intent.data, intent.type) .putExtra(Intent.EXTRA_RETURN_RESULT, true) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index d7a62fadb..6ed97ec2b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -492,8 +492,10 @@ class ReaderActivity : BaseActivity() { SurfaceColors.SURFACE_2.getColor(this), if (isNightMode()) 230 else 242, // 90% dark 95% light ) + @Suppress("DEPRECATION") window.statusBarColor = toolbarColor if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) { + @Suppress("DEPRECATION") window.navigationBarColor = toolbarColor } diff --git a/buildSrc/src/main/kotlin/mihon/buildlogic/Commands.kt b/buildSrc/src/main/kotlin/mihon/buildlogic/Commands.kt index faa75e2b4..bfffb8883 100644 --- a/buildSrc/src/main/kotlin/mihon/buildlogic/Commands.kt +++ b/buildSrc/src/main/kotlin/mihon/buildlogic/Commands.kt @@ -1,7 +1,6 @@ package mihon.buildlogic import org.gradle.api.Project -import java.io.ByteArrayOutputStream import java.time.LocalDateTime import java.time.ZoneOffset import java.time.format.DateTimeFormatter @@ -26,10 +25,11 @@ fun Project.getBuildTime(): String { } private fun Project.runCommand(command: String): String { - val byteOut = ByteArrayOutputStream() - exec { + return providers.exec { commandLine = command.split(" ") - standardOutput = byteOut } - return String(byteOut.toByteArray()).trim() + .standardOutput + .asText + .get() + .trim() } diff --git a/gradle.properties b/gradle.properties index ec3e136f6..22e7dfed5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,6 @@ android.nonTransitiveRClass=false android.useAndroidX=true kotlin.code.style=official -kotlin.mpp.androidGradlePluginCompatibility.nowarn=true kotlin.mpp.androidSourceSetLayoutVersion=2 org.gradle.caching=true