Skip to content

Commit

Permalink
fix(YouTube - Hide info cards): Fix info cards not hiding for some us…
Browse files Browse the repository at this point in the history
…ers (#3039)
LisoUseInAIKyrios authored Sep 27, 2023
1 parent ec37be2 commit cb38637
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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)
}
}

0 comments on commit cb38637

Please sign in to comment.