Skip to content

Commit

Permalink
GrindrPlus: Remove annoying green tooltip (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rattlyy authored Oct 7, 2024
1 parent a3476c4 commit b703c50
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 6 deletions.
17 changes: 13 additions & 4 deletions app/src/main/java/com/grindrplus/XposedLoader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.grindrplus

import android.app.Application
import android.widget.Toast
import com.grindrplus.core.Config
import com.grindrplus.core.Constants.GRINDR_PACKAGE_NAME
import com.grindrplus.utils.HookStage
import com.grindrplus.utils.hook
Expand Down Expand Up @@ -42,21 +43,29 @@ class XposedLoader : IXposedHookZygoteInit, IXposedHookLoadPackage {
override fun checkClientTrusted(
chain: Array<out X509Certificate>?,
authType: String?
) {}
) {
}

override fun checkServerTrusted(
chain: Array<out X509Certificate>?,
authType: String?
) {}
) {
}

override fun getAcceptedIssuers(): Array<X509Certificate> = emptyArray()

})
val sslContext = SSLContext.getInstance("TLSv1.3")
sslContext.init(null, trustAlLCerts, SecureRandom())
callMethod(param.thisObject, "sslSocketFactory", sslContext.socketFactory, trustAlLCerts.first() as X509TrustManager)
callMethod(
param.thisObject,
"sslSocketFactory",
sslContext.socketFactory,
trustAlLCerts.first() as X509TrustManager
)
callMethod(param.thisObject, "hostnameVerifier", object : HostnameVerifier {
override fun verify(hostname: String?, session: SSLSession?): Boolean = true
override fun verify(hostname: String?, session: SSLSession?): Boolean =
true
})
}
})
Expand Down
24 changes: 22 additions & 2 deletions app/src/main/java/com/grindrplus/hooks/DisableBoosting.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ package com.grindrplus.hooks

import com.grindrplus.utils.Hook
import com.grindrplus.utils.HookStage
import com.grindrplus.utils.hook
import com.grindrplus.utils.hookConstructor
import de.robv.android.xposed.XC_MethodHook
import de.robv.android.xposed.XC_MethodReplacement
import de.robv.android.xposed.XposedBridge
import de.robv.android.xposed.XposedHelpers.findAndHookMethod
import de.robv.android.xposed.XposedHelpers.setObjectField

class DisableBoosting : Hook(
Expand All @@ -12,15 +17,22 @@ class DisableBoosting : Hook(
private val drawerProfileUiState = "E8.f\$a"
private val radarUiModel = "L6.a\$a"
private val boostFabUiModel = "com.grindrapp.android.boost2.presentation.model.BoostFabUiModel"
private val boostStateClass = "com.grindrapp.android.ui.drawer.model.SideDrawerRightNowBoostState"
private val boostStateClass =
"com.grindrapp.android.ui.drawer.model.SideDrawerRightNowBoostState"

override fun init() {
findClass(drawerProfileUiState).hookConstructor(HookStage.AFTER) { param ->
setObjectField(param.thisObject(), "a", false) // showBoostMeButton
setObjectField(param.thisObject(), "e", findClass(boostStateClass).getField("UNAVAILABLE").get(null)) // boostButtonState
setObjectField(
param.thisObject(),
"e",
findClass(boostStateClass).getField("UNAVAILABLE").get(null)
) // boostButtonState
setObjectField(param.thisObject(), "h", null) // showDayPassItem
setObjectField(param.thisObject(), "i", null) // dayPassXtraItem
setObjectField(param.thisObject(), "j", null) // unlimitedWeeklySubscriptionItem
setObjectField(param.thisObject(), "s", false) // isRightNowTooltipVisible
setObjectField(param.thisObject(), "r", false) // isRightNowAvailable
}

findClass(radarUiModel).hookConstructor(HookStage.AFTER) { param ->
Expand All @@ -30,6 +42,14 @@ class DisableBoosting : Hook(
setObjectField(param.thisObject(), "d", false) // isBoostIconVisible
}

// the two anonymous functions that get called to invoke the annoying tooltip
// respectively: showRadarTooltip.<anonymous> and showTapsAndViewedMePopup
listOf("N8.y0", "N8.B0").forEach {
findClass(it).hook("invoke", HookStage.BEFORE) { param ->
param.setResult(null)
}
}

// Grindr decided to name this upsell with the weirdest name possible, I pay respects below.
findClass(boostFabUiModel)
.hookConstructor(HookStage.AFTER) { param ->
Expand Down

0 comments on commit b703c50

Please sign in to comment.