From ea5449a196f81fdd69f16c3618ecdaa510720f3d Mon Sep 17 00:00:00 2001 From: Gravit Date: Mon, 27 Apr 2020 04:22:32 +0700 Subject: [PATCH 01/15] [ANY] 5.1.5-dev --- LauncherCore/src/main/java/pro/gravit/utils/Version.java | 4 ++-- build.gradle | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LauncherCore/src/main/java/pro/gravit/utils/Version.java b/LauncherCore/src/main/java/pro/gravit/utils/Version.java index 706b2a80..9b2e44e0 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/Version.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/Version.java @@ -6,9 +6,9 @@ public final class Version { public static final int MAJOR = 5; public static final int MINOR = 1; - public static final int PATCH = 4; + public static final int PATCH = 5; public static final int BUILD = 1; - public static final Version.Type RELEASE = Type.STABLE; + public static final Version.Type RELEASE = Type.DEV; public final int major; public final int minor; public final int patch; diff --git a/build.gradle b/build.gradle index 6869c62b..85775327 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ id 'org.openjfx.javafxplugin' version '0.0.8' apply false } group = 'pro.gravit.launcher' -version = '5.1.4' +version = '5.1.5-SNAPSHOT' apply from: 'props.gradle' From fe21427d172fa80fd7bef7db3664f0263b28176e Mon Sep 17 00:00:00 2001 From: Gravit Date: Mon, 27 Apr 2020 05:22:49 +0700 Subject: [PATCH 02/15] [FEATURE] Raw WebSocketFrame API --- .../launchserver/socket/handlers/WebSocketFrameHandler.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/handlers/WebSocketFrameHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/handlers/WebSocketFrameHandler.java index 889e349c..a51182c2 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/handlers/WebSocketFrameHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/handlers/WebSocketFrameHandler.java @@ -8,6 +8,8 @@ import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.NettyConnectContext; import pro.gravit.launchserver.socket.WebSocketService; +import pro.gravit.utils.BiHookSet; +import pro.gravit.utils.HookSet; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.LogHelper; @@ -22,6 +24,7 @@ public class WebSocketFrameHandler extends SimpleChannelInboundHandler hooks = new BiHookSet<>(); private Client client; public WebSocketFrameHandler(NettyConnectContext context, LaunchServer srv, WebSocketService service) { @@ -58,6 +61,7 @@ public void channelActive(ChannelHandlerContext ctx) { @Override protected void channelRead0(ChannelHandlerContext ctx, WebSocketFrame frame) { // ping and pong frames already handled + if(hooks.hook(ctx, frame)) return; if (frame instanceof TextWebSocketFrame) { service.process(ctx, (TextWebSocketFrame) frame, client, context.ip); } else if ((frame instanceof PingWebSocketFrame)) { From 2f414ae9e7e44de4ac31b73b82fb48d5b284a35d Mon Sep 17 00:00:00 2001 From: Gravit Date: Mon, 27 Apr 2020 07:45:38 +0700 Subject: [PATCH 03/15] =?UTF-8?q?[ANY]=20=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D1=8B=20=D0=BC=D0=BE=D0=B4=D1=83=D0=BB=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index b3e50712..2fe73686 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit b3e50712f6a01f6ea4f0d7772371f9c01c309438 +Subproject commit 2fe7368616d85c4129ff9175fa1259139be11ef7 From 4ab66caad05a3e288cd78669656492170772a28a Mon Sep 17 00:00:00 2001 From: Gravit Date: Wed, 29 Apr 2020 10:57:37 +0700 Subject: [PATCH 04/15] =?UTF-8?q?[ANY]=20=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D1=8B=20=D0=BC=D0=BE=D0=B4=D1=83=D0=BB=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 2fe73686..20f142a8 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit 2fe7368616d85c4129ff9175fa1259139be11ef7 +Subproject commit 20f142a845b37a231479bfbdec30ae472d18d29d From 7f487726632236b3038563dd8184e0b78c1fa326 Mon Sep 17 00:00:00 2001 From: Gravit Date: Fri, 1 May 2020 07:56:58 +0700 Subject: [PATCH 05/15] =?UTF-8?q?[ANY]=20=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D1=8B=20=D0=BC=D0=BE=D0=B4=D1=83=D0=BB=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pro/gravit/launcher/LauncherEngine.java | 6 ++---- .../client/ClientLauncherCoreModule.java | 17 +++++++++++++++++ modules | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherCoreModule.java diff --git a/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java b/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java index 9e7232ed..1b3bcdf3 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java +++ b/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java @@ -1,9 +1,6 @@ package pro.gravit.launcher; -import pro.gravit.launcher.client.ClientLauncherEntryPoint; -import pro.gravit.launcher.client.ClientLauncherProcess; -import pro.gravit.launcher.client.ClientModuleManager; -import pro.gravit.launcher.client.DirBridge; +import pro.gravit.launcher.client.*; import pro.gravit.launcher.client.events.ClientEngineInitPhase; import pro.gravit.launcher.client.events.ClientExitPhase; import pro.gravit.launcher.client.events.ClientPreGuiPhase; @@ -93,6 +90,7 @@ public static void main(String... args) throws Throwable { LauncherEngine.checkClass(LauncherAgent.class); LauncherEngine.checkClass(ClientLauncherEntryPoint.class); LauncherEngine.modulesManager = new ClientModuleManager(); + LauncherEngine.modulesManager.loadModule(new ClientLauncherCoreModule()); LauncherConfig.initModules(LauncherEngine.modulesManager); LauncherEngine.modulesManager.initModules(null); // Start Launcher diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherCoreModule.java b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherCoreModule.java new file mode 100644 index 00000000..21e3c8af --- /dev/null +++ b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherCoreModule.java @@ -0,0 +1,17 @@ +package pro.gravit.launcher.client; + +import pro.gravit.launcher.modules.LauncherInitContext; +import pro.gravit.launcher.modules.LauncherModule; +import pro.gravit.launcher.modules.LauncherModuleInfo; +import pro.gravit.utils.Version; + +public class ClientLauncherCoreModule extends LauncherModule { + public ClientLauncherCoreModule() { + super(new LauncherModuleInfo("ClientLauncherCore", Version.getVersion())); + } + + @Override + public void init(LauncherInitContext initContext) { + + } +} diff --git a/modules b/modules index 20f142a8..4cb71b1c 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit 20f142a845b37a231479bfbdec30ae472d18d29d +Subproject commit 4cb71b1c0a2b4a4b066c680979775c2dbf1a244e From 65693fa867bdc49d598ec1ec9472c31fa5bfa7ce Mon Sep 17 00:00:00 2001 From: Gravit Date: Fri, 1 May 2020 08:30:36 +0700 Subject: [PATCH 06/15] =?UTF-8?q?[ANY]=20=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D1=8B=20=D0=BC=D0=BE=D0=B4=D1=83=D0=BB=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 4cb71b1c..7c529f62 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit 4cb71b1c0a2b4a4b066c680979775c2dbf1a244e +Subproject commit 7c529f6280c6fe05926aa355e74bbed140398553 From f676a5e1cf4cc3ce8e836cd07bfb6168f5b0d021 Mon Sep 17 00:00:00 2001 From: Gravit Date: Fri, 1 May 2020 08:45:45 +0700 Subject: [PATCH 07/15] =?UTF-8?q?[ANY]=20=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D1=8B=20=D0=BC=D0=BE=D0=B4=D1=83=D0=BB=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 7c529f62..04984c3c 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit 7c529f6280c6fe05926aa355e74bbed140398553 +Subproject commit 04984c3c75c484671e5b286527403ab55da28a01 From 19831a6f72014dd3d9abed73b6b00a9328388f2f Mon Sep 17 00:00:00 2001 From: Gravit Date: Fri, 1 May 2020 08:58:50 +0700 Subject: [PATCH 08/15] [FIX] GitHub Actions fix --- .github/workflows/push.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 9379d45a..fd5ef96f 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -42,9 +42,9 @@ jobs: cd ../../../LauncherAuthlib/build/libs cp LauncherAuthlib.jar ../../../artifacts/LauncherAuthlib.jar cd ../../../ - cp modules/*_module/build/libs/*.jar artifacts/modules - cp modules/*_swmodule/build/libs/*.jar artifacts/modules - cp modules/*_lmodule/build/libs/*.jar artifacts/modules + cp modules/*_module/build/libs/*.jar artifacts/modules || true + cp modules/*_swmodule/build/libs/*.jar artifacts/modules || true + cp modules/*_lmodule/build/libs/*.jar artifacts/modules || true - name: Upload artifacts uses: actions/upload-artifact@v1 From 4e4f606636980980efa609f58b93495a582dcb84 Mon Sep 17 00:00:00 2001 From: Gravit Date: Fri, 1 May 2020 09:57:14 +0700 Subject: [PATCH 09/15] =?UTF-8?q?[ANY]=20=D0=9F=D1=80=D0=B5=D0=B4=D1=83?= =?UTF-8?q?=D0=BF=D1=80=D0=B5=D0=B6=D0=B4=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D0=B8=20Autogen=20=D1=81=D0=B5=D1=80?= =?UTF-8?q?=D1=82=D0=B8=D1=84=D0=B8=D0=BA=D0=B0=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../launchserver/binary/tasks/CertificateAutogenTask.java | 3 +++ 1 file changed, 3 insertions(+) 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 47451bf0..9e5a1af4 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 @@ -50,6 +50,9 @@ public String getName() { public Path process(Path inputFile) throws IOException { if (signedDataGenerator != null) return inputFile; try { + LogHelper.warning("You are using an auto-generated certificate (sign.enabled false). It is not good"); + LogHelper.warning("It is highly recommended that you use the correct certificate (sign.enabled true)"); + LogHelper.warning("You can use GenerateCertificateModule or your own certificate."); X500NameBuilder subject = new X500NameBuilder(); subject.addRDN(BCStyle.CN, server.config.projectName.concat(" Autogenerated")); subject.addRDN(BCStyle.O, server.config.projectName); From 96d2cfaf261730c52ec1ae2ea2bf6d7e2eda2b62 Mon Sep 17 00:00:00 2001 From: Gravit Date: Fri, 1 May 2020 10:32:35 +0700 Subject: [PATCH 10/15] [FIX] Cyclic dependencies in LaunchServerCore Module --- .../launchserver/modules/impl/LaunchServerModulesManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 4996ab05..89433a37 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 @@ -17,7 +17,7 @@ public LaunchServerModulesManager(Path modulesDir, Path configDir, LauncherTrust super(modulesDir, configDir, trustManager); coreModule = new LaunchServerCoreModule(); checkMode = LauncherTrustManager.CheckMode.NONE_IN_NOT_SIGNED; - modules.add(coreModule); + loadModule(coreModule); } public void fullInitializedLaunchServer(LaunchServer server) { From ca5c435341dacc55c74dc141329e0991fed85b2e Mon Sep 17 00:00:00 2001 From: Gravit Date: Fri, 1 May 2020 23:56:08 +0700 Subject: [PATCH 11/15] [FIX] ClientLauncherCore module in ClientLauncherEntryPoint --- .../pro/gravit/launcher/client/ClientLauncherEntryPoint.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherEntryPoint.java b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherEntryPoint.java index b8735a44..b61d9d89 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherEntryPoint.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherEntryPoint.java @@ -67,6 +67,7 @@ public static void main(String[] args) throws Throwable { LauncherEngine.checkClass(LauncherAgent.class); LauncherEngine.checkClass(ClientLauncherEntryPoint.class); LauncherEngine.modulesManager = new ClientModuleManager(); + LauncherEngine.modulesManager.loadModule(new ClientLauncherCoreModule()); LauncherConfig.initModules(LauncherEngine.modulesManager); //INIT LauncherEngine.modulesManager.initModules(null); initGson(LauncherEngine.modulesManager); From 80e919f4a1108b4d1226e49ea77d5c31533c5cfd Mon Sep 17 00:00:00 2001 From: Gravit Date: Tue, 5 May 2020 06:40:03 +0700 Subject: [PATCH 12/15] =?UTF-8?q?[ANY]=20=D0=9F=D1=80=D0=BE=D0=B2=D0=B5?= =?UTF-8?q?=D1=80=D0=BA=D0=B0=20=D0=BD=D0=B0=20=D0=BD=D0=B0=D0=BB=D0=B8?= =?UTF-8?q?=D1=87=D0=B8=D0=B5=20=D1=84=D0=B0=D0=B9=D0=BB=D0=BE=D0=B2=20jav?= =?UTF-8?q?afx=20=D0=B4=D0=BB=D1=8F=20proguard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../binary/tasks/ProGuardBuildTask.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/ProGuardBuildTask.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/ProGuardBuildTask.java index 3fc2636c..af4f2d8b 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/ProGuardBuildTask.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/ProGuardBuildTask.java @@ -2,6 +2,7 @@ import pro.gravit.launchserver.LaunchServer; import pro.gravit.utils.helper.IOHelper; +import pro.gravit.utils.helper.JVMHelper; import pro.gravit.utils.helper.LogHelper; import proguard.Configuration; import proguard.ConfigurationParser; @@ -10,6 +11,7 @@ import java.io.IOException; import java.nio.file.Path; +import java.nio.file.Paths; public class ProGuardBuildTask implements LauncherBuildTask { private final LaunchServer server; @@ -30,6 +32,21 @@ public Path process(Path inputFile) throws IOException { Configuration proguard_cfg = new Configuration(); ConfigurationParser parser = new ConfigurationParser(server.proguardConf.buildConfig(inputFile, outputJar), server.proguardConf.proguard.toFile(), System.getProperties()); + if (JVMHelper.JVM_VERSION >= 9) + { + Path javaJModsPath = Paths.get(System.getProperty("java.home")).resolve("jmods"); + if(!IOHelper.exists(javaJModsPath)) + { + LogHelper.warning("Directory %s not found. It is not good", javaJModsPath); + } + else + { + //Find javaFX libraries + if(!IOHelper.exists(javaJModsPath.resolve("javafx.base.jmod"))) LogHelper.warning("javafx.base.jmod not found. Launcher can be assembled incorrectly. Maybe you need to install OpenJFX?"); + if(!IOHelper.exists(javaJModsPath.resolve("javafx.graphics.jmod"))) LogHelper.warning("javafx.graphics.jmod not found. Launcher can be assembled incorrectly. Maybe you need to install OpenJFX?"); + if(!IOHelper.exists(javaJModsPath.resolve("javafx.controls.jmod"))) LogHelper.warning("javafx.controls.jmod not found. Launcher can be assembled incorrectly. Maybe you need to install OpenJFX?"); + } + } try { parser.parse(proguard_cfg); ProGuard proGuard = new ProGuard(proguard_cfg); From 8d1c7621cfe5a8c9701779ef7d414b2b2a04087f Mon Sep 17 00:00:00 2001 From: Gravit Date: Tue, 5 May 2020 10:55:08 +0700 Subject: [PATCH 13/15] =?UTF-8?q?[FEATURE]=20=D0=A3=D0=BB=D1=83=D1=87?= =?UTF-8?q?=D1=88=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=81=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D1=8B=20=D0=B4=D0=BB=D1=8F=20HWID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth/protect/AdvancedProtectHandler.java | 28 +++++++++++++++++-- .../interfaces/SecureProtectHandler.java | 5 ++++ .../secure/HardwareReportResponse.java | 11 +++++++- .../secure/VerifySecureLevelKeyResponse.java | 2 +- .../VerifySecureLevelKeyRequestEvent.java | 9 ++++++ 5 files changed, 51 insertions(+), 4 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/AdvancedProtectHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/AdvancedProtectHandler.java index d792cde5..fe86458a 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/AdvancedProtectHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/AdvancedProtectHandler.java @@ -1,12 +1,16 @@ package pro.gravit.launchserver.auth.protect; import pro.gravit.launcher.events.request.GetSecureLevelInfoRequestEvent; +import pro.gravit.launcher.events.request.HardwareReportRequestEvent; +import pro.gravit.launcher.events.request.VerifySecureLevelKeyRequestEvent; +import pro.gravit.launchserver.auth.protect.interfaces.HardwareProtectHandler; import pro.gravit.launchserver.auth.protect.interfaces.SecureProtectHandler; import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.response.auth.AuthResponse; +import pro.gravit.launchserver.socket.response.secure.HardwareReportResponse; -public class AdvancedProtectHandler extends ProtectHandler implements SecureProtectHandler { - +public class AdvancedProtectHandler extends StdProtectHandler implements SecureProtectHandler, HardwareProtectHandler { + public boolean enableHardwareFeature; @Override public boolean allowGetAccessToken(AuthResponse.AuthContext context) { return (context.authType == AuthResponse.ConnectTypes.CLIENT) && context.client.checkSign; @@ -26,4 +30,24 @@ public GetSecureLevelInfoRequestEvent onGetSecureLevelInfo(GetSecureLevelInfoReq public boolean allowGetSecureLevelInfo(Client client) { return client.checkSign; } + + @Override + public void onHardwareReport(HardwareReportResponse response, Client client) { + if(!enableHardwareFeature) + { + response.sendResult(new HardwareReportRequestEvent()); + return; + } + + response.sendResult(new HardwareReportRequestEvent()); + } + + @Override + public VerifySecureLevelKeyRequestEvent onSuccessVerify(Client client) { + if(enableHardwareFeature) + { + return new VerifySecureLevelKeyRequestEvent(true); + } + return new VerifySecureLevelKeyRequestEvent(); + } } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/interfaces/SecureProtectHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/interfaces/SecureProtectHandler.java index 26b5e810..d19b9538 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/interfaces/SecureProtectHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/interfaces/SecureProtectHandler.java @@ -2,6 +2,7 @@ import pro.gravit.launcher.events.request.GetSecureLevelInfoRequestEvent; import pro.gravit.launcher.events.request.SecurityReportRequestEvent; +import pro.gravit.launcher.events.request.VerifySecureLevelKeyRequestEvent; import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.response.secure.SecurityReportResponse; import pro.gravit.utils.helper.SecurityHelper; @@ -31,4 +32,8 @@ default void verifySecureLevelKey(byte[] publicKey, byte[] data, byte[] signatur default SecurityReportRequestEvent onSecurityReport(SecurityReportResponse report, Client client) { return new SecurityReportRequestEvent(); } + default VerifySecureLevelKeyRequestEvent onSuccessVerify(Client client) + { + return new VerifySecureLevelKeyRequestEvent(); + } } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/secure/HardwareReportResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/secure/HardwareReportResponse.java index c9aa8db2..c5414576 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/secure/HardwareReportResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/secure/HardwareReportResponse.java @@ -1,7 +1,9 @@ package pro.gravit.launchserver.socket.response.secure; import io.netty.channel.ChannelHandlerContext; +import pro.gravit.launcher.events.request.HardwareReportRequestEvent; import pro.gravit.launcher.request.secure.HardwareReportRequest; +import pro.gravit.launchserver.auth.protect.interfaces.HardwareProtectHandler; import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.response.SimpleResponse; @@ -15,6 +17,13 @@ public String getType() { @Override public void execute(ChannelHandlerContext ctx, Client client) throws Exception { - + if(server.config.protectHandler instanceof HardwareProtectHandler) + { + ((HardwareProtectHandler) server.config.protectHandler).onHardwareReport(this, client); + } + else + { + sendResult(new HardwareReportRequestEvent()); + } } } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/secure/VerifySecureLevelKeyResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/secure/VerifySecureLevelKeyResponse.java index bd4c95e8..8037a821 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/secure/VerifySecureLevelKeyResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/secure/VerifySecureLevelKeyResponse.java @@ -39,6 +39,6 @@ public void execute(ChannelHandlerContext ctx, Client client) throws Exception { } client.trustLevel.keyChecked = true; client.trustLevel.publicKey = publicKey; - sendResult(new VerifySecureLevelKeyRequestEvent()); + sendResult(secureProtectHandler.onSuccessVerify(client)); } } diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/VerifySecureLevelKeyRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/VerifySecureLevelKeyRequestEvent.java index 785c3f53..c6a63041 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/VerifySecureLevelKeyRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/VerifySecureLevelKeyRequestEvent.java @@ -3,6 +3,15 @@ import pro.gravit.launcher.events.RequestEvent; public class VerifySecureLevelKeyRequestEvent extends RequestEvent { + public boolean needHardwareInfo; + + public VerifySecureLevelKeyRequestEvent() { + } + + public VerifySecureLevelKeyRequestEvent(boolean needHardwareInfo) { + this.needHardwareInfo = needHardwareInfo; + } + @Override public String getType() { return "verifySecureLevelKey"; From b9d29008ff86eeafb1bd9b8eab1b98216e5dc8bc Mon Sep 17 00:00:00 2001 From: Gravit Date: Tue, 5 May 2020 10:56:00 +0700 Subject: [PATCH 14/15] [FIX] Compile fix --- .../auth/protect/interfaces/HardwareProtectHandler.java | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/interfaces/HardwareProtectHandler.java diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/interfaces/HardwareProtectHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/interfaces/HardwareProtectHandler.java new file mode 100644 index 00000000..7f2621ec --- /dev/null +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/interfaces/HardwareProtectHandler.java @@ -0,0 +1,8 @@ +package pro.gravit.launchserver.auth.protect.interfaces; + +import pro.gravit.launchserver.socket.Client; +import pro.gravit.launchserver.socket.response.secure.HardwareReportResponse; + +public interface HardwareProtectHandler { + void onHardwareReport(HardwareReportResponse response, Client client); +} From 3332faac57eb28b7b99399cd3aa5823347f876ac Mon Sep 17 00:00:00 2001 From: Gravit Date: Fri, 8 May 2020 10:31:50 +0700 Subject: [PATCH 15/15] [ANY] 5.1.5 Stable --- LauncherCore/src/main/java/pro/gravit/utils/Version.java | 2 +- build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LauncherCore/src/main/java/pro/gravit/utils/Version.java b/LauncherCore/src/main/java/pro/gravit/utils/Version.java index 9b2e44e0..614cc940 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/Version.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/Version.java @@ -8,7 +8,7 @@ public final class Version { public static final int MINOR = 1; public static final int PATCH = 5; public static final int BUILD = 1; - public static final Version.Type RELEASE = Type.DEV; + public static final Version.Type RELEASE = Type.STABLE; public final int major; public final int minor; public final int patch; diff --git a/build.gradle b/build.gradle index 85775327..b507c090 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ id 'org.openjfx.javafxplugin' version '0.0.8' apply false } group = 'pro.gravit.launcher' -version = '5.1.5-SNAPSHOT' +version = '5.1.5' apply from: 'props.gradle'