diff --git a/patches/api/patches.api b/patches/api/patches.api index 7615d8ae69..dbb8264b66 100644 --- a/patches/api/patches.api +++ b/patches/api/patches.api @@ -328,6 +328,10 @@ public final class app/revanced/patches/lightroom/misc/premium/UnlockPremiumPatc public static final fun getUnlockPremiumPatch ()Lapp/revanced/patcher/patch/BytecodePatch; } +public final class app/revanced/patches/lightroom/misc/version/DisableVersionCheckPatchKt { + public static final fun getDisableVersionCheckPatch ()Lapp/revanced/patcher/patch/BytecodePatch; +} + public final class app/revanced/patches/memegenerator/detection/license/LicenseValidationPatchKt { public static final fun getLicenseValidationPatch ()Lapp/revanced/patcher/patch/BytecodePatch; } diff --git a/patches/src/main/kotlin/app/revanced/patches/lightroom/misc/bypassVersionCheck/DisableVersionCheckPatch.kt b/patches/src/main/kotlin/app/revanced/patches/lightroom/misc/bypassVersionCheck/DisableVersionCheckPatch.kt new file mode 100644 index 0000000000..e28d793ff3 --- /dev/null +++ b/patches/src/main/kotlin/app/revanced/patches/lightroom/misc/bypassVersionCheck/DisableVersionCheckPatch.kt @@ -0,0 +1,23 @@ +package app.revanced.patches.lightroom.misc.version + +import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction +import app.revanced.patcher.patch.bytecodePatch +import com.android.tools.smali.dexlib2.Opcode + +@Suppress("unused") +val DisableVersionCheckPatch = bytecodePatch( + name = "Disable version check", + description = "Disables the server-side version check that prevents the app from starting.", +) { + compatibleWith("com.adobe.lrmobile"("9.3.0")) + + execute { + refreshRemoteConfigurationFingerprint.method.apply { + val igetIndex = refreshRemoteConfigurationFingerprint.patternMatch!!.endIndex + + // This value represents the server command to clear all version restrictions. + const val STATUS_FORCE_RESET_HEX = "-0x2"; + replaceInstruction(igetIndex, "const/4 v1, $STATUS_FORCE_RESET_HEX") + } + } +} diff --git a/patches/src/main/kotlin/app/revanced/patches/lightroom/misc/bypassVersionCheck/Fingerprints.kt b/patches/src/main/kotlin/app/revanced/patches/lightroom/misc/bypassVersionCheck/Fingerprints.kt new file mode 100644 index 0000000000..67900c31ea --- /dev/null +++ b/patches/src/main/kotlin/app/revanced/patches/lightroom/misc/bypassVersionCheck/Fingerprints.kt @@ -0,0 +1,18 @@ +package app.revanced.patches.lightroom.misc.version + +import app.revanced.patcher.fingerprint +import com.android.tools.smali.dexlib2.AccessFlags +import com.android.tools.smali.dexlib2.Opcode + +internal val refreshRemoteConfigurationFingerprint = fingerprint { + accessFlags(AccessFlags.PUBLIC, AccessFlags.STATIC) + strings( + "com.adobe.lrmobile.denylisted_version_set_key", + "com.adobe.lrmobile.app_min_version_key" + ) + opcodes( + Opcode.INVOKE_STATIC, + Opcode.MOVE_RESULT_OBJECT, + Opcode.IGET, // Overwrite this instruction to disable the check. + ) +}