diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/general/resource/patch/GeneralResourceAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/general/resource/patch/GeneralResourceAdsPatch.kt index 0366ece8..bee2ec9c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/general/resource/patch/GeneralResourceAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/general/resource/patch/GeneralResourceAdsPatch.kt @@ -6,10 +6,10 @@ import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version import app.revanced.patcher.data.impl.ResourceData -import app.revanced.patcher.patch.annotations.Dependencies -import app.revanced.patcher.patch.impl.ResourcePatch import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultSuccess +import app.revanced.patcher.patch.annotations.Dependencies +import app.revanced.patcher.patch.impl.ResourcePatch import app.revanced.patches.youtube.ad.general.annotation.GeneralAdsCompatibility import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch import org.w3c.dom.Element @@ -43,7 +43,7 @@ class GeneralResourceAdsPatch : ResourcePatch() { if (!it.name.startsWithAny(*resourceFileNames)) return@forEach // for each file in the "layouts" directory replace all necessary attributes content - data.getXmlEditor(it.absolutePath).use { editor -> + data.xmlEditor[it.absolutePath].use { editor -> editor.file.doRecursively { node -> replacements.forEach replacement@{ replacement -> if (node !is Element) return@replacement diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/amoled/patch/AmoledPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/amoled/patch/AmoledPatch.kt index eea0146b..5a0c140f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/amoled/patch/AmoledPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/amoled/patch/AmoledPatch.kt @@ -4,11 +4,11 @@ import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version import app.revanced.patcher.data.impl.ResourceData +import app.revanced.patcher.patch.PatchResult +import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.annotations.Dependencies import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.impl.ResourcePatch -import app.revanced.patcher.patch.PatchResult -import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patches.youtube.layout.amoled.annotations.AmoledCompatibility import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch import org.w3c.dom.Element @@ -26,7 +26,7 @@ import java.io.File @Version("0.0.1") class AmoledPatch : ResourcePatch() { override fun execute(data: ResourceData): PatchResult { - data.getXmlEditor("res${File.separator}values${File.separator}colors.xml").use { editor -> + data.xmlEditor["res${File.separator}values${File.separator}colors.xml"].use { editor -> val resourcesNode = editor.file.getElementsByTagName("resources").item(0) as Element for (i in 0 until resourcesNode.childNodes.length) { diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/manifest/patch/FixLocaleConfigErrorPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/manifest/patch/FixLocaleConfigErrorPatch.kt index 3f3e55d3..ad4abb9c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/manifest/patch/FixLocaleConfigErrorPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/manifest/patch/FixLocaleConfigErrorPatch.kt @@ -4,9 +4,9 @@ import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version import app.revanced.patcher.data.impl.ResourceData -import app.revanced.patcher.patch.impl.ResourcePatch import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultSuccess +import app.revanced.patcher.patch.impl.ResourcePatch import app.revanced.patches.youtube.misc.manifest.annotations.FixLocaleConfigErrorCompatibility import org.w3c.dom.Element @@ -17,7 +17,7 @@ import org.w3c.dom.Element class FixLocaleConfigErrorPatch : ResourcePatch() { override fun execute(data: ResourceData): PatchResult { // create an xml editor instance - data.getXmlEditor("AndroidManifest.xml").use { + data.xmlEditor["AndroidManifest.xml"].use { // edit the application nodes attribute... val applicationNode = it .file