diff --git a/src/main/kotlin/app/revanced/cli/command/ListPatchesCommand.kt b/src/main/kotlin/app/revanced/cli/command/ListPatchesCommand.kt index 5b50d1b..92f4d37 100644 --- a/src/main/kotlin/app/revanced/cli/command/ListPatchesCommand.kt +++ b/src/main/kotlin/app/revanced/cli/command/ListPatchesCommand.kt @@ -9,17 +9,23 @@ import java.io.File import java.util.logging.Logger -@Command(name = "list-patches", description = ["List patches from supplied patch bundles."]) +@Command( + name = "list-patches", + description = ["List patches from supplied patch bundles."] +) internal object ListPatchesCommand : Runnable { private val logger = Logger.getLogger(ListPatchesCommand::class.java.name) @Parameters( - description = ["Paths to patch bundles."], arity = "1..*" + description = ["Paths to patch bundles."], + arity = "1..*" ) private lateinit var patchBundles: Array @Option( - names = ["-d", "--with-descriptions"], description = ["List their descriptions."], showDefaultValue = ALWAYS + names = ["-d", "--with-descriptions"], + description = ["List their descriptions."], + showDefaultValue = ALWAYS ) private var withDescriptions: Boolean = true @@ -38,7 +44,9 @@ internal object ListPatchesCommand : Runnable { private var withVersions: Boolean = false @Option( - names = ["-o", "--with-options"], description = ["List the options of the patches."], showDefaultValue = ALWAYS + names = ["-o", "--with-options"], + description = ["List the options of the patches."], + showDefaultValue = ALWAYS ) private var withOptions: Boolean = false @@ -57,7 +65,8 @@ internal object ListPatchesCommand : Runnable { private var withIndex: Boolean = true @Option( - names = ["-f", "--filter-package-name"], description = ["Filter patches by package name."] + names = ["-f", "--filter-package-name"], + description = ["Filter patches by package name."] ) private var packageName: String? = null diff --git a/src/main/kotlin/app/revanced/cli/command/OptionsCommand.kt b/src/main/kotlin/app/revanced/cli/command/OptionsCommand.kt index bbf5fef..cd7fef1 100644 --- a/src/main/kotlin/app/revanced/cli/command/OptionsCommand.kt +++ b/src/main/kotlin/app/revanced/cli/command/OptionsCommand.kt @@ -16,17 +16,22 @@ internal object OptionsCommand : Runnable { private val logger = Logger.getLogger(OptionsCommand::class.java.name) @CommandLine.Parameters( - description = ["Paths to patch bundles."], arity = "1..*" + description = ["Paths to patch bundles."], + arity = "1..*" ) private lateinit var patchBundles: Array @CommandLine.Option( - names = ["-p", "--path"], description = ["Path to patch options JSON file."], showDefaultValue = ALWAYS + names = ["-p", "--path"], + description = ["Path to patch options JSON file."], + showDefaultValue = ALWAYS ) private var filePath: File = File("options.json") @CommandLine.Option( - names = ["-o", "--overwrite"], description = ["Overwrite existing options file."], showDefaultValue = ALWAYS + names = ["-o", "--overwrite"], + description = ["Overwrite existing options file."], + showDefaultValue = ALWAYS ) private var overwrite: Boolean = false diff --git a/src/main/kotlin/app/revanced/cli/command/PatchCommand.kt b/src/main/kotlin/app/revanced/cli/command/PatchCommand.kt index 0603783..2d25c9d 100644 --- a/src/main/kotlin/app/revanced/cli/command/PatchCommand.kt +++ b/src/main/kotlin/app/revanced/cli/command/PatchCommand.kt @@ -20,7 +20,8 @@ import java.util.logging.Logger @CommandLine.Command( - name = "patch", description = ["Patch an APK file."] + name = "patch", + description = ["Patch an APK file."] ) internal object PatchCommand : Runnable { private val logger = Logger.getLogger(PatchCommand::class.java.name) @@ -35,7 +36,8 @@ internal object PatchCommand : Runnable { private var patchBundles = emptyList() @CommandLine.Option( - names = ["-i", "--include"], description = ["List of patches to include."] + names = ["-i", "--include"], + description = ["List of patches to include."] ) private var includedPatches = hashSetOf() @@ -46,7 +48,8 @@ internal object PatchCommand : Runnable { private var includedPatchesByIndex = arrayOf() @CommandLine.Option( - names = ["-e", "--exclude"], description = ["List of patches to exclude."] + names = ["-e", "--exclude"], + description = ["List of patches to exclude."] ) private var excludedPatches = hashSetOf() @@ -57,7 +60,9 @@ internal object PatchCommand : Runnable { private var excludedPatchesByIndex = arrayOf() @CommandLine.Option( - names = ["--options"], description = ["Path to patch options JSON file."], showDefaultValue = ALWAYS + names = ["--options"], + description = ["Path to patch options JSON file."], + showDefaultValue = ALWAYS ) private var optionsFile: File = File("options.json") @@ -76,22 +81,29 @@ internal object PatchCommand : Runnable { private var force: Boolean = false @CommandLine.Option( - names = ["-o", "--out"], description = ["Path to save the patched APK file to."], required = true + names = ["-o", "--out"], + description = ["Path to save the patched APK file to."], + required = true ) private lateinit var outputFilePath: File @CommandLine.Option( - names = ["-d", "--device-serial"], description = ["ADB device serial to install to."], showDefaultValue = ALWAYS + names = ["-d", "--device-serial"], + description = ["ADB device serial to install to."], + showDefaultValue = ALWAYS ) private var deviceSerial: String? = null @CommandLine.Option( - names = ["--mount"], description = ["Install by mounting the patched APK file."], showDefaultValue = ALWAYS + names = ["--mount"], + description = ["Install by mounting the patched APK file."], + showDefaultValue = ALWAYS ) private var mount: Boolean = false @CommandLine.Option( - names = ["--keystore"], description = ["Path to the keystore to sign the patched APK file with."], + names = ["--keystore"], + description = ["Path to the keystore to sign the patched APK file with."], ) private var keystoreFilePath: File? = null @@ -103,7 +115,8 @@ internal object PatchCommand : Runnable { private var keyStorePassword: String? = null // Empty password by default @CommandLine.Option( - names = ["--alias"], description = ["The alias of the key from the keystore to sign the patched APK file with."], + names = ["--alias"], + description = ["The alias of the key from the keystore to sign the patched APK file with."], showDefaultValue = ALWAYS ) private var alias = "ReVanced Key" @@ -115,7 +128,8 @@ internal object PatchCommand : Runnable { private var password = "" // Empty password by default @CommandLine.Option( - names = ["--signer"], description = ["The name of the signer to sign the patched APK file with."], + names = ["--signer"], + description = ["The name of the signer to sign the patched APK file with."], showDefaultValue = ALWAYS ) private var signer = "ReVanced" @@ -144,7 +158,8 @@ internal object PatchCommand : Runnable { private var warn: Boolean = false @CommandLine.Parameters( - description = ["APK file to be patched."], arity = "1..1" + description = ["APK file to be patched."], + arity = "1..1" ) @Suppress("unused") private fun setApk(apk: File) { @@ -156,7 +171,8 @@ internal object PatchCommand : Runnable { } @CommandLine.Option( - names = ["-m", "--merge"], description = ["One or more DEX files or containers to merge into the APK."] + names = ["-m", "--merge"], + description = ["One or more DEX files or containers to merge into the APK."] ) @Suppress("unused") private fun setIntegrations(integrations: Array) { @@ -167,7 +183,9 @@ internal object PatchCommand : Runnable { } @CommandLine.Option( - names = ["-b", "--patch-bundle"], description = ["One or more bundles of patches."], required = true + names = ["-b", "--patch-bundle"], + description = ["One or more bundles of patches."], + required = true ) @Suppress("unused") private fun setPatchBundles(patchBundles: Array) { @@ -178,7 +196,8 @@ internal object PatchCommand : Runnable { } @CommandLine.Option( - names = ["--custom-aapt2-binary"], description = ["Path to a custom AAPT binary to compile resources with."] + names = ["--custom-aapt2-binary"], + description = ["Path to a custom AAPT binary to compile resources with."] ) @Suppress("unused") private fun setAaptBinaryPath(aaptBinaryPath: File) { diff --git a/src/main/kotlin/app/revanced/cli/command/utility/InstallCommand.kt b/src/main/kotlin/app/revanced/cli/command/utility/InstallCommand.kt index 59a83dc..cffe3d7 100644 --- a/src/main/kotlin/app/revanced/cli/command/utility/InstallCommand.kt +++ b/src/main/kotlin/app/revanced/cli/command/utility/InstallCommand.kt @@ -7,18 +7,22 @@ import java.util.logging.Logger @Command( - name = "install", description = ["Install an APK file to devices with the supplied ADB device serials"] + name = "install", + description = ["Install an APK file to devices with the supplied ADB device serials"] ) internal object InstallCommand : Runnable { private val logger = Logger.getLogger(InstallCommand::class.java.name) @Parameters( - description = ["ADB device serials"], arity = "1..*" + description = ["ADB device serials"], + arity = "1..*" ) private lateinit var deviceSerials: Array @Option( - names = ["-a", "--apk"], description = ["APK file to be installed"], required = true + names = ["-a", "--apk"], + description = ["APK file to be installed"], + required = true ) private lateinit var apk: File diff --git a/src/main/kotlin/app/revanced/cli/command/utility/UninstallCommand.kt b/src/main/kotlin/app/revanced/cli/command/utility/UninstallCommand.kt index d89b050..494f93e 100644 --- a/src/main/kotlin/app/revanced/cli/command/utility/UninstallCommand.kt +++ b/src/main/kotlin/app/revanced/cli/command/utility/UninstallCommand.kt @@ -13,10 +13,17 @@ import java.util.logging.Logger internal object UninstallCommand : Runnable { private val logger = Logger.getLogger(UninstallCommand::class.java.name) - @Parameters(description = ["ADB device serials"], arity = "1..*") + @Parameters( + description = ["ADB device serials"], + arity = "1..*" + ) private lateinit var deviceSerials: Array - @Option(names = ["-p", "--package-name"], description = ["Package name of the app to uninstall"], required = true) + @Option( + names = ["-p", "--package-name"], + description = ["Package name of the app to uninstall"], + required = true + ) private lateinit var packageName: String @Option(