mirror of
https://github.com/revanced/revanced-cli.git
synced 2024-12-03 17:02:54 +01:00
fix: invalid code flow when adding patches
This commit is contained in:
parent
04e0027c08
commit
206f2029d7
1
.github/workflows/release.yml
vendored
1
.github/workflows/release.yml
vendored
@ -1,5 +1,6 @@
|
|||||||
name: Release
|
name: Release
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
@ -24,7 +24,7 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.6.21")
|
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.6.21")
|
||||||
implementation("app.revanced:revanced-patcher:1.0.0-dev.16")
|
implementation("app.revanced:revanced-patcher:1.0.0-dev.17")
|
||||||
implementation("app.revanced:revanced-patches:1.0.0-dev.11")
|
implementation("app.revanced:revanced-patches:1.0.0-dev.11")
|
||||||
|
|
||||||
implementation("info.picocli:picocli:4.6.3")
|
implementation("info.picocli:picocli:4.6.3")
|
||||||
|
@ -58,9 +58,9 @@ internal object MainCommand : Runnable {
|
|||||||
for (it in JarPatchBundle(patchBundlePath).loadPatches())
|
for (it in JarPatchBundle(patchBundlePath).loadPatches())
|
||||||
println(
|
println(
|
||||||
"[available] ${
|
"[available] ${
|
||||||
it.javaClass.findAnnotationRecursively(
|
it.findAnnotationRecursively(
|
||||||
Name::class.java
|
Name::class.java
|
||||||
)?.name ?: Name::class.java.name
|
)?.name ?: it::class.java.name
|
||||||
}"
|
}"
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
@ -24,7 +24,7 @@ fun Patcher.addPatchesFiltered(
|
|||||||
|
|
||||||
val compatibilityAnnotation = patch.javaClass.findAnnotationRecursively(Compatibility::class.java)
|
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"
|
val prefix = "[skipped] $patchName"
|
||||||
|
|
||||||
@ -47,11 +47,12 @@ fun Patcher.addPatchesFiltered(
|
|||||||
return@patch
|
return@patch
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!packageVersionCompatibilityFilter || compatiblePackage.versions.any { it == packageVersion }) return@patch
|
if (packageVersionCompatibilityFilter && !compatiblePackage.versions.any { it == packageVersion }) {
|
||||||
println("$prefix: Unsupported version.")
|
println("$prefix: Unsupported version.")
|
||||||
return@patch
|
return@patch
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
includedPatches.add(patch)
|
includedPatches.add(patch)
|
||||||
println("[added] $patchName")
|
println("[added] $patchName")
|
||||||
|
Loading…
Reference in New Issue
Block a user