mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2024-11-10 01:02:22 +01:00
fix: make patcher version public
This commit is contained in:
parent
25f74dc5e9
commit
76c45dd7c1
1 changed files with 7 additions and 3 deletions
|
@ -39,7 +39,6 @@ import java.io.File
|
|||
import java.nio.file.Files
|
||||
|
||||
private val NAMER = BasicDexFileNamer()
|
||||
private val VERSION = VersionReader.read()
|
||||
|
||||
/**
|
||||
* The ReVanced Patcher.
|
||||
|
@ -51,6 +50,11 @@ class Patcher(private val options: PatcherOptions) {
|
|||
|
||||
val data: PatcherData
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val version = VersionReader.read()
|
||||
}
|
||||
|
||||
init {
|
||||
val extInputFile = ExtFile(options.inputFile)
|
||||
try {
|
||||
|
@ -249,9 +253,9 @@ class Patcher(private val options: PatcherOptions) {
|
|||
fun addPatches(patches: Iterable<Class<out Patch<Data>>>) {
|
||||
for (patch in patches) {
|
||||
val needsVersion = patch.sincePatcherVersion
|
||||
if (needsVersion != null && needsVersion > VERSION) {
|
||||
if (needsVersion != null && needsVersion > version) {
|
||||
logger.error("Patch '${patch.patchName}' requires Patcher version $needsVersion or higher")
|
||||
logger.error("Current Patcher version is $VERSION")
|
||||
logger.error("Current Patcher version is $version")
|
||||
logger.warn("Skipping '${patch.patchName}'!")
|
||||
continue // TODO: continue or halt/throw?
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue