diff --git a/Launcher/src/main/java/pro/gravit/launcher/LauncherAgent.java b/Launcher/src/main/java/pro/gravit/launcher/LauncherAgent.java index af2d39fa..01122aff 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/LauncherAgent.java +++ b/Launcher/src/main/java/pro/gravit/launcher/LauncherAgent.java @@ -4,9 +4,11 @@ import static org.objectweb.asm.Opcodes.ARETURN; import java.io.ByteArrayOutputStream; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.lang.instrument.Instrumentation; +import java.nio.file.Path; import java.util.ArrayList; import java.util.List; import java.util.Locale; @@ -31,7 +33,12 @@ public final class LauncherAgent { public static void addJVMClassPath(String path) throws IOException { LogHelper.debug("Launcher Agent addJVMClassPath"); - inst.appendToSystemClassLoaderSearch(new JarFile(path)); + inst.appendToSystemClassLoaderSearch(new JarFile(new File(path))); + } + + public static void addJVMClassPath(Path path) throws IOException { + LogHelper.debug("Launcher Agent addJVMClassPath"); + inst.appendToSystemClassLoaderSearch(new JarFile(path.toFile())); } public boolean isAgentStarted() { diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java index f05bd312..32b35dd4 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java @@ -470,12 +470,12 @@ public static void main(String... args) throws Throwable { LogHelper.debug("Verifying ClientLauncher sign and classpath"); LinkedList classPath = resolveClassPathList(params.clientDir, profile.getClassPath()); for (Path classpathURL : classPath) { - LauncherAgent.addJVMClassPath(classpathURL.toAbsolutePath().toString()); + LauncherAgent.addJVMClassPath(classpathURL.normalize().toAbsolutePath()); } profile.pushOptionalClassPath(cp -> { LinkedList optionalClassPath = resolveClassPathList(params.clientDir, cp); for (Path classpathURL : optionalClassPath) { - LauncherAgent.addJVMClassPath(classpathURL.toAbsolutePath().toString()); + LauncherAgent.addJVMClassPath(classpathURL.normalize().toAbsolutePath()); } }); URL[] classpathurls = resolveClassPath(params.clientDir, profile.getClassPath()); diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/JarHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/JarHelper.java index f707f677..93f3470e 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/JarHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/JarHelper.java @@ -10,12 +10,12 @@ public class JarHelper { @FunctionalInterface public interface ZipWalkCallback { - void process(ZipInputStream input, ZipEntry e); + void process(ZipInputStream input, ZipEntry e) throws IOException; } @FunctionalInterface public interface JarWalkCallback { - void process(ZipInputStream input, ZipEntry e, String fullClassName, String clazz); + void process(ZipInputStream input, ZipEntry e, String fullClassName, String clazz) throws IOException; } public static void zipWalk(ZipInputStream input, ZipWalkCallback callback) throws IOException { diff --git a/modules b/modules index 36559441..ed27a816 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit 36559441ba26db3cc71818bd8a93b6464f7f00e0 +Subproject commit ed27a816fdc5794be260da0a3fb6e5f27db51bf8