Update dav4jvm

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

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

@ -128,44 +128,23 @@ open class CaldavClient(
} }
@Throws(IOException::class, XmlPullParserException::class, HttpException::class) @Throws(IOException::class, XmlPullParserException::class, HttpException::class)
suspend fun updateCollection(displayName: String, color: Int): String = withContext(Dispatchers.IO) { suspend fun updateCollection(displayName: String, color: Int): String =
val davResource = DavResource(httpClient, httpUrl!!) withContext(Dispatchers.IO) {
davResource.proppatch(getPropPatchString(displayName, color)) { _, _ -> } with(DavResource(httpClient, httpUrl!!)) {
davResource.location.toString() proppatch(
} setProperties = mutableMapOf(DisplayName.NAME to displayName).apply {
@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) { if (color != 0) {
setColor(xml, color) put(
} CalendarColor.NAME,
endTag(NS_WEBDAV, "prop") String.format("#%06X%02X", color and 0xFFFFFF, color ushr 24)
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")
} }
endTag(NS_WEBDAV, "propertyupdate") },
endDocument() removeProperties = if (color == 0) listOf(CalendarColor.NAME) else emptyList(),
flush() callback = { _, _ -> },
)
location.toString()
} }
return stringWriter.toString()
} }
@Throws(IOException::class, XmlPullParserException::class) @Throws(IOException::class, XmlPullParserException::class)

@ -9,7 +9,7 @@ object Versions {
const val crashlytics = "18.2.11" const val crashlytics = "18.2.11"
const val analytics = "20.1.0" const val analytics = "20.1.0"
const val remote_config = "21.0.1" 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 flipper = "0.149.0"
const val mockito = "3.9.0" const val mockito = "3.9.0"
const val androidx_test = "1.3.0" const val androidx_test = "1.3.0"

@ -64,9 +64,17 @@
+| | \--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.1 (c) +| | \--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.1 (c)
+| +--- androidx.databinding:databinding-runtime:7.3.1 (*) +| +--- androidx.databinding:databinding-runtime:7.3.1 (*)
+| \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31 -> 1.7.20 (*) +| \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31 -> 1.7.20 (*)
++--- com.github.tasks:dav4jvm:deb2c9aef8 ++--- com.github.bitfireAT:dav4jvm:2.2
+| +--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10 -> 1.7.20 (*) +| +--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20 (*)
+| \--- org.apache.commons:commons-lang3:3.8.1 -> 3.12.0 +| +--- 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 ++--- com.github.tasks:ical4android:2fb465b
+| +--- org.mnode.ical4j:ical4j:3.2.5 +| +--- org.mnode.ical4j:ical4j:3.2.5
+| | +--- javax.cache:cache-api:1.1.1 +| | +--- javax.cache:cache-api:1.1.1
@ -380,12 +388,7 @@
++--- io.noties.markwon:linkify:4.6.2 ++--- io.noties.markwon:linkify:4.6.2
+| \--- io.noties.markwon:core:4.6.2 (*) +| \--- io.noties.markwon:core:4.6.2 (*)
++--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20 (*) ++--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20 (*)
++--- com.squareup.okhttp3:okhttp:4.9.3 -> 4.10.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 (*)
++--- com.github.franmontiel:PersistentCookieJar:v1.0.1 ++--- com.github.franmontiel:PersistentCookieJar:v1.0.1
+| \--- com.squareup.okhttp3:okhttp:3.1.2 -> 4.10.0 (*) +| \--- com.squareup.okhttp3:okhttp:3.1.2 -> 4.10.0 (*)
++--- com.google.code.gson:gson:2.9.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-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-basement:17.0.0 -> 18.0.0 (*)
+| \--- com.google.android.gms:play-services-tasks:17.0.0 -> 18.0.1 (*) +| \--- com.google.android.gms:play-services-tasks:17.0.0 -> 18.0.1 (*)
++--- com.github.tasks:dav4jvm:deb2c9aef8 ++--- com.github.bitfireAT:dav4jvm:2.2
+| +--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10 -> 1.7.20 (*) +| +--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20 (*)
+| \--- org.apache.commons:commons-lang3:3.8.1 -> 3.12.0 +| +--- 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 ++--- com.github.tasks:ical4android:2fb465b
+| +--- org.mnode.ical4j:ical4j:3.2.5 +| +--- org.mnode.ical4j:ical4j:3.2.5
+| | +--- javax.cache:cache-api:1.1.1 +| | +--- javax.cache:cache-api:1.1.1
@ -516,12 +524,7 @@
++--- io.noties.markwon:linkify:4.6.2 ++--- io.noties.markwon:linkify:4.6.2
+| \--- io.noties.markwon:core:4.6.2 (*) +| \--- io.noties.markwon:core:4.6.2 (*)
++--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20 (*) ++--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20 (*)
++--- com.squareup.okhttp3:okhttp:4.9.3 -> 4.10.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 (*)
++--- com.github.franmontiel:PersistentCookieJar:v1.0.1 ++--- com.github.franmontiel:PersistentCookieJar:v1.0.1
+| \--- com.squareup.okhttp3:okhttp:3.1.2 -> 4.10.0 (*) +| \--- com.squareup.okhttp3:okhttp:3.1.2 -> 4.10.0 (*)
++--- com.google.code.gson:gson:2.9.0 ++--- com.google.code.gson:gson:2.9.0

Loading…
Cancel
Save