Skip to content

Commit

Permalink
Refactored all patches to work with new versions of revanced
Browse files Browse the repository at this point in the history
  • Loading branch information
Slenderman00 committed Jan 30, 2024
1 parent 66f773e commit c3b55c3
Show file tree
Hide file tree
Showing 31 changed files with 364 additions and 33 deletions.
Empty file modified .gitattributes
100644 → 100755
Empty file.
Empty file modified .github/dependabot.yml
100644 → 100755
Empty file.
Empty file modified .github/workflows/pull_request.yml
100644 → 100755
Empty file.
Empty file modified .github/workflows/release.yml
100644 → 100755
Empty file.
3 changes: 3 additions & 0 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,6 @@ node_modules/

# Ignore IDEA files
.idea/

#ignoring all builds
build/
Empty file modified .releaserc
100644 → 100755
Empty file.
Empty file modified CHANGELOG.md
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
26 changes: 13 additions & 13 deletions build.gradle.kts
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
`maven-publish`
}

group = "your.org"
group = "patches.grindr"

repositories {
mavenCentral()
Expand All @@ -32,14 +32,14 @@ kotlin {

tasks.withType(Jar::class) {
manifest {
attributes["Name"] = "Your Patches"
attributes["Description"] = "Patches for ReVanced."
attributes["Name"] = "Grindr patches"
attributes["Description"] = "Patches for Grindr."
attributes["Version"] = version
attributes["Timestamp"] = System.currentTimeMillis().toString()
attributes["Source"] = "[email protected]:you/revanced-patches.git"
attributes["Source"] = "[email protected]:Slenderman00/revanced-patches-grindr.git"
attributes["Author"] = "You"
attributes["Contact"] = "[email protected]"
attributes["Origin"] = "https://your.homepage"
attributes["Contact"] = "[email protected]"
attributes["Origin"] = "https://joar.me"
attributes["License"] = "GNU General Public License v3.0"
}
}
Expand Down Expand Up @@ -82,9 +82,9 @@ publishing {
from(components["java"])

pom {
name = "Your Patches"
description = "Patches for ReVanced."
url = "https://your.homepage"
name = "Grindr patches"
description = "Patches for Grindr."
url = "https://joar.me"

licenses {
license {
Expand All @@ -95,14 +95,14 @@ publishing {
developers {
developer {
id = "Your ID"
name = "Your Name"
email = "[email protected]"
name = "Joar Heimonen"
email = "[email protected]"
}
}
scm {
connection = "scm:git:git://github.com/you/revanced-patches.git"
developerConnection = "scm:git:[email protected]:you/revanced-patches.git"
url = "https://github.com/you/revanced-patches"
developerConnection = "scm:git:[email protected]:Slenderman00/revanced-patches-grindr.git"
url = "https://github.com/Slenderman00/revanced-patches-grindr/"
}
}
}
Expand Down
Empty file modified dummy/build.gradle.kts
100644 → 100755
Empty file.
Empty file modified gradle.properties
100644 → 100755
Empty file.
Empty file modified gradle/libs.versions.toml
100644 → 100755
Empty file.
Empty file modified gradle/wrapper/gradle-wrapper.jar
100644 → 100755
Empty file.
Empty file modified gradle/wrapper/gradle-wrapper.properties
100644 → 100755
Empty file.
Empty file modified package-lock.json
100644 → 100755
Empty file.
Empty file modified package.json
100644 → 100755
Empty file.
Empty file modified settings.gradle.kts
100644 → 100755
Empty file.
6 changes: 6 additions & 0 deletions src/main/kotlin/grindr/patches/grindr/constants.kt
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"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package app.revanced.patches.grindr.firebase.fingerprints

import app.revanced.patcher.fingerprint.MethodFingerprint

object GetMessagingCertFingerprint : MethodFingerprint(
"Ljava/lang/String;",
strings = listOf(
"ContentValues",
"Could not get fingerprint hash for package: ",
"No such package: "
)
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package app.revanced.patches.grindr.firebase.fingerprints

import app.revanced.patcher.fingerprint.MethodFingerprint

object GetRegistrationCertFingerprint : MethodFingerprint(
"Ljava/lang/String;",
strings = listOf(
"FirebaseRemoteConfig",
"Could not get fingerprint hash for package: ",
"No such package: "
)
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package app.revanced.patches.grindr.firebase.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.firebase.fingerprints.GetMessagingCertFingerprint
import app.revanced.patches.grindr.firebase.fingerprints.GetRegistrationCertFingerprint
import app.revanced.patches.grindr.Constants.SPOOFED_PACKAGE_SIGNATURE

class FirebaseGetCertPatchGrindr : BytecodePatch(
setOf(
GetRegistrationCertFingerprint,
GetMessagingCertFingerprint
)
) {
override fun execute(context: BytecodeContext) {
val spoofedInstruction =
"""
const-string v0, "$SPOOFED_PACKAGE_SIGNATURE"
return-object v0
"""

val registrationCertMethod = GetRegistrationCertFingerprint.result!!.mutableMethod
val messagingCertMethod = GetMessagingCertFingerprint.result!!.mutableMethod

registrationCertMethod.addInstructions(
0,
spoofedInstruction
)
messagingCertMethod.addInstructions(
0,
spoofedInstruction
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package app.revanced.patches.grindr.unlimited.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode

object HasFeatureFingerprint : MethodFingerprint(
"Z",
parameters = listOf("Lcom/grindrapp/android/model/Feature;"),
opcodes = listOf(
Opcode.CONST_STRING,
Opcode.INVOKE_STATIC,
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT,
Opcode.CONST_4,
Opcode.IF_LEZ,
Opcode.IGET_OBJECT,
Opcode.NEW_INSTANCE,
Opcode.INVOKE_DIRECT,
Opcode.CONST_STRING,
Opcode.INVOKE_VIRTUAL,
Opcode.INVOKE_VIRTUAL
),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package app.revanced.patches.grindr.unlimited.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode

@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
),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package app.revanced.patches.grindr.unlimited.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode

object InnaccessibleProfileManagerdFingerprint : MethodFingerprint(
"Z",
opcodes = listOf(
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.XOR_INT_LIT8,
Opcode.RETURN
),
customFingerprint = { methodDef, _ ->
methodDef.definingClass.contains("InaccessibleProfileManager")
}
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package app.revanced.patches.grindr.unlimited.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode

object IsFreeFingerprint : MethodFingerprint(
"Z",
accessFlags = AccessFlags.PUBLIC.value,
opcodes = listOf(
Opcode.IGET_OBJECT,
Opcode.INVOKE_INTERFACE,
Opcode.MOVE_RESULT,
Opcode.RETURN
),
customFingerprint = { methodDef, _ ->
methodDef.definingClass.contains("storage")
}
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package app.revanced.patches.grindr.unlimited.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode

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
),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package app.revanced.patches.grindr.unlimited.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.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
)
)
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.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.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
),
)
Loading

0 comments on commit c3b55c3

Please sign in to comment.