mirror of
https://github.com/ReVanced/revanced-cli.git
synced 2026-01-18 08:53:58 +00:00
fix: invalid code flow when adding patches
This commit is contained in:
@@ -58,9 +58,9 @@ internal object MainCommand : Runnable {
|
||||
for (it in JarPatchBundle(patchBundlePath).loadPatches())
|
||||
println(
|
||||
"[available] ${
|
||||
it.javaClass.findAnnotationRecursively(
|
||||
it.findAnnotationRecursively(
|
||||
Name::class.java
|
||||
)?.name ?: Name::class.java.name
|
||||
)?.name ?: it::class.java.name
|
||||
}"
|
||||
)
|
||||
return
|
||||
|
||||
@@ -24,7 +24,7 @@ fun Patcher.addPatchesFiltered(
|
||||
|
||||
val compatibilityAnnotation = patch.javaClass.findAnnotationRecursively(Compatibility::class.java)
|
||||
|
||||
val patchName = patch.javaClass.findAnnotationRecursively(Name::class.java)?.name ?: Name::class.java.name
|
||||
val patchName = patch.javaClass.findAnnotationRecursively(Name::class.java)?.name ?: patch.javaClass.name
|
||||
|
||||
val prefix = "[skipped] $patchName"
|
||||
|
||||
@@ -47,9 +47,10 @@ fun Patcher.addPatchesFiltered(
|
||||
return@patch
|
||||
}
|
||||
|
||||
if (!packageVersionCompatibilityFilter || compatiblePackage.versions.any { it == packageVersion }) return@patch
|
||||
println("$prefix: Unsupported version.")
|
||||
return@patch
|
||||
if (packageVersionCompatibilityFilter && !compatiblePackage.versions.any { it == packageVersion }) {
|
||||
println("$prefix: Unsupported version.")
|
||||
return@patch
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user