refactor: create methods in MainCommand class

This commit is contained in:
oSumAtrIX
2022-07-21 23:50:26 +02:00
parent 96ec6a0384
commit 168c003a31
6 changed files with 93 additions and 84 deletions

View File

@@ -15,7 +15,7 @@ fun Patcher.addPatchesFiltered() {
val packageName = this.data.packageMetadata.packageName
val packageVersion = this.data.packageMetadata.packageVersion
args.sArgs?.patchBundles!!.forEach { bundle ->
args.patchArgs?.patchBundles!!.forEach { bundle ->
val includedPatches = mutableListOf<Class<out Patch<Data>>>()
JarPatchBundle(bundle).loadPatches().forEach patch@{ patch ->
val compatiblePackages = patch.compatiblePackages
@@ -23,7 +23,7 @@ fun Patcher.addPatchesFiltered() {
val prefix = "Skipping $patchName"
val args = MainCommand.args.sArgs?.pArgs!!
val args = MainCommand.args.patchArgs?.patchingArgs!!
if (args.excludedPatches.contains(patchName)) {
logger.info("$prefix: Explicitly excluded")
@@ -72,7 +72,7 @@ fun Patcher.applyPatchesVerbose() {
}
fun Patcher.mergeFiles() {
this.addFiles(args.sArgs?.pArgs!!.mergeFiles) { file ->
this.addFiles(args.patchArgs?.patchingArgs!!.mergeFiles) { file ->
logger.info("Merging $file")
}
}

View File

@@ -56,7 +56,7 @@ internal class Signer(
// TODO: keystore should be saved securely
val ks = File(signingOptions.keyStoreFilePath)
if (!ks.exists()) newKeystore(ks) else {
logger.info("Found existing keystore: ${ks.nameWithoutExtension}")
logger.info("Found existing keystore: ${ks.name}")
}
val keyStore = KeyStore.getInstance("BKS", "BC")