From 057da4e297d2f63300d583d5b5cfaccfa762cca9 Mon Sep 17 00:00:00 2001 From: hstyi Date: Tue, 8 Jul 2025 13:50:59 +0800 Subject: [PATCH] chore: okhttp 5.1.0 --- gradle/libs.versions.toml | 2 +- plugins/bg/build.gradle.kts | 2 +- .../main/kotlin/app/termora/plugins/bg/BackgroundManager.kt | 5 +---- src/main/kotlin/app/termora/account/SyncService.kt | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7feeb51..d4d2396 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -24,7 +24,7 @@ commons-io = "2.19.0" jbr-api = "17.1.10.1" hutool = "5.8.37" jsch = "0.2.26" -okhttp = "4.12.0" +okhttp = "5.1.0" sshj = "0.39.0" sshd-core = "2.15.0" jgit = "7.2.0.202503040940-r" diff --git a/plugins/bg/build.gradle.kts b/plugins/bg/build.gradle.kts index e23a321..2397fed 100644 --- a/plugins/bg/build.gradle.kts +++ b/plugins/bg/build.gradle.kts @@ -3,7 +3,7 @@ plugins { } -project.version = "0.0.4" +project.version = "0.0.5" diff --git a/plugins/bg/src/main/kotlin/app/termora/plugins/bg/BackgroundManager.kt b/plugins/bg/src/main/kotlin/app/termora/plugins/bg/BackgroundManager.kt index f70ce35..d143628 100644 --- a/plugins/bg/src/main/kotlin/app/termora/plugins/bg/BackgroundManager.kt +++ b/plugins/bg/src/main/kotlin/app/termora/plugins/bg/BackgroundManager.kt @@ -1,7 +1,6 @@ package app.termora.plugins.bg import app.termora.* -import app.termora.database.DatabaseManager import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.delay import kotlinx.coroutines.isActive @@ -96,9 +95,7 @@ internal class BackgroundManager private constructor() : Disposable, GlassPaneAw return } val body = response.body - if (body != null) { - tempFile.outputStream().use { IOUtils.copy(body.byteStream(), it) } - } + tempFile.outputStream().use { IOUtils.copy(body.byteStream(), it) } IOUtils.closeQuietly(body) return@use tempFile } diff --git a/src/main/kotlin/app/termora/account/SyncService.kt b/src/main/kotlin/app/termora/account/SyncService.kt index 31cf6f7..825ffb7 100644 --- a/src/main/kotlin/app/termora/account/SyncService.kt +++ b/src/main/kotlin/app/termora/account/SyncService.kt @@ -3,7 +3,6 @@ package app.termora.account import app.termora.AES import app.termora.database.* import app.termora.database.Data.Companion.toData -import okhttp3.internal.EMPTY_BYTE_ARRAY import org.apache.commons.codec.binary.Base64 import org.apache.commons.codec.digest.DigestUtils import org.apache.commons.lang3.ObjectUtils @@ -88,7 +87,7 @@ abstract class SyncService { return accountManager.getSecretKey() } val team = accountManager.getTeams().firstOrNull { it.id == ownerId } - return team?.secretKey ?: EMPTY_BYTE_ARRAY + return team?.secretKey ?: byteArrayOf() } protected fun decryptData(id: String, data: String, ownerId: String): String {