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 7fdc5f16b..4de9200c7 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;" + } }