[FIX] Bug fixes

This commit is contained in:
Gravita 2021-04-01 00:24:36 +07:00
parent edbed3db1d
commit 1cb2369bfa
3 changed files with 12 additions and 9 deletions

View file

@ -317,7 +317,7 @@ public void run() {
LogHelper.error(e);
LogHelper.error("Updates/Profiles not synced");
}
});
}).start();
}
if (config.netty != null)
rebindNettyServerSocket();

View file

@ -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;
}
}

View file

@ -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 {
URL inBuildCert = IOHelper.getResourceURL("pro/gravit/launchserver/defaults/BuildCertificate.crt");
try (OutputStream outputStream = IOHelper.newOutput(dir.resolve("BuildCertificate.crt"));
InputStream inputStream = IOHelper.newInput(IOHelper.getResourceURL("pro/gravit/launchserver/defaults/BuildCertificate.crt"))) {
InputStream inputStream = IOHelper.newInput(inBuildCert)) {
IOHelper.transfer(inputStream, outputStream);
} catch (Exception ignored) {
}
} catch (NoSuchFileException ignored) {
}
} else {
if(IOHelper.exists(dir.resolve("GravitCentralRootCA.crt"))) {
LogHelper.warning("Found old default certificate - 'GravitCentralRootCA.crt'. Delete...");