mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-25 03:31:03 +00:00
22 lines
726 B
Kotlin
22 lines
726 B
Kotlin
package app.revanced.meta
|
|
|
|
import app.revanced.patcher.PatchBundleLoader
|
|
import app.revanced.patcher.patch.PatchClass
|
|
import java.io.File
|
|
|
|
internal typealias PatchBundlePatches = List<PatchClass>
|
|
|
|
internal interface PatchesFileGenerator {
|
|
fun generate(bundle: PatchBundlePatches)
|
|
|
|
private companion object {
|
|
@JvmStatic
|
|
fun main(args: Array<String>) = PatchBundleLoader.Jar(
|
|
File("build/libs/").listFiles { it -> it.name.endsWith(".jar") }!!.first()
|
|
).also { loader ->
|
|
if (loader.isEmpty()) throw IllegalStateException("No patches found")
|
|
}.let { bundle ->
|
|
arrayOf(JsonGenerator()).forEach { generator -> generator.generate(bundle) }
|
|
}
|
|
}
|
|
} |