diff --git a/api/revanced-patcher.api b/api/revanced-patcher.api index 573e5fe..42c78a4 100644 --- a/api/revanced-patcher.api +++ b/api/revanced-patcher.api @@ -44,6 +44,7 @@ public final class app/revanced/patcher/Patcher : app/revanced/patcher/Integrati public fun (Lapp/revanced/patcher/PatcherOptions;)V public fun acceptIntegrations (Ljava/util/List;)V public fun acceptPatches (Ljava/util/List;)V + public fun acceptPatches (Ljava/util/Set;)V public synthetic fun apply (Ljava/lang/Object;)Ljava/lang/Object; public fun apply (Z)Lkotlinx/coroutines/flow/Flow; public fun close ()V @@ -99,6 +100,11 @@ public final class app/revanced/patcher/PatcherResult$PatchedDexFile { public abstract interface class app/revanced/patcher/PatchesConsumer { public abstract fun acceptPatches (Ljava/util/List;)V + public abstract fun acceptPatches (Ljava/util/Set;)V +} + +public final class app/revanced/patcher/PatchesConsumer$DefaultImpls { + public static fun acceptPatches (Lapp/revanced/patcher/PatchesConsumer;Ljava/util/List;)V } public final class app/revanced/patcher/data/BytecodeContext : app/revanced/patcher/data/Context { diff --git a/src/main/kotlin/app/revanced/patcher/Patcher.kt b/src/main/kotlin/app/revanced/patcher/Patcher.kt index 2c9f67c..86b2a1a 100644 --- a/src/main/kotlin/app/revanced/patcher/Patcher.kt +++ b/src/main/kotlin/app/revanced/patcher/Patcher.kt @@ -46,7 +46,7 @@ class Patcher( * @param patches The [Patch]es to add. */ @Suppress("NAME_SHADOWING") - override fun acceptPatches(patches: List>) { + override fun acceptPatches(patches: PatchSet) { /** * Add dependencies of a [Patch] recursively to [PatcherContext.allPatches]. * If a [Patch] is already in [PatcherContext.allPatches], it will not be added again. diff --git a/src/main/kotlin/app/revanced/patcher/PatchesConsumer.kt b/src/main/kotlin/app/revanced/patcher/PatchesConsumer.kt index 91b83b9..24533bb 100644 --- a/src/main/kotlin/app/revanced/patcher/PatchesConsumer.kt +++ b/src/main/kotlin/app/revanced/patcher/PatchesConsumer.kt @@ -4,5 +4,7 @@ import app.revanced.patcher.patch.Patch @FunctionalInterface interface PatchesConsumer { - fun acceptPatches(patches: List>) + @Deprecated("Use acceptPatches(PatchSet) instead.", ReplaceWith("acceptPatches(patches.toSet())")) + fun acceptPatches(patches: List>) = acceptPatches(patches.toSet()) + fun acceptPatches(patches: PatchSet) }