feat(YouTube): separate the Hide channel profile components patch from Hide layout components patch

This commit is contained in:
inotia00
2023-11-18 02:17:46 +09:00
parent 35988a5500
commit 3993128405
3 changed files with 69 additions and 4 deletions

View File

@ -0,0 +1,63 @@
package app.revanced.patches.youtube.general.descriptions
import app.revanced.patcher.data.BytecodeContext
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.utils.litho.LithoFilterPatch
import app.revanced.patches.youtube.utils.settings.SettingsPatch
import app.revanced.util.integrations.Constants.COMPONENTS_PATH
@Patch(
name = "Hide channel profile components",
description = "Hides channel profile components.",
dependencies = [
LithoFilterPatch::class,
SettingsPatch::class
],
compatiblePackages = [
CompatiblePackage(
"com.google.android.youtube",
[
"18.25.40",
"18.27.36",
"18.29.38",
"18.30.37",
"18.31.40",
"18.32.39",
"18.33.40",
"18.34.38",
"18.35.36",
"18.36.39",
"18.37.36",
"18.38.44",
"18.39.41",
"18.40.34",
"18.41.39",
"18.42.41",
"18.43.45",
"18.44.41",
"18.45.38"
]
)
]
)
@Suppress("unused")
object ChannelProfileComponentsPatch : BytecodePatch() {
override fun execute(context: BytecodeContext) {
LithoFilterPatch.addFilter("$COMPONENTS_PATH/ChannelProfileFilter;")
/**
* Add settings
*/
SettingsPatch.addPreference(
arrayOf(
"PREFERENCE: GENERAL_SETTINGS",
"SETTINGS: HIDE_CHANNEL_PROFILE_COMPONENTS"
)
)
SettingsPatch.updatePatchStatus("Hide channel profile components")
}
}

View File

@ -45,7 +45,6 @@ import app.revanced.util.integrations.Constants.COMPONENTS_PATH
@Suppress("unused")
object LayoutComponentsPatch : BytecodePatch() {
override fun execute(context: BytecodeContext) {
LithoFilterPatch.addFilter("$COMPONENTS_PATH/BrowseStoreButtonFilter;")
LithoFilterPatch.addFilter("$COMPONENTS_PATH/CommunityPostFilter;")
LithoFilterPatch.addFilter("$COMPONENTS_PATH/LayoutComponentsFilter;")
LithoFilterPatch.addFilter("$COMPONENTS_PATH/LayoutComponentsUniversalFilter;")