Răsfoiți Sursa

Address some deprecation warnings

arkon 1 an în urmă
părinte
comite
b79ef5dc79

+ 4 - 3
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
             }
         }

+ 1 - 1
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}")