From 472886ba84362fba3e517f03517f16a35c4cd7f2 Mon Sep 17 00:00:00 2001 From: R0rt1z2 Date: Sun, 17 Nov 2024 16:57:17 +0100 Subject: [PATCH] GrindrPlus: Updates for latest 24.17.1 --- .github/workflows/build_apk.yml | 2 - app/build.gradle.kts | 4 +- .../main/java/com/grindrplus/GrindrPlus.kt | 2 +- .../java/com/grindrplus/commands/Profile.kt | 42 ++++++++++++++++++- .../com/grindrplus/hooks/DisableAnalytics.kt | 2 +- .../com/grindrplus/hooks/DisableBoosting.kt | 7 +++- .../ui/fragments/SettingsFragment.kt | 2 - version.json | 2 +- 8 files changed, 52 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build_apk.yml b/.github/workflows/build_apk.yml index a60bc1c8..3abaf122 100644 --- a/.github/workflows/build_apk.yml +++ b/.github/workflows/build_apk.yml @@ -76,7 +76,6 @@ jobs: curl -F document=@"${{ env.DEBUG_APK }}" \ -F chat_id=${{ secrets.TELEGRAM_CHAT_ID }} \ -F parse_mode=Markdown \ - -F caption="${{ env.VERSION_INFO }} (debug) | [${{ env.COMMIT_SHA }}](${{ env.COMMIT_URL }})" \ https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendDocument - name: Upload Signed Release APK to Telegram @@ -84,7 +83,6 @@ jobs: curl -F document=@"${{ env.RELEASE_APK }}" \ -F chat_id=${{ secrets.TELEGRAM_CHAT_ID }} \ -F parse_mode=Markdown \ - -F caption="${{ env.VERSION_INFO }} (release) | [${{ env.COMMIT_SHA }}](${{ env.COMMIT_URL }})" \ https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendDocument - name: Upload Debug APK as Artifact diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 46bb2f4f..419a7ed1 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -8,7 +8,7 @@ plugins { } android { - val grindrVersions = listOf("24.17.0", "24.17.1") + val grindrVersions = listOf("24.17.1") namespace = "com.grindrplus" compileSdk = 34 @@ -19,7 +19,7 @@ android { minSdk = 21 targetSdk = 34 versionCode = 14 - versionName = "3.2.4-${grindrVersions.joinToString("_")}_$gitCommitHash" + versionName = "3.2.5-${grindrVersions.joinToString("_")}_$gitCommitHash" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/src/main/java/com/grindrplus/GrindrPlus.kt b/app/src/main/java/com/grindrplus/GrindrPlus.kt index 88b920e4..9d1efb98 100644 --- a/app/src/main/java/com/grindrplus/GrindrPlus.kt +++ b/app/src/main/java/com/grindrplus/GrindrPlus.kt @@ -54,7 +54,7 @@ object GrindrPlus { var currentActivity: Activity? = null private set - private val userAgent = "d5.u" + private val userAgent = "d5.t" private val userSession = "com.grindrapp.android.storage.b" fun init(modulePath: String, application: Application) { diff --git a/app/src/main/java/com/grindrplus/commands/Profile.kt b/app/src/main/java/com/grindrplus/commands/Profile.kt index 5ccb708d..afc5ab58 100644 --- a/app/src/main/java/com/grindrplus/commands/Profile.kt +++ b/app/src/main/java/com/grindrplus/commands/Profile.kt @@ -9,6 +9,7 @@ import com.grindrplus.GrindrPlus import com.grindrplus.core.Utils.openChat import com.grindrplus.core.Utils.openProfile import com.grindrplus.ui.Utils.copyToClipboard +import okhttp3.RequestBody.Companion.toRequestBody class Profile( recipient: String, @@ -70,7 +71,7 @@ class Profile( val silent = "silent" in args if (args.isNotEmpty()) { GrindrPlus.runCatching { - val response = GrindrPlus.httpClient.sendRequest( + val response = httpClient.sendRequest( "https://grindr.mobi/v3/me/blocks/${args[0]}", "DELETE" ) @@ -108,6 +109,45 @@ class Profile( } } + @Command("report", help = "Report a user") + fun report(args: List) { + val profileId = if (args.isNotEmpty()) args[0] else sender + val reason = if (args.size > 1) args[1] else "SPAM" + val body = """ + { + "reason": "$reason", + "comment": "", + "locations": [ + "CHAT_MESSAGE" + ] + } + """.trimIndent() + GrindrPlus.runCatching { + val response = httpClient.sendRequest( + "https://grindr.mobi/v3.1/flags/$profileId", + "POST", + mapOf("Content-Type" to "application/json"), + body.toRequestBody() + ) + if (response.isSuccessful) { + showToast( + Toast.LENGTH_LONG, + "User reported successfully" + ) + } else { + showToast( + Toast.LENGTH_LONG, + "Failed to report user: ${response.body?.string()}" + ) + } + }.onFailure { + GrindrPlus.showToast( + Toast.LENGTH_LONG, + "Failed to report user: ${it.message}" + ) + } + } + @SuppressLint("SetTextI18n") @Command("id", help = "Get and copy profile IDs") fun id(args: List) { diff --git a/app/src/main/java/com/grindrplus/hooks/DisableAnalytics.kt b/app/src/main/java/com/grindrplus/hooks/DisableAnalytics.kt index d37ab9bc..00801185 100644 --- a/app/src/main/java/com/grindrplus/hooks/DisableAnalytics.kt +++ b/app/src/main/java/com/grindrplus/hooks/DisableAnalytics.kt @@ -9,7 +9,7 @@ class DisableAnalytics : Hook( "Disable analytics", "Disable Grindr analytics (data collection)" ) { - private val analyticsRestService = "a4.g" + private val analyticsRestService = "L4.a" override fun init() { val analyticsRestServiceClass = findClass(analyticsRestService) diff --git a/app/src/main/java/com/grindrplus/hooks/DisableBoosting.kt b/app/src/main/java/com/grindrplus/hooks/DisableBoosting.kt index 41ac7aac..14927074 100644 --- a/app/src/main/java/com/grindrplus/hooks/DisableBoosting.kt +++ b/app/src/main/java/com/grindrplus/hooks/DisableBoosting.kt @@ -13,6 +13,7 @@ class DisableBoosting : Hook( ) { private val drawerProfileUiState = "V9.e\$a" private val radarUiModel = "J7.a\$a" + private val roamOnBoardingFragment = "Aa.c" private val fabUiModel = "com.grindrapp.android.boost2.presentation.model.FabUIModel" private val boostStateClass = "com.grindrapp.android.ui.drawer.model.SideDrawerMicrosButtonState\$Unavailable" @@ -50,7 +51,11 @@ class DisableBoosting : Hook( } } - findClass(fabUiModel).hook("component2", HookStage.AFTER) { param -> // getIsVisible() + findClass(fabUiModel).hook("createFragment", HookStage.BEFORE) { param -> + param.setResult(null) // Don't let the fragment be created + } + + findClass(roamOnBoardingFragment).hook("a", HookStage.BEFORE) { param -> // showBoostMeButton param.setResult(false) } } diff --git a/app/src/main/java/com/grindrplus/ui/fragments/SettingsFragment.kt b/app/src/main/java/com/grindrplus/ui/fragments/SettingsFragment.kt index 90aab4b0..d43aceff 100644 --- a/app/src/main/java/com/grindrplus/ui/fragments/SettingsFragment.kt +++ b/app/src/main/java/com/grindrplus/ui/fragments/SettingsFragment.kt @@ -383,8 +383,6 @@ class SettingsFragment : Fragment() { container?.addView(otherSettingsTitle) container?.addView(createDynamicSettingView(context, "Online indicator duration (mins)", "Control when your green dot disappears after inactivity", "online_indicator")) container?.addView(createDynamicSettingView(context, "Favorites grid size", "Customize grid size of the layout for the favorites tab", "favorites_grid_columns")) - - container?.addView(createToggleableSettingView(context, "Confirm block", "Show a confirmation dialog before blocking a user", "confirm_block")) } private fun showResetConfirmationDialog() { diff --git a/version.json b/version.json index e972fd40..8a7beb65 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { "versionName": "24.17.1", - "versionCode": 131246 + "versionCode": 131488 } \ No newline at end of file