diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/fullscreen/FullscreenComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/fullscreen/FullscreenComponentsPatch.kt index b8ad3a13e..3b5fbed2d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/fullscreen/FullscreenComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/fullscreen/FullscreenComponentsPatch.kt @@ -16,6 +16,7 @@ import app.revanced.patches.youtube.player.fullscreen.fingerprints.LandScapeMode import app.revanced.patches.youtube.player.fullscreen.fingerprints.OrientationParentFingerprint import app.revanced.patches.youtube.player.fullscreen.fingerprints.OrientationPrimaryFingerprint import app.revanced.patches.youtube.player.fullscreen.fingerprints.OrientationSecondaryFingerprint +import app.revanced.patches.youtube.player.fullscreen.fingerprints.PlayerTitleViewFingerprint import app.revanced.patches.youtube.player.fullscreen.fingerprints.QuickActionsElementFingerprint import app.revanced.patches.youtube.player.fullscreen.fingerprints.RelatedEndScreenResultsFingerprint import app.revanced.patches.youtube.player.fullscreen.fingerprints.VideoPortraitParentFingerprint @@ -62,6 +63,7 @@ object FullscreenComponentsPatch : BaseBytecodePatch( LandScapeModeConfigFingerprint, LayoutConstructorFingerprint, OrientationParentFingerprint, + PlayerTitleViewFingerprint, QuickActionsElementFingerprint, RelatedEndScreenResultsFingerprint, VideoPortraitParentFingerprint, @@ -89,9 +91,13 @@ object FullscreenComponentsPatch : BaseBytecodePatch( } } - LayoutConstructorFingerprint.resultOrThrow().let { + PlayerTitleViewFingerprint.resultOrThrow().let { it.mutableMethod.apply { val insertIndex = getTargetIndexWithMethodReferenceName("addView") + val insertReference = + getInstruction(insertIndex).reference.toString() + if (!insertReference.startsWith("Landroid/widget/FrameLayout;")) + throw PatchException("Reference does not match: $insertReference") val insertInstruction = getInstruction(insertIndex) replaceInstruction( diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/fullscreen/fingerprints/PlayerTitleViewFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/player/fullscreen/fingerprints/PlayerTitleViewFingerprint.kt new file mode 100644 index 000000000..9529c1de9 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/player/fullscreen/fingerprints/PlayerTitleViewFingerprint.kt @@ -0,0 +1,12 @@ +package app.revanced.patches.youtube.player.fullscreen.fingerprints + +import app.revanced.patcher.extensions.or +import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.PlayerVideoTitleView +import app.revanced.util.fingerprint.LiteralValueFingerprint +import com.android.tools.smali.dexlib2.AccessFlags + +internal object PlayerTitleViewFingerprint : LiteralValueFingerprint( + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, + returnType = "V", + literalSupplier = { PlayerVideoTitleView } +) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/compatibility/Constants.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/compatibility/Constants.kt index 0fc96f719..6e5d30a38 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/compatibility/Constants.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/compatibility/Constants.kt @@ -7,13 +7,14 @@ object Constants { Patch.CompatiblePackage( "com.google.android.youtube", setOf( - "18.29.38", // Latest version that supports the 'Zoomed to fill' setting. - "18.33.40", // Latest version that do not use litho components in Shorts. - "18.38.44", // Latest version with no delay in applying video quality on the server side. - "18.48.39", // Latest version that do not use Rolling Number. - "19.05.36", // Latest version with the least YouTube experimental flag. - "19.16.39", // Latest version that supports the 'Restore old seekbar thumbnails' setting. - "19.20.35", // Latest version supported by the RVX patch. + "18.29.38", // This is the last version where the 'Zoomed to fill' setting works. + "18.33.40", // This is the last version that do not use litho components in Shorts. + "18.38.44", // This is the last version with no delay in applying video quality on the server side. + "18.48.39", // This is the last version that do not use Rolling Number. + "19.05.36", // This is the last version with the least YouTube experimental flag. + "19.16.39", // This is the last version that supports the 'Restore old seekbar thumbnails' setting. + "19.20.35", // This is the last version that play icon in the Miniplayer is not giant. + "19.21.40", // This is the latest version supported by the RVX patch. ) ) ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/resourceid/SharedResourceIdPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/resourceid/SharedResourceIdPatch.kt index 8583736e9..ec570889c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/resourceid/SharedResourceIdPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/resourceid/SharedResourceIdPatch.kt @@ -71,6 +71,7 @@ object SharedResourceIdPatch : ResourcePatch() { var MusicAppDeeplinkButtonView = -1L var NotificationBigPictureIconWidth = -1L var PlayerCollapseButton = -1L + var PlayerVideoTitleView = -1L var PosterArtWidthDefault = -1L var QualityAuto = -1L var QuickActionsElementContainer = -1L @@ -165,6 +166,7 @@ object SharedResourceIdPatch : ResourcePatch() { MusicAppDeeplinkButtonView = getId(ID, "music_app_deeplink_button_view") NotificationBigPictureIconWidth = getId(DIMEN, "notification_big_picture_icon_width") PlayerCollapseButton = getId(ID, "player_collapse_button") + PlayerVideoTitleView = getId(ID, "player_video_title_view") PosterArtWidthDefault = getId(DIMEN, "poster_art_width_default") QualityAuto = getId(STRING, "quality_auto") QuickActionsElementContainer = getId(ID, "quick_actions_element_container")