mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-19 17:13:59 +00:00
feat(Instagram): Add Remove build expired popup patch (#6488)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 }
|
||||
}
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user