From 8ad75cb4e96e515e210a0b2ee045a8c41b11ac29 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Mon, 21 Oct 2024 23:29:20 -0400 Subject: [PATCH 1/9] fix(YouTube): Merge `Hide album cards` patch into `Hide layout components` --- .../layout/hide/albumcards/AlbumCardsPatch.kt | 53 ++----------------- .../albumcards/AlbumCardsResourcePatch.kt | 30 ----------- .../hide/general/HideLayoutComponentsPatch.kt | 27 ++++++++-- .../HideLayoutComponentsResourcePatch.kt | 9 +++- .../fingerprints/AlbumCardsFingerprint.kt | 6 +-- 5 files changed, 39 insertions(+), 86 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsResourcePatch.kt rename src/main/kotlin/app/revanced/patches/youtube/layout/hide/{albumcards => general}/fingerprints/AlbumCardsFingerprint.kt (69%) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt index 937f2b509d..7d79a66ef6 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt @@ -1,56 +1,13 @@ package app.revanced.patches.youtube.layout.hide.albumcards -import app.revanced.util.exception import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.extensions.InstructionExtensions.addInstruction -import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch -import app.revanced.patcher.patch.annotation.CompatiblePackage -import app.revanced.patcher.patch.annotation.Patch -import app.revanced.patches.youtube.layout.hide.albumcards.fingerprints.AlbumCardsFingerprint -import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch -import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction +import app.revanced.patches.youtube.layout.hide.general.HideLayoutComponentsPatch -@Patch( - name = "Hide album cards", - description = "Adds an option to hide album cards below artist descriptions.", - dependencies = [ - IntegrationsPatch::class, - AlbumCardsResourcePatch::class - ], - compatiblePackages = [ - CompatiblePackage( - "com.google.android.youtube", - [ - "18.38.44", - "18.49.37", - "19.16.39", - "19.25.37", - "19.34.42", - ] - ) - ] -) +@Deprecated("This patch has been merged to HideLayoutComponentsPatch.") @Suppress("unused") object AlbumCardsPatch : BytecodePatch( - setOf(AlbumCardsFingerprint) + dependencies = setOf(HideLayoutComponentsPatch::class), ) { - override fun execute(context: BytecodeContext) { - AlbumCardsFingerprint.result?.let { - it.mutableMethod.apply { - val checkCastAnchorIndex = it.scanResult.patternScanResult!!.endIndex - val insertIndex = checkCastAnchorIndex + 1 - - val albumCardViewRegister = getInstruction(checkCastAnchorIndex).registerA - - addInstruction( - insertIndex, - "invoke-static {v$albumCardViewRegister}, " + - "Lapp/revanced/integrations/youtube/patches/HideAlbumCardsPatch;" + - "->" + - "hideAlbumCard(Landroid/view/View;)V" - ) - } - } ?: throw AlbumCardsFingerprint.exception - } -} + override fun execute(context: BytecodeContext) { } +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsResourcePatch.kt deleted file mode 100644 index e8265b68dc..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsResourcePatch.kt +++ /dev/null @@ -1,30 +0,0 @@ -package app.revanced.patches.youtube.layout.hide.albumcards - -import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.ResourcePatch -import app.revanced.patcher.patch.annotation.Patch -import app.revanced.patches.all.misc.resources.AddResourcesPatch -import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch -import app.revanced.patches.shared.misc.settings.preference.SwitchPreference -import app.revanced.patches.youtube.misc.settings.SettingsPatch - -@Patch( - dependencies = [ - SettingsPatch::class, - ResourceMappingPatch::class, - AddResourcesPatch::class, - ], -) -internal object AlbumCardsResourcePatch : ResourcePatch() { - internal var albumCardId: Long = -1 - - override fun execute(context: ResourceContext) { - AddResourcesPatch(this::class) - - SettingsPatch.PreferenceScreen.FEED.addPreferences( - SwitchPreference("revanced_hide_album_cards"), - ) - - albumCardId = ResourceMappingPatch["layout", "album_card"] - } -} diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt index 202bb19c4e..0d259f8214 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt @@ -14,6 +14,7 @@ import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.all.misc.resources.AddResourcesPatch import app.revanced.patches.shared.misc.settings.preference.* import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen.Sorting +import app.revanced.patches.youtube.layout.hide.general.fingerprints.AlbumCardsFingerprint import app.revanced.patches.youtube.layout.hide.general.fingerprints.HideShowMoreButtonFingerprint import app.revanced.patches.youtube.layout.hide.general.fingerprints.ParseElementFromBufferFingerprint import app.revanced.patches.youtube.layout.hide.general.fingerprints.PlayerOverlayFingerprint @@ -22,9 +23,9 @@ import app.revanced.patches.youtube.layout.hide.general.fingerprints.YoodlesImag import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch import app.revanced.patches.youtube.misc.navigation.NavigationBarHookPatch import app.revanced.patches.youtube.misc.settings.SettingsPatch +import app.revanced.util.alsoResolve import app.revanced.util.findOpcodeIndicesReversed import app.revanced.util.getReference -import app.revanced.util.alsoResolve import app.revanced.util.resultOrThrow import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction @@ -61,6 +62,7 @@ object HideLayoutComponentsPatch : BytecodePatch( ParseElementFromBufferFingerprint, PlayerOverlayFingerprint, HideShowMoreButtonFingerprint, + AlbumCardsFingerprint, YoodlesImageViewFingerprint, ), ) { @@ -105,6 +107,7 @@ object HideLayoutComponentsPatch : BytecodePatch( ) SettingsPatch.PreferenceScreen.FEED.addPreferences( + SwitchPreference("revanced_hide_album_cards"), SwitchPreference("revanced_hide_artist_cards"), SwitchPreference("revanced_hide_community_posts"), SwitchPreference("revanced_hide_compact_banner"), @@ -213,8 +216,26 @@ object HideLayoutComponentsPatch : BytecodePatch( val insertIndex = moveRegisterIndex + 1 addInstruction( insertIndex, - "invoke-static { v$viewRegister }, " + - "$LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR->hideShowMoreButton(Landroid/view/View;)V", + "invoke-static { v$viewRegister }, $LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR" + + "->hideShowMoreButton(Landroid/view/View;)V", + ) + } + } + + // endregion + + // region hide album cards + + AlbumCardsFingerprint.resultOrThrow().let { + it.mutableMethod.apply { + val checkCastAnchorIndex = it.scanResult.patternScanResult!!.endIndex + val insertIndex = checkCastAnchorIndex + 1 + val register = getInstruction(checkCastAnchorIndex).registerA + + addInstruction( + insertIndex, + "invoke-static { v$register }, $LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR" + + "->hideAlbumCard(Landroid/view/View;)V" ) } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsResourcePatch.kt index 24dcbb3f19..6b06f6e980 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsResourcePatch.kt @@ -15,8 +15,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch ], ) internal object HideLayoutComponentsResourcePatch : ResourcePatch() { - internal var expandButtonDownId: Long = -1 - + var expandButtonDownId: Long = -1 + var albumCardId: Long = -1 var youTubeLogo = -1L override fun execute(context: ResourceContext) { @@ -25,6 +25,11 @@ internal object HideLayoutComponentsResourcePatch : ResourcePatch() { "expand_button_down", ] + albumCardId = ResourceMappingPatch[ + "layout", + "album_card" + ] + youTubeLogo = ResourceMappingPatch[ "id", "youtube_logo" diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/fingerprints/AlbumCardsFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/fingerprints/AlbumCardsFingerprint.kt similarity index 69% rename from src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/fingerprints/AlbumCardsFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/fingerprints/AlbumCardsFingerprint.kt index 6bbabdf520..7032d1b793 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/fingerprints/AlbumCardsFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/fingerprints/AlbumCardsFingerprint.kt @@ -1,7 +1,7 @@ -package app.revanced.patches.youtube.layout.hide.albumcards.fingerprints +package app.revanced.patches.youtube.layout.hide.general.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patches.youtube.layout.hide.albumcards.AlbumCardsResourcePatch +import app.revanced.patches.youtube.layout.hide.general.HideLayoutComponentsResourcePatch import app.revanced.util.patch.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode @@ -16,5 +16,5 @@ internal object AlbumCardsFingerprint : LiteralValueFingerprint( Opcode.MOVE_RESULT_OBJECT, Opcode.CHECK_CAST, ), - literalSupplier = { AlbumCardsResourcePatch.albumCardId } + literalSupplier = { HideLayoutComponentsResourcePatch.albumCardId } ) \ No newline at end of file From e934f30b87c9df5e12573609b6aa1a72c395582e Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Mon, 21 Oct 2024 23:34:16 -0400 Subject: [PATCH 2/9] fix(YouTube): Merge `Hide crowdfunding box` patch into `Hide layout components` --- .../crowdfundingbox/CrowdfundingBoxPatch.kt | 48 ++----------------- .../CrowdfundingBoxResourcePatch.kt | 33 ------------- .../hide/general/HideLayoutComponentsPatch.kt | 17 +++++++ .../HideLayoutComponentsResourcePatch.kt | 7 +++ .../CrowdfundingBoxFingerprint.kt | 6 +-- 5 files changed, 32 insertions(+), 79 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxResourcePatch.kt rename src/main/kotlin/app/revanced/patches/youtube/layout/hide/{crowdfundingbox => general}/fingerprints/CrowdfundingBoxFingerprint.kt (65%) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt index e186babd7b..be071179c6 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt @@ -1,51 +1,13 @@ package app.revanced.patches.youtube.layout.hide.crowdfundingbox -import app.revanced.util.exception import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.extensions.InstructionExtensions.addInstruction -import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch -import app.revanced.patcher.patch.annotation.CompatiblePackage -import app.revanced.patcher.patch.annotation.Patch -import app.revanced.patches.youtube.layout.hide.crowdfundingbox.fingerprints.CrowdfundingBoxFingerprint -import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch -import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction +import app.revanced.patches.youtube.layout.hide.general.HideLayoutComponentsPatch -@Patch( - name = "Hide crowdfunding box", - description = "Adds an option to hide the crowdfunding box between the player and video description.", - dependencies = [ - IntegrationsPatch::class, - CrowdfundingBoxResourcePatch::class - ], - compatiblePackages = [ - CompatiblePackage( - "com.google.android.youtube", - [ - "18.38.44", - "18.49.37", - "19.16.39", - "19.25.37", - "19.34.42", - ] - ) - ] -) +@Deprecated("This patch has been merged to HideLayoutComponentsPatch.") @Suppress("unused") object CrowdfundingBoxPatch : BytecodePatch( - setOf(CrowdfundingBoxFingerprint) + dependencies = setOf(HideLayoutComponentsPatch::class), ) { - private const val INTEGRATIONS_METHOD_DESCRIPTOR = - "Lapp/revanced/integrations/youtube/patches/HideCrowdfundingBoxPatch;->hideCrowdfundingBox(Landroid/view/View;)V" - - override fun execute(context: BytecodeContext) { - CrowdfundingBoxFingerprint.result?.let { - it.mutableMethod.apply { - val insertIndex = it.scanResult.patternScanResult!!.endIndex - val objectRegister = getInstruction(insertIndex).registerA - - addInstruction(insertIndex, "invoke-static {v$objectRegister}, $INTEGRATIONS_METHOD_DESCRIPTOR") - } - } ?: throw CrowdfundingBoxFingerprint.exception - } -} + override fun execute(context: BytecodeContext) { } +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxResourcePatch.kt deleted file mode 100644 index f1763704c9..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxResourcePatch.kt +++ /dev/null @@ -1,33 +0,0 @@ -package app.revanced.patches.youtube.layout.hide.crowdfundingbox - -import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.ResourcePatch -import app.revanced.patcher.patch.annotation.Patch -import app.revanced.patches.all.misc.resources.AddResourcesPatch -import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch -import app.revanced.patches.shared.misc.settings.preference.SwitchPreference -import app.revanced.patches.youtube.misc.settings.SettingsPatch - -@Patch( - dependencies = [ - SettingsPatch::class, - ResourceMappingPatch::class, - AddResourcesPatch::class, - ], -) -internal object CrowdfundingBoxResourcePatch : ResourcePatch() { - internal var crowdfundingBoxId: Long = -1 - - override fun execute(context: ResourceContext) { - AddResourcesPatch(this::class) - - SettingsPatch.PreferenceScreen.FEED.addPreferences( - SwitchPreference("revanced_hide_crowdfunding_box"), - ) - - crowdfundingBoxId = ResourceMappingPatch[ - "layout", - "donation_companion", - ] - } -} diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt index 0d259f8214..c50a692146 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt @@ -15,6 +15,7 @@ import app.revanced.patches.all.misc.resources.AddResourcesPatch import app.revanced.patches.shared.misc.settings.preference.* import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen.Sorting import app.revanced.patches.youtube.layout.hide.general.fingerprints.AlbumCardsFingerprint +import app.revanced.patches.youtube.layout.hide.general.fingerprints.CrowdfundingBoxFingerprint import app.revanced.patches.youtube.layout.hide.general.fingerprints.HideShowMoreButtonFingerprint import app.revanced.patches.youtube.layout.hide.general.fingerprints.ParseElementFromBufferFingerprint import app.revanced.patches.youtube.layout.hide.general.fingerprints.PlayerOverlayFingerprint @@ -63,6 +64,7 @@ object HideLayoutComponentsPatch : BytecodePatch( PlayerOverlayFingerprint, HideShowMoreButtonFingerprint, AlbumCardsFingerprint, + CrowdfundingBoxFingerprint, YoodlesImageViewFingerprint, ), ) { @@ -224,6 +226,21 @@ object HideLayoutComponentsPatch : BytecodePatch( // endregion + // region crowd funding box + CrowdfundingBoxFingerprint.resultOrThrow().let { + it.mutableMethod.apply { + val insertIndex = it.scanResult.patternScanResult!!.endIndex + val objectRegister = getInstruction(insertIndex).registerA + + addInstruction( + insertIndex, + "invoke-static {v$objectRegister}, $LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR" + + "->hideCrowdfundingBox(Landroid/view/View;)V") + } + } + + // endregion + // region hide album cards AlbumCardsFingerprint.resultOrThrow().let { diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsResourcePatch.kt index 6b06f6e980..0955d11790 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsResourcePatch.kt @@ -5,6 +5,7 @@ import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.all.misc.resources.AddResourcesPatch import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch +import app.revanced.patches.youtube.layout.hide.crowdfundingbox.CrowdfundingBoxResourcePatch import app.revanced.patches.youtube.misc.settings.SettingsPatch @Patch( @@ -17,6 +18,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch internal object HideLayoutComponentsResourcePatch : ResourcePatch() { var expandButtonDownId: Long = -1 var albumCardId: Long = -1 + var crowdfundingBoxId: Long = -1 var youTubeLogo = -1L override fun execute(context: ResourceContext) { @@ -30,6 +32,11 @@ internal object HideLayoutComponentsResourcePatch : ResourcePatch() { "album_card" ] + crowdfundingBoxId = ResourceMappingPatch[ + "layout", + "donation_companion", + ] + youTubeLogo = ResourceMappingPatch[ "id", "youtube_logo" diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/fingerprints/CrowdfundingBoxFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/fingerprints/CrowdfundingBoxFingerprint.kt similarity index 65% rename from src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/fingerprints/CrowdfundingBoxFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/fingerprints/CrowdfundingBoxFingerprint.kt index 465b10bfe5..ec40629ee0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/fingerprints/CrowdfundingBoxFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/fingerprints/CrowdfundingBoxFingerprint.kt @@ -1,7 +1,7 @@ -package app.revanced.patches.youtube.layout.hide.crowdfundingbox.fingerprints +package app.revanced.patches.youtube.layout.hide.general.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patches.youtube.layout.hide.crowdfundingbox.CrowdfundingBoxResourcePatch +import app.revanced.patches.youtube.layout.hide.general.HideLayoutComponentsResourcePatch import app.revanced.util.patch.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode @@ -13,5 +13,5 @@ internal object CrowdfundingBoxFingerprint : LiteralValueFingerprint( Opcode.MOVE_RESULT_OBJECT, Opcode.IPUT_OBJECT, ), - literalSupplier = { CrowdfundingBoxResourcePatch.crowdfundingBoxId } + literalSupplier = { HideLayoutComponentsResourcePatch.crowdfundingBoxId } ) \ No newline at end of file From 098222aa0d8dae70cc8be05b1a2f50fc58c68099 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Mon, 21 Oct 2024 23:42:52 -0400 Subject: [PATCH 3/9] fix: Move album card strings --- src/main/resources/addresources/values/strings.xml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index d08ae90ea1..b54816af79 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -107,6 +107,9 @@ This is because Crowdin requires temporarily flattening this file and removing t Disable like / subscribe button glow Like and subscribe button will not glow when mentioned Like and subscribe button will glow when mentioned + Hide album cards + Album cards are hidden + Album cards are shown Hide gray separator Gray separators are hidden Gray separators are shown @@ -523,11 +526,6 @@ This is because Crowdin requires temporarily flattening this file and removing t Buttons are hidden Buttons are shown - - Hide album cards - Album cards are hidden - Album cards are shown - Comments Hide or show comments section components From e23ac43a66710c63a5c61d7cb46ba468e6a38a3e Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Mon, 21 Oct 2024 23:43:44 -0400 Subject: [PATCH 4/9] fix: Move strings --- src/main/resources/addresources/values/strings.xml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index b54816af79..7b9cb123a7 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -110,6 +110,9 @@ This is because Crowdin requires temporarily flattening this file and removing t Hide album cards Album cards are hidden Album cards are shown + Hide crowdfunding box + Crowdfunding box is hidden + Crowdfunding box is shown Hide gray separator Gray separators are hidden Gray separators are shown @@ -548,11 +551,6 @@ This is because Crowdin requires temporarily flattening this file and removing t Timestamp and emoji buttons are hidden Timestamp and emoji buttons are shown - - Hide crowdfunding box - Crowdfunding box is hidden - Crowdfunding box is shown - Hide end screen cards End screen cards are hidden From 08c5d607c6b8ecd6183564daf51a41a394e8625b Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Mon, 21 Oct 2024 23:47:54 -0400 Subject: [PATCH 5/9] fix(YouTube): Merge `Hide filter bar` patch into `Hide layout components` --- .../hide/filterbar/HideFilterBarPatch.kt | 88 ++----------------- .../filterbar/HideFilterBarResourcePatch.kt | 36 -------- .../hide/general/HideLayoutComponentsPatch.kt | 60 +++++++++++++ .../HideLayoutComponentsResourcePatch.kt | 20 ++++- .../FilterBarHeightFingerprint.kt | 6 +- .../RelatedChipCloudFingerprint.kt | 6 +- .../SearchResultsChipBarFingerprint.kt | 6 +- .../resources/addresources/values/strings.xml | 25 +++--- 8 files changed, 105 insertions(+), 142 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarResourcePatch.kt rename src/main/kotlin/app/revanced/patches/youtube/layout/hide/{filterbar => general}/fingerprints/FilterBarHeightFingerprint.kt (67%) rename src/main/kotlin/app/revanced/patches/youtube/layout/hide/{filterbar => general}/fingerprints/RelatedChipCloudFingerprint.kt (65%) rename src/main/kotlin/app/revanced/patches/youtube/layout/hide/{filterbar => general}/fingerprints/SearchResultsChipBarFingerprint.kt (68%) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt index 7e4ad51230..c084ea9e86 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt @@ -1,90 +1,12 @@ package app.revanced.patches.youtube.layout.hide.filterbar -import app.revanced.util.exception import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.extensions.InstructionExtensions.addInstructions -import app.revanced.patcher.extensions.InstructionExtensions.getInstruction -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patcher.patch.BytecodePatch -import app.revanced.patcher.patch.annotation.CompatiblePackage -import app.revanced.patcher.patch.annotation.Patch -import app.revanced.patches.youtube.layout.hide.filterbar.fingerprints.FilterBarHeightFingerprint -import app.revanced.patches.youtube.layout.hide.filterbar.fingerprints.RelatedChipCloudFingerprint -import app.revanced.patches.youtube.layout.hide.filterbar.fingerprints.SearchResultsChipBarFingerprint -import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction -import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction +import app.revanced.patches.youtube.layout.hide.general.HideLayoutComponentsPatch -@Patch( - name = "Hide filter bar", - description = "Adds options to hide the category bar at the top of video feeds.", - dependencies = [HideFilterBarResourcePatch::class], - compatiblePackages = [ - CompatiblePackage( - "com.google.android.youtube", - [ - "18.38.44", - "18.49.37", - "19.16.39", - "19.25.37", - "19.34.42", - ] - ) - ] -) -@Suppress("unused") +@Deprecated("This patch class has been merged into HideLayoutComponentsPatch.") object HideFilterBarPatch : BytecodePatch( - setOf( - RelatedChipCloudFingerprint, - SearchResultsChipBarFingerprint, - FilterBarHeightFingerprint - ) + dependencies = setOf(HideLayoutComponentsPatch::class) ) { - private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/youtube/patches/HideFilterBarPatch;" - - override fun execute(context: BytecodeContext) { - FilterBarHeightFingerprint.patch { register -> - """ - invoke-static { v$register }, $INTEGRATIONS_CLASS_DESCRIPTOR->hideInFeed(I)I - move-result v$register - """ - } - - RelatedChipCloudFingerprint.patch(1) { register -> - "invoke-static { v$register }, " + - "$INTEGRATIONS_CLASS_DESCRIPTOR->hideInRelatedVideos(Landroid/view/View;)V" - } - - SearchResultsChipBarFingerprint.patch(-1, -2) { register -> - """ - invoke-static { v$register }, $INTEGRATIONS_CLASS_DESCRIPTOR->hideInSearch(I)I - move-result v$register - """ - } - } - - /** - * Patch a [MethodFingerprint] with a given [instructions]. - * - * @param RegisterInstruction The type of instruction to get the register from. - * @param insertIndexOffset The offset to add to the end index of the [MethodFingerprint]. - * @param hookRegisterOffset The offset to add to the register of the hook. - * @param instructions The instructions to add with the register as a parameter. - */ - private fun MethodFingerprint.patch( - insertIndexOffset: Int = 0, - hookRegisterOffset: Int = 0, - instructions: (Int) -> String - ) = - result?.let { - it.mutableMethod.apply { - val endIndex = it.scanResult.patternScanResult!!.endIndex - - val insertIndex = endIndex + insertIndexOffset - val register = - getInstruction(endIndex + hookRegisterOffset).registerA - - addInstructions(insertIndex, instructions(register)) - } - } ?: throw exception -} + override fun execute(context: BytecodeContext) {} +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarResourcePatch.kt deleted file mode 100644 index d49df7a5b4..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarResourcePatch.kt +++ /dev/null @@ -1,36 +0,0 @@ -package app.revanced.patches.youtube.layout.hide.filterbar - -import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.ResourcePatch -import app.revanced.patcher.patch.annotation.Patch -import app.revanced.patches.all.misc.resources.AddResourcesPatch -import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch -import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen -import app.revanced.patches.shared.misc.settings.preference.SwitchPreference -import app.revanced.patches.youtube.misc.settings.SettingsPatch - -@Patch(dependencies = [SettingsPatch::class, ResourceMappingPatch::class, AddResourcesPatch::class]) -internal object HideFilterBarResourcePatch : ResourcePatch() { - internal var filterBarHeightId = -1L - internal var relatedChipCloudMarginId = -1L - internal var barContainerHeightId = -1L - - override fun execute(context: ResourceContext) { - AddResourcesPatch(this::class) - - SettingsPatch.PreferenceScreen.FEED.addPreferences( - PreferenceScreen( - key = "revanced_hide_filter_bar_screen", - preferences = setOf( - SwitchPreference("revanced_hide_filter_bar_feed_in_feed"), - SwitchPreference("revanced_hide_filter_bar_feed_in_search"), - SwitchPreference("revanced_hide_filter_bar_feed_in_related_videos"), - ), - ), - ) - - relatedChipCloudMarginId = ResourceMappingPatch["layout", "related_chip_cloud_reduced_margins"] - filterBarHeightId = ResourceMappingPatch["dimen", "filter_bar_height"] - barContainerHeightId = ResourceMappingPatch["dimen", "bar_container_height"] - } -} diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt index c50a692146..f188865ddf 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt @@ -7,6 +7,7 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWith import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstructions import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction +import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch @@ -16,9 +17,12 @@ import app.revanced.patches.shared.misc.settings.preference.* import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen.Sorting import app.revanced.patches.youtube.layout.hide.general.fingerprints.AlbumCardsFingerprint import app.revanced.patches.youtube.layout.hide.general.fingerprints.CrowdfundingBoxFingerprint +import app.revanced.patches.youtube.layout.hide.general.fingerprints.FilterBarHeightFingerprint import app.revanced.patches.youtube.layout.hide.general.fingerprints.HideShowMoreButtonFingerprint import app.revanced.patches.youtube.layout.hide.general.fingerprints.ParseElementFromBufferFingerprint import app.revanced.patches.youtube.layout.hide.general.fingerprints.PlayerOverlayFingerprint +import app.revanced.patches.youtube.layout.hide.general.fingerprints.RelatedChipCloudFingerprint +import app.revanced.patches.youtube.layout.hide.general.fingerprints.SearchResultsChipBarFingerprint import app.revanced.patches.youtube.layout.hide.general.fingerprints.ShowWatermarkFingerprint import app.revanced.patches.youtube.layout.hide.general.fingerprints.YoodlesImageViewFingerprint import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch @@ -66,6 +70,9 @@ object HideLayoutComponentsPatch : BytecodePatch( AlbumCardsFingerprint, CrowdfundingBoxFingerprint, YoodlesImageViewFingerprint, + RelatedChipCloudFingerprint, + SearchResultsChipBarFingerprint, + FilterBarHeightFingerprint ), ) { private const val LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR = @@ -140,6 +147,14 @@ object HideLayoutComponentsPatch : BytecodePatch( NonInteractivePreference(key = "revanced_hide_keyword_content_about_whole_words", tag = "app.revanced.integrations.youtube.settings.preference.HtmlPreference") ) + ), + PreferenceScreen( + key = "revanced_hide_filter_bar_screen", + preferences = setOf( + SwitchPreference("revanced_hide_filter_bar_feed_in_feed"), + SwitchPreference("revanced_hide_filter_bar_feed_in_search"), + SwitchPreference("revanced_hide_filter_bar_feed_in_related_videos"), + ), ) ) @@ -281,5 +296,50 @@ object HideLayoutComponentsPatch : BytecodePatch( } // endregion + + // region hide filter bar + + FilterBarHeightFingerprint.patch { register -> + """ + invoke-static { v$register }, $LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR->hideInFeed(I)I + move-result v$register + """ + } + + SearchResultsChipBarFingerprint.patch(-1, -2) { register -> + """ + invoke-static { v$register }, $LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR->hideInSearch(I)I + move-result v$register + """ + } + + RelatedChipCloudFingerprint.patch(1) { register -> + "invoke-static { v$register }, " + + "$LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR->hideInRelatedVideos(Landroid/view/View;)V" + } + } + + /** + * Patch a [MethodFingerprint] with a given [instructions]. + * + * @param RegisterInstruction The type of instruction to get the register from. + * @param insertIndexOffset The offset to add to the end index of the [MethodFingerprint]. + * @param hookRegisterOffset The offset to add to the register of the hook. + * @param instructions The instructions to add with the register as a parameter. + */ + private fun MethodFingerprint.patch( + insertIndexOffset: Int = 0, + hookRegisterOffset: Int = 0, + instructions: (Int) -> String + ) = resultOrThrow().let { + it.mutableMethod.apply { + val endIndex = it.scanResult.patternScanResult!!.endIndex + + val insertIndex = endIndex + insertIndexOffset + val register = + getInstruction(endIndex + hookRegisterOffset).registerA + + addInstructions(insertIndex, instructions(register)) + } } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsResourcePatch.kt index 0955d11790..99762c7e47 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsResourcePatch.kt @@ -5,7 +5,6 @@ import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.all.misc.resources.AddResourcesPatch import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch -import app.revanced.patches.youtube.layout.hide.crowdfundingbox.CrowdfundingBoxResourcePatch import app.revanced.patches.youtube.misc.settings.SettingsPatch @Patch( @@ -21,6 +20,10 @@ internal object HideLayoutComponentsResourcePatch : ResourcePatch() { var crowdfundingBoxId: Long = -1 var youTubeLogo = -1L + var filterBarHeightId = -1L + var relatedChipCloudMarginId = -1L + var barContainerHeightId = -1L + override fun execute(context: ResourceContext) { expandButtonDownId = ResourceMappingPatch[ "layout", @@ -41,5 +44,20 @@ internal object HideLayoutComponentsResourcePatch : ResourcePatch() { "id", "youtube_logo" ] + + relatedChipCloudMarginId = ResourceMappingPatch[ + "layout", + "related_chip_cloud_reduced_margins" + ] + + filterBarHeightId = ResourceMappingPatch[ + "dimen", + "filter_bar_height" + ] + + barContainerHeightId = ResourceMappingPatch[ + "dimen", + "bar_container_height" + ] } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/fingerprints/FilterBarHeightFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/fingerprints/FilterBarHeightFingerprint.kt similarity index 67% rename from src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/fingerprints/FilterBarHeightFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/fingerprints/FilterBarHeightFingerprint.kt index b15abf5bb9..c074abd426 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/fingerprints/FilterBarHeightFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/fingerprints/FilterBarHeightFingerprint.kt @@ -1,7 +1,7 @@ -package app.revanced.patches.youtube.layout.hide.filterbar.fingerprints +package app.revanced.patches.youtube.layout.hide.general.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patches.youtube.layout.hide.filterbar.HideFilterBarResourcePatch +import app.revanced.patches.youtube.layout.hide.general.HideLayoutComponentsResourcePatch import app.revanced.util.patch.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode @@ -15,5 +15,5 @@ internal object FilterBarHeightFingerprint : LiteralValueFingerprint( Opcode.MOVE_RESULT, Opcode.IPUT ), - literalSupplier = { HideFilterBarResourcePatch.filterBarHeightId } + literalSupplier = { HideLayoutComponentsResourcePatch.filterBarHeightId } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/fingerprints/RelatedChipCloudFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/fingerprints/RelatedChipCloudFingerprint.kt similarity index 65% rename from src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/fingerprints/RelatedChipCloudFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/fingerprints/RelatedChipCloudFingerprint.kt index d9efa6c49d..2f51b6611f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/fingerprints/RelatedChipCloudFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/fingerprints/RelatedChipCloudFingerprint.kt @@ -1,7 +1,7 @@ -package app.revanced.patches.youtube.layout.hide.filterbar.fingerprints +package app.revanced.patches.youtube.layout.hide.general.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patches.youtube.layout.hide.filterbar.HideFilterBarResourcePatch +import app.revanced.patches.youtube.layout.hide.general.HideLayoutComponentsResourcePatch import app.revanced.util.patch.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode @@ -14,5 +14,5 @@ internal object RelatedChipCloudFingerprint : LiteralValueFingerprint( Opcode.INVOKE_VIRTUAL, Opcode.MOVE_RESULT_OBJECT ), - literalSupplier = { HideFilterBarResourcePatch.relatedChipCloudMarginId } + literalSupplier = { HideLayoutComponentsResourcePatch.relatedChipCloudMarginId } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/fingerprints/SearchResultsChipBarFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/fingerprints/SearchResultsChipBarFingerprint.kt similarity index 68% rename from src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/fingerprints/SearchResultsChipBarFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/fingerprints/SearchResultsChipBarFingerprint.kt index ed1179ba72..27fc800c30 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/fingerprints/SearchResultsChipBarFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/fingerprints/SearchResultsChipBarFingerprint.kt @@ -1,7 +1,7 @@ -package app.revanced.patches.youtube.layout.hide.filterbar.fingerprints +package app.revanced.patches.youtube.layout.hide.general.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patches.youtube.layout.hide.filterbar.HideFilterBarResourcePatch +import app.revanced.patches.youtube.layout.hide.general.HideLayoutComponentsResourcePatch import app.revanced.util.patch.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode @@ -16,5 +16,5 @@ internal object SearchResultsChipBarFingerprint : LiteralValueFingerprint( Opcode.INVOKE_VIRTUAL, Opcode.MOVE_RESULT_OBJECT ), - literalSupplier = { HideFilterBarResourcePatch.barContainerHeightId } + literalSupplier = { HideLayoutComponentsResourcePatch.barContainerHeightId } ) \ No newline at end of file diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index 7b9cb123a7..a4e03335ba 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -238,6 +238,18 @@ This is because Crowdin requires temporarily flattening this file and removing t Video description Hide or show video description components + Filter bar + Hide or show the filter bar in the feed, search, and related videos + Hide in feed + Hidden in feed + Shown in feed + Hide in search + Hidden in search + Shown in search + Hide in related videos + Hidden in related videos + Shown in related videos + Hide YouTube Doodles Search bar Doodles are hidden @@ -556,19 +568,6 @@ This is because Crowdin requires temporarily flattening this file and removing t End screen cards are hidden End screen cards are shown - - Filter bar - Hide or show the filter bar in the feed, search, and related videos - Hide in feed - Hidden in feed - Shown in feed - Hide in search - Hidden in search - Shown in search - Hide in related videos - Hidden in related videos - Shown in related videos - Hide floating microphone button Microphone button hidden From bfe9a24303fdcdd0c54681b22da7099b8e86f111 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Mon, 21 Oct 2024 23:54:00 -0400 Subject: [PATCH 6/9] fix(YouTube): Merge `Hide floating microphone` patch into `Hide layout components` --- .../HideFloatingMicrophoneButtonPatch.kt | 51 ++----------------- ...deFloatingMicrophoneButtonResourcePatch.kt | 30 ----------- .../hide/general/HideLayoutComponentsPatch.kt | 22 ++++++++ .../HideLayoutComponentsResourcePatch.kt | 7 +++ ...ShowFloatingMicrophoneButtonFingerprint.kt | 6 +-- .../resources/addresources/values/strings.xml | 8 ++- 6 files changed, 40 insertions(+), 84 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonResourcePatch.kt rename src/main/kotlin/app/revanced/patches/youtube/layout/hide/{floatingmicrophone => general}/fingerprints/ShowFloatingMicrophoneButtonFingerprint.kt (64%) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt index 07b8425727..efdbb84fb7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt @@ -1,54 +1,13 @@ package app.revanced.patches.youtube.layout.hide.floatingmicrophone -import app.revanced.util.exception import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.extensions.InstructionExtensions.addInstructions -import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch -import app.revanced.patcher.patch.annotation.CompatiblePackage -import app.revanced.patcher.patch.annotation.Patch -import app.revanced.patches.youtube.layout.hide.floatingmicrophone.fingerprints.ShowFloatingMicrophoneButtonFingerprint -import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction +import app.revanced.patches.youtube.layout.hide.general.HideLayoutComponentsPatch -@Patch( - name = "Hide floating microphone button", - description = "Adds an option to hide the floating microphone button when searching.", - dependencies = [HideFloatingMicrophoneButtonResourcePatch::class], - compatiblePackages = [ - CompatiblePackage( - "com.google.android.youtube", - [ - "18.38.44", - "18.49.37", - "19.16.39", - "19.25.37", - "19.34.42", - ] - ) - ] -) +@Deprecated("This patch has been merged to HideLayoutComponentsPatch.") @Suppress("unused") object HideFloatingMicrophoneButtonPatch : BytecodePatch( - setOf(ShowFloatingMicrophoneButtonFingerprint) + dependencies = setOf(HideLayoutComponentsPatch::class), ) { - private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/youtube/patches/HideFloatingMicrophoneButtonPatch;" - - override fun execute(context: BytecodeContext) { - ShowFloatingMicrophoneButtonFingerprint.result?.let { result -> - with(result.mutableMethod) { - val insertIndex = result.scanResult.patternScanResult!!.startIndex + 1 - val showButtonRegister = - getInstruction(insertIndex - 1).registerA - - addInstructions( - insertIndex, - """ - invoke-static {v$showButtonRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->hideFloatingMicrophoneButton(Z)Z - move-result v$showButtonRegister - """ - ) - } - } ?: throw ShowFloatingMicrophoneButtonFingerprint.exception - } -} + override fun execute(context: BytecodeContext) { } +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonResourcePatch.kt deleted file mode 100644 index 30dd8e84d1..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonResourcePatch.kt +++ /dev/null @@ -1,30 +0,0 @@ -package app.revanced.patches.youtube.layout.hide.floatingmicrophone - -import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.ResourcePatch -import app.revanced.patcher.patch.annotation.Patch -import app.revanced.patches.all.misc.resources.AddResourcesPatch -import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch -import app.revanced.patches.shared.misc.settings.preference.SwitchPreference -import app.revanced.patches.youtube.misc.settings.SettingsPatch - -@Patch( - dependencies = [ - SettingsPatch::class, - ResourceMappingPatch::class, - AddResourcesPatch::class, - ], -) -internal object HideFloatingMicrophoneButtonResourcePatch : ResourcePatch() { - internal var fabButtonId: Long = -1 - - override fun execute(context: ResourceContext) { - AddResourcesPatch(this::class) - - SettingsPatch.PreferenceScreen.GENERAL_LAYOUT.addPreferences( - SwitchPreference("revanced_hide_floating_microphone_button"), - ) - - fabButtonId = ResourceMappingPatch["id", "fab"] - } -} diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt index f188865ddf..badeee4c79 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt @@ -23,6 +23,7 @@ import app.revanced.patches.youtube.layout.hide.general.fingerprints.ParseElemen import app.revanced.patches.youtube.layout.hide.general.fingerprints.PlayerOverlayFingerprint import app.revanced.patches.youtube.layout.hide.general.fingerprints.RelatedChipCloudFingerprint import app.revanced.patches.youtube.layout.hide.general.fingerprints.SearchResultsChipBarFingerprint +import app.revanced.patches.youtube.layout.hide.general.fingerprints.ShowFloatingMicrophoneButtonFingerprint import app.revanced.patches.youtube.layout.hide.general.fingerprints.ShowWatermarkFingerprint import app.revanced.patches.youtube.layout.hide.general.fingerprints.YoodlesImageViewFingerprint import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch @@ -72,6 +73,7 @@ object HideLayoutComponentsPatch : BytecodePatch( YoodlesImageViewFingerprint, RelatedChipCloudFingerprint, SearchResultsChipBarFingerprint, + ShowFloatingMicrophoneButtonFingerprint, FilterBarHeightFingerprint ), ) { @@ -123,6 +125,7 @@ object HideLayoutComponentsPatch : BytecodePatch( SwitchPreference("revanced_hide_chips_shelf"), SwitchPreference("revanced_hide_expandable_chip"), SwitchPreference("revanced_hide_feed_survey"), + SwitchPreference("revanced_hide_floating_microphone_button"), SwitchPreference("revanced_hide_for_you_shelf"), SwitchPreference("revanced_hide_horizontal_shelves"), SwitchPreference("revanced_hide_image_shelf"), @@ -274,6 +277,25 @@ object HideLayoutComponentsPatch : BytecodePatch( // endregion + // region hide floating microphone + + ShowFloatingMicrophoneButtonFingerprint.resultOrThrow().let { result -> + with(result.mutableMethod) { + val startIndex = result.scanResult.patternScanResult!!.startIndex + val register = getInstruction(startIndex).registerA + + addInstructions( + startIndex + 1, + """ + invoke-static { v$register }, $LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR->hideFloatingMicrophoneButton(Z)Z + move-result v$register + """ + ) + } + } + + // endregion + // region 'Yoodles' YoodlesImageViewFingerprint.resultOrThrow().mutableMethod.apply { diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsResourcePatch.kt index 99762c7e47..ce32d2b8a0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsResourcePatch.kt @@ -24,6 +24,8 @@ internal object HideLayoutComponentsResourcePatch : ResourcePatch() { var relatedChipCloudMarginId = -1L var barContainerHeightId = -1L + var fabButtonId: Long = -1 + override fun execute(context: ResourceContext) { expandButtonDownId = ResourceMappingPatch[ "layout", @@ -59,5 +61,10 @@ internal object HideLayoutComponentsResourcePatch : ResourcePatch() { "dimen", "bar_container_height" ] + + fabButtonId = ResourceMappingPatch[ + "id", + "fab" + ] } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/fingerprints/ShowFloatingMicrophoneButtonFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/fingerprints/ShowFloatingMicrophoneButtonFingerprint.kt similarity index 64% rename from src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/fingerprints/ShowFloatingMicrophoneButtonFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/fingerprints/ShowFloatingMicrophoneButtonFingerprint.kt index 4abde10606..b9a1a7b3b7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/fingerprints/ShowFloatingMicrophoneButtonFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/fingerprints/ShowFloatingMicrophoneButtonFingerprint.kt @@ -1,7 +1,7 @@ -package app.revanced.patches.youtube.layout.hide.floatingmicrophone.fingerprints +package app.revanced.patches.youtube.layout.hide.general.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patches.youtube.layout.hide.floatingmicrophone.HideFloatingMicrophoneButtonResourcePatch +import app.revanced.patches.youtube.layout.hide.general.HideLayoutComponentsResourcePatch import app.revanced.util.patch.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode @@ -15,5 +15,5 @@ internal object ShowFloatingMicrophoneButtonFingerprint : LiteralValueFingerprin Opcode.IF_EQZ, Opcode.RETURN_VOID ), - literalSupplier = { HideFloatingMicrophoneButtonResourcePatch.fabButtonId } + literalSupplier = { HideLayoutComponentsResourcePatch.fabButtonId } ) \ No newline at end of file diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index a4e03335ba..85cd186abf 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -113,6 +113,9 @@ This is because Crowdin requires temporarily flattening this file and removing t Hide crowdfunding box Crowdfunding box is hidden Crowdfunding box is shown + Hide floating microphone button + Microphone button hidden + Microphone button shown Hide gray separator Gray separators are hidden Gray separators are shown @@ -568,11 +571,6 @@ This is because Crowdin requires temporarily flattening this file and removing t End screen cards are hidden End screen cards are shown - - Hide floating microphone button - Microphone button hidden - Microphone button shown - Disable ambient mode in fullscreen Ambient mode disabled From 0b7ac0d5fb3ec9ba129d09423da79476dbaa3d22 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Tue, 22 Oct 2024 00:01:58 -0400 Subject: [PATCH 7/9] fix typo --- .../youtube/layout/hide/general/HideLayoutComponentsPatch.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt index badeee4c79..603fa2f912 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt @@ -122,6 +122,7 @@ object HideLayoutComponentsPatch : BytecodePatch( SwitchPreference("revanced_hide_artist_cards"), SwitchPreference("revanced_hide_community_posts"), SwitchPreference("revanced_hide_compact_banner"), + SwitchPreference("revanced_hide_crowdfunding_box"), SwitchPreference("revanced_hide_chips_shelf"), SwitchPreference("revanced_hide_expandable_chip"), SwitchPreference("revanced_hide_feed_survey"), From 753c713afd43cb6ac90bfb5d91794992b22f8503 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Tue, 22 Oct 2024 04:31:30 -0400 Subject: [PATCH 8/9] fix: Merge `Hide comments` --- .../layout/hide/comments/CommentsPatch.kt | 64 +++-------------- .../hide/general/HideLayoutComponentsPatch.kt | 69 +++++++++++-------- .../resources/addresources/values/strings.xml | 43 ++++++------ 3 files changed, 72 insertions(+), 104 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt index 9c595da663..5e89a2d1d8 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt @@ -1,59 +1,13 @@ package app.revanced.patches.youtube.layout.hide.comments -import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.ResourcePatch -import app.revanced.patcher.patch.annotation.CompatiblePackage -import app.revanced.patcher.patch.annotation.Patch -import app.revanced.patches.all.misc.resources.AddResourcesPatch -import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen -import app.revanced.patches.shared.misc.settings.preference.SwitchPreference -import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch -import app.revanced.patches.youtube.misc.settings.SettingsPatch +import app.revanced.patcher.data.BytecodeContext +import app.revanced.patcher.patch.BytecodePatch +import app.revanced.patches.youtube.layout.hide.general.HideLayoutComponentsPatch -@Patch( - name = "Comments", - description = "Adds options to hide components related to comments.", - dependencies = [ - SettingsPatch::class, - LithoFilterPatch::class, - AddResourcesPatch::class - ], - compatiblePackages = [ - CompatiblePackage( - "com.google.android.youtube", - [ - "18.38.44", - "18.49.37", - "19.16.39", - "19.25.37", - "19.34.42", - ] - ) - ] -) +@Deprecated("This patch has been merged to HideLayoutComponentsPatch.") @Suppress("unused") -object CommentsPatch : ResourcePatch() { - private const val FILTER_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/youtube/patches/components/CommentsFilter;" - - override fun execute(context: ResourceContext) { - AddResourcesPatch(this::class) - - SettingsPatch.PreferenceScreen.PLAYER.addPreferences( - PreferenceScreen( - "revanced_comments_screen", - preferences = setOf( - SwitchPreference("revanced_hide_comments_by_members_header"), - SwitchPreference("revanced_hide_comments_section"), - SwitchPreference("revanced_hide_comments_create_a_short_button"), - SwitchPreference("revanced_hide_comments_preview_comment"), - SwitchPreference("revanced_hide_comments_thanks_button"), - SwitchPreference("revanced_hide_comments_timestamp_and_emoji_buttons") - ), - sorting = PreferenceScreen.Sorting.UNSORTED - ) - ) - - LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR) - } -} +object CommentsPatch : BytecodePatch( + dependencies = setOf(HideLayoutComponentsPatch::class), +) { + override fun execute(context: BytecodeContext) { } +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt index 603fa2f912..b9e8c8598f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt @@ -81,6 +81,8 @@ object HideLayoutComponentsPatch : BytecodePatch( "Lapp/revanced/integrations/youtube/patches/components/LayoutComponentsFilter;" private const val DESCRIPTION_COMPONENTS_FILTER_CLASS_NAME = "Lapp/revanced/integrations/youtube/patches/components/DescriptionComponentsFilter;" + private const val COMMENTS_FILTER_CLASS_NAME = + "Lapp/revanced/integrations/youtube/patches/components/CommentsFilter;" private const val CUSTOM_FILTER_CLASS_NAME = "Lapp/revanced/integrations/youtube/patches/components/CustomFilter;" private const val KEYWORD_FILTER_CLASS_NAME = @@ -90,11 +92,6 @@ object HideLayoutComponentsPatch : BytecodePatch( AddResourcesPatch(this::class) SettingsPatch.PreferenceScreen.PLAYER.addPreferences( - SwitchPreference("revanced_hide_channel_bar"), - SwitchPreference("revanced_hide_channel_guidelines"), - SwitchPreference("revanced_hide_channel_member_shelf"), - SwitchPreference("revanced_hide_channel_watermark"), - SwitchPreference("revanced_hide_community_guidelines"), PreferenceScreen( key = "revanced_hide_description_components_screen", preferences = setOf( @@ -106,6 +103,23 @@ object HideLayoutComponentsPatch : BytecodePatch( SwitchPreference("revanced_hide_transcript_section"), ), ), + PreferenceScreen( + "revanced_comments_screen", + preferences = setOf( + SwitchPreference("revanced_hide_comments_by_members_header"), + SwitchPreference("revanced_hide_comments_section"), + SwitchPreference("revanced_hide_comments_create_a_short_button"), + SwitchPreference("revanced_hide_comments_preview_comment"), + SwitchPreference("revanced_hide_comments_thanks_button"), + SwitchPreference("revanced_hide_comments_timestamp_and_emoji_buttons") + ), + sorting = PreferenceScreen.Sorting.UNSORTED + ), + SwitchPreference("revanced_hide_channel_bar"), + SwitchPreference("revanced_hide_channel_guidelines"), + SwitchPreference("revanced_hide_channel_member_shelf"), + SwitchPreference("revanced_hide_channel_watermark"), + SwitchPreference("revanced_hide_community_guidelines"), SwitchPreference("revanced_hide_emergency_box"), SwitchPreference("revanced_hide_info_panels"), SwitchPreference("revanced_hide_join_membership_button"), @@ -118,6 +132,27 @@ object HideLayoutComponentsPatch : BytecodePatch( ) SettingsPatch.PreferenceScreen.FEED.addPreferences( + PreferenceScreen( + key = "revanced_hide_keyword_content_screen", + sorting = Sorting.UNSORTED, + preferences = setOf( + SwitchPreference("revanced_hide_keyword_content_home"), + SwitchPreference("revanced_hide_keyword_content_subscriptions"), + SwitchPreference("revanced_hide_keyword_content_search"), + TextPreference("revanced_hide_keyword_content_phrases", inputType = InputType.TEXT_MULTI_LINE), + NonInteractivePreference("revanced_hide_keyword_content_about"), + NonInteractivePreference(key = "revanced_hide_keyword_content_about_whole_words", + tag = "app.revanced.integrations.youtube.settings.preference.HtmlPreference") + ) + ), + PreferenceScreen( + key = "revanced_hide_filter_bar_screen", + preferences = setOf( + SwitchPreference("revanced_hide_filter_bar_feed_in_feed"), + SwitchPreference("revanced_hide_filter_bar_feed_in_search"), + SwitchPreference("revanced_hide_filter_bar_feed_in_related_videos"), + ), + ), SwitchPreference("revanced_hide_album_cards"), SwitchPreference("revanced_hide_artist_cards"), SwitchPreference("revanced_hide_community_posts"), @@ -139,27 +174,6 @@ object HideLayoutComponentsPatch : BytecodePatch( SwitchPreference("revanced_hide_search_result_shelf_header"), SwitchPreference("revanced_hide_show_more_button"), SwitchPreference("revanced_hide_doodles"), - PreferenceScreen( - key = "revanced_hide_keyword_content_screen", - sorting = Sorting.UNSORTED, - preferences = setOf( - SwitchPreference("revanced_hide_keyword_content_home"), - SwitchPreference("revanced_hide_keyword_content_subscriptions"), - SwitchPreference("revanced_hide_keyword_content_search"), - TextPreference("revanced_hide_keyword_content_phrases", inputType = InputType.TEXT_MULTI_LINE), - NonInteractivePreference("revanced_hide_keyword_content_about"), - NonInteractivePreference(key = "revanced_hide_keyword_content_about_whole_words", - tag = "app.revanced.integrations.youtube.settings.preference.HtmlPreference") - ) - ), - PreferenceScreen( - key = "revanced_hide_filter_bar_screen", - preferences = setOf( - SwitchPreference("revanced_hide_filter_bar_feed_in_feed"), - SwitchPreference("revanced_hide_filter_bar_feed_in_search"), - SwitchPreference("revanced_hide_filter_bar_feed_in_related_videos"), - ), - ) ) SettingsPatch.PreferenceScreen.GENERAL_LAYOUT.addPreferences( @@ -177,6 +191,7 @@ object HideLayoutComponentsPatch : BytecodePatch( LithoFilterPatch.addFilter(LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR) LithoFilterPatch.addFilter(DESCRIPTION_COMPONENTS_FILTER_CLASS_NAME) + LithoFilterPatch.addFilter(COMMENTS_FILTER_CLASS_NAME) LithoFilterPatch.addFilter(KEYWORD_FILTER_CLASS_NAME) LithoFilterPatch.addFilter(CUSTOM_FILTER_CLASS_NAME) @@ -290,7 +305,7 @@ object HideLayoutComponentsPatch : BytecodePatch( """ invoke-static { v$register }, $LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR->hideFloatingMicrophoneButton(Z)Z move-result v$register - """ + """ ) } } diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index 85cd186abf..05c06137ac 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -253,6 +253,27 @@ This is because Crowdin requires temporarily flattening this file and removing t Hidden in related videos Shown in related videos + Comments + Hide or show comments section components + Hide \'Comments by members\' header + \'Comments by members\' header is hidden + \'Comments by members\' header is shown + Hide comments section + Comments section is hidden + Comments section is shown + Hide \'Create a Short\' button + \'Create a Short\' button is hidden + \'Create a Short\' button is shown + Hide preview comment + Preview comment is hidden + Preview comment is shown + Hide thanks button + Thanks button is hidden + Thanks button is shown + Hide timestamp and emoji buttons + Timestamp and emoji buttons are hidden + Timestamp and emoji buttons are shown + Hide YouTube Doodles Search bar Doodles are hidden @@ -544,28 +565,6 @@ This is because Crowdin requires temporarily flattening this file and removing t Buttons are hidden Buttons are shown - - Comments - Hide or show comments section components - Hide \'Comments by members\' header - \'Comments by members\' header is hidden - \'Comments by members\' header is shown - Hide comments section - Comments section is hidden - Comments section is shown - Hide \'Create a Short\' button - \'Create a Short\' button is hidden - \'Create a Short\' button is shown - Hide preview comment - Preview comment is hidden - Preview comment is shown - Hide thanks button - Thanks button is hidden - Thanks button is shown - Hide timestamp and emoji buttons - Timestamp and emoji buttons are hidden - Timestamp and emoji buttons are shown - Hide end screen cards End screen cards are hidden From d7f01a3f1b77853d5907814e523755cd1e4266b9 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Tue, 22 Oct 2024 04:38:02 -0400 Subject: [PATCH 9/9] fix compatibility --- .../patches/youtube/layout/hide/comments/CommentsPatch.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt index 5e89a2d1d8..c9d58438e0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt @@ -1,13 +1,13 @@ package app.revanced.patches.youtube.layout.hide.comments -import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.patch.BytecodePatch +import app.revanced.patcher.data.ResourceContext +import app.revanced.patcher.patch.ResourcePatch import app.revanced.patches.youtube.layout.hide.general.HideLayoutComponentsPatch @Deprecated("This patch has been merged to HideLayoutComponentsPatch.") @Suppress("unused") -object CommentsPatch : BytecodePatch( +object CommentsPatch : ResourcePatch( dependencies = setOf(HideLayoutComponentsPatch::class), ) { - override fun execute(context: BytecodeContext) { } + override fun execute(context: ResourceContext) { } } \ No newline at end of file