mirror of
https://github.com/ReVanced/revanced-cli.git
synced 2026-01-17 16:33:58 +00:00
Compare commits
2 Commits
v4.0.3-dev
...
v4.1.0-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4fc42089a5 | ||
|
|
0139dfe0bf |
@@ -1,3 +1,10 @@
|
|||||||
|
# [4.1.0-dev.1](https://github.com/ReVanced/revanced-cli/compare/v4.0.3-dev.2...v4.1.0-dev.1) (2023-11-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* List patches which are compatible with any app ([#297](https://github.com/ReVanced/revanced-cli/issues/297)) ([0139dfe](https://github.com/ReVanced/revanced-cli/commit/0139dfe0bfa06a13f56dc03e7718aaf644029614))
|
||||||
|
|
||||||
## [4.0.3-dev.2](https://github.com/ReVanced/revanced-cli/compare/v4.0.3-dev.1...v4.0.3-dev.2) (2023-10-30)
|
## [4.0.3-dev.2](https://github.com/ReVanced/revanced-cli/compare/v4.0.3-dev.1...v4.0.3-dev.2) (2023-10-30)
|
||||||
|
|
||||||
## [4.0.3-dev.1](https://github.com/ReVanced/revanced-cli/compare/v4.0.2...v4.0.3-dev.1) (2023-10-23)
|
## [4.0.3-dev.1](https://github.com/ReVanced/revanced-cli/compare/v4.0.2...v4.0.3-dev.1) (2023-10-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.3-dev.2
|
version = 4.1.0-dev.1
|
||||||
|
|||||||
@@ -42,6 +42,13 @@ internal object ListPatchesCommand : Runnable {
|
|||||||
)
|
)
|
||||||
private var withOptions: Boolean = false
|
private var withOptions: Boolean = false
|
||||||
|
|
||||||
|
@Option(
|
||||||
|
names = ["-u", "--with-universal-patches"],
|
||||||
|
description = ["List patches which are compatible with any app."],
|
||||||
|
showDefaultValue = ALWAYS
|
||||||
|
)
|
||||||
|
private var withUniversalPatches: Boolean = true
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
names = ["-f", "--filter-package-name"], description = ["Filter patches by package name."]
|
names = ["-f", "--filter-package-name"], description = ["Filter patches by package name."]
|
||||||
)
|
)
|
||||||
@@ -92,11 +99,12 @@ internal object ListPatchesCommand : Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Patch<*>.anyPackageName(name: String) = compatiblePackages?.any { it.name == name } == true
|
fun Patch<*>.filterCompatiblePackages(name: String) = compatiblePackages?.any { it.name == name }
|
||||||
|
?: withUniversalPatches
|
||||||
|
|
||||||
val patches = PatchBundleLoader.Jar(*patchBundles)
|
val patches = PatchBundleLoader.Jar(*patchBundles)
|
||||||
|
|
||||||
val filtered = packageName?.let { patches.filter { patch -> patch.anyPackageName(it) } } ?: patches
|
val filtered = packageName?.let { patches.filter { patch -> patch.filterCompatiblePackages(it) } } ?: patches
|
||||||
|
|
||||||
if (filtered.isNotEmpty()) logger.info(filtered.joinToString("\n\n") { it.buildString() })
|
if (filtered.isNotEmpty()) logger.info(filtered.joinToString("\n\n") { it.buildString() })
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user