From da193ebf52d6edba0beef1af9107a58ef1423390 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 20 Jun 2020 15:04:43 +0100 Subject: [PATCH] Use platform class loader to resolve JDK types in the AstDeobfuscator Signed-off-by: Graham --- .../src/main/java/dev/openrs2/deob/ast/AstDeobfuscator.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deob-ast/src/main/java/dev/openrs2/deob/ast/AstDeobfuscator.kt b/deob-ast/src/main/java/dev/openrs2/deob/ast/AstDeobfuscator.kt index 36bfd35a0d..df0f9f06f7 100644 --- a/deob-ast/src/main/java/dev/openrs2/deob/ast/AstDeobfuscator.kt +++ b/deob-ast/src/main/java/dev/openrs2/deob/ast/AstDeobfuscator.kt @@ -5,9 +5,9 @@ import com.github.javaparser.ast.CompilationUnit import com.github.javaparser.printer.PrettyPrinter import com.github.javaparser.printer.PrettyPrinterConfiguration import com.github.javaparser.symbolsolver.JavaSymbolSolver +import com.github.javaparser.symbolsolver.resolution.typesolvers.ClassLoaderTypeSolver import com.github.javaparser.symbolsolver.resolution.typesolvers.CombinedTypeSolver import com.github.javaparser.symbolsolver.resolution.typesolvers.JavaParserTypeSolver -import com.github.javaparser.symbolsolver.resolution.typesolvers.ReflectionTypeSolver import com.github.javaparser.utils.SourceRoot import com.github.michaelbull.logging.InlineLogger import dev.openrs2.deob.ast.transform.Transformer @@ -21,7 +21,7 @@ class AstDeobfuscator @Inject constructor( private val transformers: Set<@JvmSuppressWildcards Transformer> ) { fun run(modules: List) { - val solver = CombinedTypeSolver(ReflectionTypeSolver(true)) + val solver = CombinedTypeSolver(ClassLoaderTypeSolver(ClassLoader.getPlatformClassLoader())) for (module in modules) { solver.add(JavaParserTypeSolver(module)) }