diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/seekbar/SeekbarComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/seekbar/SeekbarComponentsPatch.kt index fa2af31e2f..a6d6b198bb 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/seekbar/SeekbarComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/seekbar/SeekbarComponentsPatch.kt @@ -11,6 +11,7 @@ import app.revanced.patches.shared.drawable.DrawableColorPatch import app.revanced.patches.youtube.player.seekbar.fingerprints.CairoSeekbarConfigFingerprint import app.revanced.patches.youtube.player.seekbar.fingerprints.ControlsOverlayStyleFingerprint import app.revanced.patches.youtube.player.seekbar.fingerprints.SeekbarTappingFingerprint +import app.revanced.patches.youtube.player.seekbar.fingerprints.SeekbarThumbnailsQualityFingerprint import app.revanced.patches.youtube.player.seekbar.fingerprints.ShortsSeekbarColorFingerprint import app.revanced.patches.youtube.player.seekbar.fingerprints.ThumbnailPreviewConfigFingerprint import app.revanced.patches.youtube.player.seekbar.fingerprints.TimeCounterFingerprint @@ -23,6 +24,7 @@ import app.revanced.patches.youtube.utils.fingerprints.SeekbarFingerprint import app.revanced.patches.youtube.utils.fingerprints.SeekbarOnDrawFingerprint import app.revanced.patches.youtube.utils.fingerprints.TotalTimeFingerprint import app.revanced.patches.youtube.utils.flyoutmenu.FlyoutMenuHookPatch +import app.revanced.patches.youtube.utils.integrations.Constants.PATCH_STATUS_CLASS_DESCRIPTOR import app.revanced.patches.youtube.utils.integrations.Constants.PLAYER_CLASS_DESCRIPTOR import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.InlineTimeBarColorizedBarPlayedColorDark @@ -40,6 +42,7 @@ import app.revanced.util.indexOfFirstWideLiteralInstructionValueOrThrow import app.revanced.util.injectLiteralInstructionBooleanCall import app.revanced.util.patch.BaseBytecodePatch import app.revanced.util.resultOrThrow +import app.revanced.util.updatePatchStatus import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.NarrowLiteralInstruction @@ -68,6 +71,7 @@ object SeekbarComponentsPatch : BaseBytecodePatch( PlayerSeekbarColorFingerprint, SeekbarFingerprint, SeekbarTappingFingerprint, + SeekbarThumbnailsQualityFingerprint, ShortsSeekbarColorFingerprint, TimelineMarkerArrayFingerprint, ThumbnailPreviewConfigFingerprint, @@ -212,6 +216,15 @@ object SeekbarComponentsPatch : BaseBytecodePatch( // endregion + // region patch for high quality thumbnails + + SeekbarThumbnailsQualityFingerprint.injectLiteralInstructionBooleanCall( + 45399684, + "$PLAYER_CLASS_DESCRIPTOR->enableHighQualityFullscreenThumbnails()Z" + ) + + // endregion + // region patch for hide chapter TimelineMarkerArrayFingerprint.resultOrThrow().let { @@ -299,6 +312,8 @@ object SeekbarComponentsPatch : BaseBytecodePatch( ) settingArray += "SETTINGS: RESTORE_OLD_SEEKBAR_THUMBNAILS" + + context.updatePatchStatus(PATCH_STATUS_CLASS_DESCRIPTOR, "OldSeekbarThumbnailsDefaultBoolean") } ?: println("WARNING: Restore old seekbar thumbnails setting is not supported in this version. Use YouTube 19.16.39 or earlier.") diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/seekbar/fingerprints/SeekbarThumbnailsQualityFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/player/seekbar/fingerprints/SeekbarThumbnailsQualityFingerprint.kt new file mode 100644 index 0000000000..60e6a7041b --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/player/seekbar/fingerprints/SeekbarThumbnailsQualityFingerprint.kt @@ -0,0 +1,9 @@ +package app.revanced.patches.youtube.player.seekbar.fingerprints + +import app.revanced.util.fingerprint.LiteralValueFingerprint + +internal object SeekbarThumbnailsQualityFingerprint : LiteralValueFingerprint( + returnType = "Z", + parameters = emptyList(), + literalSupplier = { 45399684 }, +) \ No newline at end of file diff --git a/src/main/resources/youtube/settings/host/values/strings.xml b/src/main/resources/youtube/settings/host/values/strings.xml index 477ae6d73c..5233812303 100644 --- a/src/main/resources/youtube/settings/host/values/strings.xml +++ b/src/main/resources/youtube/settings/host/values/strings.xml @@ -1101,6 +1101,14 @@ Tap and hold to undo." Restore old seekbar thumbnails Seekbar thumbnails will appear above the seekbar. Seekbar thumbnails will appear in fullscreen. + Enable high quality thumbnails + Seekbar thumbnails are high quality. + Seekbar thumbnails are medium quality. + "This will restore thumbnails to livestreams that do not have seekbar thumbnails. + +Internet data usage may be higher, and seekbar thumbnails will have a slight delay before showing. + +This feature works best with a very fast internet connection." Enable Cairo seekbar "Cairo seekbar is enabled. diff --git a/src/main/resources/youtube/settings/xml/revanced_prefs.xml b/src/main/resources/youtube/settings/xml/revanced_prefs.xml index 0af6960049..47cd565ba8 100644 --- a/src/main/resources/youtube/settings/xml/revanced_prefs.xml +++ b/src/main/resources/youtube/settings/xml/revanced_prefs.xml @@ -450,9 +450,13 @@ SETTINGS: SEEKBAR_COMPONENTS --> + + +