From 467d8387e646c88d24a30406a5b2e84065ef4d54 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 26 Sep 2022 09:00:14 +0200 Subject: [PATCH] feat: remove unused option `-r` --- .../app/revanced/cli/command/MainCommand.kt | 20 +++++-------------- .../app/revanced/cli/patcher/Patcher.kt | 4 ++-- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/main/kotlin/app/revanced/cli/command/MainCommand.kt b/src/main/kotlin/app/revanced/cli/command/MainCommand.kt index e1d0ae9d..a1f907c5 100644 --- a/src/main/kotlin/app/revanced/cli/command/MainCommand.kt +++ b/src/main/kotlin/app/revanced/cli/command/MainCommand.kt @@ -92,9 +92,6 @@ internal object MainCommand : Runnable { @Option(names = ["-i", "--include"], description = ["Include patches"]) var includedPatches = arrayOf() - @Option(names = ["-r", "--resource-patcher"], description = ["Disable patching resources"]) - var disableResourcePatching: Boolean = false - @Option(names = ["--experimental"], description = ["Disable patch version compatibility patch"]) var experimental: Boolean = false @@ -143,7 +140,6 @@ internal object MainCommand : Runnable { PatcherOptions( args.inputFile, pArgs.cacheDirectory, - !pArgs.disableResourcePatching, pArgs.aaptPath, pArgs.cacheDirectory, PatcherLogger @@ -210,19 +206,13 @@ internal object MainCommand : Runnable { } private fun uninstall() { - // temporarily get package name using Patcher method - // fix: abstract options in patcher - val patcher = app.revanced.patcher.Patcher( - PatcherOptions( - args.inputFile, - "uninstaller-cache", + val adb: Adb? = args.deploy?.let { + Adb( + File("placeholder_file"), + app.revanced.patcher.Patcher(PatcherOptions(args.inputFile, "")).data.packageMetadata.packageName, + args.deploy!!, false ) - ) - File("uninstaller-cache").deleteRecursively() - - val adb: Adb? = args.deploy?.let { - Adb(File("placeholder_file"), patcher.data.packageMetadata.packageName, args.deploy!!, false) } adb?.uninstall() } diff --git a/src/main/kotlin/app/revanced/cli/patcher/Patcher.kt b/src/main/kotlin/app/revanced/cli/patcher/Patcher.kt index c75dd842..1f753258 100644 --- a/src/main/kotlin/app/revanced/cli/patcher/Patcher.kt +++ b/src/main/kotlin/app/revanced/cli/patcher/Patcher.kt @@ -35,10 +35,10 @@ internal object Patcher { outputFileSystem.write(it.name, it.stream.readAllBytes()) } - if (!args.disableResourcePatching) { + result.resourceFile?.let { logger.info("Writing resources...") - ZipFileSystemUtils(result.resourceFile!!).use { resourceFileSystem -> + ZipFileSystemUtils(it).use { resourceFileSystem -> val resourceFiles = resourceFileSystem.getFile(File.separator) outputFileSystem.writePathRecursively(resourceFiles) }