From e4c3e9ffc5be926e6ca537bfecd8d9a6926fa314 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 26 Feb 2023 23:18:35 +0100 Subject: [PATCH] refactor: remove unnecessary annotations Signed-off-by: oSumAtrIX --- .../revanced/patcher/annotation/CompatibilityAnnotation.kt | 4 ---- .../app/revanced/patcher/annotation/MetadataAnnotation.kt | 6 ------ .../method/annotation/MethodFingerprintMetadata.kt | 1 - .../revanced/patcher/patch/annotations/PatchAnnotation.kt | 4 ---- .../patcher/usage/bytecode/ExampleBytecodeCompatibility.kt | 1 - .../resource/annotation/ExampleResourceCompatibility.kt | 1 - 6 files changed, 17 deletions(-) diff --git a/src/main/kotlin/app/revanced/patcher/annotation/CompatibilityAnnotation.kt b/src/main/kotlin/app/revanced/patcher/annotation/CompatibilityAnnotation.kt index 9e7e0a5..19e61e8 100644 --- a/src/main/kotlin/app/revanced/patcher/annotation/CompatibilityAnnotation.kt +++ b/src/main/kotlin/app/revanced/patcher/annotation/CompatibilityAnnotation.kt @@ -7,8 +7,6 @@ import app.revanced.patcher.patch.Patch * @param compatiblePackages A list of packages a [Patch] is compatible with. */ @Target(AnnotationTarget.CLASS) -@Retention(AnnotationRetention.RUNTIME) -@MustBeDocumented annotation class Compatibility( val compatiblePackages: Array, ) @@ -19,8 +17,6 @@ annotation class Compatibility( * @param versions The versions of the package the [Patch] is compatible with. */ @Target() -@Retention(AnnotationRetention.RUNTIME) -@MustBeDocumented annotation class Package( val name: String, val versions: Array = [], diff --git a/src/main/kotlin/app/revanced/patcher/annotation/MetadataAnnotation.kt b/src/main/kotlin/app/revanced/patcher/annotation/MetadataAnnotation.kt index cdd4c92..7095a6d 100644 --- a/src/main/kotlin/app/revanced/patcher/annotation/MetadataAnnotation.kt +++ b/src/main/kotlin/app/revanced/patcher/annotation/MetadataAnnotation.kt @@ -7,8 +7,6 @@ import app.revanced.patcher.patch.Patch * @param name A suggestive name for the [Patch]. */ @Target(AnnotationTarget.CLASS) -@Retention(AnnotationRetention.RUNTIME) -@MustBeDocumented annotation class Name( val name: String, ) @@ -18,8 +16,6 @@ annotation class Name( * @param description A description for the [Patch]. */ @Target(AnnotationTarget.CLASS) -@Retention(AnnotationRetention.RUNTIME) -@MustBeDocumented annotation class Description( val description: String, ) @@ -30,8 +26,6 @@ annotation class Description( * @param version The version of a [Patch]. */ @Target(AnnotationTarget.CLASS) -@Retention(AnnotationRetention.RUNTIME) -@MustBeDocumented annotation class Version( val version: String, ) diff --git a/src/main/kotlin/app/revanced/patcher/fingerprint/method/annotation/MethodFingerprintMetadata.kt b/src/main/kotlin/app/revanced/patcher/fingerprint/method/annotation/MethodFingerprintMetadata.kt index 870f2d6..c4dfbf4 100644 --- a/src/main/kotlin/app/revanced/patcher/fingerprint/method/annotation/MethodFingerprintMetadata.kt +++ b/src/main/kotlin/app/revanced/patcher/fingerprint/method/annotation/MethodFingerprintMetadata.kt @@ -7,7 +7,6 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint * @param threshold if [threshold] or more of the opcodes do not match, skip. */ @Target(AnnotationTarget.CLASS) -@Retention(AnnotationRetention.RUNTIME) annotation class FuzzyPatternScanMethod( val threshold: Int = 1 ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patcher/patch/annotations/PatchAnnotation.kt b/src/main/kotlin/app/revanced/patcher/patch/annotations/PatchAnnotation.kt index 51fced4..317f78f 100644 --- a/src/main/kotlin/app/revanced/patcher/patch/annotations/PatchAnnotation.kt +++ b/src/main/kotlin/app/revanced/patcher/patch/annotations/PatchAnnotation.kt @@ -9,16 +9,12 @@ import kotlin.reflect.KClass * @param include If false, the patch should be treated as optional by default. */ @Target(AnnotationTarget.CLASS) -@Retention(AnnotationRetention.RUNTIME) -@MustBeDocumented annotation class Patch(val include: Boolean = true) /** * Annotation for dependencies of [Patch]es. */ @Target(AnnotationTarget.CLASS) -@Retention(AnnotationRetention.RUNTIME) -@MustBeDocumented annotation class DependsOn( val dependencies: Array>> = [] ) \ No newline at end of file diff --git a/src/test/kotlin/app/revanced/patcher/usage/bytecode/ExampleBytecodeCompatibility.kt b/src/test/kotlin/app/revanced/patcher/usage/bytecode/ExampleBytecodeCompatibility.kt index 5c8c8b8..85f0a32 100644 --- a/src/test/kotlin/app/revanced/patcher/usage/bytecode/ExampleBytecodeCompatibility.kt +++ b/src/test/kotlin/app/revanced/patcher/usage/bytecode/ExampleBytecodeCompatibility.kt @@ -9,6 +9,5 @@ import app.revanced.patcher.annotation.Package )] ) @Target(AnnotationTarget.CLASS) -@Retention(AnnotationRetention.RUNTIME) internal annotation class ExampleBytecodeCompatibility diff --git a/src/test/kotlin/app/revanced/patcher/usage/resource/annotation/ExampleResourceCompatibility.kt b/src/test/kotlin/app/revanced/patcher/usage/resource/annotation/ExampleResourceCompatibility.kt index d8154c6..059649e 100644 --- a/src/test/kotlin/app/revanced/patcher/usage/resource/annotation/ExampleResourceCompatibility.kt +++ b/src/test/kotlin/app/revanced/patcher/usage/resource/annotation/ExampleResourceCompatibility.kt @@ -9,6 +9,5 @@ import app.revanced.patcher.annotation.Package )] ) @Target(AnnotationTarget.CLASS) -@Retention(AnnotationRetention.RUNTIME) internal annotation class ExampleResourceCompatibility