mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-07 01:51:27 +01:00
feat(Instagram): Add Hide Stories from Home patch (#5756)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package app.revanced.patches.instagram.hide.stories
|
||||
import app.revanced.patcher.fingerprint
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
|
||||
internal val getOrCreateAvatarViewFingerprint = fingerprint {
|
||||
parameters()
|
||||
returns("L")
|
||||
custom { method, classDef ->
|
||||
classDef.type == "Lcom/instagram/reels/ui/views/reelavatar/RecyclerReelAvatarView;"
|
||||
}
|
||||
opcodes(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL // Add View (Story)
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package app.revanced.patches.instagram.hide.stories
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
|
||||
@Suppress("unused")
|
||||
val hideStoriesPatch = bytecodePatch(
|
||||
name = "Hide Stories from Home",
|
||||
description = "Hides Stories from the main page, by removing the buttons.",
|
||||
use = false
|
||||
) {
|
||||
compatibleWith("com.instagram.android")
|
||||
|
||||
execute {
|
||||
val addStoryMethod = getOrCreateAvatarViewFingerprint.method // Creates Story
|
||||
val addStoryEndIndex = getOrCreateAvatarViewFingerprint.patternMatch!!.endIndex
|
||||
|
||||
// Remove addView of Story.
|
||||
addStoryMethod.removeInstruction(addStoryEndIndex)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user