mirror of
https://github.com/ReVanced/revanced-cli.git
synced 2026-01-17 16:33:58 +00:00
Compare commits
12 Commits
v4.0.0-dev
...
v4.0.0-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d1c4d8df3e | ||
|
|
89acffe788 | ||
|
|
64d9127291 | ||
|
|
e3c55507cf | ||
|
|
64afc95a81 | ||
|
|
022fd230f6 | ||
|
|
a177693ece | ||
|
|
4b6dbffd7b | ||
|
|
78e89dd3bf | ||
|
|
a08530d47b | ||
|
|
eec2234226 | ||
|
|
d5ea5a0ab1 |
2
.github/workflows/pull_request.yml
vendored
2
.github/workflows/pull_request.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Open pull request
|
- name: Open pull request
|
||||||
uses: repo-sync/pull-request@v2
|
uses: repo-sync/pull-request@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
# Make sure the release step uses its own credentials:
|
# Make sure the release step uses its own credentials:
|
||||||
# https://github.com/cycjimmy/semantic-release-action#private-packages
|
# https://github.com/cycjimmy/semantic-release-action#private-packages
|
||||||
|
|||||||
23
CHANGELOG.md
23
CHANGELOG.md
@@ -1,3 +1,26 @@
|
|||||||
|
# [4.0.0-dev.5](https://github.com/ReVanced/revanced-cli/compare/v4.0.0-dev.4...v4.0.0-dev.5) (2023-10-04)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Only set options for filtered patches ([64d9127](https://github.com/ReVanced/revanced-cli/commit/64d9127291ea9a8abe21a0e82721721495094472))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* Do not check, if the options file exists twice ([e3c5550](https://github.com/ReVanced/revanced-cli/commit/e3c55507cf52e697b9ce9d59decc1cbe4cfe5b43))
|
||||||
|
|
||||||
|
# [4.0.0-dev.4](https://github.com/ReVanced/revanced-cli/compare/v4.0.0-dev.3...v4.0.0-dev.4) (2023-10-01)
|
||||||
|
|
||||||
|
# [4.0.0-dev.3](https://github.com/ReVanced/revanced-cli/compare/v4.0.0-dev.2...v4.0.0-dev.3) (2023-09-27)
|
||||||
|
|
||||||
|
# [4.0.0-dev.2](https://github.com/ReVanced/revanced-cli/compare/v4.0.0-dev.1...v4.0.0-dev.2) (2023-09-24)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Improve option descriptions ([d5ea5a0](https://github.com/ReVanced/revanced-cli/commit/d5ea5a0ab1cc015730063e5be94ee18bd88cc906))
|
||||||
|
|
||||||
# [4.0.0-dev.1](https://github.com/ReVanced/revanced-cli/compare/v3.1.2-dev.1...v4.0.0-dev.1) (2023-09-23)
|
# [4.0.0-dev.1](https://github.com/ReVanced/revanced-cli/compare/v3.1.2-dev.1...v4.0.0-dev.1) (2023-09-23)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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.0-dev.1
|
version = 4.0.0-dev.5
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ shadow = "8.1.1"
|
|||||||
kotlin-test = "1.8.20-RC"
|
kotlin-test = "1.8.20-RC"
|
||||||
kotlinx-coroutines-core = "1.7.3"
|
kotlinx-coroutines-core = "1.7.3"
|
||||||
picocli = "4.7.3"
|
picocli = "4.7.3"
|
||||||
revanced-patcher = "15.0.1"
|
revanced-patcher = "16.0.0"
|
||||||
revanced-library = "1.0.0"
|
revanced-library = "1.1.1"
|
||||||
|
|
||||||
[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" }
|
||||||
|
|||||||
@@ -39,8 +39,9 @@ internal object OptionsCommand : Runnable {
|
|||||||
|
|
||||||
override fun run() = try {
|
override fun run() = try {
|
||||||
PatchBundleLoader.Jar(*patchBundles).let { patches ->
|
PatchBundleLoader.Jar(*patchBundles).let { patches ->
|
||||||
if (!filePath.exists() || overwrite) {
|
val exists = filePath.exists()
|
||||||
if (update && filePath.exists()) patches.setOptions(filePath)
|
if (!exists || overwrite) {
|
||||||
|
if (exists && update) patches.setOptions(filePath)
|
||||||
|
|
||||||
Options.serialize(patches, prettyPrint = true).let(filePath::writeText)
|
Options.serialize(patches, prettyPrint = true).let(filePath::writeText)
|
||||||
} else throw OptionsFileAlreadyExistsException()
|
} else throw OptionsFileAlreadyExistsException()
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ internal object PatchCommand : Runnable {
|
|||||||
|
|
||||||
@CommandLine.Option(
|
@CommandLine.Option(
|
||||||
names = ["-f","--force"],
|
names = ["-f","--force"],
|
||||||
description = ["Force inclusion of patches that are incompatible with the supplied APK file'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
|
||||||
@@ -196,13 +196,6 @@ internal object PatchCommand : Runnable {
|
|||||||
logger.warning("Unknown input of patches:\n${unknownPatches.joinToString("\n")}")
|
logger.warning("Unknown input of patches:\n${unknownPatches.joinToString("\n")}")
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("Setting patch options")
|
|
||||||
|
|
||||||
optionsFile.let {
|
|
||||||
if (it.exists()) patches.setOptions(it)
|
|
||||||
else Options.serialize(patches, prettyPrint = true).let(it::writeText)
|
|
||||||
}
|
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
Patcher(
|
Patcher(
|
||||||
@@ -213,11 +206,18 @@ internal object PatchCommand : Runnable {
|
|||||||
resourceCachePath.absolutePath,
|
resourceCachePath.absolutePath,
|
||||||
)
|
)
|
||||||
).use { patcher ->
|
).use { patcher ->
|
||||||
|
val filteredPatches = patcher.filterPatchSelection(patches).also { patches ->
|
||||||
|
logger.info("Setting patch options")
|
||||||
|
|
||||||
|
if (optionsFile.exists()) patches.setOptions(optionsFile)
|
||||||
|
else Options.serialize(patches, prettyPrint = true).let(optionsFile::writeText)
|
||||||
|
}
|
||||||
|
|
||||||
// region Patch
|
// region Patch
|
||||||
|
|
||||||
val patcherResult = patcher.apply {
|
val patcherResult = patcher.apply {
|
||||||
acceptIntegrations(integrations)
|
acceptIntegrations(integrations)
|
||||||
acceptPatches(filterPatchSelection(patches))
|
acceptPatches(filteredPatches.toList())
|
||||||
|
|
||||||
// Execute patches.
|
// Execute patches.
|
||||||
runBlocking {
|
runBlocking {
|
||||||
@@ -277,7 +277,7 @@ internal object PatchCommand : Runnable {
|
|||||||
* @param patches The patches to filter.
|
* @param patches The patches to filter.
|
||||||
* @return The filtered patches.
|
* @return The filtered patches.
|
||||||
*/
|
*/
|
||||||
private fun Patcher.filterPatchSelection(patches: PatchSet) = buildList {
|
private fun Patcher.filterPatchSelection(patches: PatchSet): PatchSet = buildSet {
|
||||||
val packageName = context.packageMetadata.packageName
|
val packageName = context.packageMetadata.packageName
|
||||||
val packageVersion = context.packageMetadata.packageVersion
|
val packageVersion = context.packageMetadata.packageVersion
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user