feat(Messenger): Add Hide Facebook button patch (#5057)

This commit is contained in:
Dawid Krajcarz
2025-06-09 20:13:05 +02:00
committed by GitHub
parent 4d2decd99c
commit 9175b23e83
7 changed files with 44 additions and 13 deletions

View File

@ -2,13 +2,15 @@ package app.revanced.extension.messenger.metaai;
@SuppressWarnings("unused")
public class RemoveMetaAIPatch {
public static boolean overrideConfigBool(long id, boolean value) {
// It seems like all configs starting with 363219 are related to Meta AI.
// A list of specific ones that need disabling would probably be better,
// but these config numbers seem to change slightly with each update.
// These first 6 digits don't though.
if (Long.toString(id).startsWith("363219"))
public static boolean overrideBooleanFlag(long id, boolean value) {
// This catches all flag IDs related to Meta AI.
// The IDs change slightly with every update,
// so to work around this, IDs from different versions were compared
// to find what they have in common, which turned out to be those first bits.
// TODO: Find the specific flags that we care about and patch the code they control instead.
if ((id & 0x7FFFFFC000000000L) == 0x810A8000000000L) {
return false;
}
return value;
}