[FEATURE] Отключение использования javaagent на стороне клиента

This commit is contained in:
Gravit 2019-12-11 07:53:47 +07:00
parent a350b3bd77
commit 73e0ed53bb
No known key found for this signature in database
GPG key ID: 061981E1E85D3216
2 changed files with 3 additions and 11 deletions

View file

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

View file

@ -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");