From 0b316dff563c675f95b3ecebfa14b2deabd251b5 Mon Sep 17 00:00:00 2001 From: Zaxar163 Date: Fri, 18 Oct 2019 16:36:38 +0200 Subject: [PATCH] =?UTF-8?q?[ANY]=20=D0=9D=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C?= =?UTF-8?q?=D1=88=D0=BE=D0=B9=20=D1=80=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D0=BD=D0=B3.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/pro/gravit/launchserver/LaunchServer.java | 5 ----- .../java/pro/gravit/launchserver/LaunchServerBuilder.java | 2 -- .../launchserver/command/service/GetModulusCommand.java | 1 - .../modules/impl/LaunchServerModulesManager.java | 1 - .../java/pro/gravit/launchserver/StartLaunchServerTest.java | 2 -- .../src/main/java/pro/gravit/launcher/LauncherEngine.java | 3 --- .../main/java/pro/gravit/launcher/client/ClientLauncher.java | 1 - .../java/pro/gravit/launcher/client/FunctionalBridge.java | 1 - .../src/main/java/pro/gravit/launcher/LauncherConfig.java | 2 -- .../gravit/launcher/modules/impl/SimpleModuleManager.java | 4 ++-- .../main/java/pro/gravit/utils/helper/SecurityHelper.java | 2 +- modules | 2 +- 12 files changed, 4 insertions(+), 22 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java index a1d7de7b..ebe28e43 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java @@ -13,12 +13,8 @@ import java.security.InvalidAlgorithmParameterException; import java.security.KeyPair; import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateException; import java.security.interfaces.ECPrivateKey; import java.security.interfaces.ECPublicKey; -import java.security.interfaces.RSAPrivateKey; -import java.security.interfaces.RSAPublicKey; -import java.security.spec.InvalidKeySpecException; import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -31,7 +27,6 @@ import java.util.Set; import java.util.Timer; import java.util.concurrent.atomic.AtomicBoolean; -import java.util.zip.CRC32; import org.bouncycastle.crypto.util.PrivateKeyFactory; import org.bouncycastle.operator.OperatorCreationException; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerBuilder.java b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerBuilder.java index 3b21bea1..d3c70de6 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerBuilder.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerBuilder.java @@ -3,8 +3,6 @@ import java.nio.file.Path; import java.security.interfaces.ECPrivateKey; import java.security.interfaces.ECPublicKey; -import java.security.interfaces.RSAPrivateKey; -import java.security.interfaces.RSAPublicKey; import pro.gravit.launchserver.config.LaunchServerConfig; import pro.gravit.launchserver.config.LaunchServerRuntimeConfig; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/GetModulusCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/GetModulusCommand.java index b7454ecc..dc2c3d82 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/GetModulusCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/GetModulusCommand.java @@ -2,7 +2,6 @@ import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.command.Command; -import pro.gravit.utils.helper.LogHelper; public class GetModulusCommand extends Command { public GetModulusCommand(LaunchServer server) { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerModulesManager.java b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerModulesManager.java index 24558e99..aeb68e84 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerModulesManager.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerModulesManager.java @@ -7,7 +7,6 @@ import pro.gravit.launcher.modules.LauncherModuleInfo; import pro.gravit.launcher.modules.impl.SimpleModuleManager; import pro.gravit.launchserver.LaunchServer; -import pro.gravit.launchserver.manangers.CertificateManager; import pro.gravit.utils.helper.LogHelper; import pro.gravit.utils.verify.LauncherTrustManager; diff --git a/LaunchServer/src/test/java/pro/gravit/launchserver/StartLaunchServerTest.java b/LaunchServer/src/test/java/pro/gravit/launchserver/StartLaunchServerTest.java index 31f9d75d..3b04e1b6 100644 --- a/LaunchServer/src/test/java/pro/gravit/launchserver/StartLaunchServerTest.java +++ b/LaunchServer/src/test/java/pro/gravit/launchserver/StartLaunchServerTest.java @@ -6,8 +6,6 @@ import java.security.SecureRandom; import java.security.interfaces.ECPrivateKey; import java.security.interfaces.ECPublicKey; -import java.security.interfaces.RSAPrivateKey; -import java.security.interfaces.RSAPublicKey; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java b/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java index 17f36147..7de55081 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java +++ b/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java @@ -9,7 +9,6 @@ import java.util.Objects; import java.util.concurrent.atomic.AtomicBoolean; -import org.bouncycastle.jce.provider.BouncyCastleProvider; import pro.gravit.launcher.client.*; import pro.gravit.launcher.client.events.ClientEngineInitPhase; import pro.gravit.launcher.client.events.ClientPreGuiPhase; @@ -28,8 +27,6 @@ import pro.gravit.launcher.request.websockets.StandartClientWebSocketService; import pro.gravit.utils.helper.*; -import javax.crypto.Cipher; - public class LauncherEngine { public static final AtomicBoolean IS_CLIENT = new AtomicBoolean(false); 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 7bfba319..ea3a684b 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java @@ -38,7 +38,6 @@ import pro.gravit.launcher.client.events.ClientLauncherInitPhase; import pro.gravit.launcher.client.events.ClientLauncherPostInitPhase; import pro.gravit.launcher.guard.LauncherGuardManager; -import pro.gravit.launcher.gui.JSRuntimeProvider; import pro.gravit.launcher.hasher.FileNameMatcher; import pro.gravit.launcher.hasher.HashedDir; import pro.gravit.launcher.hwid.HWIDProvider; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/FunctionalBridge.java b/Launcher/src/main/java/pro/gravit/launcher/client/FunctionalBridge.java index 2cdf51ab..c6f9aefc 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/FunctionalBridge.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/FunctionalBridge.java @@ -1,7 +1,6 @@ package pro.gravit.launcher.client; import java.nio.file.Path; -import java.util.Arrays; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/LauncherConfig.java b/LauncherAPI/src/main/java/pro/gravit/launcher/LauncherConfig.java index 9dc70fb4..e5d89753 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/LauncherConfig.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/LauncherConfig.java @@ -2,9 +2,7 @@ import java.io.IOException; import java.security.cert.CertificateException; -import java.security.interfaces.ECPrivateKey; import java.security.interfaces.ECPublicKey; -import java.security.interfaces.RSAPublicKey; import java.security.spec.InvalidKeySpecException; import java.util.Collections; import java.util.HashMap; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/impl/SimpleModuleManager.java b/LauncherAPI/src/main/java/pro/gravit/launcher/modules/impl/SimpleModuleManager.java index 81847cd2..237a6a9e 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/impl/SimpleModuleManager.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/modules/impl/SimpleModuleManager.java @@ -159,8 +159,8 @@ public LauncherModule loadModule(Path file) throws IOException { return null; } classLoader.addURL(file.toUri().toURL()); - @SuppressWarnings("unchecked cast") - Class clazz = (Class) Class.forName(moduleClass, false, classLoader); + @SuppressWarnings("unchecked") + Class clazz = (Class) Class.forName(moduleClass, false, classLoader); checkModuleClass(clazz, checkMode); LauncherModule module = clazz.newInstance(); loadModule(module); diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/SecurityHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/SecurityHelper.java index 23acb73e..c1e04ab9 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/SecurityHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/SecurityHelper.java @@ -169,7 +169,7 @@ public static boolean isValidToken(CharSequence token) { return token.length() == TOKEN_STRING_LENGTH && token.chars().allMatch(ch -> HEX.indexOf(ch) >= 0); } - private static Cipher newCipher(String algo) { + public static Cipher newCipher(String algo) { try { return Cipher.getInstance(algo); } catch (NoSuchAlgorithmException | NoSuchPaddingException e) { diff --git a/modules b/modules index 3417974a..14389214 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit 3417974a1e903115c27b5b2b51bd43c7bbd877d1 +Subproject commit 14389214577f16795ba9844905c2e3886a1ea6d4