Skip to content

Commit

Permalink
feat: --exclusive switch (ReVanced#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
bogadana authored Jul 10, 2022
1 parent 93a4787 commit 8e91c12
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/main/kotlin/app/revanced/cli/command/MainCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ internal object MainCommand : Runnable {
@Option(names = ["-e", "--exclude"], description = ["Explicitly exclude patches"])
var excludedPatches = arrayOf<String>()

@Option(names = ["--exclusive"], description = ["Exclusively include patches"])
var defaultExclude = false

@Option(names = ["-i", "--include"], description = ["Include patches"])
var includedPatches = arrayOf<String>()

Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/app/revanced/cli/patcher/Patcher.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal object Patcher {
// merge files like necessary integrations
patcher.mergeFiles()
// add patches, but filter incompatible or excluded patches
patcher.addPatchesFiltered(excludePatches = args.excludedPatches.isNotEmpty())
patcher.addPatchesFiltered()
// apply patches
patcher.applyPatchesVerbose()

Expand Down
4 changes: 1 addition & 3 deletions src/main/kotlin/app/revanced/utils/patcher/Patcher.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import app.revanced.patcher.extensions.PatchExtensions.patchName
import app.revanced.patcher.patch.Patch
import app.revanced.patcher.util.patch.implementation.JarPatchBundle

fun Patcher.addPatchesFiltered(
excludePatches: Boolean = false
) {
fun Patcher.addPatchesFiltered() {
val packageName = this.data.packageMetadata.packageName
val packageVersion = this.data.packageMetadata.packageVersion

Expand Down

0 comments on commit 8e91c12

Please sign in to comment.