mirror of
https://github.com/revanced/revanced-patcher.git
synced 2025-05-02 14:04:24 +02:00
fix: make patcher version public
This commit is contained in:
parent
25f74dc5e9
commit
76c45dd7c1
@ -39,7 +39,6 @@ import java.io.File
|
|||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
|
|
||||||
private val NAMER = BasicDexFileNamer()
|
private val NAMER = BasicDexFileNamer()
|
||||||
private val VERSION = VersionReader.read()
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ReVanced Patcher.
|
* The ReVanced Patcher.
|
||||||
@ -51,6 +50,11 @@ class Patcher(private val options: PatcherOptions) {
|
|||||||
|
|
||||||
val data: PatcherData
|
val data: PatcherData
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
@JvmStatic
|
||||||
|
val version = VersionReader.read()
|
||||||
|
}
|
||||||
|
|
||||||
init {
|
init {
|
||||||
val extInputFile = ExtFile(options.inputFile)
|
val extInputFile = ExtFile(options.inputFile)
|
||||||
try {
|
try {
|
||||||
@ -249,9 +253,9 @@ class Patcher(private val options: PatcherOptions) {
|
|||||||
fun addPatches(patches: Iterable<Class<out Patch<Data>>>) {
|
fun addPatches(patches: Iterable<Class<out Patch<Data>>>) {
|
||||||
for (patch in patches) {
|
for (patch in patches) {
|
||||||
val needsVersion = patch.sincePatcherVersion
|
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("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}'!")
|
logger.warn("Skipping '${patch.patchName}'!")
|
||||||
continue // TODO: continue or halt/throw?
|
continue // TODO: continue or halt/throw?
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user