diff --git a/build.gradle.kts b/build.gradle.kts index 06c9a9b40..155c8eb65 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -22,7 +22,7 @@ repositories { dependencies { implementation(kotlin("stdlib")) - implementation("app.revanced:revanced-patcher:2.4.0") + implementation("app.revanced:revanced-patcher:2.9.0") implementation("app.revanced:multidexlib2:2.5.2.r2") } diff --git a/src/main/kotlin/app/revanced/extensions/Extensions.kt b/src/main/kotlin/app/revanced/extensions/Extensions.kt index b7bf29de5..e4bb1678a 100644 --- a/src/main/kotlin/app/revanced/extensions/Extensions.kt +++ b/src/main/kotlin/app/revanced/extensions/Extensions.kt @@ -14,7 +14,6 @@ import org.jf.dexlib2.builder.instruction.BuilderInstruction21t import org.jf.dexlib2.builder.instruction.BuilderInstruction35c import org.jf.dexlib2.immutable.reference.ImmutableMethodReference import org.w3c.dom.Node -import java.io.OutputStream import java.nio.file.Files // TODO: this method does not make sense here @@ -146,7 +145,7 @@ fun ResourceData.injectStrings( // open source strings.xml val sourceInputStream = classLoader.getResourceAsStream("$patchDirectoryPath/$relativePath") ?: throw PatchResultError("failed to open '$patchDirectoryPath/$relativePath'") - xmlEditor[sourceInputStream, OutputStream.nullOutputStream()].use { sourceStringsXml -> + xmlEditor[sourceInputStream].use { sourceStringsXml -> val strings = sourceStringsXml.file.getElementsByTagName("resources").item(0).childNodes // open target strings.xml diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/resource/patch/SponsorBlockResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/resource/patch/SponsorBlockResourcePatch.kt index 9492cc209..5ed75ccf1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/resource/patch/SponsorBlockResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/resource/patch/SponsorBlockResourcePatch.kt @@ -10,7 +10,6 @@ import app.revanced.patcher.patch.impl.ResourcePatch import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch import app.revanced.util.resources.ResourceUtils.copyXmlNode -import java.io.OutputStream import java.nio.file.Files @Name("sponsorblock-resource-patch") @@ -29,7 +28,7 @@ class SponsorBlockResourcePatch : ResourcePatch() { // copy nodes from the resources node to the real resource node "resources".copyXmlNode( - data.xmlEditor[stringsResourceInputStream, OutputStream.nullOutputStream()], + data.xmlEditor[stringsResourceInputStream], data.xmlEditor["res/$stringsResourcePath"] ).close() // close afterwards @@ -78,7 +77,7 @@ class SponsorBlockResourcePatch : ResourcePatch() { val targetXmlEditor = data.xmlEditor["res/$path/$resource.xml"] "RelativeLayout".copyXmlNode( - data.xmlEditor[hostingResourceStream, OutputStream.nullOutputStream()], + data.xmlEditor[hostingResourceStream], targetXmlEditor ).also { val children = targetXmlEditor.file.getElementsByTagName("RelativeLayout").item(0).childNodes diff --git a/src/main/kotlin/app/revanced/util/resources/ResourceUtils.kt b/src/main/kotlin/app/revanced/util/resources/ResourceUtils.kt index 718a49c9b..bf874d3b0 100644 --- a/src/main/kotlin/app/revanced/util/resources/ResourceUtils.kt +++ b/src/main/kotlin/app/revanced/util/resources/ResourceUtils.kt @@ -2,7 +2,6 @@ package app.revanced.util.resources import app.revanced.patcher.data.impl.DomFileEditor import app.revanced.patcher.data.impl.ResourceData -import java.io.OutputStream import java.nio.file.Files internal object ResourceUtils { @@ -44,7 +43,7 @@ internal object ResourceUtils { // Copy nodes from the resources node to the real resource node elementTag.copyXmlNode( - this.xmlEditor[stringsResourceInputStream, OutputStream.nullOutputStream()], + this.xmlEditor[stringsResourceInputStream], this.xmlEditor["res/$targetResource"] ).close() }