[FIX] Launcher sign.

This commit is contained in:
Zaxar163 2019-03-28 10:49:27 +03:00
parent d2565b74ec
commit 4edff09e78
2 changed files with 4 additions and 8 deletions

View file

@ -11,6 +11,7 @@
import ru.gravit.launcher.profiles.ClientProfile; import ru.gravit.launcher.profiles.ClientProfile;
import ru.gravit.launcher.profiles.PlayerProfile; import ru.gravit.launcher.profiles.PlayerProfile;
import ru.gravit.launcher.request.Request; import ru.gravit.launcher.request.Request;
import ru.gravit.launcher.request.update.LegacyLauncherRequest;
import ru.gravit.launcher.serialize.HInput; import ru.gravit.launcher.serialize.HInput;
import ru.gravit.launcher.serialize.HOutput; import ru.gravit.launcher.serialize.HOutput;
import ru.gravit.launcher.serialize.stream.StreamObject; import ru.gravit.launcher.serialize.stream.StreamObject;
@ -34,8 +35,6 @@
import java.nio.file.attribute.BasicFileAttributes; import java.nio.file.attribute.BasicFileAttributes;
import java.nio.file.attribute.PosixFilePermission; import java.nio.file.attribute.PosixFilePermission;
import java.util.*; import java.util.*;
import java.util.Timer;
import java.util.concurrent.TimeUnit;
public final class ClientLauncher { public final class ClientLauncher {
private static Gson gson = new Gson(); private static Gson gson = new Gson();
@ -300,7 +299,6 @@ private static void launch(ClientProfile profile, Params params) throws Throwabl
public static Process launch( public static Process launch(
HashedDir assetHDir, HashedDir clientHDir, HashedDir assetHDir, HashedDir clientHDir,
ClientProfile profile, Params params, boolean pipeOutput) throws Throwable { ClientProfile profile, Params params, boolean pipeOutput) throws Throwable {
// Write params file (instead of CLI; Mustdie32 API can't handle command line > 32767 chars)
LogHelper.debug("Writing ClientLauncher params"); LogHelper.debug("Writing ClientLauncher params");
ClientLauncherContext context = new ClientLauncherContext(); ClientLauncherContext context = new ClientLauncherContext();
clientStarted = false; clientStarted = false;
@ -427,7 +425,6 @@ public static void main(String... args) throws Throwable {
engine.runtimeProvider.init(true); engine.runtimeProvider.init(true);
engine.runtimeProvider.preLoad(); engine.runtimeProvider.preLoad();
LauncherGuardManager.initGuard(true); LauncherGuardManager.initGuard(true);
// Read and delete params file
LogHelper.debug("Reading ClientLauncher params"); LogHelper.debug("Reading ClientLauncher params");
Params params; Params params;
ClientProfile profile; ClientProfile profile;
@ -438,8 +435,6 @@ public static void main(String... args) throws Throwable {
try (HInput input = new HInput(socket.getInputStream())) { try (HInput input = new HInput(socket.getInputStream())) {
params = new Params(input); params = new Params(input);
profile = gson.fromJson(input.readString(0), ClientProfile.class); profile = gson.fromJson(input.readString(0), ClientProfile.class);
// Read hdirs
assetHDir = new HashedDir(input); assetHDir = new HashedDir(input);
clientHDir = new HashedDir(input); clientHDir = new HashedDir(input);
} }
@ -455,8 +450,8 @@ public static void main(String... args) throws Throwable {
Launcher.modulesManager.initModules(); Launcher.modulesManager.initModules();
// Verify ClientLauncher sign and classpath // Verify ClientLauncher sign and classpath
LogHelper.debug("Verifying ClientLauncher sign and classpath"); LogHelper.debug("Verifying ClientLauncher sign and classpath");
//TODO: GO TO DIGEST //Warning - experimental.
//SecurityHelper.verifySign(LegacyLauncherRequest.BINARY_PATH, params.launcherDigest, publicKey); SecurityHelper.verifySign(LegacyLauncherRequest.BINARY_PATH, params.launcherDigest, Launcher.getConfig().publicKey);
LinkedList<Path> classPath = resolveClassPathList(params.clientDir, profile.getClassPath()); LinkedList<Path> classPath = resolveClassPathList(params.clientDir, profile.getClassPath());
for (Path classpathURL : classPath) { for (Path classpathURL : classPath) {
LauncherAgent.addJVMClassPath(classpathURL.toAbsolutePath().toString()); LauncherAgent.addJVMClassPath(classpathURL.toAbsolutePath().toString());

View file

@ -4,6 +4,7 @@
dependencies { dependencies {
compile project(':libLauncher') compile project(':libLauncher')
compile 'org.java-websocket:Java-WebSocket:1.3.9' compile 'org.java-websocket:Java-WebSocket:1.3.9'
compile 'org.apache.httpcomponents:httpclient:4.5.7'
compileOnly 'com.google.guava:guava:26.0-jre' compileOnly 'com.google.guava:guava:26.0-jre'
compile files('../compat/authlib/authlib-clean.jar') compile files('../compat/authlib/authlib-clean.jar')
} }