2023-09-20 05:33:02 +02:00
|
|
|
package app.revanced.patches.youtube.layout.hide.comments
|
2022-10-25 23:33:49 +02:00
|
|
|
|
|
|
|
import app.revanced.patcher.data.ResourceContext
|
|
|
|
import app.revanced.patcher.patch.ResourcePatch
|
2023-09-20 05:33:02 +02:00
|
|
|
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
|
|
|
import app.revanced.patcher.patch.annotation.Patch
|
2024-01-27 02:34:01 +01:00
|
|
|
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
|
2023-09-20 05:33:02 +02:00
|
|
|
import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch
|
|
|
|
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|
|
|
|
|
|
|
@Patch(
|
|
|
|
name = "Comments",
|
2024-01-01 16:30:04 +01:00
|
|
|
description = "Adds options to hide components related to comments.",
|
2023-09-20 05:33:02 +02:00
|
|
|
dependencies = [
|
|
|
|
SettingsPatch::class,
|
2024-01-27 02:34:01 +01:00
|
|
|
LithoFilterPatch::class,
|
|
|
|
AddResourcesPatch::class
|
2023-09-20 05:33:02 +02:00
|
|
|
],
|
|
|
|
compatiblePackages = [
|
|
|
|
CompatiblePackage(
|
|
|
|
"com.google.android.youtube",
|
|
|
|
[
|
2023-09-28 01:28:25 +02:00
|
|
|
"18.32.39",
|
2023-10-08 03:37:42 +02:00
|
|
|
"18.37.36",
|
2023-11-12 16:43:11 +01:00
|
|
|
"18.38.44",
|
2023-11-12 17:01:49 +01:00
|
|
|
"18.43.45",
|
|
|
|
"18.44.41",
|
2024-01-16 19:54:06 +01:00
|
|
|
"18.45.43",
|
|
|
|
"18.48.39",
|
|
|
|
"18.49.37",
|
2024-01-17 21:24:55 +01:00
|
|
|
"19.01.34",
|
2024-01-24 14:19:02 +01:00
|
|
|
"19.02.39",
|
2024-02-04 18:38:19 +01:00
|
|
|
"19.03.36",
|
2024-03-11 14:20:07 +01:00
|
|
|
"19.04.38",
|
|
|
|
"19.05.36",
|
|
|
|
"19.06.39",
|
|
|
|
"19.07.40",
|
|
|
|
"19.08.36",
|
2024-04-21 01:15:31 +02:00
|
|
|
"19.09.38",
|
|
|
|
"19.10.39",
|
|
|
|
"19.11.43"
|
2023-09-20 05:33:02 +02:00
|
|
|
]
|
|
|
|
)
|
|
|
|
]
|
|
|
|
)
|
|
|
|
@Suppress("unused")
|
|
|
|
object CommentsPatch : ResourcePatch() {
|
|
|
|
private const val FILTER_CLASS_DESCRIPTOR =
|
2024-01-01 16:33:07 +01:00
|
|
|
"Lapp/revanced/integrations/youtube/patches/components/CommentsFilter;"
|
2022-10-25 23:33:49 +02:00
|
|
|
|
2023-08-27 21:40:49 +02:00
|
|
|
override fun execute(context: ResourceContext) {
|
2024-01-27 02:34:01 +01:00
|
|
|
AddResourcesPatch(this::class)
|
|
|
|
|
2024-03-02 08:27:05 +01:00
|
|
|
SettingsPatch.PreferenceScreen.PLAYER.addPreferences(
|
2022-10-25 23:33:49 +02:00
|
|
|
PreferenceScreen(
|
2024-03-02 08:27:05 +01:00
|
|
|
"revanced_comments_screen",
|
2024-01-27 02:34:01 +01:00
|
|
|
preferences = setOf(
|
2024-04-04 12:19:03 +02:00
|
|
|
SwitchPreference("revanced_hide_preview_comment"),
|
|
|
|
SwitchPreference("revanced_hide_comments_section")
|
|
|
|
),
|
|
|
|
sorting = PreferenceScreen.Sorting.UNSORTED
|
2022-10-25 23:33:49 +02:00
|
|
|
)
|
|
|
|
)
|
2024-01-27 02:34:01 +01:00
|
|
|
|
|
|
|
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
2022-10-25 23:33:49 +02:00
|
|
|
}
|
2023-06-18 01:47:31 +02:00
|
|
|
}
|