From a1748a0368c886c4d39caa3d820d2c9cc5aa58ae Mon Sep 17 00:00:00 2001 From: ElJaviLuki Date: Fri, 9 Dec 2022 21:40:35 +0100 Subject: [PATCH] Make messages always removable Now you will be able to remove any message (no matter how old it is). You can even remove the recipient's messages! --- README.md | 1 + app/build.gradle | 2 +- .../java/com/eljaviluki/grindrplus/Hooker.kt | 6 ++++++ .../main/java/com/eljaviluki/grindrplus/Hooks.kt | 16 +++++++++++++++- .../com/eljaviluki/grindrplus/Obfuscation.kt | 9 +++++++++ 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 524e8719..cdc08864 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Grindr Plus is a Xposed Module that allows you to unlock some features in Grindr - More accurate online status from other users. (The green dot from other profiles goes off after 3 minutes of inactivity.) - Allow unlimited taps (no 24h restriction) - Ability to see who viewed your profile even if you have "Show Me In Viewed Me List" disabled. +- Ability to remove messages from anyone, any time. ## Bugs * Incognito mode is kinda buggy (it turns off after a little while) diff --git a/app/build.gradle b/app/build.gradle index ec6327f3..9e216e94 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -24,7 +24,7 @@ android { applicationId 'com.eljaviluki.grindrplus' minSdk 21 targetSdk 32 - versionCode 11 + versionCode 12 versionName genVersionName() versionNameSuffix getVersionNameSuffix() } diff --git a/app/src/main/java/com/eljaviluki/grindrplus/Hooker.kt b/app/src/main/java/com/eljaviluki/grindrplus/Hooker.kt index f2de651a..35425a60 100644 --- a/app/src/main/java/com/eljaviluki/grindrplus/Hooker.kt +++ b/app/src/main/java/com/eljaviluki/grindrplus/Hooker.kt @@ -108,6 +108,12 @@ class Hooker : IXposedHookLoadPackage { } catch (e : Exception) { e.message?.let { Logger.xLog(it) } } + + try { + Hooks.makeMessagesAlwaysRemovable() + } catch (e : Exception) { + e.message?.let { Logger.xLog(it) } + } } } ) diff --git a/app/src/main/java/com/eljaviluki/grindrplus/Hooks.kt b/app/src/main/java/com/eljaviluki/grindrplus/Hooks.kt index 87dc67b1..155de8af 100644 --- a/app/src/main/java/com/eljaviluki/grindrplus/Hooks.kt +++ b/app/src/main/java/com/eljaviluki/grindrplus/Hooks.kt @@ -20,7 +20,6 @@ import com.eljaviluki.grindrplus.Obfuscation.GApp import com.eljaviluki.grindrplus.decorated.persistence.model.Profile import de.robv.android.xposed.XC_MethodReplacement import de.robv.android.xposed.XposedBridge -import de.robv.android.xposed.XposedHelpers import de.robv.android.xposed.XposedHelpers.* import kotlin.time.Duration @@ -472,4 +471,19 @@ object Hooks { XC_MethodReplacement.DO_NOTHING ) } + + fun makeMessagesAlwaysRemovable(){ + val class_ChatBaseFragmentV2 = findClass( + GApp.ui.chat.ChatBaseFragmentV2, + Hooker.pkgParam.classLoader + ) + + val class_ChatMessage = findClass(GApp.persistence.model.ChatMessage, Hooker.pkgParam.classLoader) + findAndHookMethod( + class_ChatBaseFragmentV2, + GApp.ui.chat.ChatBaseFragmentV2_._canBeUnsent, + class_ChatMessage, + RETURN_FALSE + ) + } } \ No newline at end of file diff --git a/app/src/main/java/com/eljaviluki/grindrplus/Obfuscation.kt b/app/src/main/java/com/eljaviluki/grindrplus/Obfuscation.kt index 3803fb82..4674fab9 100644 --- a/app/src/main/java/com/eljaviluki/grindrplus/Obfuscation.kt +++ b/app/src/main/java/com/eljaviluki/grindrplus/Obfuscation.kt @@ -110,6 +110,15 @@ object Obfuscation { const val setProfile = "h" } } + + object chat { + private const val _chat = "$_ui.chat" + + const val ChatBaseFragmentV2 = "$_chat.ChatBaseFragmentV2" + object ChatBaseFragmentV2_ { + const val _canBeUnsent = "X1" + } + } } object utils {