From 596ede1b129a97d9cf2efaaec2f1d475b561c259 Mon Sep 17 00:00:00 2001 From: Sculas Date: Thu, 8 Sep 2022 13:42:15 +0200 Subject: [PATCH] refactor: make patchName work on any class --- .../app/revanced/patcher/extensions/AnnotationExtensions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/patcher/extensions/AnnotationExtensions.kt b/src/main/kotlin/app/revanced/patcher/extensions/AnnotationExtensions.kt index 45a09dd..6c26d84 100644 --- a/src/main/kotlin/app/revanced/patcher/extensions/AnnotationExtensions.kt +++ b/src/main/kotlin/app/revanced/patcher/extensions/AnnotationExtensions.kt @@ -38,7 +38,7 @@ private fun Class<*>.findAnnotationRecursively( } object PatchExtensions { - val Class>.patchName: String + val Class<*>.patchName: String get() = recursiveAnnotation(Name::class)?.name ?: this.javaClass.simpleName val Class>.version get() = recursiveAnnotation(Version::class)?.version val Class>.include get() = recursiveAnnotation(app.revanced.patcher.patch.annotations.Patch::class)!!.include