fix(YouTube Music - Hide cast button): Resolve button not hiding

This commit is contained in:
LisoUseInAIKyrios
2025-09-27 16:21:32 +04:00
parent 9afe9afc67
commit 7817885cff

View File

@@ -9,6 +9,9 @@ import app.revanced.patches.all.misc.resources.addResourcesPatch
import app.revanced.patches.music.misc.extension.sharedExtensionPatch
import app.revanced.patches.music.misc.settings.PreferenceScreen
import app.revanced.patches.music.misc.settings.settingsPatch
import app.revanced.patches.shared.misc.mapping.get
import app.revanced.patches.shared.misc.mapping.resourceMappingPatch
import app.revanced.patches.shared.misc.mapping.resourceMappings
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
import app.revanced.util.indexOfFirstInstructionOrThrow
import app.revanced.util.indexOfFirstLiteralInstructionOrThrow
@@ -29,6 +32,7 @@ val hideCastButton = bytecodePatch(
sharedExtensionPatch,
settingsPatch,
addResourcesPatch,
resourceMappingPatch
)
compatibleWith(
@@ -39,6 +43,8 @@ val hideCastButton = bytecodePatch(
)
execute {
playerOverlayChip = resourceMappings["id", "player_overlay_chip"]
addResources("music", "layout.castbutton.hideCastButton")
PreferenceScreen.GENERAL.addPreferences(