feat(Instagram): Add Disable Reels auto-scroll patch (#6736)

Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
Aaron Mompié
2026-03-14 13:52:12 +01:00
committed by GitHub
co-authored by oSumAtrIX
parent b2b1e4f993
commit 806d6c799f
3 changed files with 52 additions and 1 deletions
@@ -0,0 +1,22 @@
package app.revanced.patches.instagram.reels.autoscroll
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.util.returnEarly
@Suppress("unused")
val disableReelsAutoScrollPatch = bytecodePatch(
name = "Disable Reels auto-scroll",
description = "Removes the auto-scroll toggle and prevents Reels from scrolling automatically.",
use = false,
) {
compatibleWith("com.instagram.android")
apply {
// Prevent the auto-scroll feature from being initialized.
// When this returns false, ClipsViewerFragment skips creating the auto-scroller.
clipsAutoScrollFeatureCheckMethod.returnEarly()
// Make the toggle button handler a no-op so tapping it does nothing.
clipsAutoScrollToggleMethod.returnEarly()
}
}
@@ -0,0 +1,24 @@
package app.revanced.patches.instagram.reels.autoscroll
import app.revanced.patcher.gettingFirstMethodDeclaratively
import app.revanced.patcher.parameterTypes
import app.revanced.patcher.patch.BytecodePatchContext
import app.revanced.patcher.returnType
/**
* Matches the feature availability gate that determines
* whether auto-scroll should be available for Reels.
*/
internal val BytecodePatchContext.clipsAutoScrollFeatureCheckMethod by gettingFirstMethodDeclaratively("auto_scroll") {
returnType("Z")
parameterTypes("Lcom/instagram/common/session/UserSession;", "Z")
}
/**
* Matches the toggle handler called when the user taps
* the auto-scroll button. Contains analytics logging strings.
*/
internal val BytecodePatchContext.clipsAutoScrollToggleMethod by gettingFirstMethodDeclaratively(
"auto_scroll",
"instagram_clips_viewer_autoplay_tap",
)