Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
feat: remove unused option -r
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Sep 26, 2022
1 parent 65637c8 commit 467d838
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
20 changes: 5 additions & 15 deletions src/main/kotlin/app/revanced/cli/command/MainCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ internal object MainCommand : Runnable {
@Option(names = ["-i", "--include"], description = ["Include patches"])
var includedPatches = arrayOf<String>()

@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

Expand Down Expand Up @@ -143,7 +140,6 @@ internal object MainCommand : Runnable {
PatcherOptions(
args.inputFile,
pArgs.cacheDirectory,
!pArgs.disableResourcePatching,
pArgs.aaptPath,
pArgs.cacheDirectory,
PatcherLogger
Expand Down Expand Up @@ -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()
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/app/revanced/cli/patcher/Patcher.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 467d838

Please sign in to comment.