chore: migrate to new changes from the patcher
This commit is contained in:
parent
3a25dc4fa2
commit
01a4349a3f
212 changed files with 513 additions and 1021 deletions
|
|
@ -2,12 +2,12 @@ package app.revanced.meta
|
|||
|
||||
import app.revanced.meta.json.generateJson
|
||||
import app.revanced.meta.readme.generateText
|
||||
import app.revanced.patcher.data.Data
|
||||
import app.revanced.patcher.data.Context
|
||||
import app.revanced.patcher.patch.Patch
|
||||
import app.revanced.patcher.util.patch.impl.JarPatchBundle
|
||||
import app.revanced.patcher.util.patch.PatchBundle
|
||||
import java.io.File
|
||||
|
||||
typealias Bundle = List<Class<out Patch<Data>>>
|
||||
typealias Bundle = List<Class<out Patch<Context>>>
|
||||
|
||||
object Meta {
|
||||
@JvmStatic
|
||||
|
|
@ -20,7 +20,7 @@ object Meta {
|
|||
}
|
||||
}
|
||||
|
||||
fun accumulatePatches() = JarPatchBundle(
|
||||
fun accumulatePatches() = PatchBundle.Jar(
|
||||
File("build/libs/").listFiles()!!.first {
|
||||
it.name.startsWith("revanced-patches-") && it.name.endsWith(".jar")
|
||||
}.absolutePath
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
package app.revanced.meta.readme
|
||||
|
||||
import app.revanced.patcher.data.Data
|
||||
import app.revanced.patcher.data.Context
|
||||
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
|
||||
import app.revanced.patcher.patch.Patch
|
||||
|
||||
internal fun Class<out Patch<Data>>.getLatestVersion() =
|
||||
internal fun Class<out Patch<Context>>.getLatestVersion() =
|
||||
this.compatiblePackages?.first()?.versions?.map {
|
||||
SemanticVersion.fromString(it)
|
||||
}?.maxWithOrNull(SemanticVersionComparator)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package app.revanced.meta.readme
|
||||
|
||||
import app.revanced.meta.Bundle
|
||||
import app.revanced.patcher.data.Data
|
||||
import app.revanced.patcher.data.Context
|
||||
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
|
||||
import app.revanced.patcher.extensions.PatchExtensions.description
|
||||
import app.revanced.patcher.extensions.PatchExtensions.patchName
|
||||
|
|
@ -15,7 +15,7 @@ private val TABLE_REGEX = Regex("\\{\\{\\s?table\\s?}}")
|
|||
|
||||
fun generateText(bundle: Bundle) {
|
||||
val output = StringBuilder()
|
||||
val packages = mutableMapOf<String, MutableList<Class<out Patch<Data>>>>()
|
||||
val packages = mutableMapOf<String, MutableList<Class<out Patch<Context>>>>()
|
||||
|
||||
for (patch in bundle) {
|
||||
patch.compatiblePackages?.forEach { pkg ->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue