mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2024-11-10 09:08:04 +01:00
refactor: remove deprecated methods in ResourceData.kt
This commit is contained in:
parent
2b492e7a5e
commit
35749454ab
2 changed files with 0 additions and 22 deletions
|
@ -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))
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue