fix: autoplay not working.

This commit is contained in:
TheJeterLP 2022-07-20 22:47:27 +02:00
parent 4f961298f6
commit 586eed515f
No known key found for this signature in database
GPG Key ID: D8CFD6FCF7215E6C

View File

@ -6,7 +6,6 @@ import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.BytecodeData
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.removeInstruction
import app.revanced.patcher.extensions.replaceInstructions
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
@ -53,11 +52,15 @@ class HideAutoplayButton : BytecodePatch(
val autonavInformerMethod = AutonavInformerFingerprint.result!!.mutableMethod
//force disable autoplay since it's hard to do without the button
autonavInformerMethod.replaceInstructions(
autonavInformerMethod.addInstructions(
0, """
invoke-static {}, Lapp/revanced/integrations/patches/HideAutoplayButtonPatch;->isButtonHidden()Z
move-result v0
if-eqz v0, :hidden
const/4 v0, 0x0
return v0
:hidden
nop
"""
)
@ -73,7 +76,7 @@ class HideAutoplayButton : BytecodePatch(
method.removeInstruction(index)
method.addInstructions(
index, """
invoke-static {}, Lapp/revanced/integrations/patches/HideAutoplayButtonPatch;->isButtonHidden()Z
invoke-static {}, Lapp/revanced/integrations/patches/HideAutoplayButtonPatch;->isButtonShown()Z
move-result v11
if-eqz v11, :hidebutton
invoke-virtual {v${insn.registerC}, v${insn.registerD}, v${insn.registerE}}, $methodToCall