feat(Messenger): Add Hide Facebook button
patch (#5057)
This commit is contained in:
@ -0,0 +1,10 @@
|
||||
package app.revanced.patches.messenger.layout
|
||||
|
||||
import app.revanced.patcher.fingerprint
|
||||
|
||||
internal val isFacebookButtonEnabledFingerprint = fingerprint {
|
||||
parameters()
|
||||
returns("Z")
|
||||
strings("com.facebook.messaging.inbox.tab.plugins.core.tabtoolbarbutton." +
|
||||
"facebookbutton.facebooktoolbarbutton.FacebookButtonTabButtonImplementation")
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package app.revanced.patches.messenger.layout
|
||||
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.util.returnEarly
|
||||
|
||||
@Suppress("unused")
|
||||
val hideFacebookButtonPatch = bytecodePatch(
|
||||
name = "Hide Facebook button",
|
||||
description = "Hides the Facebook button in the top toolbar."
|
||||
) {
|
||||
compatibleWith("com.facebook.orca")
|
||||
|
||||
execute {
|
||||
isFacebookButtonEnabledFingerprint.method.returnEarly(false)
|
||||
}
|
||||
}
|
@ -6,9 +6,8 @@ import app.revanced.patcher.fingerprint
|
||||
internal val getMobileConfigBoolFingerprint = fingerprint {
|
||||
parameters("J")
|
||||
returns("Z")
|
||||
opcodes(Opcode.RETURN)
|
||||
custom { method, classDef ->
|
||||
method.implementation ?: return@custom false // unsure if this is necessary
|
||||
opcodes(Opcode.RETURN)
|
||||
custom { _, classDef ->
|
||||
classDef.interfaces.contains("Lcom/facebook/mobileconfig/factory/MobileConfigUnsafeContext;")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,10 +25,10 @@ val removeMetaAIPatch = bytecodePatch(
|
||||
addInstructions(
|
||||
returnIndex,
|
||||
"""
|
||||
invoke-static { p1, p2, v$returnRegister }, $EXTENSION_CLASS_DESCRIPTOR->overrideConfigBool(JZ)Z
|
||||
invoke-static { p1, p2, v$returnRegister }, $EXTENSION_CLASS_DESCRIPTOR->overrideBooleanFlag(JZ)Z
|
||||
move-result v$returnRegister
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,4 +2,4 @@ package app.revanced.patches.messenger.misc.extension
|
||||
|
||||
import app.revanced.patches.shared.misc.extension.sharedExtensionPatch
|
||||
|
||||
val sharedExtensionPatch = sharedExtensionPatch("messenger", mainActivityOnCreateHook)
|
||||
val sharedExtensionPatch = sharedExtensionPatch("messenger", mainActivityOnCreateHook)
|
||||
|
Reference in New Issue
Block a user