diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/video/fingerprints/ShowVideoAdsFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/video/fingerprints/ShowVideoAdsFingerprint.kt deleted file mode 100644 index 407d52151..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/video/fingerprints/ShowVideoAdsFingerprint.kt +++ /dev/null @@ -1,21 +0,0 @@ -package app.revanced.patches.youtube.ad.video.fingerprints - -import app.revanced.patcher.annotation.Name -import app.revanced.patcher.annotation.Version -import app.revanced.patcher.extensions.or - -import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint -import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility -import org.jf.dexlib2.AccessFlags -import org.jf.dexlib2.Opcode - -@Name("load-ads-parent-fingerprint") -@VideoAdsCompatibility -@Version("0.0.1") -object ShowVideoAdsFingerprint : MethodFingerprint( - "V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("Z"), listOf( - Opcode.IPUT_BOOLEAN, - Opcode.INVOKE_VIRTUAL, - Opcode.RETURN_VOID, - ) -) \ 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 7474a2870..676283423 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 @@ -14,7 +14,6 @@ import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility import app.revanced.patches.youtube.ad.video.fingerprints.LoadVideoAdsFingerprint -import app.revanced.patches.youtube.ad.video.fingerprints.ShowVideoAdsFingerprint import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource @@ -29,7 +28,6 @@ import app.revanced.patches.youtube.misc.settings.framework.components.impl.Swit class VideoAdsPatch : BytecodePatch( listOf( LoadVideoAdsFingerprint, - ShowVideoAdsFingerprint, ) ) { override fun execute(context: BytecodeContext): PatchResult { @@ -43,22 +41,15 @@ class VideoAdsPatch : BytecodePatch( ) ) - val lithoAdsFingerprintMethod = LoadVideoAdsFingerprint.result!!.mutableMethod + val loadVideoAdsFingerprintMethod = LoadVideoAdsFingerprint.result!!.mutableMethod - lithoAdsFingerprintMethod.addInstructions( + loadVideoAdsFingerprintMethod.addInstructions( 0, """ invoke-static { }, Lapp/revanced/integrations/patches/VideoAdsPatch;->shouldShowAds()Z move-result v0 if-nez v0, :show_video_ads return-void - """, listOf(ExternalLabel("show_video_ads", lithoAdsFingerprintMethod.instruction(0))) - ) - - ShowVideoAdsFingerprint.result!!.mutableMethod.addInstructions( - 0, """ - invoke-static { }, Lapp/revanced/integrations/patches/VideoAdsPatch;->shouldShowAds()Z - move-result v1 - """ + """, listOf(ExternalLabel("show_video_ads", loadVideoAdsFingerprintMethod.instruction(0))) ) return PatchResultSuccess()