From 5eaad33dc1fbd24c36e1498f04e21d068e85f53e Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 24 Jul 2023 14:18:15 +0200 Subject: [PATCH] fix: print original instead of kebab cased names --- .../kotlin/app/revanced/utils/patcher/Patcher.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/app/revanced/utils/patcher/Patcher.kt b/src/main/kotlin/app/revanced/utils/patcher/Patcher.kt index 53eb07ee..fd61bae0 100644 --- a/src/main/kotlin/app/revanced/utils/patcher/Patcher.kt +++ b/src/main/kotlin/app/revanced/utils/patcher/Patcher.kt @@ -17,12 +17,11 @@ fun Patcher.addPatchesFiltered(allPatches: PatchList) { val includedPatches = mutableListOf>>() allPatches.forEach patchLoop@{ patch -> val compatiblePackages = patch.compatiblePackages - val patchName = patch.patchName.lowercase().replace(" ", "-") val args = args.patchArgs?.patchingArgs!! - val prefix = "Skipping $patchName" + val prefix = "Skipping ${patch.patchName}" - if (compatiblePackages == null) logger.trace("$patchName: No constraint on packages.") + if (compatiblePackages == null) logger.trace("${patch.patchName}: No package constraints.") else { if (!compatiblePackages.any { it.name == packageName }) { logger.trace("$prefix: Incompatible with $packageName. This patch is only compatible with ${ @@ -42,15 +41,16 @@ fun Patcher.addPatchesFiltered(allPatches: PatchList) { } } - if (args.excludedPatches.contains(patchName)) { + val kebabCasedPatchName = patch.patchName.lowercase().replace(" ", "-") + if (args.excludedPatches.contains(kebabCasedPatchName)) { logger.info("$prefix: Manually excluded") return@patchLoop - } else if ((!patch.include || args.exclusive) && !args.includedPatches.contains(patchName)) { + } else if ((!patch.include || args.exclusive) && !args.includedPatches.contains(kebabCasedPatchName)) { logger.info("$prefix: Excluded by default") return@patchLoop } - logger.trace("Adding $patchName") + logger.trace("Adding ${patch.patchName}") includedPatches.add(patch) }