diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/general/bytecode/patch/GeneralBytecodeAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/general/bytecode/patch/GeneralBytecodeAdsPatch.kt index d1dcc40b3..d6453fb2e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/general/bytecode/patch/GeneralBytecodeAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/general/bytecode/patch/GeneralBytecodeAdsPatch.kt @@ -5,14 +5,13 @@ import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version import app.revanced.patcher.data.impl.BytecodeData -import app.revanced.patcher.data.impl.proxy import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.annotations.Dependencies -import app.revanced.patcher.patch.annotations.Patch -import app.revanced.patcher.patch.impl.BytecodePatch import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultError 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.BytecodePatch import app.revanced.patcher.util.proxy.mutableTypes.MutableClass import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.smali.toInstructions diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/castbutton/patch/HideCastButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/castbutton/patch/HideCastButtonPatch.kt index e63a46f8e..a199853a6 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/castbutton/patch/HideCastButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/castbutton/patch/HideCastButtonPatch.kt @@ -4,7 +4,6 @@ import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version import app.revanced.patcher.data.impl.BytecodeData -import app.revanced.patcher.data.impl.proxy import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.patch.annotations.Dependencies import app.revanced.patcher.patch.annotations.Patch diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreenpanels/patch/FullscreenPanelsRemoverPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreenpanels/patch/FullscreenPanelsRemoverPatch.kt index f8798ba49..a6edd4c83 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreenpanels/patch/FullscreenPanelsRemoverPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreenpanels/patch/FullscreenPanelsRemoverPatch.kt @@ -4,7 +4,6 @@ import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version import app.revanced.patcher.data.impl.BytecodeData -import app.revanced.patcher.data.impl.proxy import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.impl.BytecodePatch diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/mapping/patch/ResourceIdMappingProviderResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/mapping/patch/ResourceIdMappingProviderResourcePatch.kt index dc1d3f8f1..2d247485b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/mapping/patch/ResourceIdMappingProviderResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/mapping/patch/ResourceIdMappingProviderResourcePatch.kt @@ -5,9 +5,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 org.w3c.dom.Element @Name("resource-id-mapping-provider-resource-patch-dependency") @@ -20,7 +20,7 @@ class ResourceIdMappingProviderResourcePatch : ResourcePatch() { } override fun execute(data: ResourceData): PatchResult { - data.getXmlEditor("res/values/public.xml").use { editor -> + data.xmlEditor["res/values/public.xml"].use { editor -> resourceMappings = buildMap { editor.file.documentElement.doRecursively { node -> if (node !is Element) return@doRecursively diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/microg/patch/bytecode/MicroGBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/microg/patch/bytecode/MicroGBytecodePatch.kt index 023f6871f..a492fcdaf 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/microg/patch/bytecode/MicroGBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/microg/patch/bytecode/MicroGBytecodePatch.kt @@ -5,7 +5,6 @@ import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version import app.revanced.patcher.data.impl.BytecodeData -import app.revanced.patcher.data.impl.proxy import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.replaceInstruction import app.revanced.patcher.patch.annotations.Dependencies @@ -14,7 +13,6 @@ import app.revanced.patcher.patch.impl.BytecodePatch import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.util.proxy.mutableTypes.MutableClass -import app.revanced.patcher.util.smali.toInstruction import app.revanced.patches.youtube.layout.castbutton.patch.HideCastButtonPatch import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/microg/patch/resource/MicroGResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/microg/patch/resource/MicroGResourcePatch.kt index 7a0241b76..0e3c668e1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/microg/patch/resource/MicroGResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/microg/patch/resource/MicroGResourcePatch.kt @@ -4,10 +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.annotations.Patch -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.microg.annotations.MicroGPatchCompatibility import app.revanced.patches.youtube.misc.microg.shared.Constants.BASE_MICROG_PACKAGE_NAME import app.revanced.patches.youtube.misc.microg.shared.Constants.REVANCED_APP_NAME @@ -19,7 +18,7 @@ import app.revanced.patches.youtube.misc.microg.shared.Constants.REVANCED_PACKAG @Version("0.0.1") class MicroGResourcePatch : ResourcePatch() { override fun execute(data: ResourceData): PatchResult { - data.getXmlEditor("res/xml/settings_fragment.xml").use { + data.xmlEditor["res/xml/settings_fragment.xml"].use { val settingsElementIntent = it.file.createElement("intent") settingsElementIntent.setAttribute("android:targetPackage", "$BASE_MICROG_PACKAGE_NAME.android.gms") settingsElementIntent.setAttribute("android:targetClass", "org.microg.gms.ui.SettingsActivity")