fix(youtube/spoof-signature-verification): fix audio during home feed video playback (#1754)

This commit is contained in:
LisoUseInAIKyrios 2023-03-15 21:39:03 +04:00 committed by GitHub
parent 83c74684f4
commit 7dd067b0e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;"
}
}