forked from ReVanced/revanced-patches-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fbf72b7
commit 61e3839
Showing
17 changed files
with
479 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
src/main/kotlin/app/revanced/patches/grindr/annotations/GrindrPatchCompatibility.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package app.revanced.patches.grindr.annotations | ||
|
||
import app.revanced.patcher.annotation.Compatibility | ||
import app.revanced.patcher.annotation.Package | ||
|
||
@Compatibility([Package("com.grindrapp.android", arrayOf("9.15.0"))]) | ||
@Target(AnnotationTarget.CLASS) | ||
internal annotation class GrindrPatchCompatibility |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package app.revanced.patches.grindr | ||
|
||
internal object Constants { | ||
const val PACKAGE_NAME = "com.grindrapp.android" | ||
const val SPOOFED_PACKAGE_SIGNATURE = "823F5A17C33B16B4775480B31607E7DF35D67AF8" | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/kotlin/app/revanced/patches/grindr/fingerprints/GetCertRegistrationFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package app.revanced.patches.grindr.fingerprints | ||
|
||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
|
||
object GetReqistrationCertFingerprint : MethodFingerprint( | ||
"Ljava/lang/String;", | ||
strings = listOf( | ||
"FirebaseRemoteConfig", | ||
"Could not get fingerprint hash for package: ", | ||
"No such package: " | ||
) | ||
) |
12 changes: 12 additions & 0 deletions
12
src/main/kotlin/app/revanced/patches/grindr/fingerprints/GetMessagingCertFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package app.revanced.patches.grindr.fingerprints | ||
|
||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
|
||
object GetMessagingCertFingerprint : MethodFingerprint( | ||
"Ljava/lang/String;", | ||
strings = listOf( | ||
"ContentValues", | ||
"Could not get fingerprint hash for package: ", | ||
"No such package: " | ||
) | ||
) |
50 changes: 50 additions & 0 deletions
50
src/main/kotlin/app/revanced/patches/grindr/patch/bytecode/FirebaseGetCertPatch.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package app.revanced.patches.grindr.patch.bytecode | ||
|
||
import app.revanced.patcher.annotation.Description | ||
import app.revanced.patcher.annotation.Name | ||
import app.revanced.patcher.patch.annotations.DependsOn | ||
import app.revanced.patcher.patch.annotations.Patch | ||
|
||
import app.revanced.patcher.data.BytecodeContext | ||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions | ||
import app.revanced.patcher.patch.BytecodePatch | ||
import app.revanced.patcher.patch.PatchResult | ||
import app.revanced.patches.grindr.fingerprints.GetMessagingCertFingerprint | ||
import app.revanced.patches.grindr.fingerprints.GetReqistrationCertFingerprint | ||
import app.revanced.patches.grindr.Constants.SPOOFED_PACKAGE_SIGNATURE | ||
|
||
import app.revanced.patches.grindr.annotations.GrindrPatchCompatibility | ||
|
||
@Patch | ||
@Name("Firebase patch") | ||
@Description("Allows Grindr to run after being modified by ReVanced.") | ||
@GrindrPatchCompatibility | ||
|
||
class FirebaseGetCertPatch : BytecodePatch( | ||
listOf( | ||
GetReqistrationCertFingerprint, | ||
GetMessagingCertFingerprint | ||
) | ||
) { | ||
override fun execute(context: BytecodeContext) { | ||
|
||
val spoofedInstruction = | ||
""" | ||
const-string v0, "$SPOOFED_PACKAGE_SIGNATURE" | ||
return-object v0 | ||
""" | ||
|
||
val registrationCertMethod = GetReqistrationCertFingerprint.result!!.mutableMethod | ||
val messagingCertMethod = GetMessagingCertFingerprint.result!!.mutableMethod | ||
|
||
registrationCertMethod.addInstructions( | ||
0, | ||
spoofedInstruction | ||
) | ||
messagingCertMethod.addInstructions( | ||
0, | ||
spoofedInstruction | ||
) | ||
|
||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
.../kotlin/app/revanced/patches/grindr/unlimited/annotations/UnlockUnlimitedCompatibility.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package app.revanced.patches.grindr.unlimited.annotations | ||
|
||
import app.revanced.patcher.annotation.Compatibility | ||
import app.revanced.patcher.annotation.Package | ||
|
||
@Compatibility([Package("com.grindrapp.android")]) | ||
@Target(AnnotationTarget.CLASS) | ||
internal annotation class UnlockUnlimitedCompatibility | ||
|
17 changes: 17 additions & 0 deletions
17
src/main/kotlin/app/revanced/patches/grindr/unlimited/fingerprints/HasFeatureFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
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 com.android.tools.smali.dexlib2.AccessFlags | ||
import com.android.tools.smali.dexlib2.Opcode | ||
|
||
//a | ||
|
||
object HasFeatureFingerprint : MethodFingerprint( | ||
"Z", | ||
parameters = listOf("Lcom/grindrapp/android/model/Feature;"), | ||
customFingerprint = { methodDef, _ -> | ||
methodDef.name.contains("a") | ||
} | ||
) |
30 changes: 30 additions & 0 deletions
30
...revanced/patches/grindr/unlimited/fingerprints/InnaccessibleProfileManagerbFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
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 com.android.tools.smali.dexlib2.AccessFlags | ||
import com.android.tools.smali.dexlib2.Opcode | ||
|
||
//b | ||
|
||
@FuzzyPatternScanMethod(2) | ||
object InnaccessibleProfileManagerbFingerprint : 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.CONST_4, | ||
Opcode.GOTO, | ||
Opcode.CONST_4, | ||
Opcode.RETURN | ||
), | ||
) |
15 changes: 15 additions & 0 deletions
15
...revanced/patches/grindr/unlimited/fingerprints/InnaccessibleProfileManagerdFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
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 com.android.tools.smali.dexlib2.AccessFlags | ||
import com.android.tools.smali.dexlib2.Opcode | ||
|
||
//d | ||
|
||
object InnaccessibleProfileManagerdFingerprint : MethodFingerprint( | ||
customFingerprint = { methodDef, _ -> | ||
methodDef.name == "d" && methodDef.definingClass.contains("InaccessibleProfileManager") | ||
} | ||
) |
13 changes: 13 additions & 0 deletions
13
src/main/kotlin/app/revanced/patches/grindr/unlimited/fingerprints/IsFreeFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
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 com.android.tools.smali.dexlib2.AccessFlags | ||
import com.android.tools.smali.dexlib2.Opcode | ||
|
||
object IsFreeFingerprint : MethodFingerprint( | ||
customFingerprint = { methodDef, _ -> | ||
methodDef.name == "r" && methodDef.definingClass.endsWith("storage/s0;") | ||
} | ||
) |
30 changes: 30 additions & 0 deletions
30
...in/kotlin/app/revanced/patches/grindr/unlimited/fingerprints/IsNoPlusUpsellFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
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 com.android.tools.smali.dexlib2.AccessFlags | ||
import com.android.tools.smali.dexlib2.Opcode | ||
|
||
//A | ||
|
||
object IsNoPlusUpsellFingerprint : MethodFingerprint( | ||
"Z", | ||
accessFlags = AccessFlags.PUBLIC.value, | ||
opcodes = listOf( | ||
Opcode.INVOKE_VIRTUAL, | ||
Opcode.MOVE_RESULT, | ||
Opcode.IF_NEZ, | ||
Opcode.INVOKE_VIRTUAL, | ||
Opcode.MOVE_RESULT, | ||
Opcode.IF_NEZ, | ||
Opcode.INVOKE_VIRTUAL, | ||
Opcode.MOVE_RESULT, | ||
Opcode.IF_EQZ, | ||
Opcode.GOTO, | ||
Opcode.CONST_4, | ||
Opcode.GOTO, | ||
Opcode.CONST_4, | ||
Opcode.RETURN | ||
), | ||
) |
27 changes: 27 additions & 0 deletions
27
...in/kotlin/app/revanced/patches/grindr/unlimited/fingerprints/IsNoXtraUpsellFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
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 com.android.tools.smali.dexlib2.AccessFlags | ||
import com.android.tools.smali.dexlib2.Opcode | ||
|
||
object IsNoXtraUpsellFingerprint : MethodFingerprint( | ||
"Z", | ||
accessFlags = AccessFlags.PUBLIC.value, | ||
opcodes = listOf( | ||
Opcode.INVOKE_VIRTUAL, | ||
Opcode.MOVE_RESULT, | ||
Opcode.IF_NEZ, | ||
Opcode.INVOKE_VIRTUAL, | ||
Opcode.MOVE_RESULT, | ||
Opcode.IF_NEZ, | ||
Opcode.CONST_4, | ||
Opcode.GOTO, | ||
Opcode.CONST_4, | ||
Opcode.RETURN | ||
), | ||
customFingerprint = { methodDef, _ -> | ||
methodDef.name.contains("h") | ||
} | ||
) |
30 changes: 30 additions & 0 deletions
30
src/main/kotlin/app/revanced/patches/grindr/unlimited/fingerprints/IsPlusFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
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 com.android.tools.smali.dexlib2.AccessFlags | ||
import com.android.tools.smali.dexlib2.Opcode | ||
|
||
object IsPlusFingerprint : MethodFingerprint( | ||
"Z", | ||
accessFlags = AccessFlags.PUBLIC.value, | ||
opcodes = listOf( | ||
Opcode.IGET_OBJECT, | ||
Opcode.CHECK_CAST, | ||
Opcode.CONST_4, | ||
Opcode.NEW_ARRAY, | ||
Opcode.CONST_4, | ||
Opcode.SGET_OBJECT, | ||
Opcode.APUT_OBJECT, | ||
Opcode.CONST_4, | ||
Opcode.SGET_OBJECT, | ||
Opcode.APUT_OBJECT, | ||
Opcode.INVOKE_STATIC, | ||
Opcode.MOVE_RESULT, | ||
Opcode.RETURN | ||
), | ||
customFingerprint = { methodDef, _ -> | ||
methodDef.name.contains("y") | ||
} | ||
) |
30 changes: 30 additions & 0 deletions
30
src/main/kotlin/app/revanced/patches/grindr/unlimited/fingerprints/IsUnlimitedFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
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 com.android.tools.smali.dexlib2.AccessFlags | ||
import com.android.tools.smali.dexlib2.Opcode | ||
|
||
object IsUnlimitedFingerprint : MethodFingerprint( | ||
"Z", | ||
accessFlags = AccessFlags.PUBLIC.value, | ||
opcodes = listOf( | ||
Opcode.IGET_OBJECT, | ||
Opcode.CHECK_CAST, | ||
Opcode.CONST_4, | ||
Opcode.NEW_ARRAY, | ||
Opcode.CONST_4, | ||
Opcode.SGET_OBJECT, | ||
Opcode.APUT_OBJECT, | ||
Opcode.CONST_4, | ||
Opcode.SGET_OBJECT, | ||
Opcode.APUT_OBJECT, | ||
Opcode.INVOKE_STATIC, | ||
Opcode.MOVE_RESULT, | ||
Opcode.RETURN | ||
), | ||
customFingerprint = { methodDef, _ -> | ||
methodDef.name.contains("x") | ||
} | ||
) |
30 changes: 30 additions & 0 deletions
30
src/main/kotlin/app/revanced/patches/grindr/unlimited/fingerprints/IsXtraFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
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 com.android.tools.smali.dexlib2.AccessFlags | ||
import com.android.tools.smali.dexlib2.Opcode | ||
|
||
object IsXtraFingerprint : MethodFingerprint( | ||
"Z", | ||
accessFlags = AccessFlags.PUBLIC.value, | ||
opcodes = listOf( | ||
Opcode.IGET_OBJECT, | ||
Opcode.CHECK_CAST, | ||
Opcode.CONST_4, | ||
Opcode.NEW_ARRAY, | ||
Opcode.CONST_4, | ||
Opcode.SGET_OBJECT, | ||
Opcode.APUT_OBJECT, | ||
Opcode.CONST_4, | ||
Opcode.SGET_OBJECT, | ||
Opcode.APUT_OBJECT, | ||
Opcode.INVOKE_STATIC, | ||
Opcode.MOVE_RESULT, | ||
Opcode.RETURN | ||
), | ||
customFingerprint = { methodDef, _ -> | ||
methodDef.name.contains("p") | ||
} | ||
) |
35 changes: 35 additions & 0 deletions
35
src/main/kotlin/app/revanced/patches/grindr/unlimited/fingerprints/ShowStoreFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 com.android.tools.smali.dexlib2.AccessFlags | ||
import com.android.tools.smali.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 | ||
), | ||
) |
Oops, something went wrong.