fix(syncforreddit): use correct overriding method signature (#2483)

This commit is contained in:
johnconner122 2023-06-24 16:37:49 +05:00 committed by GitHub
parent 9efd7904ac
commit f9770cf1ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,8 +6,8 @@ import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction 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.MethodFingerprint.Companion.resolve
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
@ -29,8 +29,8 @@ class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
Options, Options,
listOf(GetAuthorizationStringFingerprint) listOf(GetAuthorizationStringFingerprint)
) { ) {
override fun List<MethodFingerprint>.patch(context: BytecodeContext): PatchResult { override fun List<MethodFingerprintResult>.patch(context: BytecodeContext): PatchResult {
map { it.result ?: return it.toErrorResult() }.forEach { fingerprintResult -> forEach { fingerprintResult ->
fingerprintResult.also { result -> fingerprintResult.also { result ->
GetBearerTokenFingerprint.also { it.resolve(context, result.classDef) }.result?.mutableMethod?.apply { GetBearerTokenFingerprint.also { it.resolve(context, result.classDef) }.result?.mutableMethod?.apply {
val auth = Base64.getEncoder().encodeToString("$clientId:".toByteArray(Charsets.UTF_8)) val auth = Base64.getEncoder().encodeToString("$clientId:".toByteArray(Charsets.UTF_8))