diff --git a/patches/api/patches.api b/patches/api/patches.api index be251e84a5..0ee251f737 100644 --- a/patches/api/patches.api +++ b/patches/api/patches.api @@ -365,6 +365,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 index 673ccdf933..443d60d155 100644 --- 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 @@ -1,7 +1,7 @@ package app.revanced.patches.instagram.story.locationsticker -import app.revanced.patcher.extensions.replaceInstruction import app.revanced.patcher.patch.bytecodePatch +import app.revanced.util.returnEarly @Suppress("unused") val enableLocationStickerRedesignPatch = bytecodePatch( @@ -12,11 +12,9 @@ val enableLocationStickerRedesignPatch = bytecodePatch( 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") - } + // 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 index af030aba4d..0de1c92290 100644 --- 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 @@ -11,7 +11,7 @@ import app.revanced.patcher.patch.BytecodePatchContext // app updates as MobileConfig keys are server-assigned constants. private const val LOCATION_STICKER_REDESIGN_CONFIG_KEY = 0x8105a100041e0dL -internal val BytecodePatchContext.locationStickerRedesignGateMethod +internal val BytecodePatchContext.locationStickerRedesignGateMethodMatch by composingFirstMethod { instructions(LOCATION_STICKER_REDESIGN_CONFIG_KEY()) }