From cb38637e6be968d54561a1e0466b9259dbf0b4ee Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Thu, 28 Sep 2023 00:18:31 +0400 Subject: [PATCH] fix(YouTube - Hide info cards): Fix info cards not hiding for some users (#3039) --- .../youtube/layout/hide/infocards/HideInfoCardsPatch.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt index 0c111dd81..08e116f49 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt @@ -13,6 +13,7 @@ import app.revanced.patches.youtube.layout.hide.infocards.fingerprints.Infocards import app.revanced.patches.youtube.layout.hide.infocards.fingerprints.InfocardsIncognitoParentFingerprint import app.revanced.patches.youtube.layout.hide.infocards.fingerprints.InfocardsMethodCallFingerprint import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch +import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction @@ -22,6 +23,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction description = "Hides info cards in videos.", dependencies = [ IntegrationsPatch::class, + LithoFilterPatch::class, HideInfocardsResourcePatch::class ], compatiblePackages = [ @@ -45,6 +47,9 @@ object HideInfoCardsPatch : BytecodePatch( InfocardsMethodCallFingerprint, ) ) { + private const val FILTER_CLASS_DESCRIPTOR = + "Lapp/revanced/integrations/patches/components/HideInfoCardsFilterPatch;" + override fun execute(context: BytecodeContext) { InfocardsIncognitoFingerprint.also { it.resolve(context, InfocardsIncognitoParentFingerprint.result!!.classDef) @@ -79,5 +84,8 @@ object HideInfoCardsPatch : BytecodePatch( ) ) } + + // Info cards can also appear as litho components. + LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR) } } \ No newline at end of file