fix: Accept `PatchSet` in `PatchesConsumer#acceptPatches`

This deprecates accepting `List<Patch<*>>`
This commit is contained in:
oSumAtrIX 2023-12-01 23:10:23 +01:00
parent 58bd46750b
commit 716825f232
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
3 changed files with 10 additions and 2 deletions

View File

@ -44,6 +44,7 @@ public final class app/revanced/patcher/Patcher : app/revanced/patcher/Integrati
public fun <init> (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 {

View File

@ -46,7 +46,7 @@ class Patcher(
* @param patches The [Patch]es to add.
*/
@Suppress("NAME_SHADOWING")
override fun acceptPatches(patches: List<Patch<*>>) {
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.

View File

@ -4,5 +4,7 @@ import app.revanced.patcher.patch.Patch
@FunctionalInterface
interface PatchesConsumer {
fun acceptPatches(patches: List<Patch<*>>)
@Deprecated("Use acceptPatches(PatchSet) instead.", ReplaceWith("acceptPatches(patches.toSet())"))
fun acceptPatches(patches: List<Patch<*>>) = acceptPatches(patches.toSet())
fun acceptPatches(patches: PatchSet)
}