mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-16 14:27:18 +02:00

- I'm guessing it's based on the following branch, but I'm not sure: https://github.com/ReVanced/revanced-patches-template/pull/1985
25 lines
843 B
Kotlin
25 lines
843 B
Kotlin
package app.revanced.meta
|
|
|
|
import app.revanced.patcher.Context
|
|
import app.revanced.patcher.patch.Patch
|
|
import app.revanced.patcher.util.patch.PatchBundle
|
|
import java.io.File
|
|
|
|
internal typealias PatchBundlePatches = List<Class<out Patch<Context>>>
|
|
|
|
internal interface PatchesFileGenerator {
|
|
fun generate(bundle: PatchBundlePatches)
|
|
|
|
private companion object {
|
|
@JvmStatic
|
|
fun main(args: Array<String>) = PatchBundle.Jar(
|
|
File("build/libs/").listFiles()!!.first {
|
|
it.name.startsWith("revanced-patches-") && it.name.endsWith(".jar")
|
|
}.absolutePath
|
|
).toList().also {
|
|
if (it.isEmpty()) throw IllegalStateException("No patches found")
|
|
}.let { bundle ->
|
|
arrayOf(JsonGenerator(), ReadmeGenerator()).forEach { it.generate(bundle) }
|
|
}
|
|
}
|
|
} |