mirror of
https://github.com/revanced/revanced-patches
synced 2024-06-14 09:00:10 +02:00
27 lines
1021 B
Kotlin
27 lines
1021 B
Kotlin
package app.revanced.patches.lightroom.misc.login
|
|
|
|
import app.revanced.patcher.data.BytecodeContext
|
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
|
import app.revanced.patcher.patch.BytecodePatch
|
|
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
|
import app.revanced.patcher.patch.annotation.Patch
|
|
import app.revanced.patches.lightroom.misc.login.fingerprints.IsLoggedInFingerprint
|
|
import app.revanced.util.exception
|
|
|
|
@Patch(
|
|
name = "Disable mandatory login",
|
|
compatiblePackages = [CompatiblePackage("com.adobe.lrmobile")]
|
|
)
|
|
@Suppress("unused")
|
|
object DisableMandatoryLoginPatch : BytecodePatch(
|
|
setOf(IsLoggedInFingerprint)
|
|
) {
|
|
override fun execute(context: BytecodeContext) {
|
|
IsLoggedInFingerprint.result?.mutableMethod?.apply {
|
|
val index = implementation!!.instructions.lastIndex - 1
|
|
// Set isLoggedIn = true.
|
|
replaceInstruction(index, "const/4 v0, 0x1")
|
|
} ?: throw IsLoggedInFingerprint.exception
|
|
}
|
|
}
|