From 6d48adef53d00b2ec7a0600e8e31cc268280bc6b Mon Sep 17 00:00:00 2001 From: inotia00 <108592928+inotia00@users.noreply.github.com> Date: Mon, 23 Sep 2024 22:15:18 +0900 Subject: [PATCH] fix(YouTube/Player components): `Disable player popup panels` setting disables the engagement panel in Mix playlists on certain YouTube version --- .../fingerprints/StartVideoInformerFingerprint.kt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/patches/shared/fingerprints/StartVideoInformerFingerprint.kt b/src/main/kotlin/app/revanced/patches/shared/fingerprints/StartVideoInformerFingerprint.kt index dec566143..ca8d33f53 100644 --- a/src/main/kotlin/app/revanced/patches/shared/fingerprints/StartVideoInformerFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/shared/fingerprints/StartVideoInformerFingerprint.kt @@ -12,5 +12,17 @@ internal object StartVideoInformerFingerprint : MethodFingerprint( Opcode.INVOKE_INTERFACE, Opcode.RETURN_VOID ), - strings = listOf("pc") + strings = listOf("pc"), + customFingerprint = custom@{ methodDef, _ -> + if (methodDef.implementation == null) + return@custom false + + methodDef.implementation!!.instructions + .withIndex() + .filter { (_, instruction) -> + instruction.opcode == Opcode.CONST_STRING + } + .map { (index, _) -> index } + .size == 1 + } ) \ No newline at end of file