From d4da4e2de341ea1fed60fe9e204b3077630f3705 Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 15 Mar 2020 15:30:51 +0000 Subject: [PATCH] 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 --- bundler/src/main/java/dev/openrs2/bundler/Bundler.kt | 2 +- deob/src/main/java/dev/openrs2/deob/Deobfuscator.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bundler/src/main/java/dev/openrs2/bundler/Bundler.kt b/bundler/src/main/java/dev/openrs2/bundler/Bundler.kt index 595443c932..7a0f3713c3 100644 --- a/bundler/src/main/java/dev/openrs2/bundler/Bundler.kt +++ b/bundler/src/main/java/dev/openrs2/bundler/Bundler.kt @@ -44,7 +44,7 @@ class Bundler @Inject constructor(publicKeyTransformer: PublicKeyTransformer) { val glClient = Library.readPack(input.resolve("runescape_gl.pack200")) // bundle libraries together into a common classpath - val runtime = ClassLoader.getSystemClassLoader() + val runtime = ClassLoader.getPlatformClassLoader() val classPath = ClassPath( runtime, dependencies = listOf(unpacker), diff --git a/deob/src/main/java/dev/openrs2/deob/Deobfuscator.kt b/deob/src/main/java/dev/openrs2/deob/Deobfuscator.kt index 0b7bdbabf0..9feb9fd365 100644 --- a/deob/src/main/java/dev/openrs2/deob/Deobfuscator.kt +++ b/deob/src/main/java/dev/openrs2/deob/Deobfuscator.kt @@ -88,7 +88,7 @@ class Deobfuscator(private val input: Path, private val output: Path) { glUnpacker.remap(create(glUnpacker, "unpacker_")) // bundle libraries together into a common classpath - val runtime = ClassLoader.getSystemClassLoader() + val runtime = ClassLoader.getPlatformClassLoader() val classPath = ClassPath( runtime, dependencies = emptyList(),