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"]) @Option(names = ["-i", "--include"], description = ["Include patches"])
var includedPatches = arrayOf<String>() 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"]) @Option(names = ["--experimental"], description = ["Disable patch version compatibility patch"])
var experimental: Boolean = false var experimental: Boolean = false
@ -143,7 +140,6 @@ internal object MainCommand : Runnable {
PatcherOptions( PatcherOptions(
args.inputFile, args.inputFile,
pArgs.cacheDirectory, pArgs.cacheDirectory,
!pArgs.disableResourcePatching,
pArgs.aaptPath, pArgs.aaptPath,
pArgs.cacheDirectory, pArgs.cacheDirectory,
PatcherLogger PatcherLogger
@ -210,19 +206,13 @@ internal object MainCommand : Runnable {
} }
private fun uninstall() { private fun uninstall() {
// temporarily get package name using Patcher method val adb: Adb? = args.deploy?.let {
// fix: abstract options in patcher Adb(
val patcher = app.revanced.patcher.Patcher( File("placeholder_file"),
PatcherOptions( app.revanced.patcher.Patcher(PatcherOptions(args.inputFile, "")).data.packageMetadata.packageName,
args.inputFile, args.deploy!!,
"uninstaller-cache",
false false
) )
)
File("uninstaller-cache").deleteRecursively()
val adb: Adb? = args.deploy?.let {
Adb(File("placeholder_file"), patcher.data.packageMetadata.packageName, args.deploy!!, false)
} }
adb?.uninstall() adb?.uninstall()
} }

View File

@ -35,10 +35,10 @@ internal object Patcher {
outputFileSystem.write(it.name, it.stream.readAllBytes()) outputFileSystem.write(it.name, it.stream.readAllBytes())
} }
if (!args.disableResourcePatching) { result.resourceFile?.let {
logger.info("Writing resources...") logger.info("Writing resources...")
ZipFileSystemUtils(result.resourceFile!!).use { resourceFileSystem -> ZipFileSystemUtils(it).use { resourceFileSystem ->
val resourceFiles = resourceFileSystem.getFile(File.separator) val resourceFiles = resourceFileSystem.getFile(File.separator)
outputFileSystem.writePathRecursively(resourceFiles) outputFileSystem.writePathRecursively(resourceFiles)
} }