From f9770cf1babce61cd32f6ca9140103419d8d094d Mon Sep 17 00:00:00 2001 From: johnconner122 <107796137+johnconner122@users.noreply.github.com> Date: Sat, 24 Jun 2023 16:37:49 +0500 Subject: [PATCH] fix(syncforreddit): use correct overriding method signature (#2483) --- .../syncforreddit/api/patch/ChangeOAuthClientIdPatch.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/reddit/customclients/syncforreddit/api/patch/ChangeOAuthClientIdPatch.kt b/src/main/kotlin/app/revanced/patches/reddit/customclients/syncforreddit/api/patch/ChangeOAuthClientIdPatch.kt index 0446445b..0fd16189 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/customclients/syncforreddit/api/patch/ChangeOAuthClientIdPatch.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/customclients/syncforreddit/api/patch/ChangeOAuthClientIdPatch.kt @@ -6,8 +6,8 @@ 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.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve +import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.annotations.Patch @@ -29,8 +29,8 @@ class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch( Options, listOf(GetAuthorizationStringFingerprint) ) { - override fun List.patch(context: BytecodeContext): PatchResult { - map { it.result ?: return it.toErrorResult() }.forEach { fingerprintResult -> + override fun List.patch(context: BytecodeContext): PatchResult { + forEach { fingerprintResult -> fingerprintResult.also { result -> GetBearerTokenFingerprint.also { it.resolve(context, result.classDef) }.result?.mutableMethod?.apply { val auth = Base64.getEncoder().encodeToString("$clientId:".toByteArray(Charsets.UTF_8))