-
-
Notifications
You must be signed in to change notification settings - Fork 632
fix(Lightroom): Add Disable version check patch
#6315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
|
|
||
| @Suppress("unused") | ||
| val disableVersionCheckPatch = bytecodePatch( | ||
| name = "Disable version check", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a description with the purpose of the patch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the patch can be directly placed in misc package. The file name should start with uppercase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I placed it similarly to the two existing patches
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure but the file still seems in the wrong package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The package name should be lowercase "versioncheck" for example
| Opcode.INVOKE_STATIC, // invoke-static {}, Lbf/p;->b()Lbf/p$a; | ||
| Opcode.MOVE_RESULT_OBJECT, // move-result-object v0 | ||
| Opcode.IGET, // iget v1, v0, Lbf/p$a;->a:I <-- TARGET | ||
| Opcode.CONST_4, // const/4 v2, -0x2 | ||
| Opcode.CONST_STRING, // const-string v3... | ||
| Opcode.CONST_STRING, // const-string v4... | ||
| Opcode.IF_NE // if-ne v1, v2, :cond_0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of commenting code like this, say how you want to change the specific instruction, e.g "Overwrite this."
| Opcode.INVOKE_STATIC, // invoke-static {}, Lbf/p;->b()Lbf/p$a; | ||
| Opcode.MOVE_RESULT_OBJECT, // move-result-object v0 | ||
| Opcode.IGET, // iget v1, v0, Lbf/p$a;->a:I <-- TARGET | ||
| Opcode.CONST_4, // const/4 v2, -0x2 | ||
| Opcode.CONST_STRING, // const-string v3... | ||
| Opcode.CONST_STRING, // const-string v4... | ||
| Opcode.IF_NE // if-ne v1, v2, :cond_0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the pattern be made shorter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplified, seems to work fine
Disable version check patch
patches/src/main/kotlin/app/revanced/patches/lightroom/misc/bypassVersionCheck/Fingerprints.kt
Outdated
Show resolved
Hide resolved
|
|
||
| execute { | ||
| versionCheckFingerprint.method.apply { | ||
| val igetIndex = implementation!!.instructions.indexOfFirst { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this, use versionCheckFingerprint.patternMatch.endIndex
patches/src/main/kotlin/app/revanced/patches/lightroom/misc/bypassVersionCheck/Fingerprints.kt
Outdated
Show resolved
Hide resolved
patches/src/main/kotlin/app/revanced/patches/lightroom/misc/bypassVersionCheck/Fingerprints.kt
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| if (igetIndex != -1) { | ||
| addInstruction(igetIndex + 1, "const/4 v1, -0x2") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats -0x2? Add a comment or use a named val to avoid magic constants.
| } | ||
|
|
||
| if (igetIndex != -1) { | ||
| addInstruction(igetIndex + 1, "const/4 v1, -0x2") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use "replaceInstruction instead of add
| import com.android.tools.smali.dexlib2.AccessFlags | ||
| import com.android.tools.smali.dexlib2.Opcode | ||
|
|
||
| internal val versionCheckFingerprint = fingerprint { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the name ideal for the fingerprint? Is the method it matches a "checkVersion()" method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, as decompiling this gives a single letter method name. I assumed it's a valid name given what this patch does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to infer from the methods implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is refreshRemoteConfigurationFingerprint better? This method seems to load a current config from remote servers and save it to the app's storage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, or simpler saveRemoteConfigurationFingerprint or fetchRemoteConfigurationFingerprint
...in/kotlin/app/revanced/patches/lightroom/misc/bypassVersionCheck/DisableVersionCheckPatch.kt
Outdated
Show resolved
Hide resolved
...in/kotlin/app/revanced/patches/lightroom/misc/bypassVersionCheck/DisableVersionCheckPatch.kt
Outdated
Show resolved
Hide resolved
patches/src/main/kotlin/app/revanced/patches/lightroom/misc/bypassVersionCheck/Fingerprints.kt
Show resolved
Hide resolved
oSumAtrIX
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last issue, then lgtm https://github.com/ReVanced/revanced-patches/pull/6315/files#r2557189697
This PR introduces a new patch for Adobe Lightroom named Disable version check.
It specifically targets version 9.3.0 to bypass the application's startup validation, which prevents the app from opening if the version is deemed "denylisted" or below the minimum requirement by the server.
Fingerprint: Locates the public static method responsible for fetching the version status (references denylisted_version_set_key and app_min_version_key).
Patch Logic:
API: Updated patches.api to expose the new DisableVersionCheckPatch