From b7fefd6ad9ed6452f97b9b25cbb928fbe3614653 Mon Sep 17 00:00:00 2001 From: RobbieTechie Date: Sat, 16 Dec 2023 18:09:50 +0100 Subject: [PATCH] Make `updateAvailability` return 1 instead of 0 * 1 means UPDATE_NOT_AVAILABLE --- app/src/main/java/com/grindrplus/Constants.kt | 1 + app/src/main/java/com/grindrplus/Hooks.kt | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/grindrplus/Constants.kt b/app/src/main/java/com/grindrplus/Constants.kt index 7fb341e1..fcded2e4 100644 --- a/app/src/main/java/com/grindrplus/Constants.kt +++ b/app/src/main/java/com/grindrplus/Constants.kt @@ -12,6 +12,7 @@ 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_ONE: XC_MethodReplacement = returnConstant(1) val RETURN_UNIT: XC_MethodReplacement = returnConstant(Unit) val RETURN_NULL: XC_MethodReplacement = returnConstant(null) } diff --git a/app/src/main/java/com/grindrplus/Hooks.kt b/app/src/main/java/com/grindrplus/Hooks.kt index a6fe110f..50fad86a 100644 --- a/app/src/main/java/com/grindrplus/Hooks.kt +++ b/app/src/main/java/com/grindrplus/Hooks.kt @@ -14,6 +14,7 @@ import androidx.core.view.children import com.grindrplus.Constants.Returns.RETURN_FALSE import com.grindrplus.Constants.Returns.RETURN_INTEGER_MAX_VALUE import com.grindrplus.Constants.Returns.RETURN_LONG_MAX_VALUE +import com.grindrplus.Constants.Returns.RETURN_ONE import com.grindrplus.Constants.Returns.RETURN_TRUE import com.grindrplus.Constants.Returns.RETURN_UNIT import com.grindrplus.Constants.Returns.RETURN_ZERO @@ -1069,7 +1070,7 @@ object Hooks { "com.google.android.play.core.appupdate.AppUpdateInfo", Hooker.pkgParam.classLoader, "updateAvailability", - RETURN_ZERO + RETURN_ONE // UPDATE_NOT_AVAILABLE ) findAndHookConstructor(