Skip to content

feat(Telegram): Add Remove birthday input message patch #5041

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

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions patches/api/patches.api
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,10 @@ public final class app/revanced/patches/swissid/integritycheck/RemoveGooglePlayI
public static final fun getRemoveGooglePlayIntegrityCheckPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}

public final class app/revanced/patches/telegram/birthday/HideBirthdayMessageKt {
public static final fun getRemoveBirthdayMassagePatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}

public final class app/revanced/patches/ticktick/misc/themeunlock/UnlockThemePatchKt {
public static final fun getUnlockProPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package app.revanced.patches.telegram.birthday

import app.revanced.patcher.fingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode

// Located @ org.telegram.messenger.BirthdayController#getState
internal val birthdayStateFingerprint = fingerprint {
accessFlags(AccessFlags.PUBLIC)
returns("Lorg/telegram/messenger/BirthdayController\$BirthdayState")
parameters()
opcodes(
Opcode.MOVE_RESULT,
Opcode.OP_IF_EQZ,
Opcode.RETURN_OBJECT
)
custom { methodDef, classDef ->
methodDef.name == "getState" && classDef.endsWith("/BirtdayController;")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package app.revanced.patches.telegram.birthday

import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.bytecodePatch

@Suppress("unused")
val removeBirthdayMassagePatch = bytecodePatch(
name = "Remove birthday input message",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Hide' is the typical wording used. It's more than just the message, it's hiding the prompt.

Maybe name this Hide birthday prompt

description = "Removes the message asking for your birthday.",
) {
compatibleWith("org.telegram.messenger")

execute {
birthdayStateFingerprint.method.addInstructions(
0,
"""
const/4 v0, 0x0
return-object v0
""",
)
}
}
Loading