mirror of
https://github.com/revanced/revanced-cli.git
synced 2024-12-11 20:57:49 +01:00
fix: broken control flow of includeFilter
This commit is contained in:
parent
ef01bb2016
commit
a0644c7045
@ -63,9 +63,6 @@ internal object MainCommand : Runnable {
|
|||||||
)
|
)
|
||||||
var clean: Boolean = false
|
var clean: Boolean = false
|
||||||
|
|
||||||
@Option(names = ["--sign"], description = ["Sign the apk file"])
|
|
||||||
var signApk: Boolean = false
|
|
||||||
|
|
||||||
override fun run() {
|
override fun run() {
|
||||||
if (listOnly) {
|
if (listOnly) {
|
||||||
for (patchBundlePath in patchBundles) for (patch in JarPatchBundle(patchBundlePath).loadPatches()) {
|
for (patchBundlePath in patchBundles) for (patch in JarPatchBundle(patchBundlePath).loadPatches()) {
|
||||||
@ -82,11 +79,11 @@ internal object MainCommand : Runnable {
|
|||||||
Adb(outputFile, patcher.data.packageMetadata.packageName, deploy!!, install)
|
Adb(outputFile, patcher.data.packageMetadata.packageName, deploy!!, install)
|
||||||
}
|
}
|
||||||
|
|
||||||
val patchedFile = if (signApk) File(cacheDirectory).resolve("raw.apk") else outputFile
|
val patchedFile = if (install) File(cacheDirectory).resolve("raw.apk") else outputFile
|
||||||
|
|
||||||
Patcher.start(patcher, patchedFile)
|
Patcher.start(patcher, patchedFile)
|
||||||
|
|
||||||
if (signApk) {
|
if (install) {
|
||||||
Signing.start(
|
Signing.start(
|
||||||
patchedFile,
|
patchedFile,
|
||||||
outputFile,
|
outputFile,
|
||||||
|
@ -6,7 +6,7 @@ import app.revanced.cli.command.MainCommand.patchBundles
|
|||||||
import app.revanced.patcher.Patcher
|
import app.revanced.patcher.Patcher
|
||||||
import app.revanced.patcher.data.base.Data
|
import app.revanced.patcher.data.base.Data
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
|
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.excludeByDefault
|
import app.revanced.patcher.extensions.PatchExtensions.include
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.patchName
|
import app.revanced.patcher.extensions.PatchExtensions.patchName
|
||||||
import app.revanced.patcher.patch.base.Patch
|
import app.revanced.patcher.patch.base.Patch
|
||||||
import app.revanced.patcher.util.patch.implementation.JarPatchBundle
|
import app.revanced.patcher.util.patch.implementation.JarPatchBundle
|
||||||
@ -25,8 +25,13 @@ fun Patcher.addPatchesFiltered(
|
|||||||
|
|
||||||
val prefix = "[skipped] $patchName"
|
val prefix = "[skipped] $patchName"
|
||||||
|
|
||||||
if ((includeFilter && !MainCommand.includedPatches.contains(patchName)) || patch.excludeByDefault) {
|
if (includeFilter) {
|
||||||
println(prefix)
|
if (!MainCommand.includedPatches.contains(patchName)) {
|
||||||
|
println("$prefix: Explicitly excluded.")
|
||||||
|
return@patch
|
||||||
|
}
|
||||||
|
} else if (!patch.include) {
|
||||||
|
println("$prefix: Implicitly excluded.")
|
||||||
return@patch
|
return@patch
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user