Update dav4jvm

pull/2068/head
Alex Baker 2 years ago
parent 80abbbcce5
commit 5c368cf970

@ -21,6 +21,7 @@ repositories {
content {
includeGroup("com.github.tasks")
includeModule("com.github.bitfireAT", "cert4android")
includeModule("com.github.bitfireAT", "dav4jvm")
includeModule("com.github.tasks.opentasks", "opentasks-provider")
includeModule("com.github.QuadFlask", "colorpicker")
includeModule("com.github.twofortyfouram", "android-plugin-api-for-locale")
@ -160,7 +161,9 @@ val googleplayImplementation by configurations
dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.2.2")
implementation("com.github.tasks:dav4jvm:deb2c9aef8")
implementation("com.github.bitfireAT:dav4jvm:2.2") {
exclude(group = "junit")
}
implementation("com.github.tasks:ical4android:2fb465b") {
exclude(group = "commons-logging")
exclude(group = "org.json", module = "json")

@ -128,45 +128,24 @@ open class CaldavClient(
}
@Throws(IOException::class, XmlPullParserException::class, HttpException::class)
suspend fun updateCollection(displayName: String, color: Int): String = withContext(Dispatchers.IO) {
val davResource = DavResource(httpClient, httpUrl!!)
davResource.proppatch(getPropPatchString(displayName, color)) { _, _ -> }
davResource.location.toString()
}
@Throws(IOException::class, XmlPullParserException::class)
private fun getPropPatchString(displayName: String, color: Int): String {
val xmlPullParserFactory = XmlPullParserFactory.newInstance()
val xml = xmlPullParserFactory.newSerializer()
val stringWriter = StringWriter()
with(xml) {
setOutput(stringWriter)
startDocument("UTF-8", null)
setPrefix("", NS_WEBDAV)
setPrefix("CAL", NS_CALDAV)
startTag(NS_WEBDAV, "propertyupdate")
startTag(NS_WEBDAV, "set")
startTag(NS_WEBDAV, "prop")
setDisplayName(this, displayName)
if (color != 0) {
setColor(xml, color)
}
endTag(NS_WEBDAV, "prop")
endTag(NS_WEBDAV, "set")
if (color == 0) {
startTag(NS_WEBDAV, "remove")
startTag(NS_WEBDAV, "prop")
startTag(NS_APPLE_ICAL, "calendar-color")
endTag(NS_APPLE_ICAL, "calendar-color")
endTag(NS_WEBDAV, "prop")
endTag(NS_WEBDAV, "remove")
suspend fun updateCollection(displayName: String, color: Int): String =
withContext(Dispatchers.IO) {
with(DavResource(httpClient, httpUrl!!)) {
proppatch(
setProperties = mutableMapOf(DisplayName.NAME to displayName).apply {
if (color != 0) {
put(
CalendarColor.NAME,
String.format("#%06X%02X", color and 0xFFFFFF, color ushr 24)
)
}
},
removeProperties = if (color == 0) listOf(CalendarColor.NAME) else emptyList(),
callback = { _, _ -> },
)
location.toString()
}
endTag(NS_WEBDAV, "propertyupdate")
endDocument()
flush()
}
return stringWriter.toString()
}
@Throws(IOException::class, XmlPullParserException::class)
private fun getMkcolString(displayName: String, color: Int): String {

@ -9,7 +9,7 @@ object Versions {
const val crashlytics = "18.2.11"
const val analytics = "20.1.0"
const val remote_config = "21.0.1"
const val okhttp = "4.9.3"
const val okhttp = "4.10.0"
const val flipper = "0.149.0"
const val mockito = "3.9.0"
const val androidx_test = "1.3.0"

@ -64,9 +64,17 @@
+| | \--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.1 (c)
+| +--- androidx.databinding:databinding-runtime:7.3.1 (*)
+| \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31 -> 1.7.20 (*)
++--- com.github.tasks:dav4jvm:deb2c9aef8
+| +--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10 -> 1.7.20 (*)
+| \--- org.apache.commons:commons-lang3:3.8.1 -> 3.12.0
++--- com.github.bitfireAT:dav4jvm:2.2
+| +--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20 (*)
+| +--- org.apache.commons:commons-lang3:3.8.1 -> 3.12.0
+| +--- com.squareup.okhttp3:okhttp:4.10.0
+| | +--- com.squareup.okio:okio:3.0.0 -> 3.2.0
+| | | \--- com.squareup.okio:okio-jvm:3.2.0
+| | | +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20 -> 1.7.20 (*)
+| | | \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.6.20 -> 1.7.20
+| | \--- org.jetbrains.kotlin:kotlin-stdlib:1.6.20 -> 1.7.20 (*)
+| \--- org.ogce:xpp3:1.1.6
+| \--- jakarta-regexp:jakarta-regexp:1.4
++--- com.github.tasks:ical4android:2fb465b
+| +--- org.mnode.ical4j:ical4j:3.2.5
+| | +--- javax.cache:cache-api:1.1.1
@ -380,12 +388,7 @@
++--- io.noties.markwon:linkify:4.6.2
+| \--- io.noties.markwon:core:4.6.2 (*)
++--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20 (*)
++--- com.squareup.okhttp3:okhttp:4.9.3 -> 4.10.0
+| +--- com.squareup.okio:okio:3.0.0 -> 3.2.0
+| | \--- com.squareup.okio:okio-jvm:3.2.0
+| | +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20 -> 1.7.20 (*)
+| | \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.6.20 -> 1.7.20
+| \--- org.jetbrains.kotlin:kotlin-stdlib:1.6.20 -> 1.7.20 (*)
++--- com.squareup.okhttp3:okhttp:4.10.0 (*)
++--- com.github.franmontiel:PersistentCookieJar:v1.0.1
+| \--- com.squareup.okhttp3:okhttp:3.1.2 -> 4.10.0 (*)
++--- com.google.code.gson:gson:2.9.0

@ -311,9 +311,17 @@
+| +--- com.google.android.gms:play-services-base:17.0.0 -> 18.0.1 (*)
+| +--- com.google.android.gms:play-services-basement:17.0.0 -> 18.0.0 (*)
+| \--- com.google.android.gms:play-services-tasks:17.0.0 -> 18.0.1 (*)
++--- com.github.tasks:dav4jvm:deb2c9aef8
+| +--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10 -> 1.7.20 (*)
+| \--- org.apache.commons:commons-lang3:3.8.1 -> 3.12.0
++--- com.github.bitfireAT:dav4jvm:2.2
+| +--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20 (*)
+| +--- org.apache.commons:commons-lang3:3.8.1 -> 3.12.0
+| +--- com.squareup.okhttp3:okhttp:4.10.0
+| | +--- com.squareup.okio:okio:3.0.0 -> 3.2.0
+| | | \--- com.squareup.okio:okio-jvm:3.2.0
+| | | +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20 -> 1.7.20 (*)
+| | | \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.6.20 -> 1.7.20
+| | \--- org.jetbrains.kotlin:kotlin-stdlib:1.6.20 -> 1.7.20 (*)
+| \--- org.ogce:xpp3:1.1.6
+| \--- jakarta-regexp:jakarta-regexp:1.4
++--- com.github.tasks:ical4android:2fb465b
+| +--- org.mnode.ical4j:ical4j:3.2.5
+| | +--- javax.cache:cache-api:1.1.1
@ -516,12 +524,7 @@
++--- io.noties.markwon:linkify:4.6.2
+| \--- io.noties.markwon:core:4.6.2 (*)
++--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20 (*)
++--- com.squareup.okhttp3:okhttp:4.9.3 -> 4.10.0
+| +--- com.squareup.okio:okio:3.0.0 -> 3.2.0
+| | \--- com.squareup.okio:okio-jvm:3.2.0
+| | +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20 -> 1.7.20 (*)
+| | \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.6.20 -> 1.7.20
+| \--- org.jetbrains.kotlin:kotlin-stdlib:1.6.20 -> 1.7.20 (*)
++--- com.squareup.okhttp3:okhttp:4.10.0 (*)
++--- com.github.franmontiel:PersistentCookieJar:v1.0.1
+| \--- com.squareup.okhttp3:okhttp:3.1.2 -> 4.10.0 (*)
++--- com.google.code.gson:gson:2.9.0

Loading…
Cancel
Save