diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java index ef78541c..3c5fcaa4 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java @@ -317,7 +317,7 @@ public void run() { LogHelper.error(e); LogHelper.error("Updates/Profiles not synced"); } - }); + }).start(); } if (config.netty != null) rebindNettyServerSocket(); diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/components/Component.java b/LaunchServer/src/main/java/pro/gravit/launchserver/components/Component.java index 508036c6..604bc0b4 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/components/Component.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/components/Component.java @@ -13,6 +13,7 @@ public static void registerComponents() { providers.register("authLimiter", AuthLimiterComponent.class); providers.register("regLimiter", RegLimiterComponent.class); providers.register("commandRemover", CommandRemoverComponent.class); + providers.register("proguard", ProGuardComponent.class); registredComp = true; } } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/CertificateManager.java b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/CertificateManager.java index 5ddfbafa..76db3d9c 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/CertificateManager.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/CertificateManager.java @@ -28,10 +28,8 @@ import java.io.*; import java.math.BigInteger; -import java.nio.file.FileVisitResult; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.SimpleFileVisitor; +import java.net.URL; +import java.nio.file.*; import java.nio.file.attribute.BasicFileAttributes; import java.security.*; import java.security.cert.CertificateException; @@ -170,12 +168,16 @@ public X509CertificateHolder readCertificate(Reader reader) throws IOException { public void readTrustStore(Path dir) throws IOException, CertificateException { if (!IOHelper.isDir(dir)) { Files.createDirectories(dir); - try (OutputStream outputStream = IOHelper.newOutput(dir.resolve("BuildCertificate.crt")); - InputStream inputStream = IOHelper.newInput(IOHelper.getResourceURL("pro/gravit/launchserver/defaults/BuildCertificate.crt"))) { - IOHelper.transfer(inputStream, outputStream); - } catch (Exception ignored) { + try { + URL inBuildCert = IOHelper.getResourceURL("pro/gravit/launchserver/defaults/BuildCertificate.crt"); + try (OutputStream outputStream = IOHelper.newOutput(dir.resolve("BuildCertificate.crt")); + InputStream inputStream = IOHelper.newInput(inBuildCert)) { + IOHelper.transfer(inputStream, outputStream); + } + } catch (NoSuchFileException ignored) { } + } else { if(IOHelper.exists(dir.resolve("GravitCentralRootCA.crt"))) { LogHelper.warning("Found old default certificate - 'GravitCentralRootCA.crt'. Delete...");