Skip to content

Commit

Permalink
fix(Boost for Reddit - Spoof client): Fix account login by removing u…
Browse files Browse the repository at this point in the history
…ser agent patch
  • Loading branch information
oSumAtrIX committed Dec 12, 2023
1 parent d90786e commit 42a5de9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
1 change: 0 additions & 1 deletion api/revanced-patches.api
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,6 @@ public final class app/revanced/patches/reddit/customclients/baconreader/api/Spo
public final class app/revanced/patches/reddit/customclients/boostforreddit/api/SpoofClientPatch : app/revanced/patches/reddit/customclients/AbstractSpoofClientPatch {
public static final field INSTANCE Lapp/revanced/patches/reddit/customclients/boostforreddit/api/SpoofClientPatch;
public fun patchClientId (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V
public fun patchUserAgent (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V
}

public final class app/revanced/patches/reddit/customclients/infinityforreddit/api/SpoofClientPatch : app/revanced/patches/reddit/customclients/AbstractSpoofClientPatch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.fingerprint.MethodFingerprintResult
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
import app.revanced.patches.reddit.customclients.Constants.OAUTH_USER_AGENT
import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.GetClientIdFingerprint
import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.LoginActivityOnCreateFingerprint

Expand All @@ -25,20 +24,4 @@ object SpoofClientPatch : AbstractSpoofClientPatch(
"""
)
}

override fun Set<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext) {
first().let { result ->
result.mutableMethod.apply {
val insertIndex = result.scanResult.patternScanResult!!.endIndex

addInstructions(
insertIndex,
"""
const-string v7, "$OAUTH_USER_AGENT"
invoke-virtual {v4, v7}, Landroid/webkit/WebSettings;->setUserAgentString(Ljava/lang/String;)V
"""
)
}
}
}
}

0 comments on commit 42a5de9

Please sign in to comment.