1
mirror of https://github.com/revanced/revanced-cli synced 2025-11-19 15:33:27 +01:00

Compare commits

...

29 Commits

Author SHA1 Message Date
semantic-release-bot
d5c27408f3 chore(release): 4.5.0 [skip ci]
# [4.5.0](https://github.com/ReVanced/revanced-cli/compare/v4.4.2...v4.5.0) (2024-03-11)

### Bug Fixes

* Show path for missing files instead of just the name ([f0f3e56](f0f3e5614b))
* Sign APKs correctly ([5ff105c](5ff105cf6b))

### Features

* Remove deprecated CLI options ([48a1a39](48a1a39b94))
2024-03-11 09:12:29 +00:00
oSumAtrIX
8ee5b754da chore: Merge branch dev to main (#317) 2024-03-11 10:10:56 +01:00
semantic-release-bot
9476f5a2e4 chore(release): 4.5.0-dev.1 [skip ci]
# [4.5.0-dev.1](https://github.com/ReVanced/revanced-cli/compare/v4.4.2...v4.5.0-dev.1) (2024-03-11)

### Bug Fixes

* Show path for missing files instead of just the name ([f0f3e56](f0f3e5614b))
* Sign APKs correctly ([5ff105c](5ff105cf6b))

### Features

* Remove deprecated CLI options ([48a1a39](48a1a39b94))
2024-03-11 09:08:04 +00:00
oSumAtrIX
5ff105cf6b fix: Sign APKs correctly 2024-03-11 10:05:32 +01:00
oSumAtrIX
f0f3e5614b fix: Show path for missing files instead of just the name 2024-03-11 10:05:04 +01:00
oSumAtrIX
48a1a39b94 feat: Remove deprecated CLI options 2024-03-11 09:22:35 +01:00
semantic-release-bot
c45ed69adf chore(release): 4.4.2 [skip ci]
## [4.4.2](https://github.com/ReVanced/revanced-cli/compare/v4.4.1...v4.4.2) (2024-03-10)
2024-03-10 15:44:08 +00:00
oSumAtrIX
8641d301b1 chore: Merge branch dev to main (#315) 2024-03-10 16:42:17 +01:00
semantic-release-bot
44b72ca99d chore(release): 4.4.2-dev.2 [skip ci]
## [4.4.2-dev.2](https://github.com/ReVanced/revanced-cli/compare/v4.4.2-dev.1...v4.4.2-dev.2) (2024-03-10)
2024-03-10 15:41:25 +00:00
oSumAtrIX
240f2cfb6b build(Needs bump): Bump dependencies to fix generating keystore 2024-03-10 16:39:43 +01:00
semantic-release-bot
304275ddbb chore(release): 4.4.2-dev.1 [skip ci]
## [4.4.2-dev.1](https://github.com/ReVanced/revanced-cli/compare/v4.4.1...v4.4.2-dev.1) (2024-03-09)
2024-03-09 04:22:02 +00:00
oSumAtrIX
483590726a build(Needs bump): Bump dependencies to fix signing issues 2024-03-09 05:20:11 +01:00
semantic-release-bot
cf20efd467 chore(release): 4.4.1 [skip ci]
## [4.4.1](https://github.com/ReVanced/revanced-cli/compare/v4.4.0...v4.4.1) (2024-03-06)

### Bug Fixes

* Bump dependencies to support BCS keystore ([1c10a77](1c10a7760d))
2024-03-06 19:14:29 +00:00
oSumAtrIX
164d09dec1 chore: Merge branch dev to main (#309) 2024-03-06 20:12:35 +01:00
oSumAtrIX
1e92239616 build: Set target bytecode level to JVM 11 2024-03-04 19:16:09 +01:00
semantic-release-bot
a5a5085f0f chore(release): 4.4.1-dev.2 [skip ci]
## [4.4.1-dev.2](https://github.com/ReVanced/revanced-cli/compare/v4.4.1-dev.1...v4.4.1-dev.2) (2024-03-04)

### Bug Fixes

* Bump dependencies to support BCS keystore ([1c10a77](1c10a7760d))
2024-03-04 14:50:04 +00:00
oSumAtrIX
1c10a7760d fix: Bump dependencies to support BCS keystore 2024-03-04 15:47:59 +01:00
oSumAtrIX
4ff697ef0b ci: Update action 2024-03-04 15:36:34 +01:00
oSumAtrIX
628b452b7e docs: Add features and documentation section to readme 2024-02-26 04:38:22 +01:00
oSumAtrIX
e622616628 docs: Fix broken links 2024-02-26 04:37:46 +01:00
oSumAtrIX
109b33f1ed chore: Rename issue templates 2024-02-25 03:37:53 +01:00
oSumAtrIX
9fe4795923 ci: Rename workflow file 2024-02-25 03:14:02 +01:00
oSumAtrIX
f21c56d8c0 ci: Fix indentation in workflow 2024-02-24 01:14:45 +01:00
oSumAtrIX
de63cfa426 refactor: Move code out of use block 2024-02-24 01:10:23 +01:00
oSumAtrIX
9c0ad4604a docs: Break long lines 2024-02-23 04:02:32 +01:00
oSumAtrIX
2fcb74e79d docs: Fix mistakes and wording 2024-02-23 03:57:02 +01:00
oSumAtrIX
f2368ccf27 docs: Format markdown code 2024-02-23 03:03:51 +01:00
oSumAtrIX
a4e8d2df0d docs: Fix incorrect punctuation 2024-02-23 03:00:35 +01:00
oSumAtrIX
724593a7b1 ci: Split release into a separate PR build workflow
Because the release workflow already runs on dev and main, it is not necessary to also trigger it for PRs.
ci: Do not start a Gradle daemon for PR builds
2024-02-23 02:26:12 +01:00
15 changed files with 167 additions and 89 deletions

View File

@@ -0,0 +1,25 @@
name: Build pull request
on:
workflow_dispatch:
pull_request:
branches:
- dev
jobs:
release:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache Gradle
uses: burrunan/gradle-cache-action@v1
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew build --no-daemon

View File

@@ -6,10 +6,6 @@ on:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
jobs:
release:

View File

@@ -11,7 +11,7 @@ jobs:
name: Dispatch event to documentation repository
if: github.ref == 'refs/heads/main'
steps:
- uses: peter-evans/repository-dispatch@v2
- uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.DOCUMENTATION_REPO_ACCESS_TOKEN }}
repository: revanced/revanced-documentation

View File

@@ -1,3 +1,49 @@
# [4.5.0](https://github.com/ReVanced/revanced-cli/compare/v4.4.2...v4.5.0) (2024-03-11)
### Bug Fixes
* Show path for missing files instead of just the name ([f0f3e56](https://github.com/ReVanced/revanced-cli/commit/f0f3e5614b99b34391e0492177706f9c09781cad))
* Sign APKs correctly ([5ff105c](https://github.com/ReVanced/revanced-cli/commit/5ff105cf6b3fac9cd12478efd10caf90d1ecf589))
### Features
* Remove deprecated CLI options ([48a1a39](https://github.com/ReVanced/revanced-cli/commit/48a1a39b94dd9121c400d28e3e93dec3fc13e3be))
# [4.5.0-dev.1](https://github.com/ReVanced/revanced-cli/compare/v4.4.2...v4.5.0-dev.1) (2024-03-11)
### Bug Fixes
* Show path for missing files instead of just the name ([f0f3e56](https://github.com/ReVanced/revanced-cli/commit/f0f3e5614b99b34391e0492177706f9c09781cad))
* Sign APKs correctly ([5ff105c](https://github.com/ReVanced/revanced-cli/commit/5ff105cf6b3fac9cd12478efd10caf90d1ecf589))
### Features
* Remove deprecated CLI options ([48a1a39](https://github.com/ReVanced/revanced-cli/commit/48a1a39b94dd9121c400d28e3e93dec3fc13e3be))
## [4.4.2](https://github.com/ReVanced/revanced-cli/compare/v4.4.1...v4.4.2) (2024-03-10)
## [4.4.2-dev.2](https://github.com/ReVanced/revanced-cli/compare/v4.4.2-dev.1...v4.4.2-dev.2) (2024-03-10)
## [4.4.2-dev.1](https://github.com/ReVanced/revanced-cli/compare/v4.4.1...v4.4.2-dev.1) (2024-03-09)
## [4.4.1](https://github.com/ReVanced/revanced-cli/compare/v4.4.0...v4.4.1) (2024-03-06)
### Bug Fixes
* Bump dependencies to support BCS keystore ([1c10a77](https://github.com/ReVanced/revanced-cli/commit/1c10a7760d76ea850260ca49b448be7ad121de44))
## [4.4.1-dev.2](https://github.com/ReVanced/revanced-cli/compare/v4.4.1-dev.1...v4.4.1-dev.2) (2024-03-04)
### Bug Fixes
* Bump dependencies to support BCS keystore ([1c10a77](https://github.com/ReVanced/revanced-cli/commit/1c10a7760d76ea850260ca49b448be7ad121de44))
## [4.4.1-dev.1](https://github.com/ReVanced/revanced-cli/compare/v4.4.0...v4.4.1-dev.1) (2024-02-21)
# [4.4.0](https://github.com/ReVanced/revanced-cli/compare/v4.3.0...v4.4.0) (2023-12-28)

View File

@@ -64,14 +64,14 @@ This document describes how to contribute to ReVanced CLI.
## 📖 Resources to help you get started
* The [documentation](/docs) explains how to use ReVanced CLI
* [Our backlog](https://github.com/orgs/ReVanced/projects/12) is where we keep track of what we're working on
* [Issues](https://github.com/ReVanced/revanced-cli/issues) are where we keep track of bugs and feature requests
- The [documentation](/docs) explains how to use ReVanced CLI
- [Our backlog](https://github.com/orgs/ReVanced/projects/12) is where we keep track of what we're working on
- [Issues](https://github.com/ReVanced/revanced-cli/issues) are where we keep track of bugs and feature requests
## 🙏 Submitting a feature request
Features can be requested by opening an issue using the
[Feature request issue template](https://github.com/ReVanced/revanced-cli/issues/new?assignees=&labels=Feature+request&projects=&template=feature-request.yml&title=feat%3A+).
[Feature request issue template](https://github.com/ReVanced/revanced-cli/issues/new?assignees=&labels=Feature+request&projects=&template=feature_request.yml&title=feat%3A+).
> **Note**
> Requests can be accepted or rejected at the discretion of maintainers of ReVanced CLI.
@@ -80,7 +80,7 @@ Features can be requested by opening an issue using the
## 🐞 Submitting a bug report
If you encounter a bug while using ReVanced CLI, open an issue using the
[Bug report issue template](https://github.com/ReVanced/revanced-cli/issues/new?assignees=&labels=Bug+report&projects=&template=bug-report.yml&title=bug%3A+).
[Bug report issue template](https://github.com/ReVanced/revanced-cli/issues/new?assignees=&labels=Bug+report&projects=&template=bug_report.yml&title=bug%3A+).
## 📝 How to contribute
@@ -88,11 +88,11 @@ If you encounter a bug while using ReVanced CLI, open an issue using the
with the maintainers of ReVanced CLI. This will help you determine whether your change is acceptable
and whether it is worth your time to implement it
2. Development happens on the `dev` branch. Fork the repository and create your branch from `dev`
3. Commit your changes.
3. Commit your changes
4. Submit a pull request to the `dev` branch of the repository and reference issues
that your pull request closes in the description of your pull request
5. Our team will review your pull request and provide feedback. Once your pull request is approved,
it will be merged into the `dev` branch and will be included in the next release of ReVanced CLI
❤️ Thank you for considering contributing to ReVanced CLI,
❤️ Thank you for considering contributing to ReVanced CLI,
ReVanced

View File

@@ -67,13 +67,23 @@ Command line application to use ReVanced.
## ❓ About
ReVanced CLI is a command line application to patch apps using ReVanced.
ReVanced CLI also comes with commands to uninstall or install patched apps and list patches from supplied patch bundles.
ReVanced CLI is a command line application that uses [ReVanced Patcher](https://github.com/revanced/revanced-patcher) to patch Android apps.
## 🚀 Download
## 💪 Features
You can download the most recent version of ReVanced CLI from
[here](https://github.com/ReVanced/revanced-cli/releases/latest). Learn how to use ReVanced CLI by following the [documentation](/docs).
Some of the features ReVanced CLI provides are:
- 💉 **Patch apps**: Harness ReVanced Patcher to patch Android apps
- 💾 **Install and uninstall apps**: Install and uninstall Apps via ADB,
using the Android package manager, or by mounting using root permissions
- 📃 **List patches from patch bundles**: List available patches, compatible packages, and versions
- 💪 **Flexibility and functionality**: Apply any combination of patches to any version of Android apps
## 🔽 Download
You can download the most recent version of ReVanced CLI from
[here](https://github.com/ReVanced/revanced-cli/releases/latest).
Learn how to use ReVanced CLI by following the [documentation](/docs).
## 📚 Everything else
@@ -84,10 +94,14 @@ You can find the contribution guidelines [here](CONTRIBUTING.md).
### 🛠️ Building
In order to build ReVanced CLI, you can follow the [documentation](/docs).
To build a ReVanced CLI, you can follow the [documentation](/docs).
### 📃 Documentation
You can find the documentation of ReVanced CLI [here](/docs).
## 📜 Licence
ReVanced CLI is licensed under the GPLv3 licence. Please see the [licence file](LICENSE) for more information.
ReVanced CLI is licensed under the GPLv3 license. Please see the [license file](LICENSE) for more information.
[tl;dr](https://www.tldrlegal.com/license/gnu-general-public-license-v3-gpl-3) you may copy, distribute and modify ReVanced CLI as long as you track changes/dates in source files.
Any modifications to ReVanced CLI must also be made available under the GPL along with build & install instructions.
Any modifications to ReVanced CLI must also be made available under the GPL, along with build & install instructions.

View File

@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
alias(libs.plugins.kotlin)
alias(libs.plugins.shadow)
@@ -35,7 +37,15 @@ dependencies {
testImplementation(libs.kotlin.test)
}
kotlin { jvmToolchain(11) }
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
}
}
java {
targetCompatibility = JavaVersion.VERSION_11
}
tasks {
test {

View File

@@ -26,7 +26,7 @@ ReVanced CLI is divided into the following fundamental commands:
This will generate an `options.json` file for the patches from a list of supplied patch bundles.
The file can be supplied to ReVanced CLI later on.
```bash
java -jar revanced-cli.jar options \
--path options.json \
@@ -35,14 +35,14 @@ ReVanced CLI is divided into the following fundamental commands:
```
> ** Note**
> A default `options.json` file will be automatically created if it does not exist
without any need for intervention when using the `patch` command.
> A default `options.json` file will be automatically created if it does not exist
> without any need for intervention when using the `patch` command.
- ### 💉 Patch an app
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:
> **💡 Tip**
> For ReVanced CLI to be able to install the patched app on your device, make sure ADB is working:
>
@@ -55,7 +55,6 @@ ReVanced CLI is divided into the following fundamental commands:
> ```bash
> adb shell su -c exit
> ```
>
> **⚠️ Warning**
> Some patches may require integrations
@@ -72,10 +71,10 @@ ReVanced CLI is divided into the following fundamental commands:
```
- #### 👾 Patch an app and mount it on top of the un-patched app with root permissions
> **❗ Caution**
> Ensure that the same app you are patching and mounting over is installed on your device:
>
>
> ```bash
> adb install app.apk
> ```
@@ -90,18 +89,18 @@ ReVanced CLI is divided into the following fundamental commands:
--mount \
app.apk
```
> **💡 Tip**
> You can use the option `--ii` to include or `--ie` to exclude
> patches by their index in relation to supplied patch bundles,
> similarly to the option `--include` and `--exclude`.
>
>
> This is useful in case two patches have the same name, and you must include or exclude one.
> The patch index is calculated by the position of the patch in the list of patches
> from patch bundles supplied using the option `--patch-bundle`.
>
>
> You can list all patches with their indices using the command `list-patches`.
>
>
> Keep in mind that the indices can change based on the order of the patch bundles supplied,
> as well if the patch bundles are updated because patches can be added or removed.
@@ -115,7 +114,7 @@ ReVanced CLI is divided into the following fundamental commands:
> **💡 Tip**
> You can unmount an APK file
by adding the option `--unmount`.
> by adding the option `--unmount`.
- ### 📦 Install an app
@@ -126,5 +125,5 @@ ReVanced CLI is divided into the following fundamental commands:
```
> **💡 Tip**
> You can mount an APK file
> You can mount an APK file
> by supplying the app's package name to mount the supplied APK file over the option `-mount`.

View File

@@ -21,6 +21,6 @@ To build ReVanced CLI, follow these steps:
```bash
./gradlew build
```
```
After the build succeeds, the built JAR file will be located at `build/libs/revanced-cli-<version>-all.jar`.

View File

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

View File

@@ -4,7 +4,7 @@ kotlin = "1.9.22"
kotlinx-coroutines-core = "1.7.3"
picocli = "4.7.5"
revanced-patcher = "19.3.1"
revanced-library = "2.0.0"
revanced-library = "2.2.1"
[libraries]
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }

View File

@@ -142,17 +142,6 @@ internal object PatchCommand : Runnable {
)
private var signer = "ReVanced"
@CommandLine.Option(
names = ["-r", "--resource-cache"],
description = ["Path to temporary resource cache directory."],
)
private var resourceCachePath: File? = null
set(value) {
logger.warning("The --resource-cache option is deprecated. Use --temporary-files-patch instead.")
field = value
temporaryFilesPath = value
}
@CommandLine.Option(
names = ["-t", "--temporary-files-path"],
description = ["Path to temporary files directory."],
@@ -184,7 +173,7 @@ internal object PatchCommand : Runnable {
if (!apk.exists()) {
throw CommandLine.ParameterException(
spec.commandLine(),
"APK file ${apk.name} does not exist",
"APK file ${apk.path} does not exist",
)
}
this.apk = apk
@@ -197,7 +186,7 @@ internal object PatchCommand : Runnable {
@Suppress("unused")
private fun setIntegrations(integrations: Array<File>) {
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.path} does not exist.")
}
this.integrations += integrations
}
@@ -273,13 +262,13 @@ internal object PatchCommand : Runnable {
}
// endregion
Patcher(
val patcherTemporaryFilesPath = temporaryFilesPath.resolve("patcher")
val (packageName, patcherResult) = Patcher(
PatcherConfig(
apk,
temporaryFilesPath,
patcherTemporaryFilesPath,
aaptBinaryPath?.path,
temporaryFilesPath.absolutePath,
patcherTemporaryFilesPath.absolutePath,
true,
),
).use { patcher ->
@@ -296,34 +285,33 @@ internal object PatchCommand : Runnable {
// region Patch
val patcherResult =
patcher.apply {
acceptIntegrations(integrations)
acceptPatches(filteredPatches)
patcher.context.packageMetadata.packageName to patcher.apply {
acceptIntegrations(integrations)
acceptPatches(filteredPatches)
// Execute patches.
runBlocking {
apply(false).collect { patchResult ->
patchResult.exception?.let {
StringWriter().use { writer ->
it.printStackTrace(PrintWriter(writer))
logger.severe("${patchResult.patch.name} failed:\n$writer")
}
} ?: logger.info("${patchResult.patch.name} succeeded")
}
// Execute patches.
runBlocking {
apply(false).collect { patchResult ->
patchResult.exception?.let {
StringWriter().use { writer ->
it.printStackTrace(PrintWriter(writer))
logger.severe("${patchResult.patch.name} failed:\n$writer")
}
} ?: logger.info("${patchResult.patch.name} succeeded")
}
}.get()
}
}.get()
// endregion
}
// region Save
apk.copyTo(outputFilePath, overwrite = true)
patcherResult.applyTo(outputFilePath)
// region Save
apk.copyTo(temporaryFilesPath.resolve(apk.name), overwrite = true).apply {
patcherResult.applyTo(this)
}.let {
if (!mount) {
outputFilePath.sign(
sign(
it,
outputFilePath,
ApkUtils.SigningOptions(
keystoreFilePath,
keyStorePassword,
@@ -333,20 +321,20 @@ internal object PatchCommand : Runnable {
),
)
}
logger.info("Saved to $outputFilePath")
// endregion
// region Install
deviceSerial?.let { serial ->
AdbManager.getAdbManager(deviceSerial = serial.ifEmpty { null }, mount)
}?.install(AdbManager.Apk(outputFilePath, patcher.context.packageMetadata.packageName))
// endregion
}
logger.info("Saved to $outputFilePath")
// endregion
// region Install
deviceSerial?.let { serial ->
AdbManager.getAdbManager(deviceSerial = serial.ifEmpty { null }, mount)
}?.install(AdbManager.Apk(outputFilePath, packageName))
// endregion
if (purge) {
logger.info("Purging temporary files")
purge(temporaryFilesPath)