mirror of
https://github.com/ReVanced/revanced-cli.git
synced 2026-01-11 22:06:20 +00:00
Compare commits
4 Commits
v4.0.0-dev
...
v4.0.0-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d1c4d8df3e | ||
|
|
89acffe788 | ||
|
|
64d9127291 | ||
|
|
e3c55507cf |
12
CHANGELOG.md
12
CHANGELOG.md
@@ -1,3 +1,15 @@
|
||||
# [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)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
org.gradle.parallel = true
|
||||
org.gradle.caching = true
|
||||
kotlin.code.style = official
|
||||
version = 4.0.0-dev.4
|
||||
version = 4.0.0-dev.5
|
||||
|
||||
@@ -3,8 +3,8 @@ shadow = "8.1.1"
|
||||
kotlin-test = "1.8.20-RC"
|
||||
kotlinx-coroutines-core = "1.7.3"
|
||||
picocli = "4.7.3"
|
||||
revanced-patcher = "15.0.3"
|
||||
revanced-library = "1.1.0"
|
||||
revanced-patcher = "16.0.0"
|
||||
revanced-library = "1.1.1"
|
||||
|
||||
[libraries]
|
||||
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin-test" }
|
||||
|
||||
@@ -39,8 +39,9 @@ internal object OptionsCommand : Runnable {
|
||||
|
||||
override fun run() = try {
|
||||
PatchBundleLoader.Jar(*patchBundles).let { patches ->
|
||||
if (!filePath.exists() || overwrite) {
|
||||
if (update && filePath.exists()) patches.setOptions(filePath)
|
||||
val exists = filePath.exists()
|
||||
if (!exists || overwrite) {
|
||||
if (exists && update) patches.setOptions(filePath)
|
||||
|
||||
Options.serialize(patches, prettyPrint = true).let(filePath::writeText)
|
||||
} else throw OptionsFileAlreadyExistsException()
|
||||
|
||||
@@ -196,13 +196,6 @@ internal object PatchCommand : Runnable {
|
||||
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
|
||||
|
||||
Patcher(
|
||||
@@ -213,11 +206,18 @@ internal object PatchCommand : Runnable {
|
||||
resourceCachePath.absolutePath,
|
||||
)
|
||||
).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
|
||||
|
||||
val patcherResult = patcher.apply {
|
||||
acceptIntegrations(integrations)
|
||||
acceptPatches(filterPatchSelection(patches))
|
||||
acceptPatches(filteredPatches.toList())
|
||||
|
||||
// Execute patches.
|
||||
runBlocking {
|
||||
@@ -277,7 +277,7 @@ internal object PatchCommand : Runnable {
|
||||
* @param patches The patches to filter.
|
||||
* @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 packageVersion = context.packageMetadata.packageVersion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user