mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-05 17:14:35 +02:00
fix: materialyou
patch is broken
This commit is contained in:
parent
0bf27dd2a6
commit
fa741d87d1
@ -58,13 +58,7 @@ class MaterialYouPatch : ResourcePatch {
|
||||
}
|
||||
}
|
||||
|
||||
val sourcePath = this.javaClass.classLoader.getResourceAsStream("youtube/materialyou/host/values-v31/colors.xml")!!
|
||||
val relativePath = context.xmlEditor["res/values-v31/colors.xml"]
|
||||
|
||||
"resources".copyXmlNode(
|
||||
context.xmlEditor[sourcePath],
|
||||
relativePath
|
||||
)
|
||||
context.copyXmlNode("youtube/materialyou/host", "values-v31/colors.xml", "resources")
|
||||
|
||||
/*
|
||||
* Add settings
|
||||
|
@ -44,15 +44,18 @@ internal object IconHelper {
|
||||
iconName
|
||||
)
|
||||
|
||||
this.xmlEditor["res/values-v31/styles.xml"].use { editor ->
|
||||
with(editor.file) {
|
||||
val resourcesNode = getElementsByTagName("resources").item(0) as Element
|
||||
this.xmlEditor["res/values-v31/styles.xml"].use { dom ->
|
||||
val applicationNode = dom
|
||||
.file
|
||||
.getElementsByTagName("resources")
|
||||
.item(0) as Element
|
||||
|
||||
for (i in 0 until resourcesNode.childNodes.length) {
|
||||
val node = resourcesNode.childNodes.item(i) as? Element ?: continue
|
||||
|
||||
if (node.getAttribute("name") == "Base.Theme.YouTube.Launcher") {
|
||||
node.removeChild(node.childNodes.item(0))
|
||||
applicationNode.getElementsByTagName("style").also { list ->
|
||||
for (i in 0 until list.length) {
|
||||
val element = list.item(i) as? Element ?: continue
|
||||
if (element.getAttribute("name") == "Base.Theme.YouTube.Launcher") {
|
||||
element.removeChild(element.firstChild)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user