From d90786e26d9c0e581284aab0d9d6d5097da2bfda Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Tue, 12 Dec 2023 22:42:07 +0100 Subject: [PATCH] fix(Sync for Reddit - Spoof client): Fix account login by removing user agent patch --- api/revanced-patches.api | 1 - .../syncforreddit/api/SpoofClientPatch.kt | 17 +---------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/api/revanced-patches.api b/api/revanced-patches.api index d84d9dc4..46d1e7f1 100644 --- a/api/revanced-patches.api +++ b/api/revanced-patches.api @@ -482,7 +482,6 @@ public final class app/revanced/patches/reddit/customclients/syncforreddit/api/S public static final field INSTANCE Lapp/revanced/patches/reddit/customclients/syncforreddit/api/SpoofClientPatch; public fun patchClientId (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V public fun patchMiscellaneous (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/syncforreddit/detection/piracy/DisablePiracyDetectionPatch : app/revanced/patcher/patch/BytecodePatch { diff --git a/src/main/kotlin/app/revanced/patches/reddit/customclients/syncforreddit/api/SpoofClientPatch.kt b/src/main/kotlin/app/revanced/patches/reddit/customclients/syncforreddit/api/SpoofClientPatch.kt index f98a2c20..b19ee402 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/customclients/syncforreddit/api/SpoofClientPatch.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/customclients/syncforreddit/api/SpoofClientPatch.kt @@ -1,18 +1,17 @@ package app.revanced.patches.reddit.customclients.syncforreddit.api -import app.revanced.util.exception 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.MethodFingerprintResult import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch -import app.revanced.patches.reddit.customclients.Constants.OAUTH_USER_AGENT import app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints.GetAuthorizationStringFingerprint import app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints.GetBearerTokenFingerprint import app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints.ImgurImageAPIFingerprint import app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints.LoadBrowserURLFingerprint import app.revanced.patches.reddit.customclients.syncforreddit.detection.piracy.DisablePiracyDetectionPatch +import app.revanced.util.exception import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.reference.StringReference @@ -76,18 +75,4 @@ object SpoofClientPatch : AbstractSpoofClientPatch( "const-string v1, \"https://api.imgur.com/3/image\"" ) } - - override fun Set.patchUserAgent(context: BytecodeContext) { - first().let { result -> - val insertIndex = result.scanResult.patternScanResult!!.startIndex - - result.mutableMethod.addInstructions( - insertIndex, - """ - const-string v0, "$OAUTH_USER_AGENT" - invoke-virtual {p1, v0}, Landroid/webkit/WebSettings;->setUserAgentString(Ljava/lang/String;)V - """ - ) - } - } }