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")!!
|
context.copyXmlNode("youtube/materialyou/host", "values-v31/colors.xml", "resources")
|
||||||
val relativePath = context.xmlEditor["res/values-v31/colors.xml"]
|
|
||||||
|
|
||||||
"resources".copyXmlNode(
|
|
||||||
context.xmlEditor[sourcePath],
|
|
||||||
relativePath
|
|
||||||
)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add settings
|
* Add settings
|
||||||
|
@ -44,15 +44,18 @@ internal object IconHelper {
|
|||||||
iconName
|
iconName
|
||||||
)
|
)
|
||||||
|
|
||||||
this.xmlEditor["res/values-v31/styles.xml"].use { editor ->
|
this.xmlEditor["res/values-v31/styles.xml"].use { dom ->
|
||||||
with(editor.file) {
|
val applicationNode = dom
|
||||||
val resourcesNode = getElementsByTagName("resources").item(0) as Element
|
.file
|
||||||
|
.getElementsByTagName("resources")
|
||||||
|
.item(0) as Element
|
||||||
|
|
||||||
for (i in 0 until resourcesNode.childNodes.length) {
|
applicationNode.getElementsByTagName("style").also { list ->
|
||||||
val node = resourcesNode.childNodes.item(i) as? Element ?: continue
|
for (i in 0 until list.length) {
|
||||||
|
val element = list.item(i) as? Element ?: continue
|
||||||
if (node.getAttribute("name") == "Base.Theme.YouTube.Launcher") {
|
if (element.getAttribute("name") == "Base.Theme.YouTube.Launcher") {
|
||||||
node.removeChild(node.childNodes.item(0))
|
element.removeChild(element.firstChild)
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user