diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/protobufpoof/fingerprints/SubtitleWindowFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/protobufpoof/fingerprints/SubtitleWindowFingerprint.kt new file mode 100644 index 000000000..825078c3c --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/protobufpoof/fingerprints/SubtitleWindowFingerprint.kt @@ -0,0 +1,10 @@ +package app.revanced.patches.youtube.misc.protobufpoof.fingerprints + +import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint + +object SubtitleWindowFingerprint : MethodFingerprint( + parameters = listOf("I", "I", "I", "Z", "Z"), + customFingerprint = { it.definingClass == "Lcom/google/android/libraries/youtube/player/subtitles/model/SubtitleWindowSettings;" + && it.name == "" + } +) \ No newline at end of file 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 2d2b5b879..c85e78ef6 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 @@ -34,7 +34,8 @@ import app.revanced.util.integrations.Constants.MISC_PATH class ProtobufSpoofPatch : BytecodePatch( listOf( BadResponseFingerprint, - ProtobufParameterBuilderFingerprint + ProtobufParameterBuilderFingerprint, + SubtitleWindowFingerprint ) ) { override fun execute(context: BytecodeContext): PatchResult { @@ -51,7 +52,7 @@ class ProtobufSpoofPatch : BytecodePatch( addInstructions( 0, """ - invoke-static {p$protobufParam}, $MISC_PATH/ProtobufSpoofPatch;->getProtobufOverride(Ljava/lang/String;)Ljava/lang/String; + invoke-static {p$protobufParam}, $MISC_PATH/ProtobufSpoofPatch;->overrideProtobufParameter(Ljava/lang/String;)Ljava/lang/String; move-result-object p$protobufParam """ ) @@ -64,6 +65,16 @@ class ProtobufSpoofPatch : BytecodePatch( "invoke-static {}, $MISC_PATH/ProtobufSpoofPatch;->switchProtobufSpoof()V" ) ?: return BadResponseFingerprint.toErrorResult() + // fix protobuf spoof side issue + SubtitleWindowFingerprint.result?.mutableMethod?.addInstructions( + 1, """ + invoke-static {p1, p2, p3}, $MISC_PATH/ProtobufSpoofPatch;->overrideAnchorPosition(III)I + move-result p1 + invoke-static {p2, p3}, $MISC_PATH/ProtobufSpoofPatch;->overrideAnchorVerticalPosition(II)I + move-result p3 + """ + ) ?: return SubtitleWindowFingerprint.toErrorResult() + /* * Add settings */ diff --git a/src/main/resources/youtube/settings/host/values/strings.xml b/src/main/resources/youtube/settings/host/values/strings.xml index 046a43229..058b5404e 100644 --- a/src/main/resources/youtube/settings/host/values/strings.xml +++ b/src/main/resources/youtube/settings/host/values/strings.xml @@ -519,15 +519,6 @@ Are you sure you want to continue though?" If you enable this setting, the following features are available: - Community Posts - Hide Mix playlist" - "Spoof protobuf to bypass playback issues - -If you enable this setting, the following features are not available: - -When spoofing general video -- Do not display thumbnails when pressing the seekbar - -When spoofing shorts videos -- Captions are positioned above the player" It is recommended not to use it if your internet speed is not fast enough "If you enable this setting, the following features are not available: - Ambient mode" @@ -558,9 +549,6 @@ Since these setting is quite outdated, it may not be valid" Seekbar Known issue: Title disappears when clicked Show fullscreen title - Spoof to general video - Spoof to shorts video - Select protobuf to spoof SponsorBlock related settings Swipe controls The amount of threshold for swipe to occur diff --git a/src/main/resources/youtube/settings/xml/revanced_prefs.xml b/src/main/resources/youtube/settings/xml/revanced_prefs.xml index 1e32cdb11..4ef0dde62 100644 --- a/src/main/resources/youtube/settings/xml/revanced_prefs.xml +++ b/src/main/resources/youtube/settings/xml/revanced_prefs.xml @@ -413,8 +413,7 @@ + SETTINGS: ENABLE_PROTOBUF_SPOOF -->