From 0f9530513fb935870609ed008097f6e4828e70a7 Mon Sep 17 00:00:00 2001 From: Joar Heimonen Date: Fri, 1 Sep 2023 14:39:43 +0200 Subject: [PATCH] Fixed restart promt --- .../InnaccessibleProfileFingerprint.kt | 29 +++++++++++++++ .../fingerprints/ShowStoreFingerprint.kt | 35 +++++++++++++++++++ .../grindr/unlimited/patch/setUnlimited.kt | 11 +++++- 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 src/main/kotlin/app/revanced/patches/grindr/unlimited/fingerprints/InnaccessibleProfileFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/grindr/unlimited/fingerprints/ShowStoreFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/grindr/unlimited/fingerprints/InnaccessibleProfileFingerprint.kt b/src/main/kotlin/app/revanced/patches/grindr/unlimited/fingerprints/InnaccessibleProfileFingerprint.kt new file mode 100644 index 0000000000..301338edcd --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/grindr/unlimited/fingerprints/InnaccessibleProfileFingerprint.kt @@ -0,0 +1,29 @@ +package app.revanced.patches.grindr.unlimited.fingerprints + +import app.revanced.patcher.extensions.or +import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod +import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint +import org.jf.dexlib2.AccessFlags +import org.jf.dexlib2.Opcode + +//A + +@FuzzyPatternScanMethod(2) +object InnaccessibleProfileFingerprint : MethodFingerprint( + "Z", + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL + opcodes = listOf( + Opcode.IGET_OBJECT, + Opcode.INVOKE_VIRTUAL, + Opcode.MOVE_RESULT, + Opcode.IF_EQZ, + Opcode.IGET_OBJECT, + Opcode.INVOKE_VIRTUAL, + Opcode.MOVE_RESULT_OBJECT, + Opcode.SGET_OBJECT, + Opcode.IF_EQ, + Opcode.GOTO, + Opcode.CONST_4, + Opcode.RETURN + ), +) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/grindr/unlimited/fingerprints/ShowStoreFingerprint.kt b/src/main/kotlin/app/revanced/patches/grindr/unlimited/fingerprints/ShowStoreFingerprint.kt new file mode 100644 index 0000000000..ada225dbbe --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/grindr/unlimited/fingerprints/ShowStoreFingerprint.kt @@ -0,0 +1,35 @@ +package app.revanced.patches.grindr.unlimited.fingerprints + +import app.revanced.patcher.extensions.or +import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod +import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint +import org.jf.dexlib2.AccessFlags +import org.jf.dexlib2.Opcode + +//A + +@FuzzyPatternScanMethod(2) +object ShowStoreFingerprint : MethodFingerprint( + "Z", + accessFlags = AccessFlags.PUBLIC.value, + opcodes = listOf( + Opcode.SGET_OBJECT, + Opcode.INVOKE_VIRTUAL, + Opcode.MOVE_RESULT, + Opcode.IF_EQZ, + Opcode.SGET_OBJECT, + Opcode.INVOKE_VIRTUAL, + Opcode.MOVE_RESULT, + Opcode.IF_NEZ, + Opcode.INVOKE_VIRTUAL, + Opcode.MOVE_RESULT_OBJECT, + Opcode.INVOKE_VIRTUAL, + Opcode.MOVE_RESULT, + Opcode.IF_NEZ, + Opcode.GOTO, + Opcode.CONST_4, + Opcode.GOTO, + Opcode.CONST_4, + Opcode.RETURN + ), +) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/grindr/unlimited/patch/setUnlimited.kt b/src/main/kotlin/app/revanced/patches/grindr/unlimited/patch/setUnlimited.kt index 9ff4fcacc1..c22330ce3c 100644 --- a/src/main/kotlin/app/revanced/patches/grindr/unlimited/patch/setUnlimited.kt +++ b/src/main/kotlin/app/revanced/patches/grindr/unlimited/patch/setUnlimited.kt @@ -32,7 +32,8 @@ class UnlockUnlimitedPatch : BytecodePatch( IsNoXtraUpsellFingerprint, IsPlusFingerprint, IsUnlimitedFingerprint, - IsXtraFingerprint + IsXtraFingerprint, + InnaccessibleProfileFingerprint ) ) { override fun execute(context: BytecodeContext): PatchResult { @@ -100,6 +101,14 @@ class UnlockUnlimitedPatch : BytecodePatch( } } ?: return IsXtraFingerprint.toErrorResult() + InnaccessibleProfileFingerprint.result?.let { result -> + println("Found InnaccessibleProfileFingerprint!") + result.mutableMethod.apply { + replaceInstructions(0, _true) + } + } ?: return InnaccessibleProfileFingerprint.toErrorResult() + + return PatchResultSuccess() } } \ No newline at end of file