mirror of
https://github.com/revanced/revanced-cli.git
synced 2025-02-10 17:56:48 +01:00
fix: check if packageVersion
is compatible with any from compatiblePackages
This commit is contained in:
parent
3878532688
commit
32589c88e4
@ -36,14 +36,14 @@ fun Patcher.addPatchesFiltered(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (compatiblePackages == null) println("$prefix: Missing compatibility annotation. Continuing.")
|
if (compatiblePackages == null) println("$prefix: Missing compatibility annotation. Continuing.")
|
||||||
else compatiblePackages.forEach { compatiblePackage ->
|
else {
|
||||||
if (compatiblePackage.name != packageName) {
|
if (!compatiblePackages.any { it.name == packageName }) {
|
||||||
println("$prefix: Package name not matching ${compatiblePackage.name}.")
|
println("$prefix: Incompatible package.")
|
||||||
return@patch
|
return@patch
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(debugging || compatiblePackage.versions.any { it == packageVersion })) {
|
if (!(debugging || compatiblePackages.any { it.versions.isEmpty() || it.versions.any { version -> version == packageVersion }})) {
|
||||||
println("$prefix: Unsupported version.")
|
println("$prefix: The package version is $packageVersion and is incompatible.")
|
||||||
return@patch
|
return@patch
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user