Open-source multiplayer game server compatible with the RuneScape client https://www.openrs2.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

31 lines
969 B

package org.openrs2.decompiler
import org.jetbrains.java.decompiler.main.Fernflower
import org.jetbrains.java.decompiler.main.extern.IFernflowerPreferences
import org.openrs2.deob.util.Module
import javax.inject.Singleton
@Singleton
public class Decompiler {
public fun run(modules: Set<Module>) {
for (module in modules) {
DecompilerIo(module.sources).use { io ->
val fernflower = Fernflower(io, io, OPTIONS, Slf4jFernflowerLogger)
for (dependency in module.transitiveDependencies) {
fernflower.addLibrary(dependency.jar.toFile())
}
fernflower.addSource(module.jar.toFile())
fernflower.decompileContext()
}
}
}
private companion object {
private val OPTIONS = mapOf(
IFernflowerPreferences.INDENT_STRING to "\t",
IFernflowerPreferences.SYNTHETIC_NOT_SET to "1"
)
}
}