Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Grindr 9.7.0 #45

Merged
merged 22 commits into from
May 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ plugins {
}

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

private String genVersionName() {
String versionName = "${ext.versionMajor}.${ext.versionMinor}.${ext.versionPatch}"
Expand All @@ -18,12 +18,12 @@ private String getVersionNameSuffix() {
}

android {
compileSdk 32
compileSdk 33

defaultConfig {
applicationId 'com.eljaviluki.grindrplus'
minSdk 21
targetSdk 32
targetSdk 33
versionCode 14
versionName genVersionName()
versionNameSuffix getVersionNameSuffix()
Expand All @@ -42,6 +42,7 @@ android {
kotlinOptions {
jvmTarget = '1.8'
}
namespace 'com.eljaviluki.grindrplus'
}

dependencies {
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.eljaviluki.grindrplus">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/com/eljaviluki/grindrplus/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ object Constants {
val RETURN_INTEGER_MAX_VALUE: XC_MethodReplacement = returnConstant(Int.MAX_VALUE)
val RETURN_LONG_MAX_VALUE: XC_MethodReplacement = returnConstant(Long.MAX_VALUE)
val RETURN_ZERO: XC_MethodReplacement = returnConstant(0)
val RETURN_UNIT: XC_MethodReplacement = returnConstant(Unit)
}
}
87 changes: 66 additions & 21 deletions app/src/main/java/com/eljaviluki/grindrplus/Hooker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@ import android.content.Context
import android.widget.Toast
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.XC_MethodHook
import de.robv.android.xposed.XposedHelpers.*
import de.robv.android.xposed.XposedHelpers.findAndHookMethod
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
import kotlin.time.Duration.Companion.minutes


class Hooker : IXposedHookLoadPackage {

fun toastInvalidVersionName(){
Toast.makeText(appContext,
fun toastInvalidVersionName() {
Toast.makeText(
appContext,
"This hook is for client version $TARGET_PKG_VERSION_NAME. (Current: $pkgVersionName) Hook will not be loaded.",
Toast.LENGTH_LONG).show()
Toast.LENGTH_LONG
).show()
}

override fun handleLoadPackage(lpparam: LoadPackageParam) {
Expand All @@ -31,93 +33,135 @@ class Hooker : IXposedHookLoadPackage {
pkgVersionName = appContext.packageManager
.getPackageInfo(appContext.packageName, 0).versionName

if(pkgVersionName != TARGET_PKG_VERSION_NAME){
if (pkgVersionName != TARGET_PKG_VERSION_NAME) {
toastInvalidVersionName()
return
}

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

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

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

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

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

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

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

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

try {
//I've set this to max 3 min. If we make an UI for Hook Settings, we'll let the user to change this.
Hooks.hookOnlineIndicatorDuration(3.minutes)
} catch (e : Exception) {
} catch (e: Exception) {
e.message?.let { Logger.xLog(it) }
}

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

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

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

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

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

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

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

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

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

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

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

try {
Hooks.dontSendTypingIndicator()
} catch (e: Exception) {
e.message?.let { Logger.xLog(it) }
}
}
Expand All @@ -126,10 +170,11 @@ class Hooker : IXposedHookLoadPackage {
}

companion object {
const val TARGET_PKG_VERSION_NAME = "8.23.0"
const val TARGET_PKG_VERSION_NAME = "9.7.0"

var pkgParam: LoadPackageParam by InitOnce()
var appContext: Context by InitOnce()
var pkgVersionName: String by InitOnce()
val sharedPref by lazy { appContext.getSharedPreferences("phrases", Context.MODE_PRIVATE) }
}
}
Loading