feat: remove unused option -r

This commit is contained in:
oSumAtrIX 2022-09-26 09:00:14 +02:00
parent 65637c8b3a
commit 467d8387e6
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
2 changed files with 7 additions and 17 deletions

View File

@ -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
@ -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()
}

View File

@ -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)
}