From 7dd067b0e96679fe653c9796bef31d743287b2d0 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Wed, 15 Mar 2023 21:39:03 +0400 Subject: [PATCH] fix(youtube/spoof-signature-verification): fix audio during home feed video playback (#1754) --- .../patch/SpoofSignatureVerificationPatch.kt | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/patch/SpoofSignatureVerificationPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/patch/SpoofSignatureVerificationPatch.kt index 7fdc5f16..4de9200c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/patch/SpoofSignatureVerificationPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/patch/SpoofSignatureVerificationPatch.kt @@ -7,13 +7,11 @@ import app.revanced.patcher.annotation.Version import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.data.toMethodWalker import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.extensions.instruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod -import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.misc.fix.playback.annotation.ProtobufSpoofCompatibility import app.revanced.patches.youtube.misc.fix.playback.fingerprints.ProtobufParameterBuilderFingerprint @@ -33,21 +31,21 @@ class SpoofSignatureVerificationPatch : BytecodePatch( setParamMethod.apply { val protobufParameterRegister = 3 - val parameterValue = "8AEByAMTuAQP" /* Protobuf Parameter of shorts */ addInstructions( 0, """ - invoke-virtual { p$protobufParameterRegister }, Ljava/lang/String;->length()I - move-result v0 - const/16 v1, 0x10 - if-ge v0, v1, :not_spoof # bypass on feed - const-string p$protobufParameterRegister, "$parameterValue" - """, - listOf(ExternalLabel("not_spoof", instruction(0)))) + invoke-static {p$protobufParameterRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->getVerificationSpoofOverride(Ljava/lang/String;)Ljava/lang/String; + move-result-object p$protobufParameterRegister + """ + ) } } ?: return ProtobufParameterBuilderFingerprint.toErrorResult() return PatchResultSuccess() } + + companion object { + const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/SpoofSignatureVerificationPatch;" + } }