Skip to content

Commit

Permalink
Make updateAvailability return 1 instead of 0
Browse files Browse the repository at this point in the history
* 1 means UPDATE_NOT_AVAILABLE
  • Loading branch information
RobbieTechie authored and R0rt1z2 committed Dec 16, 2023
1 parent cc34230 commit b7fefd6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/src/main/java/com/grindrplus/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/grindrplus/Hooks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit b7fefd6

Please sign in to comment.