feat(Instagram): Add Disable Reels auto-scroll patch (#6736)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
co-authored by
oSumAtrIX
parent
b2b1e4f993
commit
806d6c799f
+22
@@ -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()
|
||||
}
|
||||
}
|
||||
+24
@@ -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",
|
||||
)
|
||||
Reference in New Issue
Block a user