fix(protobuf-spoof): additional fixes for subtitle window positions

This commit is contained in:
inotia00 2023-04-28 16:34:22 +09:00
parent 3e9c987c09
commit be9d745d9c

View File

@ -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.playertype.patch.PlayerTypeHookPatch
import app.revanced.patches.youtube.misc.protobufpoof.fingerprints.* import app.revanced.patches.youtube.misc.protobufpoof.fingerprints.*
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch 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 import app.revanced.util.integrations.Constants.MISC_PATH
@Patch @Patch
@ -25,6 +26,7 @@ import app.revanced.util.integrations.Constants.MISC_PATH
@Description("Spoofs the protobuf to prevent playback issues.") @Description("Spoofs the protobuf to prevent playback issues.")
@DependsOn( @DependsOn(
[ [
LegacyVideoIdPatch::class,
PlayerTypeHookPatch::class, PlayerTypeHookPatch::class,
SettingsPatch::class SettingsPatch::class
] ]
@ -72,7 +74,7 @@ class ProtobufSpoofPatch : BytecodePatch(
invoke-static {p1, p2, p3, p4, p5}, $MISC_PATH/ProtobufSpoofPatch;->getSubtitleWindowSettingsOverride(IIIZZ)[I invoke-static {p1, p2, p3, p4, p5}, $MISC_PATH/ProtobufSpoofPatch;->getSubtitleWindowSettingsOverride(IIIZZ)[I
move-result-object v0 move-result-object v0
const/4 v1, 0x0 const/4 v1, 0x0
aget p1, v0, v1 # ap, anchor configuration aget p1, v0, v1 # ap, anchor position
const/4 v1, 0x1 const/4 v1, 0x1
aget p2, v0, v1 # ah, horizontal anchor aget p2, v0, v1 # ah, horizontal anchor
const/4 v1, 0x2 const/4 v1, 0x2
@ -80,6 +82,9 @@ class ProtobufSpoofPatch : BytecodePatch(
""" """
) ?: return SubtitleWindowFingerprint.toErrorResult() ) ?: return SubtitleWindowFingerprint.toErrorResult()
// Hook video id, required for subtitle fix.
LegacyVideoIdPatch.injectCall("$MISC_PATH/ProtobufSpoofPatch;->setCurrentVideoId(Ljava/lang/String;)V")
/* /*
* Add settings * Add settings
*/ */