From 697dc7416937f872b2ad48fba6ebffce527f718c Mon Sep 17 00:00:00 2001 From: inotia00 <108592928+inotia00@users.noreply.github.com> Date: Fri, 27 Sep 2024 19:23:04 +0900 Subject: [PATCH] fix(YouTube/Player components): patch is broken in certain versions --- .../youtube/player/components/PlayerComponentsPatch.kt | 6 +++--- .../fullscreen/fingerprints/PlayerTitleViewFingerprint.kt | 3 --- .../fingerprints/EngagementPanelBuilderFingerprint.kt} | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) rename src/main/kotlin/app/revanced/patches/youtube/{player/components/fingerprints/EngagementPanelControllerFingerprint.kt => utils/fingerprints/EngagementPanelBuilderFingerprint.kt} (79%) diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/components/PlayerComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/components/PlayerComponentsPatch.kt index 94fabf8990..eca7754ce9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/components/PlayerComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/components/PlayerComponentsPatch.kt @@ -12,7 +12,6 @@ import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.shared.fingerprints.StartVideoInformerFingerprint import app.revanced.patches.shared.litho.LithoFilterPatch import app.revanced.patches.youtube.player.components.fingerprints.CrowdfundingBoxFingerprint -import app.revanced.patches.youtube.player.components.fingerprints.EngagementPanelControllerFingerprint import app.revanced.patches.youtube.player.components.fingerprints.FilmStripOverlayConfigFingerprint import app.revanced.patches.youtube.player.components.fingerprints.FilmStripOverlayInteractionFingerprint import app.revanced.patches.youtube.player.components.fingerprints.FilmStripOverlayParentFingerprint @@ -34,6 +33,7 @@ import app.revanced.patches.youtube.player.components.fingerprints.WatermarkPare import app.revanced.patches.youtube.player.speedoverlay.SpeedOverlayPatch import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PACKAGE import app.revanced.patches.youtube.utils.controlsoverlay.ControlsOverlayConfigPatch +import app.revanced.patches.youtube.utils.fingerprints.EngagementPanelBuilderFingerprint import app.revanced.patches.youtube.utils.fingerprints.YouTubeControlsOverlayFingerprint import app.revanced.patches.youtube.utils.fix.suggestedvideoendscreen.SuggestedVideoEndScreenPatch import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH @@ -81,7 +81,7 @@ object PlayerComponentsPatch : BaseBytecodePatch( compatiblePackages = COMPATIBLE_PACKAGE, fingerprints = setOf( CrowdfundingBoxFingerprint, - EngagementPanelControllerFingerprint, + EngagementPanelBuilderFingerprint, FilmStripOverlayParentFingerprint, InfoCardsIncognitoFingerprint, LayoutCircleFingerprint, @@ -158,7 +158,7 @@ object PlayerComponentsPatch : BaseBytecodePatch( } } - EngagementPanelControllerFingerprint.resultOrThrow().let { + EngagementPanelBuilderFingerprint.resultOrThrow().let { it.mutableMethod.apply { addInstructionsWithLabels( 0, """ 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 index 9529c1de94..1f8cc8b053 100644 --- 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 @@ -1,12 +1,9 @@ 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/player/components/fingerprints/EngagementPanelControllerFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/EngagementPanelBuilderFingerprint.kt similarity index 79% rename from src/main/kotlin/app/revanced/patches/youtube/player/components/fingerprints/EngagementPanelControllerFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/EngagementPanelBuilderFingerprint.kt index ffc7e9c979..45002b73e9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/components/fingerprints/EngagementPanelControllerFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/fingerprints/EngagementPanelBuilderFingerprint.kt @@ -1,10 +1,10 @@ -package app.revanced.patches.youtube.player.components.fingerprints +package app.revanced.patches.youtube.utils.fingerprints import app.revanced.patcher.extensions.or import app.revanced.patcher.fingerprint.MethodFingerprint import com.android.tools.smali.dexlib2.AccessFlags -internal object EngagementPanelControllerFingerprint : MethodFingerprint( +internal object EngagementPanelBuilderFingerprint : MethodFingerprint( returnType = "L", accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL, parameters = listOf("L", "L", "Z", "Z"),