mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2024-11-10 01:01:56 +01:00
feat(messenger): add disable-typing-indicator
patch (#2115)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
parent
4633fcd4d6
commit
5d1de4f4ea
2 changed files with 44 additions and 0 deletions
|
@ -0,0 +1,15 @@
|
|||
package app.revanced.patches.messenger.inputfield.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.dexbacked.value.DexBackedStringEncodedValue
|
||||
|
||||
object SendTypingIndicatorFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
parameters = listOf(),
|
||||
customFingerprint = { methodDef, classDef ->
|
||||
methodDef.name == "run" && classDef.fields.any {
|
||||
it.name == "__redex_internal_original_name"
|
||||
&& (it.initialValue as? DexBackedStringEncodedValue)?.value == "ConversationTypingContext\$sendActiveStateRunnable\$1"
|
||||
}
|
||||
}
|
||||
)
|
|
@ -0,0 +1,29 @@
|
|||
package app.revanced.patches.messenger.inputfield.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Package
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.replaceInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.messenger.inputfield.fingerprints.SendTypingIndicatorFingerprint
|
||||
|
||||
@Patch
|
||||
@Name("disable-typing-indicator")
|
||||
@Description("Disables the indicator while typing a message")
|
||||
@Compatibility([Package("com.facebook.orca")])
|
||||
@Version("0.0.1")
|
||||
class DisableTypingIndicator : BytecodePatch(listOf(SendTypingIndicatorFingerprint)) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
SendTypingIndicatorFingerprint.result?.mutableMethod?.replaceInstruction(0, "return-void")
|
||||
?: throw SendTypingIndicatorFingerprint.toErrorResult()
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue