add hide-button-shelf patch

This commit is contained in:
inotia00
2023-04-28 11:29:32 +09:00
parent 8f12e6ae93
commit 420cd86070

View File

@ -0,0 +1,35 @@
package app.revanced.patches.music.layout.buttonshelf.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.misc.litho.patch.MusicLithoFilterPatch
import app.revanced.patches.music.misc.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.enum.CategoryType
@Patch
@Name("hide-button-shelf")
@Description("Hides the button shelf from homepage and explorer.")
@DependsOn(
[
MusicLithoFilterPatch::class,
MusicSettingsPatch::class
]
)
@YouTubeMusicCompatibility
@Version("0.0.1")
class HideButtonShelfPatch : BytecodePatch() {
override fun execute(context: BytecodeContext): PatchResult {
MusicSettingsPatch.addMusicPreference(CategoryType.LAYOUT, "revanced_hide_button_shelf", "false")
return PatchResultSuccess()
}
}