Skip to content

Commit

Permalink
feat: debugging option
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Jun 5, 2022
1 parent 4758289 commit 1b645c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/main/kotlin/app/revanced/cli/MainCommand.kt
Expand Up @@ -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()) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/app/revanced/utils/patcher/Patcher.kt
Expand Up @@ -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
}
Expand Down

0 comments on commit 1b645c6

Please sign in to comment.