mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-22 01:51:47 +00:00
Replace ClassIndex (unmaintained) with KlassIndex
This commit is contained in:
parent
333ad876aa
commit
526c3a9c4d
@ -267,6 +267,10 @@ 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.
|
||||
@ -307,8 +311,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.classindex)
|
||||
kapt(libs.classindex)
|
||||
implementation(libs.klassindex.library)
|
||||
kapt(libs.klassindex.processor)
|
||||
|
||||
// The android-smsmms library is the only way I know to handle MMS in Android
|
||||
// (Shouldn't a phone OS make phone things easy?)
|
||||
|
@ -5,7 +5,7 @@ androidGradlePlugin = "8.7.0"
|
||||
androidSmsmms = "kdeconnect-1-21-0"
|
||||
appcompat = "1.7.0"
|
||||
bcpkixJdk15on = "1.70"
|
||||
classindex = "3.13"
|
||||
klassindex = "4.1.0"
|
||||
commonsCollections4 = "4.4"
|
||||
commonsIo = "2.17.0"
|
||||
commonsLang3 = "3.17.0"
|
||||
@ -58,7 +58,8 @@ 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" }
|
||||
classindex = { module = "org.atteo.classindex:classindex", version.ref = "classindex" }
|
||||
klassindex-library = { module = "fyi.fax.klassindex:library", version.ref = "klassindex" }
|
||||
klassindex-processor = { module = "fyi.fax.klassindex:processor", version.ref = "klassindex" }
|
||||
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" }
|
||||
|
@ -8,17 +8,21 @@ package org.kde.kdeconnect.Plugins
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import androidx.annotation.DrawableRes
|
||||
import org.atteo.classindex.ClassIndex
|
||||
import org.atteo.classindex.IndexAnnotated
|
||||
import fyi.fax.klassindex.KlassIndex
|
||||
import fyi.fax.klassindex.IndexAnnotated
|
||||
import org.kde.kdeconnect.Device
|
||||
|
||||
object PluginFactory {
|
||||
|
||||
@IndexAnnotated
|
||||
annotation class LoadablePlugin //Annotate plugins with this so PluginFactory finds them
|
||||
|
||||
private var pluginInfo: Map<String, PluginInfo> = mapOf()
|
||||
|
||||
fun initPluginInfo(context: Context) {
|
||||
try {
|
||||
val plugins = ClassIndex.getAnnotated(LoadablePlugin::class.java)
|
||||
.map { it.newInstance() as Plugin }
|
||||
val plugins = KlassIndex.getAnnotated(LoadablePlugin::class)
|
||||
.map { it.java.getDeclaredConstructor().newInstance() as Plugin }
|
||||
.map { plugin -> plugin.apply { setContext(context, null) } }
|
||||
|
||||
pluginInfo = plugins.associate { plugin -> Pair(plugin.pluginKey, PluginInfo(plugin)) }
|
||||
@ -67,9 +71,6 @@ 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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user