Skip to content

Commit

Permalink
Merge pull request #7 from Aunali321/dev
Browse files Browse the repository at this point in the history
chore: Merge branch `dev` to `main`
  • Loading branch information
Aunali321 authored Nov 28, 2024
2 parents e9a5240 + c698265 commit 88c595a
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
4 changes: 4 additions & 0 deletions patches/api/patches.api
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ public final class li/auna/patches/telegram/bypassintegrity/BypassIntegrityPatch
public static final fun getBypassIntegrityPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}

public final class li/auna/patches/telegram/disableautoupdate/DisableAutoUpdateKt {
public static final fun getUnlockProPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}

public final class li/auna/patches/telegram/downloadboost/DownloadBoostPatchKt {
public static final fun getDownloadBoostPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
Expand Down
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"
)
}
}
}
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,
)
}

0 comments on commit 88c595a

Please # to comment.