From 1b645c67db58eb4d49b5290fd247507c9b43a9c6 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 5 Jun 2022 07:56:27 +0200 Subject: [PATCH] feat: debugging option --- src/main/kotlin/app/revanced/cli/MainCommand.kt | 3 +++ src/main/kotlin/app/revanced/utils/patcher/Patcher.kt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/cli/MainCommand.kt b/src/main/kotlin/app/revanced/cli/MainCommand.kt index df51b351..b8ab9c42 100644 --- a/src/main/kotlin/app/revanced/cli/MainCommand.kt +++ b/src/main/kotlin/app/revanced/cli/MainCommand.kt @@ -52,6 +52,9 @@ internal object MainCommand : Runnable { @Option(names = ["-d", "--deploy-on"], description = ["If specified, deploy to adb device with given name"]) internal var deploy: String? = null + @Option(names = ["-b", "--debugging"], description = ["Disable patch version compatibility"]) + internal var debugging: Boolean = false + override fun run() { if (listOnly) { for (patchBundlePath in patchBundles) for (it in JarPatchBundle(patchBundlePath).loadPatches()) { diff --git a/src/main/kotlin/app/revanced/utils/patcher/Patcher.kt b/src/main/kotlin/app/revanced/utils/patcher/Patcher.kt index 7b1c1262..fee8d8f1 100644 --- a/src/main/kotlin/app/revanced/utils/patcher/Patcher.kt +++ b/src/main/kotlin/app/revanced/utils/patcher/Patcher.kt @@ -34,7 +34,7 @@ fun Patcher.addPatchesFiltered( return@patch } - if (!compatiblePackage.versions.any { it == packageVersion }) { + if (!(MainCommand.debugging || compatiblePackage.versions.any { it == packageVersion })) { println("$prefix: Unsupported version.") return@patch }