From b79ef5dc79b12a3e47ea7c06bd16d2957422a8fd Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 30 Jun 2023 22:14:17 -0400 Subject: [PATCH] Address some deprecation warnings --- app/src/main/java/eu/kanade/tachiyomi/AppModule.kt | 7 ++++--- .../eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/AppModule.kt b/app/src/main/java/eu/kanade/tachiyomi/AppModule.kt index 86a5bb6dc..41cdec738 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/AppModule.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/AppModule.kt @@ -31,7 +31,6 @@ import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory import kotlinx.serialization.json.Json import nl.adaptivity.xmlutil.XmlDeclMode import nl.adaptivity.xmlutil.core.XmlVersion -import nl.adaptivity.xmlutil.serialization.UnknownChildHandler import nl.adaptivity.xmlutil.serialization.XML import tachiyomi.core.preference.AndroidPreferenceStore import tachiyomi.core.preference.PreferenceStore @@ -110,10 +109,12 @@ class AppModule(val app: Application) : InjektModule { } addSingletonFactory { XML { - unknownChildHandler = UnknownChildHandler { _, _, _, _, _ -> emptyList() } + defaultPolicy { + ignoreUnknownChildren() + } autoPolymorphic = true xmlDeclMode = XmlDeclMode.Charset - indent = 4 + indent = 2 xmlVersion = XmlVersion.XML10 } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt index dbfffa023..02246a30d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt @@ -168,7 +168,7 @@ internal object ExtensionLoader { } .flatMap { try { - when (val obj = Class.forName(it, false, classLoader).newInstance()) { + when (val obj = Class.forName(it, false, classLoader).getDeclaredConstructor().newInstance()) { is Source -> listOf(obj) is SourceFactory -> obj.createSources() else -> throw Exception("Unknown source class type! ${obj.javaClass}")