diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/Launcher.java b/LauncherAPI/src/main/java/pro/gravit/launcher/Launcher.java index 28bb2374..27457da0 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/Launcher.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/Launcher.java @@ -76,8 +76,6 @@ public static URL getResourceURL(String name) throws IOException { // Resolve URL and verify digest URL url = IOHelper.getResourceURL(RUNTIME_DIR + '/' + name); - if (!Arrays.equals(validDigest, SecurityHelper.digest(SecurityHelper.DigestAlgorithm.MD5, url))) - throw new NoSuchFileException(name); // Digest mismatch // Return verified URL return url; @@ -91,8 +89,6 @@ public static URL getResourceURL(String name, String prefix) throws IOException // Resolve URL and verify digest URL url = IOHelper.getResourceURL(prefix + '/' + name); - if (!Arrays.equals(validDigest, SecurityHelper.digest(SecurityHelper.DigestAlgorithm.MD5, url))) - throw new NoSuchFileException(name); // Digest mismatch // Return verified URL return url; diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java index 8c52aa53..6a9ec45d 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java @@ -119,7 +119,13 @@ private static JavaVersion tryFindJavaByPath(Path path) { public static void tryAddJava(List javaPaths, List result, JavaVersion version) { if (version == null) return; - String path = version.jvmDir.toAbsolutePath().toString(); + Path realPath = version.jvmDir.toAbsolutePath(); + try { + realPath = realPath.toRealPath(); + } catch (IOException ignored) { + + } + String path = realPath.toString(); if (javaPaths.contains(path)) return; javaPaths.add(path); result.add(version);