feat(YouTube): add support version 19.21.40

This commit is contained in:
inotia00 2024-06-13 00:34:35 +09:00
parent 58e93da4f8
commit e4855808ba
4 changed files with 29 additions and 8 deletions

View File

@ -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.OrientationParentFingerprint
import app.revanced.patches.youtube.player.fullscreen.fingerprints.OrientationPrimaryFingerprint 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.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.QuickActionsElementFingerprint
import app.revanced.patches.youtube.player.fullscreen.fingerprints.RelatedEndScreenResultsFingerprint import app.revanced.patches.youtube.player.fullscreen.fingerprints.RelatedEndScreenResultsFingerprint
import app.revanced.patches.youtube.player.fullscreen.fingerprints.VideoPortraitParentFingerprint import app.revanced.patches.youtube.player.fullscreen.fingerprints.VideoPortraitParentFingerprint
@ -62,6 +63,7 @@ object FullscreenComponentsPatch : BaseBytecodePatch(
LandScapeModeConfigFingerprint, LandScapeModeConfigFingerprint,
LayoutConstructorFingerprint, LayoutConstructorFingerprint,
OrientationParentFingerprint, OrientationParentFingerprint,
PlayerTitleViewFingerprint,
QuickActionsElementFingerprint, QuickActionsElementFingerprint,
RelatedEndScreenResultsFingerprint, RelatedEndScreenResultsFingerprint,
VideoPortraitParentFingerprint, VideoPortraitParentFingerprint,
@ -89,9 +91,13 @@ object FullscreenComponentsPatch : BaseBytecodePatch(
} }
} }
LayoutConstructorFingerprint.resultOrThrow().let { PlayerTitleViewFingerprint.resultOrThrow().let {
it.mutableMethod.apply { it.mutableMethod.apply {
val insertIndex = getTargetIndexWithMethodReferenceName("addView") val insertIndex = getTargetIndexWithMethodReferenceName("addView")
val insertReference =
getInstruction<ReferenceInstruction>(insertIndex).reference.toString()
if (!insertReference.startsWith("Landroid/widget/FrameLayout;"))
throw PatchException("Reference does not match: $insertReference")
val insertInstruction = getInstruction<FiveRegisterInstruction>(insertIndex) val insertInstruction = getInstruction<FiveRegisterInstruction>(insertIndex)
replaceInstruction( replaceInstruction(

View File

@ -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 }
)

View File

@ -7,13 +7,14 @@ object Constants {
Patch.CompatiblePackage( Patch.CompatiblePackage(
"com.google.android.youtube", "com.google.android.youtube",
setOf( setOf(
"18.29.38", // Latest version that supports the 'Zoomed to fill' setting. "18.29.38", // This is the last version where the 'Zoomed to fill' setting works.
"18.33.40", // Latest version that do not use litho components in Shorts. "18.33.40", // This is the last 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.38.44", // This is the last version with no delay in applying video quality on the server side.
"18.48.39", // Latest version that do not use Rolling Number. "18.48.39", // This is the last version that do not use Rolling Number.
"19.05.36", // Latest version with the least YouTube experimental flag. "19.05.36", // This is the last version with the least YouTube experimental flag.
"19.16.39", // Latest version that supports the 'Restore old seekbar thumbnails' setting. "19.16.39", // This is the last version that supports the 'Restore old seekbar thumbnails' setting.
"19.20.35", // Latest version supported by the RVX patch. "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.
) )
) )
) )

View File

@ -71,6 +71,7 @@ object SharedResourceIdPatch : ResourcePatch() {
var MusicAppDeeplinkButtonView = -1L var MusicAppDeeplinkButtonView = -1L
var NotificationBigPictureIconWidth = -1L var NotificationBigPictureIconWidth = -1L
var PlayerCollapseButton = -1L var PlayerCollapseButton = -1L
var PlayerVideoTitleView = -1L
var PosterArtWidthDefault = -1L var PosterArtWidthDefault = -1L
var QualityAuto = -1L var QualityAuto = -1L
var QuickActionsElementContainer = -1L var QuickActionsElementContainer = -1L
@ -165,6 +166,7 @@ object SharedResourceIdPatch : ResourcePatch() {
MusicAppDeeplinkButtonView = getId(ID, "music_app_deeplink_button_view") MusicAppDeeplinkButtonView = getId(ID, "music_app_deeplink_button_view")
NotificationBigPictureIconWidth = getId(DIMEN, "notification_big_picture_icon_width") NotificationBigPictureIconWidth = getId(DIMEN, "notification_big_picture_icon_width")
PlayerCollapseButton = getId(ID, "player_collapse_button") PlayerCollapseButton = getId(ID, "player_collapse_button")
PlayerVideoTitleView = getId(ID, "player_video_title_view")
PosterArtWidthDefault = getId(DIMEN, "poster_art_width_default") PosterArtWidthDefault = getId(DIMEN, "poster_art_width_default")
QualityAuto = getId(STRING, "quality_auto") QualityAuto = getId(STRING, "quality_auto")
QuickActionsElementContainer = getId(ID, "quick_actions_element_container") QuickActionsElementContainer = getId(ID, "quick_actions_element_container")