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

Conversation

Shoggomo
Copy link
Contributor

@Shoggomo Shoggomo commented May 26, 2025

When opening the app the user is frequently asked about their birthday. Dismissing this hiddes the message for around a day. This patch hides the message indefinitely.

@LisoUseInAIKyrios LisoUseInAIKyrios changed the title feat(Telegram): Add ´Remove birthday input message´ patch feat(Telegram): Add Remove birthday input message patch May 26, 2025
@Shoggomo Shoggomo marked this pull request as ready for review May 26, 2025 15:39

@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

@Shoggomo
Copy link
Contributor Author

This seemed to work, but inconsistently. I need to check into this more thoroughly.

@scrazzz
Copy link
Contributor

scrazzz commented May 26, 2025

This seemed to work, but inconsistently. I need to check into this more thoroughly.

Maybe patching check() to return-void work? I'm still new to this so I might be wrong
image

@LisoUseInAIKyrios
Copy link
Contributor

Try it. Look promising.

@scrazzz
Copy link
Contributor

scrazzz commented May 26, 2025

I'm not able to check right now but I can provide the fingerprint and code here if that would help @Shoggomo

I'm 100% sure the fingerprint is correct, but the bytecode patch needs to be tested...

Edit: corrected the code as LisoUseInAIKyrios said below

Fingerprints.kt

package app.revanced.patches.telegram.birthday

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

internal val birthdayCheckFingerprint = fingerprint {
    accessFlags(AccessFlags.PUBLIC)
    returns("V")
    custom { method, classDef -> 
        method.name == "check" && classDef.contains("BirthdayController")
    }
}

HideBirthdayCheck.kt

package app.revanced.patches.telegram.birthday

import app.revanced.patcher.patch.bytecodePatch

@Suppress("unused")
val hideBirthdayCheck = bytecodePatch(
    name = "Hide Birthday Check"
) {
    compatibleWith("org.telegram.messenger")

    execute {
        birthdayCheckFingerprint.method.returnEarly()
    }
}

@LisoUseInAIKyrios
Copy link
Contributor

Can't return true a void method.

That should be birthdayCheckFingerprint.method.returnEarly()

@Shoggomo Shoggomo marked this pull request as draft May 26, 2025 22:33
@Shoggomo
Copy link
Contributor Author

I think I was a bit fast on this one. The BirthdayController seems to be for showing other peoples' birthdays, not hiding the message to input your own.
I think this is the section showing the correct message. This if needs to run its else section, but I'm not sure how to enforce this and keep it future-proof. I'll test it first in the next couple days.

grafik

@cyberboh
Copy link
Contributor

Also support for telegram web would be nice:
org.telegram.messenger.web
Some users prefer using web version instead Playstore
Here for the difference https://www.reddit.com/r/Telegram/comments/17spmy3/comment/k8uk0gh/

@Nuckyz
Copy link
Member

Nuckyz commented May 27, 2025

I think I was a bit fast on this one. The BirthdayController seems to be for showing other peoples' birthdays, not hiding the message to input your own. I think this is the section showing the correct message. This if needs to run its else section, but I'm not sure how to enforce this and keep it future-proof. I'll test it first in the next couple days.

grafik

The telegram app is open source. You can use that to find the patch location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants