2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-22 09:58:08 +00:00

Revert "Replace ClassIndex (unmaintained) with KlassIndex"

Fixes the R8 minifier error "Type fyi.fax.klassindex.AnnotationIndex is defined multiple times"

This reverts commit 526c3a9c4d9868e59cac59ebe422357b301a7a11.
This commit is contained in:
Albert Vaca Cintora 2024-10-21 16:47:46 +02:00
parent 2d421e3eb6
commit 056b569951
No known key found for this signature in database
3 changed files with 11 additions and 17 deletions

View File

@ -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?)

View File

@ -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" }

View File

@ -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<String, PluginInfo> = 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,