feat(Disney+): Add Skip ads patch (#6343)

Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
g9q
2025-12-08 07:45:41 -06:00
committed by GitHub
parent 22ed7bfbb3
commit 6bd7dca75b
3 changed files with 48 additions and 0 deletions

View File

@@ -188,6 +188,10 @@ public final class app/revanced/patches/crunchyroll/ads/HideAdsPatchKt {
public static final fun getHideAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch; 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 final class app/revanced/patches/duolingo/ad/DisableAdsPatchKt {
public static final fun getDisableAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch; public static final fun getDisableAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
} }

View File

@@ -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;"
}
}

View File

@@ -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
""",
)
}
}
}