feat(Instagram): Add Enable location sticker redesign patch

Adds a new patch that unlocks the redesigned location sticker styles on
Android. The redesign is already fully built into the app but gated behind
a MobileConfig boolean flag. This patch hardcodes the flag check to always
return true, making all redesigned style variants available.
This commit is contained in:
Aaron Mompié 2026-03-15 21:10:42 +01:00 committed by Zen Instagram
parent 882cb4a0d4
commit c9e9fafa49
2 changed files with 39 additions and 0 deletions

View file

@ -0,0 +1,22 @@
package app.revanced.patches.instagram.story.locationsticker
import app.revanced.patcher.extensions.replaceInstruction
import app.revanced.patcher.patch.bytecodePatch
@Suppress("unused")
val enableLocationStickerRedesignPatch = bytecodePatch(
name = "Enable location sticker redesign",
description = "Unlocks the redesigned location sticker with additional style options.",
use = false,
) {
compatibleWith("com.instagram.android")
apply {
locationStickerRedesignGateMethod.method.apply {
// The gate method reads a MobileConfig boolean flag and returns it directly (6 instructions total).
// Replacing the move-result at index 4 with a hardcoded true skips the flag check entirely,
// enabling the redesigned sticker styles regardless of server configuration.
replaceInstruction(4, "const/4 v0, 0x1")
}
}
}

View file

@ -0,0 +1,17 @@
package app.revanced.patches.instagram.story.locationsticker
import app.revanced.patcher.composingFirstMethod
import app.revanced.patcher.instructions
import app.revanced.patcher.invoke
import app.revanced.patcher.patch.BytecodePatchContext
// MobileConfig boolean key that gates the redesigned location sticker styles.
// The method containing this constant reads the flag and returns it directly,
// making it the sole control point for the feature. The key is stable across
// app updates as MobileConfig keys are server-assigned constants.
private const val LOCATION_STICKER_REDESIGN_CONFIG_KEY = 0x8105a100041e0dL
internal val BytecodePatchContext.locationStickerRedesignGateMethod
by composingFirstMethod {
instructions(LOCATION_STICKER_REDESIGN_CONFIG_KEY())
}