mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-11 03:43:56 +01:00
feat(Disney+): Add Skip ads patch (#6343)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
@@ -188,6 +188,10 @@ public final class app/revanced/patches/crunchyroll/ads/HideAdsPatchKt {
|
||||
public static final fun getHideAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/disneyplus/ads/SkipAdsPatchKt {
|
||||
public static final fun getSkipAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/duolingo/ad/DisableAdsPatchKt {
|
||||
public static final fun getDisableAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package app.revanced.patches.disneyplus.ads
|
||||
|
||||
import app.revanced.patcher.fingerprint
|
||||
|
||||
internal val insertionGetPointsFingerprint = fingerprint {
|
||||
returns("Ljava/util/List")
|
||||
custom { method, _ ->
|
||||
method.name == "getPoints" &&
|
||||
method.definingClass == "Lcom/dss/sdk/internal/media/Insertion;"
|
||||
}
|
||||
}
|
||||
|
||||
internal val insertionGetRangesFingerprint = fingerprint {
|
||||
returns("Ljava/util/List")
|
||||
custom { method, _ ->
|
||||
method.name == "getRanges" &&
|
||||
method.definingClass == "Lcom/dss/sdk/internal/media/Insertion;"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package app.revanced.patches.disneyplus.ads
|
||||
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
|
||||
@Suppress("unused")
|
||||
val skipAdsPatch = bytecodePatch(
|
||||
name = "Skip ads",
|
||||
description = "Automatically skips ads.",
|
||||
) {
|
||||
compatibleWith("com.disney.disneyplus")
|
||||
|
||||
execute {
|
||||
arrayOf(insertionGetPointsFingerprint, insertionGetRangesFingerprint).forEach {
|
||||
it.method.addInstructions(
|
||||
0,
|
||||
"""
|
||||
new-instance v0, Ljava/util/ArrayList;
|
||||
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
||||
return-object v0
|
||||
""",
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user