fix: ClassLoader not working with Java 9+

This commit is contained in:
danthe1st
2022-05-07 21:05:09 +02:00
parent 7a6025a278
commit 3a11e1135b
6 changed files with 26 additions and 37 deletions

View File

@@ -1,6 +1,5 @@
package app.revanced.cli
import app.revanced.patch.PatchLoader
import app.revanced.patch.Patches
import app.revanced.utils.adb.Adb
import picocli.CommandLine.*
@@ -49,8 +48,7 @@ internal object MainCommand : Runnable {
override fun run() {
if (listOnly) {
patchBundles.forEach {
PatchLoader.injectPatches(it)
Patches.loadPatches().forEach {
Patches.load(it).forEach {
println(it().metadata)
}
}

View File

@@ -1,6 +1,5 @@
package app.revanced.cli
import app.revanced.patch.PatchLoader
import app.revanced.patch.Patches
import app.revanced.patcher.data.base.Data
import app.revanced.patcher.patch.base.Patch
@@ -59,9 +58,8 @@ internal class Patcher {
val checkInclude = MainCommand.includedPatches.isNotEmpty()
MainCommand.patchBundles.forEach { bundle ->
PatchLoader.injectPatches(bundle)
val includedPatches = mutableListOf<Patch<Data>>()
Patches.loadPatches().forEach patch@{
Patches.load(bundle).forEach patch@{
val patch = it()
// TODO: filter out incompatible patches with package metadata