Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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.