From ae7d0d8b606ff543ae3d4d2e1992ed62ee2170d6 Mon Sep 17 00:00:00 2001 From: ElJaviLuki Date: Thu, 15 Sep 2022 19:38:32 +0200 Subject: [PATCH] Fix Location Mock error on devices below SDK 31 --- .../main/java/com/eljaviluki/grindrplus/Hooks.kt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/eljaviluki/grindrplus/Hooks.kt b/app/src/main/java/com/eljaviluki/grindrplus/Hooks.kt index e08dce9b..578c2f95 100644 --- a/app/src/main/java/com/eljaviluki/grindrplus/Hooks.kt +++ b/app/src/main/java/com/eljaviluki/grindrplus/Hooks.kt @@ -1,5 +1,6 @@ package com.eljaviluki.grindrplus +import android.os.Build import android.util.AttributeSet import android.view.View import android.view.Window @@ -352,11 +353,13 @@ object Hooks { RETURN_FALSE ) - findAndHookMethod( - class_Location, - "isMock", - RETURN_FALSE - ) + if(Build.VERSION.SDK_INT >= 31) { + findAndHookMethod( + class_Location, + "isMock", + RETURN_FALSE + ) + } }