From 35749454abd160ae61b3219eec0c0efd5772c5a7 Mon Sep 17 00:00:00 2001 From: Lucaskyy Date: Sun, 26 Jun 2022 16:53:25 +0200 Subject: [PATCH] refactor: remove deprecated methods in ResourceData.kt --- .../app/revanced/patcher/data/impl/ResourceData.kt | 10 ---------- .../usage/resource/patch/ExampleResourcePatch.kt | 12 ------------ 2 files changed, 22 deletions(-) diff --git a/src/main/kotlin/app/revanced/patcher/data/impl/ResourceData.kt b/src/main/kotlin/app/revanced/patcher/data/impl/ResourceData.kt index 4ed7bb4..c02b031 100644 --- a/src/main/kotlin/app/revanced/patcher/data/impl/ResourceData.kt +++ b/src/main/kotlin/app/revanced/patcher/data/impl/ResourceData.kt @@ -15,16 +15,6 @@ class ResourceData(private val resourceCacheDirectory: File) : Data { fun forEach(action: (File) -> Unit) = resourceCacheDirectory.walkTopDown().forEach(action) fun get(path: String) = resolve(path) - fun replace(path: String, oldValue: String, newValue: String, oldValueIsRegex: Boolean = false) { - // TODO: buffer this somehow - val content = resolve(path).readText() - - if (oldValueIsRegex) { - content.replace(Regex(oldValue), newValue) - return - } - } - fun getXmlEditor(path: String) = DomFileEditor(resolve(path)) } diff --git a/src/test/kotlin/app/revanced/patcher/usage/resource/patch/ExampleResourcePatch.kt b/src/test/kotlin/app/revanced/patcher/usage/resource/patch/ExampleResourcePatch.kt index 4a9d535..3d0f33f 100644 --- a/src/test/kotlin/app/revanced/patcher/usage/resource/patch/ExampleResourcePatch.kt +++ b/src/test/kotlin/app/revanced/patcher/usage/resource/patch/ExampleResourcePatch.kt @@ -30,18 +30,6 @@ class ExampleResourcePatch : ResourcePatch() { ) } - // iterate through all available resources - data.forEach { - if (it.extension.lowercase() != "xml") return@forEach - - data.replace( - it.path, - "\\ddip", // regex supported - "0dip", - true - ) - } - return PatchResultSuccess() } } \ No newline at end of file