Skip to content

Commit

Permalink
Fix for Grindr 9.12.0 v2
Browse files Browse the repository at this point in the history
  • Loading branch information
TebbeUbben committed Jul 13, 2023
1 parent 3474883 commit 190f9f4
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 5 deletions.
7 changes: 7 additions & 0 deletions app/src/main/java/com/eljaviluki/grindrplus/Hooker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class Hooker : IXposedHookLoadPackage {
} catch (e: Exception) {
e.message?.let { Logger.xLog(it) }
}

findAndHookMethod(
Application::class.java,
"onCreate",
Expand All @@ -52,6 +53,12 @@ class Hooker : IXposedHookLoadPackage {
return
}

try {
Hooks.unlimitedProfiles()
} catch (e: Exception) {
e.message?.let { Logger.xLog(it) }
}

try {
Hooks.allowScreenshotsHook()
} catch (e: Exception) {
Expand Down
101 changes: 98 additions & 3 deletions app/src/main/java/com/eljaviluki/grindrplus/Hooks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import com.eljaviluki.grindrplus.Constants.Returns.RETURN_INTEGER_MAX_VALUE
import com.eljaviluki.grindrplus.Constants.Returns.RETURN_LONG_MAX_VALUE
import com.eljaviluki.grindrplus.Constants.Returns.RETURN_TRUE
import com.eljaviluki.grindrplus.Constants.Returns.RETURN_UNIT
import com.eljaviluki.grindrplus.Constants.Returns.RETURN_ZERO
import com.eljaviluki.grindrplus.Obfuscation.GApp
import de.robv.android.xposed.XC_MethodHook
import de.robv.android.xposed.XC_MethodReplacement
Expand Down Expand Up @@ -258,7 +257,7 @@ object Hooks {
findAndHookMethod(
userSessionImpl,
GApp.storage.IUserSession_.isNoXtraUpsell,
RETURN_FALSE
RETURN_TRUE
) //Not sure what is this for

findAndHookMethod(
Expand All @@ -267,6 +266,18 @@ object Hooks {
RETURN_TRUE
)

findAndHookMethod(
userSessionImpl,
GApp.storage.IUserSession_.isPlus,
RETURN_TRUE
)

findAndHookMethod(
userSessionImpl,
GApp.storage.IUserSession_.isNoPlusUpsell,
RETURN_TRUE
)

findAndHookMethod(
userSessionImpl,
GApp.storage.IUserSession_.isUnlimited,
Expand Down Expand Up @@ -322,7 +333,40 @@ object Hooks {
RETURN_TRUE
)

val class_UpsellsV8 = findClass(
findAndHookMethod(
"com.grindrapp.android.flags.featureflags.g",
Hooker.pkgParam.classLoader,
"b",
object : XC_MethodReplacement() {
override fun replaceHookedMethod(param: MethodHookParam): Any {
val feature = getObjectField(param.thisObject, "b") as String
return when (feature) {
"profile-redesign-20230214" -> true
"notification-action-chat-20230206" -> true
"gender-updates" -> true
"gender-filter" -> true
"gender-exclusion" -> true
"calendar-ui" -> true
"vaccine-profile-field" -> true
"tag-search" -> true
"approximate-distance" -> true
"spectrum_solicitation_sex" -> true
"allow-mock-location" -> true
"spectrum-solicitation-of-drugs" -> true
"reporting-lag-time" -> true
"side-profile-link" -> true
"sift-kill-switch" -> true
"canceled-screen" -> true
"takemehome-button" -> true
"download-my-data" -> true
"face-auth-android" -> true
else -> XposedBridge.invokeOriginalMethod(param.method, param.thisObject, param.args)
}
}
}
)

/*val class_UpsellsV8 = findClass(
GApp.model.UpsellsV8,
Hooker.pkgParam.classLoader
)
Expand Down Expand Up @@ -354,6 +398,45 @@ object Hooks {
class_Inserts,
GApp.model.Inserts_.getMpuXtra,
RETURN_ZERO
)*/
}

fun unlimitedProfiles() {
//Enforce usage of InaccessibleProfileManager...
findAndHookMethod(
"com.grindrapp.android.profile.experiments.InaccessibleProfileManager",
Hooker.pkgParam.classLoader,
"b",
RETURN_TRUE
)

//...and then just never ask for upsells
findAndHookMethod(
"com.grindrapp.android.profile.experiments.InaccessibleProfileManager",
Hooker.pkgParam.classLoader,
"c",
Int::class.javaPrimitiveType,
Int::class.javaObjectType,
Int::class.javaObjectType,
GApp.storage.IUserSession,
"com.grindrapp.android.base.model.profile.ReferrerType",
RETURN_FALSE
)

//Remove all ads and upsells from the cascade
findAndHookMethod(
"com.grindrapp.android.persistence.model.serverdrivencascade.ServerDrivenCascadeCacheState",
Hooker.pkgParam.classLoader,
"getItems",
object : XC_MethodReplacement() {
override fun replaceHookedMethod(param: MethodHookParam): Any {
val items = XposedBridge.invokeOriginalMethod(param.method, param.thisObject, param.args) as List<*>
return items.filterNotNull().filter {
it.javaClass.name == "com.grindrapp.android.persistence.model.serverdrivencascade.ServerDrivenCascadeCachedProfile"
}
}

}
)
}

Expand Down Expand Up @@ -543,6 +626,18 @@ object Hooks {
GApp.view.TapsAnimLayout_.getDisableVariantSelection,
RETURN_FALSE
)

findAndHookMethod(
"com.grindrapp.android.ui.profileV2.ChatTapsQuickbarView",
Hooker.pkgParam.classLoader,
"u",
Boolean::class.javaPrimitiveType,
object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) {
param.args[0] = true
}
}
)
}

/**
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/java/com/eljaviluki/grindrplus/Obfuscation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,10 @@ object Obfuscation {

object IUserSession_ {
const val hasFeature_feature = "a"
const val isFree = "i"
const val isNoXtraUpsell = "A"
const val isFree = "r"
const val isNoPlusUpsell = "A"
const val isNoXtraUpsell = "i"
const val isPlus = "y"
const val isXtra = "p"
const val isUnlimited = "x"
const val getProfileId = "f"
Expand Down

0 comments on commit 190f9f4

Please sign in to comment.