diff --git a/src/main/kotlin/app/revanced/patches/music/layout/channelguidelines/patch/HideChannelGuidelinesPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/channelguidelines/patch/HideChannelGuidelinesPatch.kt new file mode 100644 index 000000000..2b9b01c7d --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/music/layout/channelguidelines/patch/HideChannelGuidelinesPatch.kt @@ -0,0 +1,47 @@ +package app.revanced.patches.music.layout.carouselshelf.patch + +import app.revanced.patcher.annotation.Description +import app.revanced.patcher.annotation.Name +import app.revanced.patcher.annotation.Version +import app.revanced.patcher.data.BytecodeContext +import app.revanced.patcher.patch.BytecodePatch +import app.revanced.patcher.patch.PatchResult +import app.revanced.patcher.patch.PatchResultSuccess +import app.revanced.patcher.patch.annotations.DependsOn +import app.revanced.patcher.patch.annotations.Patch +import app.revanced.patches.music.utils.annotations.MusicCompatibility +import app.revanced.patches.music.utils.litho.patch.LithoFilterPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch +import app.revanced.util.enum.CategoryType +import app.revanced.util.integrations.Constants.MUSIC_ADS_PATH + +@Patch +@Name("Hide channel guidelines") +@Description("Hides channel guidelines at the top of comments.") +@DependsOn( + [ + LithoFilterPatch::class, + SettingsPatch::class + ] +) +@MusicCompatibility +@Version("0.0.1") +class HideChannelGuidelinesPatch : BytecodePatch() { + override fun execute(context: BytecodeContext): PatchResult { + + SettingsPatch.addMusicPreference( + CategoryType.LAYOUT, + "revanced_hide_channel_guidelines", + "true" + ) + + LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR) + + return PatchResultSuccess() + } + + private companion object { + private const val FILTER_CLASS_DESCRIPTOR = + "$MUSIC_ADS_PATH/ChannelGuidelinesFilter;" + } +} diff --git a/src/main/resources/music/settings/host/values/strings.xml b/src/main/resources/music/settings/host/values/strings.xml index f58318346..d0d4346e8 100644 --- a/src/main/resources/music/settings/host/values/strings.xml +++ b/src/main/resources/music/settings/host/values/strings.xml @@ -47,6 +47,8 @@ Hide cast button Hides the music category bar at the top of the homepage. Hide category bar + Hides channel guidelines at the top of comments + Hide channel guidelines Hides ads before playing a music. Hide music ads Hide labels in navigation bar.