Skip to content

Commit

Permalink
Don't block incoming chat markers
Browse files Browse the repository at this point in the history
  • Loading branch information
TebbeUbben committed Apr 29, 2023
1 parent 43291e5 commit 3495257
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {

ext.versionMajor = 1
ext.versionMinor = 2
ext.versionPatch = 3
ext.versionPatch = 4
ext.grindrVersion = '9.7.0'

private String genVersionName() {
Expand Down
25 changes: 13 additions & 12 deletions app/src/main/java/com/eljaviluki/grindrplus/Hooks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1197,19 +1197,20 @@ object Hooks {

fun dontSendChatMarkers() {
findAndHookMethod(
"org.jivesoftware.smack.packet.Stanza",
GApp.xmpp.ChatMarkersManager,
Hooker.pkgParam.classLoader,
"addExtension",
"org.jivesoftware.smack.packet.ExtensionElement",
object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) {
if (param.args[0] == null) return
val elementName = callMethod(param.args[0], "getElementName") as String
if (elementName in arrayOf("received", "displayed")) {
param.args[0] = null
}
}
}
GApp.xmpp.ChatMarkersManager_.addDisplayedExtension,
"org.jivesoftware.smack.chat2.Chat",
"org.jivesoftware.smack.packet.Message",
XC_MethodReplacement.DO_NOTHING
)
findAndHookMethod(
GApp.xmpp.ChatMarkersManager,
Hooker.pkgParam.classLoader,
GApp.xmpp.ChatMarkersManager_.addReceivedExtension,
"org.jivesoftware.smack.chat2.Chat",
"org.jivesoftware.smack.packet.Message",
XC_MethodReplacement.DO_NOTHING
)
}

Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/com/eljaviluki/grindrplus/Obfuscation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,13 @@ object Obfuscation {
object ChatMessageManager_ {
const val handleIncomingChatMessage = "p"
}

const val ChatMarkersManager = "$_xmpp.i"

object ChatMarkersManager_ {
const val addDisplayedExtension = "d"
const val addReceivedExtension = "f"
}
}
}
}

0 comments on commit 3495257

Please sign in to comment.