refactor: make patchName work on any class

This commit is contained in:
Sculas
2022-09-08 13:42:15 +02:00
parent 7debe62738
commit 596ede1b12

View File

@@ -38,7 +38,7 @@ private fun <T : Annotation> Class<*>.findAnnotationRecursively(
}
object PatchExtensions {
val Class<out Patch<Data>>.patchName: String
val Class<*>.patchName: String
get() = recursiveAnnotation(Name::class)?.name ?: this.javaClass.simpleName
val Class<out Patch<Data>>.version get() = recursiveAnnotation(Version::class)?.version
val Class<out Patch<Data>>.include get() = recursiveAnnotation(app.revanced.patcher.patch.annotations.Patch::class)!!.include