mirror of
https://github.com/revanced/revanced-cli.git
synced 2024-12-04 17:32:53 +01:00
feat: add path for cacheDirectory
and enable resource patching by default
This commit is contained in:
parent
bd185133bc
commit
54c0a03d44
@ -22,11 +22,11 @@ internal object MainCommand : Runnable {
|
|||||||
@Option(names = ["-p", "--patches"], description = ["One or more bundles of patches"])
|
@Option(names = ["-p", "--patches"], description = ["One or more bundles of patches"])
|
||||||
internal var patchBundles = arrayOf<String>()
|
internal var patchBundles = arrayOf<String>()
|
||||||
|
|
||||||
@Option(names = ["-t", "--temp-dir"], description = ["Temporal resource cache directory"], required = true)
|
@Option(names = ["-t", "--temp-dir"], description = ["Temporal resource cache directory"])
|
||||||
internal lateinit var cacheDirectory: String
|
internal var cacheDirectory = "revanced-cache"
|
||||||
|
|
||||||
@Option(names = ["-r", "--resource-patcher"], description = ["Enable patching resources"])
|
@Option(names = ["-r", "--resource-patcher"], description = ["Disable patching resources"])
|
||||||
internal var patchResources: Boolean = false
|
internal var disableResourcePatching: Boolean = false
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
names = ["-c", "--clean"],
|
names = ["-c", "--clean"],
|
||||||
@ -65,7 +65,7 @@ internal object MainCommand : Runnable {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
val patcher = app.revanced.patcher.Patcher(PatcherOptions(inputFile, cacheDirectory, patchResources))
|
val patcher = app.revanced.patcher.Patcher(PatcherOptions(inputFile, cacheDirectory, !disableResourcePatching))
|
||||||
|
|
||||||
if (signatureCheck) {
|
if (signatureCheck) {
|
||||||
patcher.addPatchesFiltered()
|
patcher.addPatchesFiltered()
|
||||||
|
@ -30,7 +30,7 @@ internal class Patcher {
|
|||||||
zipFileSystem.replaceFile(name, data.data)
|
zipFileSystem.replaceFile(name, data.data)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MainCommand.patchResources) {
|
if (!MainCommand.disableResourcePatching) {
|
||||||
for (file in File(MainCommand.cacheDirectory).resolve("build/").listFiles(FileFilter { it.isDirectory })
|
for (file in File(MainCommand.cacheDirectory).resolve("build/").listFiles(FileFilter { it.isDirectory })
|
||||||
?.first()?.listFiles()!!) {
|
?.first()?.listFiles()!!) {
|
||||||
if (!file.isDirectory) {
|
if (!file.isDirectory) {
|
||||||
|
Loading…
Reference in New Issue
Block a user