fix: patches not being reloaded

This commit is contained in:
Ax333l 2023-08-14 18:29:56 +02:00
parent 0520ff23c7
commit cd75ac90d9
No known key found for this signature in database
GPG Key ID: D2B4D85271127D23
1 changed files with 7 additions and 6 deletions

View File

@ -12,14 +12,15 @@ import java.io.File
class PatchBundle(private val loader: Iterable<PatchClass>, val integrations: File?) {
constructor(bundleJar: File, integrations: File?) : this(
object : Iterable<PatchClass> {
private val bundle = bundleJar.absolutePath.let {
PatchBundle.Dex(
it,
PathClassLoader(it, Patcher::class.java.classLoader)
)
private fun load(): List<PatchClass> {
val path = bundleJar.absolutePath
return PatchBundle.Dex(
path,
PathClassLoader(path, Patcher::class.java.classLoader)
).loadPatches()
}
override fun iterator() = bundle.loadPatches().iterator()
override fun iterator() = load().iterator()
},
integrations
) {