refactor: simply if condition

This commit is contained in:
oSumAtrIX 2022-06-22 12:23:14 +02:00
parent 4d5efab8bd
commit a48c0860e3
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4

View File

@ -3,8 +3,8 @@ package app.revanced.cli.command
import app.revanced.cli.patcher.Patcher import app.revanced.cli.patcher.Patcher
import app.revanced.cli.signing.Signing import app.revanced.cli.signing.Signing
import app.revanced.patcher.PatcherOptions import app.revanced.patcher.PatcherOptions
import app.revanced.patcher.extensions.PatchExtensions.patchName
import app.revanced.patcher.extensions.PatchExtensions.description import app.revanced.patcher.extensions.PatchExtensions.description
import app.revanced.patcher.extensions.PatchExtensions.patchName
import app.revanced.patcher.util.patch.implementation.JarPatchBundle import app.revanced.patcher.util.patch.implementation.JarPatchBundle
import app.revanced.utils.adb.Adb import app.revanced.utils.adb.Adb
import picocli.CommandLine.* import picocli.CommandLine.*
@ -12,9 +12,7 @@ import java.io.File
import java.nio.file.Files import java.nio.file.Files
@Command( @Command(
name = "ReVanced-CLI", name = "ReVanced-CLI", version = ["1.0.0"], mixinStandardHelpOptions = true
version = ["1.0.0"],
mixinStandardHelpOptions = true
) )
internal object MainCommand : Runnable { internal object MainCommand : Runnable {
@ArgGroup(exclusive = false, multiplicity = "1") @ArgGroup(exclusive = false, multiplicity = "1")
@ -99,9 +97,8 @@ internal object MainCommand : Runnable {
Adb(outputFile, patcher.data.packageMetadata.packageName, args.deploy!!, !args.mount) Adb(outputFile, patcher.data.packageMetadata.packageName, args.deploy!!, !args.mount)
} }
val patchedFile = if (!args.mount) { val patchedFile = if (args.mount) outputFile
File(args.cacheDirectory).resolve("${outputFile.nameWithoutExtension}_raw.apk") else File(args.cacheDirectory).resolve("${outputFile.nameWithoutExtension}_raw.apk")
} else outputFile
Patcher.start(patcher, patchedFile) Patcher.start(patcher, patchedFile)