diff --git a/app/src/main/java/com/grindrplus/XposedLoader.kt b/app/src/main/java/com/grindrplus/XposedLoader.kt index 76dfb2c7..4cfeeb7a 100644 --- a/app/src/main/java/com/grindrplus/XposedLoader.kt +++ b/app/src/main/java/com/grindrplus/XposedLoader.kt @@ -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 @@ -42,21 +43,29 @@ class XposedLoader : IXposedHookZygoteInit, IXposedHookLoadPackage { override fun checkClientTrusted( chain: Array?, authType: String? - ) {} + ) { + } override fun checkServerTrusted( chain: Array?, authType: String? - ) {} + ) { + } override fun getAcceptedIssuers(): Array = 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 }) } }) diff --git a/app/src/main/java/com/grindrplus/hooks/DisableBoosting.kt b/app/src/main/java/com/grindrplus/hooks/DisableBoosting.kt index 4ec17fee..a66bb7cf 100644 --- a/app/src/main/java/com/grindrplus/hooks/DisableBoosting.kt +++ b/app/src/main/java/com/grindrplus/hooks/DisableBoosting.kt @@ -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( @@ -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 -> @@ -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. 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 ->