mirror of
https://github.com/revanced/revanced-cli.git
synced 2024-11-13 23:29:23 +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"])
|
||||
internal var patchBundles = arrayOf<String>()
|
||||
|
||||
@Option(names = ["-t", "--temp-dir"], description = ["Temporal resource cache directory"], required = true)
|
||||
internal lateinit var cacheDirectory: String
|
||||
@Option(names = ["-t", "--temp-dir"], description = ["Temporal resource cache directory"])
|
||||
internal var cacheDirectory = "revanced-cache"
|
||||
|
||||
@Option(names = ["-r", "--resource-patcher"], description = ["Enable patching resources"])
|
||||
internal var patchResources: Boolean = false
|
||||
@Option(names = ["-r", "--resource-patcher"], description = ["Disable patching resources"])
|
||||
internal var disableResourcePatching: Boolean = false
|
||||
|
||||
@Option(
|
||||
names = ["-c", "--clean"],
|
||||
@ -65,7 +65,7 @@ internal object MainCommand : Runnable {
|
||||
return
|
||||
}
|
||||
|
||||
val patcher = app.revanced.patcher.Patcher(PatcherOptions(inputFile, cacheDirectory, patchResources))
|
||||
val patcher = app.revanced.patcher.Patcher(PatcherOptions(inputFile, cacheDirectory, !disableResourcePatching))
|
||||
|
||||
if (signatureCheck) {
|
||||
patcher.addPatchesFiltered()
|
||||
|
@ -30,7 +30,7 @@ internal class Patcher {
|
||||
zipFileSystem.replaceFile(name, data.data)
|
||||
}
|
||||
|
||||
if (MainCommand.patchResources) {
|
||||
if (!MainCommand.disableResourcePatching) {
|
||||
for (file in File(MainCommand.cacheDirectory).resolve("build/").listFiles(FileFilter { it.isDirectory })
|
||||
?.first()?.listFiles()!!) {
|
||||
if (!file.isDirectory) {
|
||||
|
Loading…
Reference in New Issue
Block a user