From 08584e680fc658f37e8730499fa5197a08370776 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Tue, 25 Apr 2023 17:22:40 +0400 Subject: [PATCH] fix(youtube/spoof-signature-verification): additional fixes for subtitle window positions (#1975) --- .../playback/patch/SpoofSignatureVerificationPatch.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 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 32b094c1..debb24dc 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 @@ -24,6 +24,7 @@ import app.revanced.patches.youtube.misc.fix.playback.fingerprints.SubtitleWindo import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch +import app.revanced.patches.youtube.misc.video.videoid.patch.VideoIdPatch import org.jf.dexlib2.iface.instruction.OneRegisterInstruction @Patch @@ -34,7 +35,8 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction IntegrationsPatch::class, SettingsPatch::class, PlayerTypeHookPatch::class, - ClientSpoofPatch::class + ClientSpoofPatch::class, + VideoIdPatch::class ]) @Version("0.0.1") class SpoofSignatureVerificationPatch : BytecodePatch( @@ -57,6 +59,9 @@ class SpoofSignatureVerificationPatch : BytecodePatch( ) ) + // Hook video id, required for subtitle fix. + VideoIdPatch.injectCall("$INTEGRATIONS_CLASS_DESCRIPTOR->setCurrentVideoId(Ljava/lang/String;)V") + // hook parameter ProtobufParameterBuilderFingerprint.result?.let { val setParamMethod = context @@ -102,7 +107,7 @@ class SpoofSignatureVerificationPatch : BytecodePatch( invoke-static {p1, p2, p3, p4, p5}, $INTEGRATIONS_CLASS_DESCRIPTOR->getSubtitleWindowSettingsOverride(IIIZZ)[I move-result-object v0 const/4 v1, 0x0 - aget p1, v0, v1 # ap, anchor configuration + aget p1, v0, v1 # ap, anchor position const/4 v1, 0x1 aget p2, v0, v1 # ah, horizontal anchor const/4 v1, 0x2