mirror of
https://github.com/revanced/revanced-patches
synced 2024-11-09 11:37:02 +01:00
fix(youtube/comments): add missing filter (#2423)
This commit is contained in:
parent
eb908d120d
commit
cab04b3a56
@ -9,21 +9,23 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
|||||||
import app.revanced.patcher.patch.ResourcePatch
|
import app.revanced.patcher.patch.ResourcePatch
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
|
||||||
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
||||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||||
import app.revanced.patches.youtube.layout.hide.comments.annotations.HideCommentsCompatibility
|
import app.revanced.patches.youtube.layout.hide.comments.annotations.HideCommentsCompatibility
|
||||||
|
import app.revanced.patches.youtube.misc.litho.filter.patch.LithoFilterPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("comments")
|
@Name("comments")
|
||||||
@Description("Hides components related to comments.")
|
@Description("Hides components related to comments.")
|
||||||
@HideCommentsCompatibility
|
@HideCommentsCompatibility
|
||||||
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
@DependsOn([SettingsPatch::class, LithoFilterPatch::class])
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class CommentsPatch : ResourcePatch {
|
class CommentsPatch : ResourcePatch {
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
override fun execute(context: ResourceContext): PatchResult {
|
||||||
|
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
||||||
|
|
||||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||||
PreferenceScreen(
|
PreferenceScreen(
|
||||||
"revanced_comments_preference_screen",
|
"revanced_comments_preference_screen",
|
||||||
@ -48,4 +50,8 @@ class CommentsPatch : ResourcePatch {
|
|||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private companion object {
|
||||||
|
const val FILTER_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/components/CommentsFilter;"
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user