From a47ce9ba4f75673de23eb6054f5652224a48f43e Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Tue, 18 Oct 2022 01:45:51 +0200 Subject: [PATCH] fix(youtube/video-ads): return empty ad list earlier --- .../youtube/ad/video/fingerprints/LoadAdsFingerprint.kt | 7 ++++--- .../patches/youtube/ad/video/patch/VideoAdsPatch.kt | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/video/fingerprints/LoadAdsFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/video/fingerprints/LoadAdsFingerprint.kt index a93be1465..7d1b85e0e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/video/fingerprints/LoadAdsFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/video/fingerprints/LoadAdsFingerprint.kt @@ -13,7 +13,8 @@ import org.jf.dexlib2.Opcode @Version("0.0.1") object LoadAdsFingerprint : MethodFingerprint( opcodes = listOf(Opcode.INVOKE_INTERFACE_RANGE), - customFingerprint = { method -> - method.parameterTypes.size > 0 && method.parameterTypes.first().endsWith("InstreamAdBreak;") - } + strings = listOf( + "Received unsupported ad type, this should never happen.", + "AdBreakRenderer path ad playerResponse cannot be deserialized." + ) ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/video/patch/VideoAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/video/patch/VideoAdsPatch.kt index cd4ad5fc5..fcf20c127 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/video/patch/VideoAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/video/patch/VideoAdsPatch.kt @@ -50,7 +50,7 @@ class VideoAdsPatch : BytecodePatch( invoke-static { }, Lapp/revanced/integrations/patches/VideoAdsPatch;->shouldShowAds()Z move-result v4 if-nez v4, :show_video_ads - return-object v3 + return-object v9 """, listOf(ExternalLabel("show_video_ads", instruction(insertIndex))) )