From 73e0ed53bba888753da4e8d9f0468fa0a08eaddf Mon Sep 17 00:00:00 2001 From: Gravit Date: Wed, 11 Dec 2019 07:53:47 +0700 Subject: [PATCH] =?UTF-8?q?[FEATURE]=20=D0=9E=D1=82=D0=BA=D0=BB=D1=8E?= =?UTF-8?q?=D1=87=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20javaagent=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=81=D1=82=D0=BE=D1=80=D0=BE=D0=BD=D0=B5=20?= =?UTF-8?q?=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/pro/gravit/launcher/LauncherEngine.java | 3 --- .../pro/gravit/launcher/client/ClientLauncher.java | 11 +++-------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java b/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java index db38369d..9ef2d841 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java +++ b/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java @@ -75,9 +75,6 @@ public static void main(String... args) throws Throwable { HWIDProvider.registerHWIDs(); LauncherEngine.modulesManager.invokeEvent(new PreConfigPhase()); LauncherConfig config = Launcher.getConfig(); - if (config.environment.equals(LauncherConfig.LauncherEnvironment.PROD)) { - if (!LauncherAgent.isStarted()) throw new SecurityException("LauncherAgent must started"); - } long startTime = System.currentTimeMillis(); try { new LauncherEngine().start(args); 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 4d9e2aef..066b4aab 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java @@ -356,13 +356,12 @@ public static Process launch( } } // Add classpath and main class - String pathLauncher = IOHelper.getCodeSource(ClientLauncher.class).toString(); - context.pathLauncher = pathLauncher; + context.pathLauncher = IOHelper.getCodeSource(ClientLauncher.class).toString(); context.args.add(ClientLauncherWrapper.MAGIC_ARG); Collections.addAll(context.args, profile.getJvmArgs()); profile.pushOptionalJvmArgs(context.args); context.args.add("-Djava.library.path=".concat(params.clientDir.resolve(NATIVES_DIR).toString())); // Add Native Path - context.args.add("-javaagent:".concat(pathLauncher)); + //context.args.add("-javaagent:".concat(pathLauncher)); ClientHookManager.clientLaunchHook.hook(context); LauncherGuardManager.guard.addCustomParams(context); context.args.add(ClientLauncher.class.getName()); @@ -443,10 +442,7 @@ public static void main(String... args) throws Throwable { LauncherConfig.getAutogenConfig().initModules(); //INIT LauncherEngine.modulesManager.initModules(null); initGson(LauncherEngine.modulesManager); - if (!LauncherAgent.isStarted()) { - NativeJVMHalt.haltA(100); - return; - } + LauncherEngine.verifyNoAgent(); LauncherEngine.modulesManager.invokeEvent(new PreConfigPhase()); JVMHelper.verifySystemProperties(ClientLauncher.class, true); EnvHelper.checkDangerousParams(); @@ -507,7 +503,6 @@ public static void main(String... args) throws Throwable { }; AuthService.username = params.pp.username; AuthService.uuid = params.pp.uuid; - ClientService.instrumentation = LauncherAgent.inst; ClientService.classLoader = classLoader; classLoader.addURL(IOHelper.getCodeSource(ClientLauncher.class).toUri().toURL()); //classForName(classLoader, "com.google.common.collect.ForwardingMultimap");