mirror of
https://github.com/revanced/revanced-patches
synced 2024-11-10 16:59:23 +01:00
fix(youtube/hide-player-buttons): fix previous/next button showing if previous video exists (#2261)
This commit is contained in:
parent
47580a0367
commit
91d1aabd32
@ -31,6 +31,7 @@ class HidePlayerButtonsPatch : BytecodePatch(
|
|||||||
) {
|
) {
|
||||||
private object ParameterOffsets {
|
private object ParameterOffsets {
|
||||||
const val HAS_NEXT = 5
|
const val HAS_NEXT = 5
|
||||||
|
const val HAS_PREVIOUS = 6
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
@ -58,13 +59,16 @@ class HidePlayerButtonsPatch : BytecodePatch(
|
|||||||
|
|
||||||
// overriding this parameter register hides the previous and next buttons
|
// overriding this parameter register hides the previous and next buttons
|
||||||
val hasNextParameterRegister = callInstruction.startRegister + ParameterOffsets.HAS_NEXT
|
val hasNextParameterRegister = callInstruction.startRegister + ParameterOffsets.HAS_NEXT
|
||||||
|
val hasPreviousParameterRegister = callInstruction.startRegister + ParameterOffsets.HAS_PREVIOUS
|
||||||
|
|
||||||
mutableMethod.addInstructions(
|
mutableMethod.addInstructions(
|
||||||
callIndex,
|
callIndex,
|
||||||
"""
|
"""
|
||||||
invoke-static { }, Lapp/revanced/integrations/patches/HidePlayerButtonsPatch;->hideButtons()Z
|
invoke-static { v$hasNextParameterRegister }, Lapp/revanced/integrations/patches/HidePlayerButtonsPatch;->previousOrNextButtonIsVisible(Z)Z
|
||||||
move-result v$hasNextParameterRegister
|
move-result v$hasNextParameterRegister
|
||||||
xor-int/lit8 v$hasNextParameterRegister, v$hasNextParameterRegister, 1
|
|
||||||
|
invoke-static { v$hasPreviousParameterRegister }, Lapp/revanced/integrations/patches/HidePlayerButtonsPatch;->previousOrNextButtonIsVisible(Z)Z
|
||||||
|
move-result v$hasPreviousParameterRegister
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
} ?: return PlayerControlsVisibilityModelFingerprint.toErrorResult()
|
} ?: return PlayerControlsVisibilityModelFingerprint.toErrorResult()
|
||||||
|
Loading…
Reference in New Issue
Block a user