From 97b30aa2349caf650f043ca539b862126a7602da Mon Sep 17 00:00:00 2001 From: Zaxar163 Date: Thu, 28 Nov 2019 18:01:04 +0100 Subject: [PATCH] =?UTF-8?q?[ANY]=20=D0=A0=D0=B5=D1=84=D0=B0=D0=BA=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=B8=D0=BD=D0=B3.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../binary/JARLauncherBinary.java | 3 --- .../launchserver/binary/ProguardConf.java | 6 +----- .../binary/tasks/CertificateAutogenTask.java | 1 - .../binary/tasks/MainBuildTask.java | 1 - .../binary/tasks/SignJarTask.java | 20 ------------------- .../binary/tasks/exe/Launch4JTask.java | 1 - .../response/update/UpdateResponse.java | 1 - .../launcher/client/ClientProcessBuilder.java | 1 - .../pro/gravit/utils/helper/CryptoHelper.java | 1 - .../gravit/launcher/server/ServerWrapper.java | 2 +- 10 files changed, 2 insertions(+), 35 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/JARLauncherBinary.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/JARLauncherBinary.java index 5bd5ea78..aec99498 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/JARLauncherBinary.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/JARLauncherBinary.java @@ -3,9 +3,6 @@ import pro.gravit.launcher.Launcher; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.binary.tasks.*; -import pro.gravit.utils.helper.CommonHelper; -import pro.gravit.utils.helper.IOHelper; -import pro.gravit.utils.helper.LogHelper; import java.io.IOException; import java.nio.file.Files; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/ProguardConf.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/ProguardConf.java index d9eb81ee..9201cad4 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/ProguardConf.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/ProguardConf.java @@ -70,7 +70,7 @@ public String[] buildConfig(Path inputJar, Path outputJar) { .map(e -> "-libraryjars \'" + e.toAbsolutePath().toString() + "\'") .forEach(confStrs::add); confStrs.add("-classobfuscationdictionary \'" + words.toFile().getName() + "\'"); - confStrs.add(readConf()); + confStrs.add("@".concat(config.toFile().getName())); return confStrs.toArray(new String[0]); } @@ -102,8 +102,4 @@ public void prepare(boolean force) { LogHelper.error(e); } } - - private String readConf() { - return "@".concat(config.toFile().getName()); - } } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/CertificateAutogenTask.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/CertificateAutogenTask.java index c597034f..feaddff3 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/CertificateAutogenTask.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/CertificateAutogenTask.java @@ -20,7 +20,6 @@ import java.math.BigInteger; import java.nio.file.Path; import java.security.cert.Certificate; -import java.security.cert.CertificateEncodingException; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.time.LocalDate; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/MainBuildTask.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/MainBuildTask.java index 83946c33..807e6993 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/MainBuildTask.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/MainBuildTask.java @@ -23,7 +23,6 @@ import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; import java.security.cert.CertificateEncodingException; -import java.security.cert.X509Certificate; import java.util.*; import java.util.jar.JarFile; import java.util.stream.Collectors; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/SignJarTask.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/SignJarTask.java index 44eadd98..d327150d 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/SignJarTask.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/SignJarTask.java @@ -1,17 +1,8 @@ package pro.gravit.launchserver.binary.tasks; -import org.bouncycastle.asn1.x500.X500Name; -import org.bouncycastle.asn1.x500.X500NameBuilder; -import org.bouncycastle.asn1.x500.style.BCStyle; -import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo; -import org.bouncycastle.cert.X509CertificateHolder; -import org.bouncycastle.cert.X509v3CertificateBuilder; -import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; import org.bouncycastle.cms.CMSException; import org.bouncycastle.cms.CMSSignedDataGenerator; -import org.bouncycastle.operator.ContentSigner; import org.bouncycastle.operator.OperatorCreationException; -import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.binary.SignerJar; import pro.gravit.launchserver.config.LaunchServerConfig; @@ -21,23 +12,12 @@ import java.io.File; import java.io.IOException; -import java.math.BigInteger; import java.nio.file.Path; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.UnrecoverableKeyException; -import java.security.cert.Certificate; import java.security.cert.CertificateEncodingException; -import java.security.cert.CertificateException; -import java.security.cert.X509Certificate; -import java.security.interfaces.ECPrivateKey; -import java.security.interfaces.ECPublicKey; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.ZoneId; -import java.util.ArrayList; -import java.util.Date; import java.util.jar.Manifest; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/exe/Launch4JTask.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/exe/Launch4JTask.java index 11ab9927..08d743fb 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/exe/Launch4JTask.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/exe/Launch4JTask.java @@ -4,7 +4,6 @@ import net.sf.launch4j.Log; import net.sf.launch4j.config.*; import pro.gravit.launchserver.LaunchServer; -import pro.gravit.launchserver.binary.EXEL4JLauncherBinary; import pro.gravit.launchserver.binary.tasks.LauncherBuildTask; import pro.gravit.utils.Version; import pro.gravit.utils.helper.IOHelper; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/UpdateResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/UpdateResponse.java index 3765dfa3..4eef9f11 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/UpdateResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/UpdateResponse.java @@ -1,7 +1,6 @@ package pro.gravit.launchserver.socket.response.update; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.events.request.ErrorRequestEvent; import pro.gravit.launcher.events.request.UpdateRequestEvent; import pro.gravit.launcher.hasher.HashedDir; import pro.gravit.launcher.profiles.ClientProfile; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/ClientProcessBuilder.java b/Launcher/src/main/java/pro/gravit/launcher/client/ClientProcessBuilder.java index cd4d9382..4259700d 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/ClientProcessBuilder.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/ClientProcessBuilder.java @@ -1,7 +1,6 @@ package pro.gravit.launcher.client; import pro.gravit.launcher.ClientLauncherWrapper; -import pro.gravit.launcher.Launcher; import pro.gravit.launcher.guard.LauncherGuardManager; import pro.gravit.launcher.hasher.HashedDir; import pro.gravit.launcher.managers.ClientHookManager; diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/CryptoHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/CryptoHelper.java index 7106fca5..3a843df7 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/CryptoHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/CryptoHelper.java @@ -1,6 +1,5 @@ package pro.gravit.utils.helper; -import java.io.OutputStream; import java.util.Objects; import java.util.function.LongSupplier; diff --git a/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapper.java b/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapper.java index 365f6eeb..3df2bc50 100644 --- a/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapper.java +++ b/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapper.java @@ -52,7 +52,7 @@ public ServerWrapper(Type type, Path configPath) { public boolean auth() { try { - LauncherConfig cfg = Launcher.getConfig(); + Launcher.getConfig(); AuthRequest request = new AuthRequest(config.login, config.password, config.auth_id, AuthRequest.ConnectTypes.SERVER); permissions = request.request().permissions; ProfilesRequestEvent result = new ProfilesRequest().request();