mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2026-01-23 19:21:05 +00:00
This commit introduces a couple changes besides the refactor. Executing patches can be cancelled, multiple bundles loaded into the same class loader and `Patch.execute` does not have to return anymore. BREAKING CHANGE: Various public APIs have been changed. The `Version` annotation has been removed. Patches do not return anything anymore and instead throw `PatchException`. Multiple patch bundles can now be loaded in a single ClassLoader to bypass class loader isolation.
27 lines
770 B
Kotlin
27 lines
770 B
Kotlin
package app.revanced.patcher.patch.annotations
|
|
|
|
import app.revanced.patcher.data.Context
|
|
import app.revanced.patcher.patch.Patch
|
|
import kotlin.reflect.KClass
|
|
|
|
/**
|
|
* Annotation to mark a class as a patch.
|
|
* @param include If false, the patch should be treated as optional by default.
|
|
*/
|
|
@Target(AnnotationTarget.CLASS)
|
|
annotation class Patch(val include: Boolean = true)
|
|
|
|
/**
|
|
* Annotation for dependencies of [Patch]es.
|
|
*/
|
|
@Target(AnnotationTarget.CLASS)
|
|
annotation class DependsOn(
|
|
val dependencies: Array<KClass<out Patch<Context<*>>>> = []
|
|
)
|
|
|
|
// TODO: Remove this annotation, once integrations are coupled with patches.
|
|
/**
|
|
* Annotation to mark [Patch]es which depend on integrations.
|
|
*/
|
|
@Target(AnnotationTarget.CLASS)
|
|
annotation class RequiresIntegrations |