From 6c78fece082bda12eb87a3a70aafbb56a1d068b0 Mon Sep 17 00:00:00 2001 From: az4521 <18432684+az4521@users.noreply.github.com> Date: Thu, 14 Mar 2024 17:49:25 +0000 Subject: [PATCH] add ignorenulls to json decoder (fixes hitomi) --- app/build.gradle | 6 +++--- app/src/main/java/eu/kanade/tachiyomi/AppModule.kt | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index bc3948819d4c..a53d57dcd2f7 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -218,7 +218,7 @@ dependencies { implementation "com.squareup.retrofit2:adapter-rxjava:$retrofit_version" // JSON - final kotlin_serialization_version = '1.6.2' + final kotlin_serialization_version = '1.6.3' implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlin_serialization_version" implementation "org.jetbrains.kotlinx:kotlinx-serialization-json-okio:$kotlin_serialization_version" implementation "org.jetbrains.kotlinx:kotlinx-serialization-protobuf:$kotlin_serialization_version" @@ -418,9 +418,9 @@ tasks.withType(AbstractKotlinCompile).all { //kotlinOptions.freeCompilerArgs += ["-Xopt-in=kotlin.RequiresOptIn"] //kotlinOptions.freeCompilerArgs += ["-Xuse-experimental=kotlin.ExperimentalStdlibApi"] //kotlinOptions.freeCompilerArgs += ["-Xuse-experimental=kotlinx.coroutines.FlowPreview"] - //kotlinOptions.freeCompilerArgs += ["-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi"] + kotlinOptions.freeCompilerArgs += ["-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"] //kotlinOptions.freeCompilerArgs += ["-Xuse-experimental=kotlinx.coroutines.InternalCoroutinesApi"] - //kotlinOptions.freeCompilerArgs += ["-Xuse-experimental=kotlinx.serialization.ExperimentalSerializationApi"] + kotlinOptions.freeCompilerArgs += ["-opt-in=kotlinx.serialization.ExperimentalSerializationApi"] //kotlinOptions.freeCompilerArgs += ["-Xuse-experimental=coil.annotation.ExperimentalCoilApi"] } diff --git a/app/src/main/java/eu/kanade/tachiyomi/AppModule.kt b/app/src/main/java/eu/kanade/tachiyomi/AppModule.kt index 483b95fcc9ff..5878e1b54a03 100755 --- a/app/src/main/java/eu/kanade/tachiyomi/AppModule.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/AppModule.kt @@ -29,7 +29,12 @@ class AppModule(val app: Application) : InjektModule { override fun InjektRegistrar.registerInjectables() { addSingleton(app) - addSingletonFactory { Json { ignoreUnknownKeys = true } } + addSingletonFactory { + Json { + ignoreUnknownKeys = true + explicitNulls = false + } + } addSingletonFactory { PreferencesHelper(app) } @@ -57,8 +62,6 @@ class AppModule(val app: Application) : InjektModule { addSingletonFactory { Markwon.create(app) } - addSingletonFactory { Json { ignoreUnknownKeys = true } } - addSingletonFactory { DelayedTrackingStore(app) } // Asynchronously init expensive components for a faster cold start