From f6c221d72dc43ebea00e5eba6bfa02751ae8ad77 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 10 Jul 2023 18:49:40 +0200 Subject: [PATCH] feat: use new patch naming convention --- docs/1_usage.md | 2 +- src/main/kotlin/app/revanced/cli/command/MainCommand.kt | 2 +- src/main/kotlin/app/revanced/utils/patcher/Patcher.kt | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/1_usage.md b/docs/1_usage.md index bf07f49..a3226de 100644 --- a/docs/1_usage.md +++ b/docs/1_usage.md @@ -35,7 +35,7 @@ Learn how to ReVanced CLI. ```bash java -jar revanced-cli.jar -b revanced-patches.jar \ - -l + -l # Names of all patches will be in kebab-case ``` - ### 💉 Use ReVanced CLI to patch an APK file but deploy without root permissions diff --git a/src/main/kotlin/app/revanced/cli/command/MainCommand.kt b/src/main/kotlin/app/revanced/cli/command/MainCommand.kt index 0d3b954..182fdaa 100644 --- a/src/main/kotlin/app/revanced/cli/command/MainCommand.kt +++ b/src/main/kotlin/app/revanced/cli/command/MainCommand.kt @@ -241,7 +241,7 @@ internal object MainCommand : Runnable { } // Add patch name - val patchName = patch.patchName.padStart(25) + val patchName = patch.patchName.lowercase().replace(" ", "-").padStart(25) append(patchName) // Add description if flag is set. diff --git a/src/main/kotlin/app/revanced/utils/patcher/Patcher.kt b/src/main/kotlin/app/revanced/utils/patcher/Patcher.kt index adbfde5..53eb07e 100644 --- a/src/main/kotlin/app/revanced/utils/patcher/Patcher.kt +++ b/src/main/kotlin/app/revanced/utils/patcher/Patcher.kt @@ -1,6 +1,5 @@ package app.revanced.utils.patcher -import app.revanced.cli.command.MainCommand import app.revanced.cli.command.MainCommand.args import app.revanced.cli.command.MainCommand.logger import app.revanced.cli.command.PatchList @@ -18,8 +17,8 @@ fun Patcher.addPatchesFiltered(allPatches: PatchList) { val includedPatches = mutableListOf>>() allPatches.forEach patchLoop@{ patch -> val compatiblePackages = patch.compatiblePackages - val patchName = patch.patchName - val args = MainCommand.args.patchArgs?.patchingArgs!! + val patchName = patch.patchName.lowercase().replace(" ", "-") + val args = args.patchArgs?.patchingArgs!! val prefix = "Skipping $patchName"