fix(youtube/overlay-buttons): Disable playlist autoplay loops video in minimized and PiP mode

This commit is contained in:
inotia00 2023-07-23 13:07:59 +09:00
parent 8a748e979e
commit 59edd59e01

View File

@ -16,8 +16,6 @@ import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.youtube.overlaybutton.alwaysrepeat.fingerprints.AutoNavInformerFingerprint import app.revanced.patches.youtube.overlaybutton.alwaysrepeat.fingerprints.AutoNavInformerFingerprint
import app.revanced.patches.youtube.overlaybutton.alwaysrepeat.fingerprints.VideoEndFingerprint import app.revanced.patches.youtube.overlaybutton.alwaysrepeat.fingerprints.VideoEndFingerprint
import app.revanced.patches.youtube.overlaybutton.alwaysrepeat.fingerprints.VideoEndParentFingerprint import app.revanced.patches.youtube.overlaybutton.alwaysrepeat.fingerprints.VideoEndParentFingerprint
import app.revanced.patches.youtube.utils.fingerprints.PlayerPatchFingerprint
import app.revanced.util.integrations.Constants.INTEGRATIONS_PATH
import app.revanced.util.integrations.Constants.UTILS_PATH import app.revanced.util.integrations.Constants.UTILS_PATH
import app.revanced.util.integrations.Constants.VIDEO_PATH import app.revanced.util.integrations.Constants.VIDEO_PATH
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@ -25,7 +23,6 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
class AlwaysRepeatPatch : BytecodePatch( class AlwaysRepeatPatch : BytecodePatch(
listOf( listOf(
AutoNavInformerFingerprint, AutoNavInformerFingerprint,
PlayerPatchFingerprint,
VideoEndParentFingerprint VideoEndParentFingerprint
) )
) { ) {
@ -35,7 +32,6 @@ class AlwaysRepeatPatch : BytecodePatch(
it.mutableMethod.apply { it.mutableMethod.apply {
addInstructionsWithLabels( addInstructionsWithLabels(
0, """ 0, """
invoke-static {}, $UTILS_PATH/AlwaysRepeatPatch;->shouldRepeatAndPause()V
invoke-static {}, $VIDEO_PATH/VideoInformation;->shouldAlwaysRepeat()Z invoke-static {}, $VIDEO_PATH/VideoInformation;->shouldAlwaysRepeat()Z
move-result v0 move-result v0
if-eqz v0, :end if-eqz v0, :end
@ -46,13 +42,6 @@ class AlwaysRepeatPatch : BytecodePatch(
} ?: return VideoEndFingerprint.toErrorResult() } ?: return VideoEndFingerprint.toErrorResult()
} ?: return VideoEndParentFingerprint.toErrorResult() } ?: return VideoEndParentFingerprint.toErrorResult()
PlayerPatchFingerprint.result?.mutableMethod?.addInstruction(
0,
"invoke-static {p0}, " +
"$INTEGRATIONS_PATH/utils/ResourceHelper;->" +
"setPlayPauseButton(Landroid/view/View;)V"
) ?: return PlayerPatchFingerprint.toErrorResult()
AutoNavInformerFingerprint.result?.let { AutoNavInformerFingerprint.result?.let {
with( with(
context context