mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-29 21:30:19 +02:00
feat(music): add hide-channel-guidelines
patch
This commit is contained in:
parent
ec7f11bef4
commit
98c8214954
@ -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;"
|
||||||
|
}
|
||||||
|
}
|
@ -47,6 +47,8 @@
|
|||||||
<string name="revanced_hide_cast_button_title">Hide cast button</string>
|
<string name="revanced_hide_cast_button_title">Hide cast button</string>
|
||||||
<string name="revanced_hide_category_bar_summary">Hides the music category bar at the top of the homepage.</string>
|
<string name="revanced_hide_category_bar_summary">Hides the music category bar at the top of the homepage.</string>
|
||||||
<string name="revanced_hide_category_bar_title">Hide category bar</string>
|
<string name="revanced_hide_category_bar_title">Hide category bar</string>
|
||||||
|
<string name="revanced_hide_channel_guidelines_summary">Hides channel guidelines at the top of comments</string>
|
||||||
|
<string name="revanced_hide_channel_guidelines_title">Hide channel guidelines</string>
|
||||||
<string name="revanced_hide_music_ads_summary">Hides ads before playing a music.</string>
|
<string name="revanced_hide_music_ads_summary">Hides ads before playing a music.</string>
|
||||||
<string name="revanced_hide_music_ads_title">Hide music ads</string>
|
<string name="revanced_hide_music_ads_title">Hide music ads</string>
|
||||||
<string name="revanced_hide_navigation_label_summary">Hide labels in navigation bar.</string>
|
<string name="revanced_hide_navigation_label_summary">Hide labels in navigation bar.</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user