generated from ReVanced/revanced-patches-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from Aunali321/dev
chore: Merge branch `dev` to `main`
- Loading branch information
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
patches/src/main/kotlin/li/auna/patches/telegram/disableautoupdate/DisableAutoUpdate.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package li.auna.patches.telegram.disableautoupdate | ||
|
||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction | ||
import app.revanced.patcher.patch.bytecodePatch | ||
|
||
@Suppress("unused") | ||
val unlockProPatch = bytecodePatch( | ||
name = "Disable Auto Update", | ||
description = "Disable Auto Update", | ||
) { | ||
compatibleWith( | ||
"org.telegram.messenger", "org.telegram.messenger.web" | ||
) | ||
|
||
execute { | ||
checkAppUpdateFingerprint.apply { | ||
method.addInstruction( | ||
patternMatch!!.endIndex + 1, "const/4 v0, 0x0" | ||
) | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
patches/src/main/kotlin/li/auna/patches/telegram/disableautoupdate/Fingerprints.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package li.auna.patches.telegram.disableautoupdate | ||
|
||
import app.revanced.patcher.fingerprint | ||
import com.android.tools.smali.dexlib2.Opcode | ||
|
||
internal val checkAppUpdateFingerprint = fingerprint { | ||
returns("V") | ||
custom { methodDef, classDef -> | ||
methodDef.name == "checkAppUpdate" && classDef.type.endsWith("Lorg/telegram/ui/LaunchActivity;") | ||
} | ||
opcodes( | ||
Opcode.IF_NEZ, | ||
Opcode.SGET_BOOLEAN, | ||
Opcode.IF_NEZ, | ||
Opcode.IF_NEZ, | ||
) | ||
} |