mirror of
https://github.com/revanced/revanced-patches
synced 2024-12-01 08:32:53 +01:00
fix(youtube/video-ads): block earlier in call hirarchy (#813)
This commit is contained in:
parent
412663b0a3
commit
f9517d2058
@ -5,16 +5,15 @@ import app.revanced.patcher.annotation.Version
|
|||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility
|
import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility
|
||||||
import org.jf.dexlib2.Opcode
|
|
||||||
|
|
||||||
@Name("load-ads-fingerprint")
|
@Name("load-ads-fingerprint")
|
||||||
|
|
||||||
@VideoAdsCompatibility
|
@VideoAdsCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
object LoadAdsFingerprint : MethodFingerprint(
|
object LoadAdsFingerprint : MethodFingerprint(
|
||||||
opcodes = listOf(Opcode.INVOKE_INTERFACE_RANGE),
|
|
||||||
strings = listOf(
|
strings = listOf(
|
||||||
"Received unsupported ad type, this should never happen.",
|
"OnFulfillmentTriggersActivated has non registered slot",
|
||||||
"AdBreakRenderer path ad playerResponse cannot be deserialized."
|
"markFillRequested",
|
||||||
|
"Trying to enter a slot when a slot of same type and physical position is already active. Its status: ",
|
||||||
)
|
)
|
||||||
)
|
)
|
@ -41,21 +41,16 @@ class VideoAdsPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
with(LoadAdsFingerprint.result!!) {
|
val lithoAdsFingerprintMethod = LoadAdsFingerprint.result!!.mutableMethod
|
||||||
val insertIndex = scanResult.patternScanResult!!.startIndex
|
|
||||||
with(mutableMethod) {
|
lithoAdsFingerprintMethod.addInstructions(
|
||||||
addInstructions(
|
0, """
|
||||||
insertIndex,
|
|
||||||
"""
|
|
||||||
invoke-static { }, Lapp/revanced/integrations/patches/VideoAdsPatch;->shouldShowAds()Z
|
invoke-static { }, Lapp/revanced/integrations/patches/VideoAdsPatch;->shouldShowAds()Z
|
||||||
move-result v4
|
move-result v0
|
||||||
if-nez v4, :show_video_ads
|
if-nez v0, :show_video_ads
|
||||||
return-object v9
|
return-void
|
||||||
""",
|
""", listOf(ExternalLabel("show_video_ads", lithoAdsFingerprintMethod.instruction(0)))
|
||||||
listOf(ExternalLabel("show_video_ads", instruction(insertIndex)))
|
|
||||||
)
|
)
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user