diff --git a/src/main/kotlin/app/revanced/patches/shared/fingerprints/ControlsOverlayStyleFingerprint.kt b/src/main/kotlin/app/revanced/patches/shared/fingerprints/ControlsOverlayStyleFingerprint.kt
new file mode 100644
index 000000000..e0a542b08
--- /dev/null
+++ b/src/main/kotlin/app/revanced/patches/shared/fingerprints/ControlsOverlayStyleFingerprint.kt
@@ -0,0 +1,9 @@
+package app.revanced.patches.shared.fingerprints
+
+import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
+import org.jf.dexlib2.Opcode
+
+object ControlsOverlayStyleFingerprint : MethodFingerprint(
+ opcodes = listOf(Opcode.IGET_BOOLEAN),
+ strings = listOf("supportsNextPrevious", "Missing required properties:")
+)
\ No newline at end of file
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/player/nextprevbutton/patch/HideNextPrevButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/player/nextprevbutton/patch/HideNextPrevButtonPatch.kt
deleted file mode 100644
index bbb83ca1c..000000000
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/player/nextprevbutton/patch/HideNextPrevButtonPatch.kt
+++ /dev/null
@@ -1,45 +0,0 @@
-package app.revanced.patches.youtube.layout.player.nextprevbutton.patch
-
-import app.revanced.patcher.annotation.Description
-import app.revanced.patcher.annotation.Name
-import app.revanced.patcher.annotation.Version
-import app.revanced.patcher.data.ResourceContext
-import app.revanced.patcher.patch.PatchResult
-import app.revanced.patcher.patch.PatchResultSuccess
-import app.revanced.patcher.patch.ResourcePatch
-import app.revanced.patcher.patch.annotations.DependsOn
-import app.revanced.patcher.patch.annotations.Patch
-import app.revanced.patches.shared.annotation.YouTubeCompatibility
-import app.revanced.patches.youtube.misc.playerbutton.patch.PlayerButtonPatch
-import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch
-
-@Patch
-@Name("hide-next-prev-button")
-@Description("Hides the next prev button in the player controller.")
-@DependsOn(
- [
- PlayerButtonPatch::class,
- SettingsPatch::class
- ]
-)
-@YouTubeCompatibility
-@Version("0.0.1")
-class HideNextPrevButtonPatch : ResourcePatch {
- override fun execute(context: ResourceContext): PatchResult {
-
- /*
- * Add settings
- */
- SettingsPatch.addPreference(
- arrayOf(
- "PREFERENCE: PLAYER_SETTINGS",
- "SETTINGS: HIDE_NEXT_BUTTON",
- "SETTINGS: HIDE_PREV_BUTTON"
- )
- )
-
- SettingsPatch.updatePatchStatus("hide-next-prev-button")
-
- return PatchResultSuccess()
- }
-}
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/player/previousnextbutton/patch/HidePreviousNextButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/player/previousnextbutton/patch/HidePreviousNextButtonPatch.kt
new file mode 100644
index 000000000..dd832b289
--- /dev/null
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/player/previousnextbutton/patch/HidePreviousNextButtonPatch.kt
@@ -0,0 +1,59 @@
+package app.revanced.patches.youtube.layout.player.previousnextbutton.patch
+
+import app.revanced.extensions.toErrorResult
+import app.revanced.patcher.annotation.Description
+import app.revanced.patcher.annotation.Name
+import app.revanced.patcher.annotation.Version
+import app.revanced.patcher.data.BytecodeContext
+import app.revanced.patcher.extensions.addInstructions
+import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
+import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
+import app.revanced.patcher.patch.BytecodePatch
+import app.revanced.patcher.patch.PatchResult
+import app.revanced.patcher.patch.PatchResultSuccess
+import app.revanced.patcher.patch.annotations.DependsOn
+import app.revanced.patcher.patch.annotations.Patch
+import app.revanced.patches.shared.annotation.YouTubeCompatibility
+import app.revanced.patches.shared.fingerprints.ControlsOverlayStyleFingerprint
+import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch
+import app.revanced.util.integrations.Constants.PLAYER
+
+@Patch
+@Name("hide-previous-next-button")
+@Description("Hides the previous and next button in the player controller.")
+@DependsOn([SettingsPatch::class])
+@YouTubeCompatibility
+@Version("0.0.1")
+class HidePreviousNextButtonPatch : BytecodePatch(
+ listOf(ControlsOverlayStyleFingerprint)
+) {
+ override fun execute(context: BytecodeContext): PatchResult {
+
+ val controlsOverlayStyleClassDef = ControlsOverlayStyleFingerprint.result?.classDef?: return ControlsOverlayStyleFingerprint.toErrorResult()
+
+ val previousNextButtonVisibleFingerprint =
+ object : MethodFingerprint(returnType = "V", parameters = listOf("Z"), customFingerprint = { it.name == "j" }) {}
+ previousNextButtonVisibleFingerprint.resolve(context, controlsOverlayStyleClassDef)
+ previousNextButtonVisibleFingerprint.result?.mutableMethod?.addInstructions(
+ 0, """
+ invoke-static {p1}, $PLAYER->hidePreviousNextButton(Z)Z
+ move-result p1
+ """
+ )?: return previousNextButtonVisibleFingerprint.toErrorResult()
+
+
+ /*
+ * Add settings
+ */
+ SettingsPatch.addPreference(
+ arrayOf(
+ "PREFERENCE: PLAYER_SETTINGS",
+ "SETTINGS: HIDE_PREVIOUS_NEXT_BUTTON"
+ )
+ )
+
+ SettingsPatch.updatePatchStatus("hide-previous-next-button")
+
+ return PatchResultSuccess()
+ }
+}
diff --git a/src/main/resources/youtube/settings/host/values/strings.xml b/src/main/resources/youtube/settings/host/values/strings.xml
index f4916c5de..00ee4e276 100644
--- a/src/main/resources/youtube/settings/host/values/strings.xml
+++ b/src/main/resources/youtube/settings/host/values/strings.xml
@@ -404,9 +404,6 @@ Please do not report any issues you encounter while using this feature."Movies shelves are shown
Movies shelves are hidden
Hide movies shelf
- Next button is shown
- Next button is hidden
- Hide next button
Official header is shown
Official header is hidden
Hide official header
@@ -419,9 +416,9 @@ Please do not report any issues you encounter while using this feature."Preview comment is shown
Preview comment is hidden
Hide preview comment
- Prev button is shown
- Prev button is hidden
- Hide prev button
+ Buttons are shown
+ Buttons are hidden
+ Hide previous & next button
Seekbar is shown
Seekbar is hidden
Hide seekbar
diff --git a/src/main/resources/youtube/settings/xml/revanced_prefs.xml b/src/main/resources/youtube/settings/xml/revanced_prefs.xml
index 65bbe5ee2..cd02194fc 100644
--- a/src/main/resources/youtube/settings/xml/revanced_prefs.xml
+++ b/src/main/resources/youtube/settings/xml/revanced_prefs.xml
@@ -169,8 +169,8 @@
-
+
@@ -466,7 +466,7 @@
-
+