mirror of
https://github.com/ReVanced/revanced-cli.git
synced 2026-01-18 08:53:58 +00:00
Compare commits
8 Commits
v4.2.0
...
v4.4.0-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d17459fa3 | ||
|
|
16109bd8bc | ||
|
|
09bc652317 | ||
|
|
1d051365f3 | ||
|
|
ab7d9d8e1e | ||
|
|
5e089ea9af | ||
|
|
06c6a97915 | ||
|
|
a974b8ea80 |
21
CHANGELOG.md
21
CHANGELOG.md
@@ -1,3 +1,24 @@
|
|||||||
|
# [4.4.0-dev.1](https://github.com/ReVanced/revanced-cli/compare/v4.3.0...v4.4.0-dev.1) (2023-12-01)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Log saved patched APK file path ([16109bd](https://github.com/ReVanced/revanced-cli/commit/16109bd8bc6236debf71cbc8db78fe452b2ed00d))
|
||||||
|
|
||||||
|
# [4.3.0](https://github.com/ReVanced/revanced-cli/compare/v4.2.0...v4.3.0) (2023-12-01)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Add `list-versions` command ([a974b8e](https://github.com/ReVanced/revanced-cli/commit/a974b8ea80acd85f8dc472a3f93b8fd7bea08007))
|
||||||
|
|
||||||
|
# [4.3.0-dev.1](https://github.com/ReVanced/revanced-cli/compare/v4.2.0...v4.3.0-dev.1) (2023-11-27)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Add `list-versions` command ([a974b8e](https://github.com/ReVanced/revanced-cli/commit/a974b8ea80acd85f8dc472a3f93b8fd7bea08007))
|
||||||
|
|
||||||
# [4.2.0](https://github.com/ReVanced/revanced-cli/compare/v4.1.0...v4.2.0) (2023-11-26)
|
# [4.2.0](https://github.com/ReVanced/revanced-cli/compare/v4.1.0...v4.2.0) (2023-11-26)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -34,39 +34,39 @@ ReVanced CLI is divided into the following fundamental commands:
|
|||||||
revanced-patches.jar [<patch-bundle> ...]
|
revanced-patches.jar [<patch-bundle> ...]
|
||||||
```
|
```
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> A default `options.json` file will be automatically created, if it does not exist
|
> A default `options.json` file will be automatically created, if it does not exist
|
||||||
without any need for intervention when using the `patch` command.
|
without any need for intervention when using the `patch` command.
|
||||||
|
|
||||||
- ### 💉 Patch an app
|
- ### 💉 Patch an app
|
||||||
|
|
||||||
You can patch apps by supplying patch bundles and the app to patch.
|
You can patch apps by supplying patch bundles and the app to patch.
|
||||||
After patching, ReVanced CLI can install the patched app on your device using two methods:
|
After patching, ReVanced CLI can install the patched app on your device using two methods:
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> For ReVanced CLI to be able to install the patched app on your device, make sure ADB is working:
|
> For ReVanced CLI to be able to install the patched app on your device, make sure ADB is working:
|
||||||
>
|
>
|
||||||
> ```bash
|
> ```bash
|
||||||
> adb shell exit
|
> adb shell exit
|
||||||
> ```
|
> ```
|
||||||
>
|
>
|
||||||
> To get your device's serial, run the following command:
|
> To get your device's serial, run the following command:
|
||||||
>
|
>
|
||||||
> ```bash
|
> ```bash
|
||||||
> adb devices
|
> adb devices
|
||||||
> ```
|
> ```
|
||||||
>
|
>
|
||||||
> If you want to mount the patched app on top of the un-patched app, make sure you have root permissions:
|
> If you want to mount the patched app on top of the un-patched app, make sure you have root permissions:
|
||||||
>
|
>
|
||||||
> ```bash
|
> ```bash
|
||||||
> adb shell su -c exit
|
> adb shell su -c exit
|
||||||
> ```
|
> ```
|
||||||
>
|
>
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> Some patches may require integrations
|
> Some patches may require integrations
|
||||||
> such as [ReVanced Integrations](https://github.com/revanced/revanced-integrations).
|
> such as [ReVanced Integrations](https://github.com/revanced/revanced-integrations).
|
||||||
> Supply them with the option `--merge`. ReVanced Patcher will automatically determine if they are necessary.
|
> Supply them with the option `--merge`. ReVanced Patcher will automatically determine if they are necessary.
|
||||||
|
|
||||||
- #### 👾 Patch an app and install it on your device regularly
|
- #### 👾 Patch an app and install it on your device regularly
|
||||||
|
|
||||||
@@ -119,9 +119,9 @@ ReVanced CLI is divided into the following fundamental commands:
|
|||||||
[<device-serial>]
|
[<device-serial>]
|
||||||
```
|
```
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> You can unmount an APK file
|
> You can unmount an APK file
|
||||||
by adding the option `--unmount`.
|
by adding the option `--unmount`.
|
||||||
|
|
||||||
- ### ️ 📦 Install an app
|
- ### ️ 📦 Install an app
|
||||||
|
|
||||||
@@ -131,6 +131,6 @@ ReVanced CLI is divided into the following fundamental commands:
|
|||||||
[<device-serial>]
|
[<device-serial>]
|
||||||
```
|
```
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> You can mount an APK file
|
> You can mount an APK file
|
||||||
> by supplying the package name of the app to mount the supplied APK file to over the option `--mount`.
|
> by supplying the package name of the app to mount the supplied APK file to over the option `--mount`.
|
||||||
|
|||||||
@@ -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.2.0
|
version = 4.4.0-dev.1
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ shadow = "8.1.1"
|
|||||||
kotlin-test = "1.9.20"
|
kotlin-test = "1.9.20"
|
||||||
kotlinx-coroutines-core = "1.7.3"
|
kotlinx-coroutines-core = "1.7.3"
|
||||||
picocli = "4.7.3"
|
picocli = "4.7.3"
|
||||||
revanced-patcher = "19.0.0"
|
revanced-patcher = "19.1.0"
|
||||||
revanced-library = "1.3.0"
|
revanced-library = "1.4.0"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin-test" }
|
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin-test" }
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package app.revanced.cli.command
|
||||||
|
|
||||||
|
import app.revanced.library.PackageName
|
||||||
|
import app.revanced.library.PatchUtils
|
||||||
|
import app.revanced.library.VersionMap
|
||||||
|
import app.revanced.patcher.PatchBundleLoader
|
||||||
|
import picocli.CommandLine
|
||||||
|
import java.io.File
|
||||||
|
import java.util.logging.Logger
|
||||||
|
|
||||||
|
@CommandLine.Command(
|
||||||
|
name = "list-versions",
|
||||||
|
description = [
|
||||||
|
"List the most common compatible versions of apps that are compatible " +
|
||||||
|
"with the patches in the supplied patch bundles.",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
internal class ListCompatibleVersions : Runnable {
|
||||||
|
private val logger = Logger.getLogger(ListCompatibleVersions::class.java.name)
|
||||||
|
|
||||||
|
@CommandLine.Parameters(
|
||||||
|
description = ["Paths to patch bundles."],
|
||||||
|
arity = "1..*",
|
||||||
|
)
|
||||||
|
private lateinit var patchBundles: Array<File>
|
||||||
|
|
||||||
|
@CommandLine.Option(
|
||||||
|
names = ["-f", "--filter-package-names"],
|
||||||
|
description = ["Filter patches by package name."],
|
||||||
|
)
|
||||||
|
private var packageNames: Set<String>? = null
|
||||||
|
|
||||||
|
@CommandLine.Option(
|
||||||
|
names = ["-u", "--count-unused-patches"],
|
||||||
|
description = ["Count patches that are not used by default."],
|
||||||
|
showDefaultValue = CommandLine.Help.Visibility.ALWAYS,
|
||||||
|
)
|
||||||
|
private var countUnusedPatches: Boolean = false
|
||||||
|
|
||||||
|
override fun run() {
|
||||||
|
val patches = PatchBundleLoader.Jar(*patchBundles)
|
||||||
|
|
||||||
|
fun VersionMap.buildVersionsString(): String {
|
||||||
|
if (isEmpty()) return "Any"
|
||||||
|
|
||||||
|
fun buildPatchesCountString(count: Int) = if (count == 1) "1 patch" else "$count patches"
|
||||||
|
|
||||||
|
return entries.joinToString("\n") { (version, count) ->
|
||||||
|
"$version (${buildPatchesCountString(count)})"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun buildString(entry: Map.Entry<PackageName, VersionMap>) =
|
||||||
|
buildString {
|
||||||
|
val (name, versions) = entry
|
||||||
|
appendLine("Package name: $name")
|
||||||
|
appendLine("Most common compatible versions:")
|
||||||
|
appendLine(versions.buildVersionsString().prependIndent("\t"))
|
||||||
|
}
|
||||||
|
|
||||||
|
PatchUtils.getMostCommonCompatibleVersions(
|
||||||
|
patches,
|
||||||
|
packageNames,
|
||||||
|
countUnusedPatches,
|
||||||
|
).entries.joinToString("\n", transform = ::buildString).let(logger::info)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -33,9 +33,10 @@ private object CLIVersionProvider : IVersionProvider {
|
|||||||
mixinStandardHelpOptions = true,
|
mixinStandardHelpOptions = true,
|
||||||
versionProvider = CLIVersionProvider::class,
|
versionProvider = CLIVersionProvider::class,
|
||||||
subcommands = [
|
subcommands = [
|
||||||
ListPatchesCommand::class,
|
|
||||||
PatchCommand::class,
|
PatchCommand::class,
|
||||||
OptionsCommand::class,
|
OptionsCommand::class,
|
||||||
|
ListPatchesCommand::class,
|
||||||
|
ListCompatibleVersions::class,
|
||||||
UtilityCommand::class,
|
UtilityCommand::class,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -325,6 +325,8 @@ internal object PatchCommand : Runnable {
|
|||||||
alignedFile.renameTo(outputFilePath)
|
alignedFile.renameTo(outputFilePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.info("Saved to $outputFilePath")
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
// region Install
|
// region Install
|
||||||
|
|||||||
Reference in New Issue
Block a user