Skip to content

Commit c875cc0

Browse files
author
redsec
committed
fix: lightroom version bypass patch (allow 9.3.0 to open)
1 parent b9bc7e3 commit c875cc0

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

patches/api/patches.api

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,10 @@ public final class app/revanced/patches/lightroom/misc/premium/UnlockPremiumPatc
328328
public static final fun getUnlockPremiumPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
329329
}
330330

331+
public final class app/revanced/patches/lightroom/misc/version/DisableVersionCheckPatchKt {
332+
public static final fun getDisableVersionCheckPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
333+
}
334+
331335
public final class app/revanced/patches/memegenerator/detection/license/LicenseValidationPatchKt {
332336
public static final fun getLicenseValidationPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
333337
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package app.revanced.patches.lightroom.misc.version
2+
3+
import app.revanced.patcher.fingerprint
4+
import com.android.tools.smali.dexlib2.AccessFlags
5+
import com.android.tools.smali.dexlib2.Opcode
6+
7+
internal val versionCheckFingerprint = fingerprint {
8+
// Matches public static k()V
9+
accessFlags(AccessFlags.PUBLIC, AccessFlags.STATIC)
10+
11+
strings(
12+
"com.adobe.lrmobile.denylisted_version_set_key",
13+
"com.adobe.lrmobile.app_min_version_key"
14+
)
15+
16+
opcodes(
17+
Opcode.INVOKE_STATIC, // invoke-static {}, Lbf/p;->b()Lbf/p$a;
18+
Opcode.MOVE_RESULT_OBJECT, // move-result-object v0
19+
Opcode.IGET, // iget v1, v0, Lbf/p$a;->a:I <-- TARGET
20+
Opcode.CONST_4, // const/4 v2, -0x2
21+
Opcode.CONST_STRING, // const-string v3...
22+
Opcode.CONST_STRING, // const-string v4...
23+
Opcode.IF_NE // if-ne v1, v2, :cond_0
24+
)
25+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package app.revanced.patches.lightroom.misc.version
2+
3+
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
4+
import app.revanced.patcher.patch.bytecodePatch
5+
import com.android.tools.smali.dexlib2.Opcode
6+
7+
@Suppress("unused")
8+
val disableVersionCheckPatch = bytecodePatch(
9+
name = "Disable version check",
10+
) {
11+
compatibleWith("com.adobe.lrmobile"("9.3.0"))
12+
13+
execute {
14+
versionCheckFingerprint.method.apply {
15+
val igetIndex = implementation!!.instructions.indexOfFirst {
16+
it.opcode == Opcode.IGET
17+
}
18+
19+
if (igetIndex != -1) {
20+
addInstruction(igetIndex + 1, "const/4 v1, -0x2")
21+
}
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)