feat(Instagram): Add Remove build expired popup patch (#6488)

Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
Swakshan
2026-01-19 14:31:42 +05:30
committed by GitHub
parent 4c4ba1c78c
commit 18c0b04f0c
3 changed files with 43 additions and 0 deletions

View File

@@ -336,6 +336,10 @@ public final class app/revanced/patches/instagram/misc/links/OpenLinksExternally
public static final fun getOpenLinksExternallyPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/instagram/misc/removeBuildExpiredPopup/RemoveBuildExpiredPopupPatchKt {
public static final fun getRemoveBuildExpiredPopupPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/instagram/misc/share/domain/ChangeLinkSharingDomainPatchKt {
public static final fun getChangeLinkSharingDomainPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}

View File

@@ -0,0 +1,12 @@
package app.revanced.patches.instagram.misc.removeBuildExpiredPopup
import app.revanced.patcher.fingerprint
import app.revanced.util.literal
internal const val MILLISECOND_IN_A_DAY_LITERAL = 0x5265c00L
internal val appUpdateLockoutBuilderFingerprint = fingerprint {
strings("android.hardware.sensor.hinge_angle")
literal { MILLISECOND_IN_A_DAY_LITERAL }
}

View File

@@ -0,0 +1,27 @@
package app.revanced.patches.instagram.misc.removeBuildExpiredPopup
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.instructions
import app.revanced.patcher.patch.bytecodePatch
import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
@Suppress("unused")
val removeBuildExpiredPopupPatch = bytecodePatch(
name = "Remove build expired popup",
description = "Removes the popup that appears after a while, when the app version ages.",
) {
compatibleWith("com.instagram.android")
execute {
appUpdateLockoutBuilderFingerprint.method.apply {
val longToIntIndex = instructions.first { it.opcode == Opcode.LONG_TO_INT }.location.index
val appAgeRegister = getInstruction<TwoRegisterInstruction>(longToIntIndex).registerA
// Set app age to 0 days old such that the build expired popup doesn't appear.
addInstruction(longToIntIndex + 1, "const v$appAgeRegister, 0x0")
}
}
}