Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Forked from:
* https://gitlab.com/ReVanced/revanced-patches/-/tree/main/patches/src/main/kotlin/app/revanced/patches/lightroom
*/
package app.morphe.patches.lightroom.misc.login

import app.morphe.patches.shared.compat.AppCompatibilities
import app.morphe.patcher.patch.bytecodePatch
import app.morphe.util.returnEarly

@Suppress("unused")
val disableMandatoryLoginPatch = bytecodePatch(
name = "Disable mandatory login",
description = "Disables the mandatory login requirement, allowing the app to be used without signing in.",
) {
compatibleWith(AppCompatibilities.LIGHTROOM)

execute {
// Force isLoggedIn = true.
IsLoggedInMethodFingerprint.method.returnEarly(true)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Forked from:
* https://gitlab.com/ReVanced/revanced-patches/-/tree/main/patches/src/main/kotlin/app/revanced/patches/lightroom
*/
package app.morphe.patches.lightroom.misc.login

import app.morphe.patcher.Fingerprint
import app.morphe.patcher.OpcodesFilter
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode

internal object IsLoggedInMethodFingerprint : Fingerprint(
accessFlags = listOf(AccessFlags.PUBLIC, AccessFlags.STATIC, AccessFlags.FINAL),
returnType = "Z",
filters = OpcodesFilter.opcodesToFilters(
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT,
Opcode.SGET_OBJECT,
Opcode.IF_NE,
Opcode.CONST_4,
Opcode.GOTO,
),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Forked from:
* https://gitlab.com/ReVanced/revanced-patches/-/tree/main/patches/src/main/kotlin/app/revanced/patches/lightroom
*/
package app.morphe.patches.lightroom.misc.premium

import app.morphe.patcher.Fingerprint
import app.morphe.patcher.OpcodesFilter
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode

internal object HasPurchasedMethodFingerprint : Fingerprint(
definingClass = "Ll7/a;",
accessFlags = listOf(AccessFlags.PRIVATE, AccessFlags.FINAL),
returnType = "Z",
filters = OpcodesFilter.opcodesToFilters(
Opcode.SGET_OBJECT,
Opcode.CONST_4,
Opcode.CONST_4,
Opcode.CONST_4,
),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Forked from:
* https://gitlab.com/ReVanced/revanced-patches/-/tree/main/patches/src/main/kotlin/app/revanced/patches/lightroom
*/
package app.morphe.patches.lightroom.misc.premium

import app.morphe.patches.shared.compat.AppCompatibilities
import app.morphe.patcher.patch.bytecodePatch
import app.morphe.util.returnEarly

@Suppress("unused")
val unlockPremiumPatch = bytecodePatch(
name = "Unlock Premium",
description = "Unlocks premium features by making the premium check always return true.",
) {
compatibleWith(AppCompatibilities.LIGHTROOM)

execute {
// Set hasPremium = true.
HasPurchasedMethodFingerprint.method.returnEarly(true)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Forked from:
* https://gitlab.com/ReVanced/revanced-patches/-/tree/main/patches/src/main/kotlin/app/revanced/patches/lightroom
*/
package app.morphe.patches.lightroom.misc.version

import app.morphe.patches.shared.compat.AppCompatibilities
import app.morphe.patcher.extensions.InstructionExtensions.replaceInstruction
import app.morphe.patcher.patch.bytecodePatch

@Suppress("unused")
val disableVersionCheckPatch = bytecodePatch(
name = "Disable version check",
description = "Disables the server-side version check that prevents the app from starting.",
) {
compatibleWith(AppCompatibilities.LIGHTROOM)

execute {
// Get the index of the IGET instruction (last matched opcode).
val igetIndex = RefreshRemoteConfigurationMethodFingerprint.instructionMatches.last().index

// This value represents the server command to clear all version restrictions.
val statusForceReset = "-0x2"
RefreshRemoteConfigurationMethodFingerprint.method.replaceInstruction(
igetIndex,
"const/4 v1, $statusForceReset",
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Forked from:
* https://gitlab.com/ReVanced/revanced-patches/-/tree/main/patches/src/main/kotlin/app/revanced/patches/lightroom
*/
package app.morphe.patches.lightroom.misc.version

import app.morphe.patcher.Fingerprint
import app.morphe.patcher.OpcodesFilter
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode

internal object RefreshRemoteConfigurationMethodFingerprint : Fingerprint(
accessFlags = listOf(AccessFlags.PUBLIC, AccessFlags.STATIC),
strings = listOf(
"com.adobe.lrmobile.denylisted_version_set_key",
"com.adobe.lrmobile.app_min_version_key",
),
filters = OpcodesFilter.opcodesToFilters(
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT,
Opcode.IGET, // Overwrite this instruction to disable the check.
),
)
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ internal object AppCompatibilities {
appIconColor = 0x00B020,
)

val LIGHTROOM = Compatibility(
name = "Lightroom",
packageName = "com.adobe.lrmobile",
appIconColor = 0x31A8FF,
targets = listOf(AppTarget("9.3.0")),
)

val PIXIV = Compatibility(
name = "Pixiv",
packageName = "jp.pxv.android",
Expand Down