diff --git a/patches/api/patches.api b/patches/api/patches.api index 49548475b6..4a8ed81323 100644 --- a/patches/api/patches.api +++ b/patches/api/patches.api @@ -377,6 +377,10 @@ public final class app/revanced/patches/instagram/story/flipping/DisableStoryAut public static final fun getDisableStoryAutoFlippingPatch ()Lapp/revanced/patcher/patch/Patch; } +public final class app/revanced/patches/instagram/story/locationsticker/EnableLocationStickerRedesignPatchKt { + public static final fun getEnableLocationStickerRedesignPatch ()Lapp/revanced/patcher/patch/Patch; +} + public final class app/revanced/patches/irplus/ad/RemoveAdsPatchKt { public static final fun getRemoveAdsPatch ()Lapp/revanced/patcher/patch/Patch; } diff --git a/patches/src/main/kotlin/app/revanced/patches/instagram/story/locationsticker/EnableLocationStickerRedesignPatch.kt b/patches/src/main/kotlin/app/revanced/patches/instagram/story/locationsticker/EnableLocationStickerRedesignPatch.kt new file mode 100644 index 0000000000..443d60d155 --- /dev/null +++ b/patches/src/main/kotlin/app/revanced/patches/instagram/story/locationsticker/EnableLocationStickerRedesignPatch.kt @@ -0,0 +1,20 @@ +package app.revanced.patches.instagram.story.locationsticker + +import app.revanced.patcher.patch.bytecodePatch +import app.revanced.util.returnEarly + +@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 { + // The gate method reads a MobileConfig boolean flag and returns it directly. + // Returning early with true bypasses the flag check entirely, + // enabling the redesigned sticker styles regardless of server configuration. + locationStickerRedesignGateMethodMatch.method.returnEarly(true) + } +} diff --git a/patches/src/main/kotlin/app/revanced/patches/instagram/story/locationsticker/Fingerprints.kt b/patches/src/main/kotlin/app/revanced/patches/instagram/story/locationsticker/Fingerprints.kt new file mode 100644 index 0000000000..0972d692c9 --- /dev/null +++ b/patches/src/main/kotlin/app/revanced/patches/instagram/story/locationsticker/Fingerprints.kt @@ -0,0 +1,16 @@ +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.locationStickerRedesignGateMethodMatch by composingFirstMethod { + instructions(LOCATION_STICKER_REDESIGN_CONFIG_KEY()) +}