mirror of
https://github.com/revanced/revanced-patches
synced 2025-01-07 16:55:48 +01:00
fix(youtube/video-ads): revert faulty method patch (#820)
This commit is contained in:
parent
9ecd4e6ac8
commit
666248ae65
@ -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,
|
|
||||||
)
|
|
||||||
)
|
|
@ -14,7 +14,6 @@ import app.revanced.patcher.patch.annotations.Patch
|
|||||||
import app.revanced.patcher.util.smali.ExternalLabel
|
import app.revanced.patcher.util.smali.ExternalLabel
|
||||||
import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility
|
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.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.integrations.patch.IntegrationsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
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(
|
class VideoAdsPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
LoadVideoAdsFingerprint,
|
LoadVideoAdsFingerprint,
|
||||||
ShowVideoAdsFingerprint,
|
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
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, """
|
0, """
|
||||||
invoke-static { }, Lapp/revanced/integrations/patches/VideoAdsPatch;->shouldShowAds()Z
|
invoke-static { }, Lapp/revanced/integrations/patches/VideoAdsPatch;->shouldShowAds()Z
|
||||||
move-result v0
|
move-result v0
|
||||||
if-nez v0, :show_video_ads
|
if-nez v0, :show_video_ads
|
||||||
return-void
|
return-void
|
||||||
""", listOf(ExternalLabel("show_video_ads", lithoAdsFingerprintMethod.instruction(0)))
|
""", listOf(ExternalLabel("show_video_ads", loadVideoAdsFingerprintMethod.instruction(0)))
|
||||||
)
|
|
||||||
|
|
||||||
ShowVideoAdsFingerprint.result!!.mutableMethod.addInstructions(
|
|
||||||
0, """
|
|
||||||
invoke-static { }, Lapp/revanced/integrations/patches/VideoAdsPatch;->shouldShowAds()Z
|
|
||||||
move-result v1
|
|
||||||
"""
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
|
Loading…
Reference in New Issue
Block a user