diff --git a/build.gradle.kts b/build.gradle.kts index f94d97a2..3fc7be84 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -267,10 +267,6 @@ androidComponents { } } -kapt { - useBuildCache = true -} - dependencies { // It has a bug that causes a crash when using PosixFilePermission and minSdk < 26. // It has been used in SSHD Core. @@ -311,8 +307,8 @@ dependencies { //implementation("com.github.bright:slf4android:0.1.6") { transitive = true } // For org.apache.sshd debugging implementation(libs.bcpkix.jdk15on) //For SSL certificate generation - implementation(libs.klassindex.library) - kapt(libs.klassindex.processor) + implementation(libs.classindex) + kapt(libs.classindex) // The android-smsmms library is the only way I know to handle MMS in Android // (Shouldn't a phone OS make phone things easy?) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5757cd2e..13404dea 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ androidGradlePlugin = "8.7.0" androidSmsmms = "kdeconnect-1-21-0" appcompat = "1.7.0" bcpkixJdk15on = "1.70" -klassindex = "4.1.0" +classindex = "3.13" commonsCollections4 = "4.4" commonsIo = "2.17.0" commonsLang3 = "3.17.0" @@ -58,8 +58,7 @@ androidx-preference-ktx = { module = "androidx.preference:preference-ktx", versi androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "recyclerview" } androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "swiperefreshlayout" } bcpkix-jdk15on = { module = "org.bouncycastle:bcpkix-jdk15on", version.ref = "bcpkixJdk15on" } -klassindex-library = { module = "fyi.fax.klassindex:library", version.ref = "klassindex" } -klassindex-processor = { module = "fyi.fax.klassindex:processor", version.ref = "klassindex" } +classindex = { module = "org.atteo.classindex:classindex", version.ref = "classindex" } commons-collections4 = { module = "org.apache.commons:commons-collections4", version.ref = "commonsCollections4" } commons-io = { module = "commons-io:commons-io", version.ref = "commonsIo" } commons-lang3 = { module = "org.apache.commons:commons-lang3", version.ref = "commonsLang3" } diff --git a/src/org/kde/kdeconnect/Plugins/PluginFactory.kt b/src/org/kde/kdeconnect/Plugins/PluginFactory.kt index c04099ae..d12bc7ac 100644 --- a/src/org/kde/kdeconnect/Plugins/PluginFactory.kt +++ b/src/org/kde/kdeconnect/Plugins/PluginFactory.kt @@ -8,21 +8,17 @@ package org.kde.kdeconnect.Plugins import android.content.Context import android.util.Log import androidx.annotation.DrawableRes -import fyi.fax.klassindex.KlassIndex -import fyi.fax.klassindex.IndexAnnotated +import org.atteo.classindex.ClassIndex +import org.atteo.classindex.IndexAnnotated import org.kde.kdeconnect.Device object PluginFactory { - - @IndexAnnotated - annotation class LoadablePlugin //Annotate plugins with this so PluginFactory finds them - private var pluginInfo: Map = mapOf() fun initPluginInfo(context: Context) { try { - val plugins = KlassIndex.getAnnotated(LoadablePlugin::class) - .map { it.java.getDeclaredConstructor().newInstance() as Plugin } + val plugins = ClassIndex.getAnnotated(LoadablePlugin::class.java) + .map { it.newInstance() as Plugin } .map { plugin -> plugin.apply { setContext(context, null) } } pluginInfo = plugins.associate { plugin -> Pair(plugin.pluginKey, PluginInfo(plugin)) } @@ -71,6 +67,9 @@ object PluginFactory { return used.map { it.key }.toSet() } + @IndexAnnotated + annotation class LoadablePlugin //Annotate plugins with this so PluginFactory finds them + class PluginInfo private constructor( val displayName: String, val description: String,