Compare commits

...

3 Commits

Author SHA1 Message Date
semantic-release-bot
f166bd7ea7 chore(release): 2.191.0-dev.8 [skip ci]
# [2.191.0-dev.8](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.7...v2.191.0-dev.8) (2023-09-24)

### Bug Fixes

* **Relay - Spoof client:** Restore OAuth login ([df43cea](df43cea4f8))
* **Slide - Spoof client:** Use correct patch name ([444b196](444b196f41))
2023-09-24 21:57:15 +00:00
oSumAtrIX
df43cea4f8 fix(Relay - Spoof client): Restore OAuth login 2023-09-24 23:54:26 +02:00
oSumAtrIX
444b196f41 fix(Slide - Spoof client): Use correct patch name 2023-09-24 23:52:46 +02:00
7 changed files with 42 additions and 10 deletions

View File

@@ -1,3 +1,11 @@
# [2.191.0-dev.8](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.7...v2.191.0-dev.8) (2023-09-24)
### Bug Fixes
* **Relay - Spoof client:** Restore OAuth login ([96e01f7](https://github.com/ReVanced/revanced-patches/commit/96e01f7a7b87f468776fbde48e114a3f51630a46))
* **Slide - Spoof client:** Use correct patch name ([f355dbf](https://github.com/ReVanced/revanced-patches/commit/f355dbf1d2af3075c6a3f13d8bf5f8dca22e6005))
# [2.191.0-dev.7](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.6...v2.191.0-dev.7) (2023-09-24)

View File

@@ -1,4 +1,4 @@
org.gradle.parallel = true
org.gradle.caching = true
kotlin.code.style = official
version = 2.191.0-dev.7
version = 2.191.0-dev.8

File diff suppressed because one or more lines are too long

View File

@@ -14,9 +14,11 @@ abstract class AbstractSpoofClientPatch(
private val redirectUri: String,
private val clientIdFingerprints: List<MethodFingerprint>,
private val userAgentFingerprints: List<MethodFingerprint>? = null,
private val miscellaneousFingerprints: List<MethodFingerprint>? = null
) : BytecodePatch(buildSet {
addAll(clientIdFingerprints)
userAgentFingerprints?.let(::addAll)
miscellaneousFingerprints?.let(::addAll)
}) {
var clientId by stringPatchOption(
"client-id",
@@ -56,10 +58,12 @@ abstract class AbstractSpoofClientPatch(
clientIdFingerprints.executePatch { patchClientId(context) }
userAgentFingerprints.executePatch { patchUserAgent(context) }
miscellaneousFingerprints.executePatch { patchMiscellaneous(context) }
}
/**
* Patch the client ID. The fingerprints are guaranteed to be in the same order as in [clientIdFingerprints].
* Patch the client ID.
* The fingerprints are guaranteed to be in the same order as in [clientIdFingerprints].
*
* @param context The current [BytecodeContext].
*
@@ -67,10 +71,19 @@ abstract class AbstractSpoofClientPatch(
abstract fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext)
/**
* Patch the user agent. The fingerprints are guaranteed to be in the same order as in [userAgentFingerprints].
* Patch the user agent.
* The fingerprints are guaranteed to be in the same order as in [userAgentFingerprints].
*
* @param context The current [BytecodeContext].
*/
// Not every client needs to patch the user agent.
open fun List<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext) {}
/**
* Patch miscellaneous things such as protection measures.
* The fingerprints are guaranteed to be in the same order as in [miscellaneousFingerprints].
*
* @param context The current [BytecodeContext].
*/
open fun List<MethodFingerprintResult>.patchMiscellaneous(context: BytecodeContext) { }
}

View File

@@ -1,16 +1,14 @@
package app.revanced.patches.reddit.customclients.relayforreddit.api
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.GetLoggedInBearerTokenFingerprint
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.GetLoggedOutBearerTokenFingerprint
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.GetRefreshTokenFingerprint
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.LoginActivityClientIdFingerprint
import app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints.*
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
@Patch(
@@ -31,7 +29,8 @@ object SpoofClientPatch : AbstractSpoofClientPatch(
GetLoggedInBearerTokenFingerprint,
GetLoggedOutBearerTokenFingerprint,
GetRefreshTokenFingerprint
)
),
miscellaneousFingerprints = listOf(SetRemoteConfigFingerprint)
) {
override fun List<MethodFingerprintResult>.patchClientId(context: BytecodeContext) {
forEach {
@@ -46,4 +45,8 @@ object SpoofClientPatch : AbstractSpoofClientPatch(
}
}
}
override fun List<MethodFingerprintResult>.patchMiscellaneous(context: BytecodeContext) =
// Do not load remote config which disables OAuth login remotely
first().mutableMethod.addInstructions(0, "return-void")
}

View File

@@ -0,0 +1,8 @@
package app.revanced.patches.reddit.customclients.relayforreddit.api.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object SetRemoteConfigFingerprint : MethodFingerprint(
strings = listOf("reddit_oauth_url"),
parameters = listOf("Lcom/google/firebase/remoteconfig/FirebaseRemoteConfig;")
)

View File

@@ -9,7 +9,7 @@ import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.GetClientIdFingerprint
@Patch(
name = "Slide client spoof",
name = "Spoof client",
description = "Spoofs the client in order to allow logging in. " +
"The OAuth application type has to be \"Installed app\" " +
"and the redirect URI has to be set to \"http://www.ccrama.me\".",