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
d9a1cbc
commit 878cc59
Showing
9 changed files
with
53 additions
and
9 deletions.
There are no files selected for viewing
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
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
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
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
8 changes: 8 additions & 0 deletions
8
...otlin/app/revanced/patches/grindr/microg/fingerprints/OpenHttpURLConnectionFingerprint.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.microg.fingerprints | ||
|
||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
|
||
object OpenHttpURLConnectionFingerprint : MethodFingerprint( | ||
returnType = "Ljava/net/HttpURLConnection", | ||
strings = listOf("Failed to get heartbeats header", "ContentValues", "Content-Type", "application/json", "Accept"), | ||
) |
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
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
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
38 changes: 38 additions & 0 deletions
38
...in/kotlin/app/revanced/patches/grindr/microg/patch/bytecode/OpenHttpURLConnectionPatch.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,38 @@ | ||
package app.revanced.patches.grindr.microg.patch.bytecode | ||
|
||
import app.revanced.patcher.annotation.Description | ||
import app.revanced.patcher.annotation.Name | ||
import app.revanced.patcher.data.BytecodeContext | ||
import app.revanced.patcher.patch.BytecodePatch | ||
import app.revanced.patcher.patch.PatchResult | ||
import app.revanced.patcher.patch.PatchResultSuccess | ||
import app.revanced.patcher.patch.annotations.DependsOn | ||
import app.revanced.patcher.patch.annotations.Patch | ||
import app.revanced.extensions.toErrorResult | ||
|
||
import app.revanced.patches.grindr.microg.fingerprints.OpenHttpURLConnectionFingerprint | ||
|
||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions | ||
|
||
class OpenHttpURLConnectionPatch : BytecodePatch( | ||
listOf( | ||
OpenHttpURLConnectionFingerprint, | ||
) | ||
) { | ||
override fun execute(context: BytecodeContext): PatchResult { | ||
OpenHttpURLConnectionFingerprint.result?.let { result -> | ||
println("Found fingerprint!") | ||
|
||
result.mutableMethod.apply { | ||
replaceInstructions( | ||
23, | ||
""" | ||
const-string v2, "com.grindrapp.android" | ||
""" | ||
) | ||
} | ||
} ?: return OpenHttpURLConnectionFingerprint.toErrorResult() | ||
|
||
return PatchResultSuccess() | ||
} | ||
} |