From be9d745d9c855570ac8e52900e725f5152d1fd6c Mon Sep 17 00:00:00 2001 From: inotia00 Date: Fri, 28 Apr 2023 16:34:22 +0900 Subject: [PATCH] fix(protobuf-spoof): additional fixes for subtitle window positions --- .../youtube/misc/protobufpoof/patch/ProtobufSpoofPatch.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/protobufpoof/patch/ProtobufSpoofPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/protobufpoof/patch/ProtobufSpoofPatch.kt index abea9b8f0..ea2cba785 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/protobufpoof/patch/ProtobufSpoofPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/protobufpoof/patch/ProtobufSpoofPatch.kt @@ -18,6 +18,7 @@ import app.revanced.patches.shared.annotation.YouTubeCompatibility import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch import app.revanced.patches.youtube.misc.protobufpoof.fingerprints.* import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch +import app.revanced.patches.youtube.misc.videoid.legacy.patch.LegacyVideoIdPatch import app.revanced.util.integrations.Constants.MISC_PATH @Patch @@ -25,6 +26,7 @@ import app.revanced.util.integrations.Constants.MISC_PATH @Description("Spoofs the protobuf to prevent playback issues.") @DependsOn( [ + LegacyVideoIdPatch::class, PlayerTypeHookPatch::class, SettingsPatch::class ] @@ -72,7 +74,7 @@ class ProtobufSpoofPatch : BytecodePatch( invoke-static {p1, p2, p3, p4, p5}, $MISC_PATH/ProtobufSpoofPatch;->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 @@ -80,6 +82,9 @@ class ProtobufSpoofPatch : BytecodePatch( """ ) ?: return SubtitleWindowFingerprint.toErrorResult() + // Hook video id, required for subtitle fix. + LegacyVideoIdPatch.injectCall("$MISC_PATH/ProtobufSpoofPatch;->setCurrentVideoId(Ljava/lang/String;)V") + /* * Add settings */