Replace SystemClassLoader with the PlatformClassLoader

This ensures the bundler/deobfuscator can only see classes that are part
of the Java runtime, and not classes from the bundler/deobfuscator
themselves.

Signed-off-by: Graham <gpe@openrs2.dev>
bzip2
Graham 5 years ago
parent 8e0b480cfb
commit d4da4e2de3
  1. 2
      bundler/src/main/java/dev/openrs2/bundler/Bundler.kt
  2. 2
      deob/src/main/java/dev/openrs2/deob/Deobfuscator.kt

@ -44,7 +44,7 @@ class Bundler @Inject constructor(publicKeyTransformer: PublicKeyTransformer) {
val glClient = Library.readPack(input.resolve("runescape_gl.pack200")) val glClient = Library.readPack(input.resolve("runescape_gl.pack200"))
// bundle libraries together into a common classpath // bundle libraries together into a common classpath
val runtime = ClassLoader.getSystemClassLoader() val runtime = ClassLoader.getPlatformClassLoader()
val classPath = ClassPath( val classPath = ClassPath(
runtime, runtime,
dependencies = listOf(unpacker), dependencies = listOf(unpacker),

@ -88,7 +88,7 @@ class Deobfuscator(private val input: Path, private val output: Path) {
glUnpacker.remap(create(glUnpacker, "unpacker_")) glUnpacker.remap(create(glUnpacker, "unpacker_"))
// bundle libraries together into a common classpath // bundle libraries together into a common classpath
val runtime = ClassLoader.getSystemClassLoader() val runtime = ClassLoader.getPlatformClassLoader()
val classPath = ClassPath( val classPath = ClassPath(
runtime, runtime,
dependencies = emptyList(), dependencies = emptyList(),

Loading…
Cancel
Save