Update dependencies, including dav4jvm that updates okhttp to 5.x (#1593)

* Update dependencies, including dav4jvm that updates okhttp to 5.x

* Update mockk and okhttp
This commit is contained in:
Ricki Hirner
2025-07-17 11:06:04 +02:00
committed by GitHub
parent ba9eb1446b
commit ca56380c29
7 changed files with 16 additions and 20 deletions

View File

@@ -15,7 +15,6 @@ import dagger.hilt.android.testing.HiltAndroidRule
import dagger.hilt.android.testing.HiltAndroidTest
import io.mockk.junit4.MockKRule
import kotlinx.coroutines.test.runTest
import okhttp3.CookieJar
import okhttp3.mockwebserver.Dispatcher
import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.MockWebServer
@@ -94,7 +93,7 @@ class DavDocumentsProviderTest {
// Query
val actor = davDocumentsActorFactory.create(
cookieStore = mutableMapOf<Long, CookieJar>(),
cookieStore = mutableMapOf(),
credentialsStore = credentialsStore
)
actor.queryChildren(parent)
@@ -130,7 +129,7 @@ class DavDocumentsProviderTest {
// Query - should update the parent displayname and folder name
val actor = davDocumentsActorFactory.create(
cookieStore = mutableMapOf<Long, CookieJar>(),
cookieStore = mutableMapOf(),
credentialsStore = credentialsStore
)
actor.queryChildren(parent)
@@ -157,7 +156,7 @@ class DavDocumentsProviderTest {
// Query - discovers serverside deletion
val actor = davDocumentsActorFactory.create(
cookieStore = mutableMapOf<Long, CookieJar>(),
cookieStore = mutableMapOf(),
credentialsStore = credentialsStore
)
actor.queryChildren(parent)
@@ -183,7 +182,7 @@ class DavDocumentsProviderTest {
// Query - find children of two nodes simultaneously
val actor = davDocumentsActorFactory.create(
cookieStore = mutableMapOf<Long, CookieJar>(),
cookieStore = mutableMapOf(),
credentialsStore = credentialsStore
)
actor.queryChildren(parent1)

View File

@@ -125,7 +125,7 @@ class NextcloudLoginFlow @Inject constructor(
if (response.code != HttpURLConnection.HTTP_OK)
throw HttpException(response)
response.body?.use { body ->
response.body.use { body ->
val mimeType = body.contentType() ?: throw DavException("Login Flow response without MIME type")
if (mimeType.type != "application" || mimeType.subtype != "json")
throw DavException("Invalid Login Flow response (not JSON)")
@@ -133,8 +133,6 @@ class NextcloudLoginFlow @Inject constructor(
// decode JSON
return@withContext JSONObject(body.string())
}
throw DavException("Invalid Login Flow response (no body)")
}
}

View File

@@ -471,7 +471,7 @@ class ContactsSyncManager @AssistedInject constructor(
.build()).execute()
if (response.isSuccessful)
return response.body?.bytes()
return response.body.bytes()
else
logger.warning("Couldn't download external resource")
} catch(e: IOException) {

View File

@@ -621,7 +621,7 @@ class DavDocumentsProvider(
var result: ByteArray? = null
runInterruptible(ioDispatcher) {
dav.get("image/*", null) { response ->
response.body?.byteStream()?.use { data ->
response.body.byteStream().use { data ->
BitmapFactory.decodeStream(data)?.let { bitmap ->
val thumb = ThumbnailUtils.extractThumbnail(bitmap, sizeHint.x, sizeHint.y)
val baos = ByteArrayOutputStream()

View File

@@ -215,7 +215,7 @@ class RandomAccessCallback @AssistedInject constructor(
else if (response.code != 206)
throw HttpException(response)
result = response.body?.bytes()
result = response.body.bytes()
}
result ?: throw DavException("No response body")
}

View File

@@ -28,7 +28,6 @@ import kotlinx.coroutines.runInterruptible
import okhttp3.HttpUrl
import okhttp3.MediaType
import okhttp3.RequestBody
import okhttp3.internal.headersContentLength
import okio.BufferedSink
import java.io.IOException
import java.util.logging.Level
@@ -113,9 +112,9 @@ class StreamingFileDescriptor @AssistedInject constructor(
@WorkerThread
private suspend fun downloadNow(writeFd: ParcelFileDescriptor) = runInterruptible {
dav.get(DavUtils.acceptAnything(preferred = mimeType), null) { response ->
response.body?.use { body ->
response.body.use { body ->
if (response.isSuccessful) {
val length = response.headersContentLength()
val length = body.contentLength()
notification.setContentTitle(context.getString(R.string.webdav_notification_download))
if (length == -1L)

View File

@@ -9,7 +9,7 @@ androidx-arch = "2.2.0"
androidx-browser = "1.8.0"
androidx-core = "1.16.0"
androidx-hilt = "1.2.0"
androidx-lifecycle = "2.9.1"
androidx-lifecycle = "2.9.2"
androidx-paging = "3.3.6"
androidx-preference = "1.2.1"
androidx-security = "1.1.0-beta01"
@@ -19,14 +19,14 @@ androidx-test-rules = "1.6.1"
androidx-test-junit = "1.2.1"
androidx-work = "2.10.2"
bitfire-cert4android = "41009d48ed"
bitfire-dav4jvm = "acbfbacbaf"
bitfire-dav4jvm = "fda822904a"
bitfire-synctools = "503324b4fe"
compose-accompanist = "0.37.3"
compose-bom = "2025.06.01"
compose-bom = "2025.07.00"
dnsjava = "3.6.3"
glance = "1.1.1"
guava = "33.4.8-android"
hilt = "2.56.2"
hilt = "2.57"
# keep in sync with ksp version
kotlin = "2.2.0"
kotlinx-coroutines = "1.10.2"
@@ -34,8 +34,8 @@ kotlinx-coroutines = "1.10.2"
ksp = "2.2.0-2.0.2"
mikepenz-aboutLibraries = "12.2.4"
nsk90-kstatemachine = "0.33.0"
mockk = "1.14.4"
okhttp = "4.12.0"
mockk = "1.14.5"
okhttp = "5.1.0"
openid-appauth = "0.11.1"
room = "2.7.2"
unifiedpush = "3.0.10"