mirror of
https://github.com/revanced/revanced-patches
synced 2024-12-03 00:22:57 +01:00
build: bump patcher dependency version
This commit is contained in:
parent
553fad3fe1
commit
0039f59a1a
@ -22,7 +22,7 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("stdlib"))
|
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")
|
implementation("app.revanced:multidexlib2:2.5.2.r2")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@ import org.jf.dexlib2.builder.instruction.BuilderInstruction21t
|
|||||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction35c
|
import org.jf.dexlib2.builder.instruction.BuilderInstruction35c
|
||||||
import org.jf.dexlib2.immutable.reference.ImmutableMethodReference
|
import org.jf.dexlib2.immutable.reference.ImmutableMethodReference
|
||||||
import org.w3c.dom.Node
|
import org.w3c.dom.Node
|
||||||
import java.io.OutputStream
|
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
|
|
||||||
// TODO: this method does not make sense here
|
// TODO: this method does not make sense here
|
||||||
@ -146,7 +145,7 @@ fun ResourceData.injectStrings(
|
|||||||
// open source strings.xml
|
// open source strings.xml
|
||||||
val sourceInputStream = classLoader.getResourceAsStream("$patchDirectoryPath/$relativePath")
|
val sourceInputStream = classLoader.getResourceAsStream("$patchDirectoryPath/$relativePath")
|
||||||
?: throw PatchResultError("failed to open '$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
|
val strings = sourceStringsXml.file.getElementsByTagName("resources").item(0).childNodes
|
||||||
|
|
||||||
// open target strings.xml
|
// open target strings.xml
|
||||||
|
@ -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.layout.sponsorblock.annotations.SponsorBlockCompatibility
|
||||||
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
||||||
import app.revanced.util.resources.ResourceUtils.copyXmlNode
|
import app.revanced.util.resources.ResourceUtils.copyXmlNode
|
||||||
import java.io.OutputStream
|
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
|
|
||||||
@Name("sponsorblock-resource-patch")
|
@Name("sponsorblock-resource-patch")
|
||||||
@ -29,7 +28,7 @@ class SponsorBlockResourcePatch : ResourcePatch() {
|
|||||||
|
|
||||||
// copy nodes from the resources node to the real resource node
|
// copy nodes from the resources node to the real resource node
|
||||||
"resources".copyXmlNode(
|
"resources".copyXmlNode(
|
||||||
data.xmlEditor[stringsResourceInputStream, OutputStream.nullOutputStream()],
|
data.xmlEditor[stringsResourceInputStream],
|
||||||
data.xmlEditor["res/$stringsResourcePath"]
|
data.xmlEditor["res/$stringsResourcePath"]
|
||||||
).close() // close afterwards
|
).close() // close afterwards
|
||||||
|
|
||||||
@ -78,7 +77,7 @@ class SponsorBlockResourcePatch : ResourcePatch() {
|
|||||||
|
|
||||||
val targetXmlEditor = data.xmlEditor["res/$path/$resource.xml"]
|
val targetXmlEditor = data.xmlEditor["res/$path/$resource.xml"]
|
||||||
"RelativeLayout".copyXmlNode(
|
"RelativeLayout".copyXmlNode(
|
||||||
data.xmlEditor[hostingResourceStream, OutputStream.nullOutputStream()],
|
data.xmlEditor[hostingResourceStream],
|
||||||
targetXmlEditor
|
targetXmlEditor
|
||||||
).also {
|
).also {
|
||||||
val children = targetXmlEditor.file.getElementsByTagName("RelativeLayout").item(0).childNodes
|
val children = targetXmlEditor.file.getElementsByTagName("RelativeLayout").item(0).childNodes
|
||||||
|
@ -2,7 +2,6 @@ package app.revanced.util.resources
|
|||||||
|
|
||||||
import app.revanced.patcher.data.impl.DomFileEditor
|
import app.revanced.patcher.data.impl.DomFileEditor
|
||||||
import app.revanced.patcher.data.impl.ResourceData
|
import app.revanced.patcher.data.impl.ResourceData
|
||||||
import java.io.OutputStream
|
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
|
|
||||||
internal object ResourceUtils {
|
internal object ResourceUtils {
|
||||||
@ -44,7 +43,7 @@ internal object ResourceUtils {
|
|||||||
|
|
||||||
// Copy nodes from the resources node to the real resource node
|
// Copy nodes from the resources node to the real resource node
|
||||||
elementTag.copyXmlNode(
|
elementTag.copyXmlNode(
|
||||||
this.xmlEditor[stringsResourceInputStream, OutputStream.nullOutputStream()],
|
this.xmlEditor[stringsResourceInputStream],
|
||||||
this.xmlEditor["res/$targetResource"]
|
this.xmlEditor["res/$targetResource"]
|
||||||
).close()
|
).close()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user