Compare commits

..

4 Commits

Author SHA1 Message Date
semantic-release-bot
fd8b00702d chore(release): 4.0.1-dev.1 [skip ci]
## [4.0.1-dev.1](https://github.com/ReVanced/revanced-cli/compare/v4.0.0...v4.0.1-dev.1) (2023-10-07)

### Bug Fixes

* Correct warning message ([e4e339d](e4e339dff4))
2023-10-07 00:10:10 +00:00
oSumAtrIX
e4e339dff4 fix: Correct warning message 2023-10-07 01:56:13 +02:00
oSumAtrIX
0c70b589b6 build(Needs bump): Bump dependencies 2023-10-07 01:56:12 +02:00
oSumAtrIX
ca07dbc0e7 docs: Fix incorrect bullet point 2023-10-07 01:14:12 +02:00
7 changed files with 40 additions and 57 deletions

View File

@@ -1,17 +1,3 @@
## [4.0.2-dev.1](https://github.com/ReVanced/revanced-cli/compare/v4.0.1...v4.0.2-dev.1) (2023-10-08)
### Bug Fixes
* Use punctuation in option descriptions ([da4469f](https://github.com/ReVanced/revanced-cli/commit/da4469f402c26ad95898404236b0acf0202907e2))
## [4.0.1](https://github.com/ReVanced/revanced-cli/compare/v4.0.0...v4.0.1) (2023-10-08)
### Bug Fixes
* Correct warning message ([ba573f7](https://github.com/ReVanced/revanced-cli/commit/ba573f73d0e310fdeb8be2831fd40a7188473fff))
## [4.0.1-dev.1](https://github.com/ReVanced/revanced-cli/compare/v4.0.0...v4.0.1-dev.1) (2023-10-07) ## [4.0.1-dev.1](https://github.com/ReVanced/revanced-cli/compare/v4.0.0...v4.0.1-dev.1) (2023-10-07)

View File

@@ -28,15 +28,12 @@
<a href="https://t.me/app_revanced"> <a href="https://t.me/app_revanced">
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" /> <img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
</a>&nbsp;&nbsp;&nbsp; </a>&nbsp;&nbsp;&nbsp;
<a href="https://x.com/revancedapp"> <a href="https://twitter.com/revancedapp">
<picture> <img height="24px" src="https://user-images.githubusercontent.com/13122796/178032018-6da37214-7474-4641-a1da-7af7db3a31cd.png" />
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/93124920/270180600-7c1b38bf-889b-4d68-bd5e-b9d86f91421a.png">
<img height="24px" src="https://user-images.githubusercontent.com/93124920/270108715-d80743fa-b330-4809-b1e6-79fbdc60d09c.png" />
<picture/>
</a>&nbsp;&nbsp;&nbsp; </a>&nbsp;&nbsp;&nbsp;
<a href="https://www.youtube.com/@ReVanced"> <a href="https://www.youtube.com/@ReVanced">
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" /> <img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
</a> </a>&nbsp;&nbsp;&nbsp;
<br> <br>
<br> <br>
Continuing the legacy of Vanced Continuing the legacy of Vanced

View File

@@ -1,4 +1,4 @@
org.gradle.parallel = true org.gradle.parallel = true
org.gradle.caching = true org.gradle.caching = true
kotlin.code.style = official kotlin.code.style = official
version = 4.0.2-dev.1 version = 4.0.1-dev.1

View File

@@ -9,41 +9,41 @@ import java.io.File
import java.util.logging.Logger 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 { internal object ListPatchesCommand : Runnable {
private val logger = Logger.getLogger(ListPatchesCommand::class.java.name) private val logger = Logger.getLogger(ListPatchesCommand::class.java.name)
@Parameters( @Parameters(
description = ["Paths to patch bundles."], arity = "1..*" description = ["Paths to patch bundles"], arity = "1..*"
) )
private lateinit var patchBundles: Array<File> private lateinit var patchBundles: Array<File>
@Option( @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 private var withDescriptions: Boolean = true
@Option( @Option(
names = ["-p", "--with-packages"], names = ["-p", "--with-packages"],
description = ["List the packages the patches are compatible with."], description = ["List the packages the patches are compatible with"],
showDefaultValue = ALWAYS showDefaultValue = ALWAYS
) )
private var withPackages: Boolean = false private var withPackages: Boolean = false
@Option( @Option(
names = ["-v", "--with-versions"], names = ["-v", "--with-versions"],
description = ["List the versions of the apps the patches are compatible with."], description = ["List the versions of the apps the patches are compatible with"],
showDefaultValue = ALWAYS showDefaultValue = ALWAYS
) )
private var withVersions: Boolean = false private var withVersions: Boolean = false
@Option( @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 private var withOptions: Boolean = false
@Option( @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 private var packageName: String? = null

View File

@@ -26,7 +26,7 @@ private object CLIVersionProvider : IVersionProvider {
@Command( @Command(
name = "revanced-cli", name = "revanced-cli",
description = ["Command line application to use ReVanced."], description = ["Command line application to use ReVanced"],
mixinStandardHelpOptions = true, mixinStandardHelpOptions = true,
versionProvider = CLIVersionProvider::class, versionProvider = CLIVersionProvider::class,
subcommands = [ subcommands = [

View File

@@ -10,29 +10,29 @@ import java.util.logging.Logger
@CommandLine.Command( @CommandLine.Command(
name = "options", name = "options",
description = ["Generate options file from patches."], description = ["Generate options file from patches"],
) )
internal object OptionsCommand : Runnable { internal object OptionsCommand : Runnable {
private val logger = Logger.getLogger(OptionsCommand::class.java.name) private val logger = Logger.getLogger(OptionsCommand::class.java.name)
@CommandLine.Parameters( @CommandLine.Parameters(
description = ["Paths to patch bundles."], arity = "1..*" description = ["Paths to patch bundles"], arity = "1..*"
) )
private lateinit var patchBundles: Array<File> private lateinit var patchBundles: Array<File>
@CommandLine.Option( @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") private var filePath: File = File("options.json")
@CommandLine.Option( @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 private var overwrite: Boolean = false
@CommandLine.Option( @CommandLine.Option(
names = ["-u", "--update"], names = ["-u", "--update"],
description = ["Update existing options by adding missing and removing non-existent options."], description = ["Update existing options by adding missing and removing non-existent options"],
showDefaultValue = ALWAYS showDefaultValue = ALWAYS
) )
private var update: Boolean = false private var update: Boolean = false

View File

@@ -20,7 +20,7 @@ import java.util.logging.Logger
@CommandLine.Command( @CommandLine.Command(
name = "patch", description = ["Patch an APK file."] name = "patch", description = ["Patch an APK file"]
) )
internal object PatchCommand : Runnable { internal object PatchCommand : Runnable {
private val logger = Logger.getLogger(PatchCommand::class.java.name) private val logger = Logger.getLogger(PatchCommand::class.java.name)
@@ -35,104 +35,104 @@ internal object PatchCommand : Runnable {
private var patchBundles = emptyList<File>() private var patchBundles = emptyList<File>()
@CommandLine.Option( @CommandLine.Option(
names = ["-i", "--include"], description = ["List of patches to include."] names = ["-i", "--include"], description = ["List of patches to include"]
) )
private var includedPatches = arrayOf<String>() private var includedPatches = arrayOf<String>()
@CommandLine.Option( @CommandLine.Option(
names = ["-e", "--exclude"], description = ["List of patches to exclude."] names = ["-e", "--exclude"], description = ["List of patches to exclude"]
) )
private var excludedPatches = arrayOf<String>() private var excludedPatches = arrayOf<String>()
@CommandLine.Option( @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") private var optionsFile: File = File("options.json")
@CommandLine.Option( @CommandLine.Option(
names = ["--exclusive"], names = ["--exclusive"],
description = ["Only include patches that are explicitly specified to be included."], description = ["Only include patches that are explicitly specified to be included"],
showDefaultValue = ALWAYS showDefaultValue = ALWAYS
) )
private var exclusive = false private var exclusive = false
@CommandLine.Option( @CommandLine.Option(
names = ["-f","--force"], names = ["-f","--force"],
description = ["Bypass compatibility checks for the supplied APK's version."], description = ["Bypass compatibility checks for the supplied APK's version"],
showDefaultValue = ALWAYS showDefaultValue = ALWAYS
) )
private var force: Boolean = false private var force: Boolean = false
@CommandLine.Option( @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 private lateinit var outputFilePath: File
@CommandLine.Option( @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 private var deviceSerial: String? = null
@CommandLine.Option( @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 private var mount: Boolean = false
@CommandLine.Option( @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 private var keystoreFilePath: File? = null
// key store password // key store password
@CommandLine.Option( @CommandLine.Option(
names = ["--keystore-password"], names = ["--keystore-password"],
description = ["The password of the keystore to sign the patched APK file with."], description = ["The password of the keystore to sign the patched APK file with"],
) )
private var keyStorePassword: String? = null // Empty password by default private var keyStorePassword: String? = null // Empty password by default
@CommandLine.Option( @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 showDefaultValue = ALWAYS
) )
private var alias = "ReVanced Key" private var alias = "ReVanced Key"
@CommandLine.Option( @CommandLine.Option(
names = ["--keystore-entry-password"], names = ["--keystore-entry-password"],
description = ["The password of the entry from the keystore for the key to sign the patched APK file with."] description = ["The password of the entry from the keystore for the key to sign the patched APK file with"]
) )
private var password = "" // Empty password by default private var password = "" // Empty password by default
@CommandLine.Option( @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 showDefaultValue = ALWAYS
) )
private var signer = "ReVanced" private var signer = "ReVanced"
@CommandLine.Option( @CommandLine.Option(
names = ["-r", "--resource-cache"], names = ["-r", "--resource-cache"],
description = ["Path to temporary resource cache directory."], description = ["Path to temporary resource cache directory"],
showDefaultValue = ALWAYS showDefaultValue = ALWAYS
) )
private var resourceCachePath = File("revanced-resource-cache.") private var resourceCachePath = File("revanced-resource-cache")
private var aaptBinaryPath: File? = null private var aaptBinaryPath: File? = null
@CommandLine.Option( @CommandLine.Option(
names = ["-p", "--purge"], names = ["-p", "--purge"],
description = ["Purge the temporary resource cache directory after patching."], description = ["Purge the temporary resource cache directory after patching"],
showDefaultValue = ALWAYS showDefaultValue = ALWAYS
) )
private var purge: Boolean = false private var purge: Boolean = false
@CommandLine.Option( @CommandLine.Option(
names = ["-w", "--warn"], names = ["-w", "--warn"],
description = ["Warn if a patch can not be found in the supplied patch bundles."], description = ["Warn if a patch can not be found in the supplied patch bundles"],
showDefaultValue = ALWAYS showDefaultValue = ALWAYS
) )
private var warn: Boolean = false private var warn: Boolean = false
@CommandLine.Parameters( @CommandLine.Parameters(
description = ["APK file to be patched."], arity = "1..1" description = ["APK file to be patched"], arity = "1..1"
) )
@Suppress("unused") @Suppress("unused")
private fun setApk(apk: File) { private fun setApk(apk: File) {
@@ -144,18 +144,18 @@ internal object PatchCommand : Runnable {
} }
@CommandLine.Option( @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") @Suppress("unused")
private fun setIntegrations(integrations: Array<File>) { private fun setIntegrations(integrations: Array<File>) {
integrations.firstOrNull { !it.exists() }?.let { integrations.firstOrNull { !it.exists() }?.let {
throw CommandLine.ParameterException(spec.commandLine(), "Integrations file ${it.name} does not exist.") throw CommandLine.ParameterException(spec.commandLine(), "Integrations file ${it.name} does not exist")
} }
this.integrations += integrations this.integrations += integrations
} }
@CommandLine.Option( @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") @Suppress("unused")
private fun setPatchBundles(patchBundles: Array<File>) { private fun setPatchBundles(patchBundles: Array<File>) {
@@ -166,7 +166,7 @@ internal object PatchCommand : Runnable {
} }
@CommandLine.Option( @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") @Suppress("unused")
private fun setAaptBinaryPath(aaptBinaryPath: File) { private fun setAaptBinaryPath(aaptBinaryPath: File) {