fix: make integrations optional

This commit is contained in:
Lucaskyy 2022-04-11 11:44:59 +02:00
parent 967fac48d0
commit bea8b829c7
No known key found for this signature in database
GPG Key ID: 1530BFF96D1EEB89

View File

@ -20,13 +20,12 @@ class Main {
inApk: String,
inSignatures: String,
inPatches: String,
integrations: String,
inIntegrations: String?,
inOutput: String,
) {
val apk = Preconditions.isFile(inApk)
val signatures = Preconditions.isFile(inSignatures)
val patchesFile = Preconditions.isFile(inPatches)
val integrationsFile = Preconditions.isFile(integrations)
val output = Preconditions.isDirectory(inOutput)
val patcher = Patcher(
@ -36,7 +35,10 @@ class Main {
.toTypedArray()
)
patcher.addFiles(integrationsFile)
inIntegrations?.let {
val integrations = Preconditions.isFile(it)
patcher.addFiles(integrations)
}
PatchLoader.injectPatches(patchesFile)
val patches = Patches.loadPatches()
@ -81,7 +83,7 @@ class Main {
fullName = "integrations",
shortName = "i",
description = "Integrations APK file"
).required()
)
val output by parser.option(
ArgType.String,
fullName = "output",