From 771df3852c999cb90a638d2e3ccc3330f3a76e1b Mon Sep 17 00:00:00 2001 From: inotia00 <108592928+inotia00@users.noreply.github.com> Date: Thu, 9 Nov 2023 16:18:29 +0900 Subject: [PATCH] feat(YouTube): remove `Force hide player button background` patch (deprecated) --- .../PlayerButtonBackgroundPatch.kt | 63 ------------------- 1 file changed, 63 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/forcebackground/PlayerButtonBackgroundPatch.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/forcebackground/PlayerButtonBackgroundPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/forcebackground/PlayerButtonBackgroundPatch.kt deleted file mode 100644 index b53795387..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/forcebackground/PlayerButtonBackgroundPatch.kt +++ /dev/null @@ -1,63 +0,0 @@ -package app.revanced.patches.youtube.layout.forcebackground - -import app.revanced.extensions.doRecursively -import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.ResourcePatch -import app.revanced.patcher.patch.annotation.CompatiblePackage -import app.revanced.patcher.patch.annotation.Patch -import app.revanced.patches.youtube.utils.settings.SettingsPatch -import org.w3c.dom.Element - -@Patch( - name = "Force hide player button background", - description = "Force hides the background from the video player buttons.", - dependencies = [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" - ] - ) - ], - use = false -) -@Suppress("unused") -object PlayerButtonBackgroundPatch : ResourcePatch() { - override fun execute(context: ResourceContext) { - context.xmlEditor["res/drawable/player_button_circle_background.xml"].use { editor -> - editor.file.doRecursively { node -> - arrayOf("color").forEach replacement@{ replacement -> - if (node !is Element) return@replacement - - node.getAttributeNode("android:$replacement")?.let { attribute -> - attribute.textContent = "@android:color/transparent" - } - } - } - } - - val prefs = context["res/xml/revanced_prefs.xml"] - prefs.writeText( - prefs.readText() - .replace( - "HIDE_PLAYER_BUTTON_BACKGROUND", - "FORCE_BUTTON_BACKGROUND" - ) - ) - - } -} \ No newline at end of file