mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 11:39:11 +03:00
Merge branch 'experimental/profiles-rework' into dev
This commit is contained in:
commit
0d74d8a671
38 changed files with 77 additions and 951 deletions
|
@ -219,7 +219,14 @@ public void reload(ReloadType type) throws Exception {
|
|||
});
|
||||
logger.debug("Init components successful");
|
||||
}
|
||||
|
||||
if(!type.equals(ReloadType.NO_AUTH)) {
|
||||
nettyServerSocketHandler.nettyServer.service.forEachActiveChannels((channel, wsHandler) -> {
|
||||
Client client = wsHandler.getClient();
|
||||
if(client.auth != null) {
|
||||
client.auth = config.getAuthProviderPair(client.auth_id);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -236,7 +243,7 @@ public void invoke(String... args) throws Exception {
|
|||
case "full" -> reload(ReloadType.FULL);
|
||||
case "no_auth" -> reload(ReloadType.NO_AUTH);
|
||||
case "no_components" -> reload(ReloadType.NO_COMPONENTS);
|
||||
default -> reload(ReloadType.FULL);
|
||||
default -> reload(ReloadType.NO_AUTH);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
public final class JARLauncherBinary extends LauncherBinary {
|
||||
public final AtomicLong count;
|
||||
public final Path runtimeDir;
|
||||
public final Path guardDir;
|
||||
public final Path buildDir;
|
||||
public final List<Path> coreLibs;
|
||||
public final List<Path> addonLibs;
|
||||
|
@ -27,7 +26,6 @@ public JARLauncherBinary(LaunchServer server) throws IOException {
|
|||
super(server, resolve(server, ".jar"), "Launcher-%s-%d.jar");
|
||||
count = new AtomicLong(0);
|
||||
runtimeDir = server.dir.resolve(Launcher.RUNTIME_DIR);
|
||||
guardDir = server.dir.resolve(Launcher.GUARD_DIR);
|
||||
buildDir = server.dir.resolve("build");
|
||||
coreLibs = new ArrayList<>();
|
||||
addonLibs = new ArrayList<>();
|
||||
|
|
|
@ -72,7 +72,6 @@ public Path process(Path inputJar) throws IOException {
|
|||
} else {
|
||||
context.pushDir(server.launcherBinary.runtimeDir, Launcher.RUNTIME_DIR, runtime, false);
|
||||
}
|
||||
context.pushDir(server.launcherBinary.guardDir, Launcher.GUARD_DIR, runtime, false);
|
||||
|
||||
LauncherConfig launcherConfig = new LauncherConfig(server.config.netty.address, server.keyAgreementManager.ecdsaPublicKey, server.keyAgreementManager.rsaPublicKey, runtime, server.config.projectName);
|
||||
context.pushFile(Launcher.CONFIG_FILE, launcherConfig);
|
||||
|
@ -108,7 +107,6 @@ protected void initProps() {
|
|||
properties.put("launcher.projectName", server.config.projectName);
|
||||
properties.put("runtimeconfig.secretKeyClient", SecurityHelper.randomStringAESKey());
|
||||
properties.put("launcher.port", 32148 + SecurityHelper.newRandom().nextInt(512));
|
||||
properties.put("launcher.guardType", server.config.launcher.guardType);
|
||||
properties.put("launchercore.env", server.config.env);
|
||||
properties.put("launcher.memory", server.config.launcher.memoryLimit);
|
||||
properties.put("launcher.customJvmOptions", server.config.launcher.customJvmOptions);
|
||||
|
|
|
@ -60,7 +60,6 @@ public boolean allowDelete() {
|
|||
|
||||
public void tryUnpack() throws IOException {
|
||||
logger.info("Unpacking launcher native guard list and runtime");
|
||||
UnpackHelper.unpackZipNoCheck("guard.zip", server.launcherBinary.guardDir);
|
||||
UnpackHelper.unpackZipNoCheck("runtime.zip", server.launcherBinary.runtimeDir);
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,6 @@ public static LaunchServerConfig getDefault(LaunchServer.LaunchServerEnv env) {
|
|||
newConfig.netty.performance.schedulerThread = 2;
|
||||
|
||||
newConfig.launcher = new LauncherConf();
|
||||
newConfig.launcher.guardType = "no";
|
||||
newConfig.launcher.compress = true;
|
||||
newConfig.launcher.deleteTempFiles = true;
|
||||
newConfig.launcher.stripLineNumbers = true;
|
||||
|
@ -269,7 +268,6 @@ public static class NettyUpdatesBind {
|
|||
}
|
||||
|
||||
public static class LauncherConf {
|
||||
public String guardType;
|
||||
public boolean compress;
|
||||
public boolean stripLineNumbers;
|
||||
public boolean deleteTempFiles;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"features": [],
|
||||
"features": ["profiles-rework"],
|
||||
"info": []
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
{
|
||||
"version": "1.10.2",
|
||||
"assetIndex": "1.10.2",
|
||||
"assetDir": "asset1.10",
|
||||
"dir": "HiTech",
|
||||
"info": "Информация о сервере",
|
||||
"sortIndex": 0,
|
||||
"title": "xxxxxxxx",
|
||||
"servers": [
|
||||
{
|
||||
"name": "----",
|
||||
"serverAddress": "localhost",
|
||||
"serverPort": 25565,
|
||||
"isDefault": true
|
||||
}
|
||||
],
|
||||
"update": ["servers.dat"],
|
||||
"updateExclusions": [],
|
||||
"updateShared": [],
|
||||
"updateVerify": [
|
||||
"libraries", "natives", "mods",
|
||||
"minecraft.jar", "forge.jar", "liteloader.jar"
|
||||
],
|
||||
"updateOptional": [
|
||||
],
|
||||
"updateFastCheck": true,
|
||||
"useWhitelist": false,
|
||||
"mainClass": "net.minecraft.launchwrapper.Launch",
|
||||
"jvmArgs": [
|
||||
"-Dfml.ignorePatchDiscrepancies=true",
|
||||
"-Dfml.ignoreInvalidMinecraftCertificates=true",
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
"-XX:+CMSIncrementalMode",
|
||||
"-XX:-UseAdaptiveSizePolicy",
|
||||
"-Xmn128M",
|
||||
"-XX:+DisableAttachMechanism"
|
||||
],
|
||||
"classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"],
|
||||
"clientArgs": [
|
||||
"--tweakClass", "net.minecraftforge.fml.common.launcher.FMLTweaker",
|
||||
"--tweakClass", "com.mumfrey.liteloader.launch.LiteLoaderTweaker"
|
||||
],
|
||||
"optionalJVMArgs": [],
|
||||
"optionalClientArgs": [],
|
||||
"optionalClassPath": [],
|
||||
"whitelist": []
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
{
|
||||
"version": "1.11.2",
|
||||
"assetIndex": "1.11.2",
|
||||
"assetDir": "asset1.11",
|
||||
"dir": "HiTech",
|
||||
"info": "Информация о сервере",
|
||||
"sortIndex": 0,
|
||||
"title": "xxxxxxxx",
|
||||
"servers": [
|
||||
{
|
||||
"name": "----",
|
||||
"serverAddress": "localhost",
|
||||
"serverPort": 25565,
|
||||
"isDefault": true
|
||||
}
|
||||
],
|
||||
"update": ["servers.dat"],
|
||||
"updateExclusions": [],
|
||||
"updateShared": [],
|
||||
"updateVerify": [
|
||||
"libraries", "natives", "mods",
|
||||
"minecraft.jar", "forge.jar", "liteloader.jar"
|
||||
],
|
||||
"updateOptional": [
|
||||
],
|
||||
"updateFastCheck": true,
|
||||
"useWhitelist": false,
|
||||
"mainClass": "net.minecraft.launchwrapper.Launch",
|
||||
"jvmArgs": [
|
||||
"-Dfml.ignorePatchDiscrepancies=true",
|
||||
"-Dfml.ignoreInvalidMinecraftCertificates=true",
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
"-XX:+CMSIncrementalMode",
|
||||
"-XX:-UseAdaptiveSizePolicy",
|
||||
"-Xmn128M",
|
||||
"-XX:+DisableAttachMechanism"
|
||||
],
|
||||
"classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"],
|
||||
"clientArgs": [
|
||||
"--tweakClass", "net.minecraftforge.fml.common.launcher.FMLTweaker",
|
||||
"--tweakClass", "com.mumfrey.liteloader.launch.LiteLoaderTweaker"
|
||||
],
|
||||
"optionalJVMArgs": [],
|
||||
"optionalClientArgs": [],
|
||||
"optionalClassPath": [],
|
||||
"whitelist": []
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
{
|
||||
"version": "1.12.2",
|
||||
"assetIndex": "1.12.2",
|
||||
"assetDir": "asset1.12",
|
||||
"dir": "HiTech",
|
||||
"info": "Информация о сервере",
|
||||
"sortIndex": 0,
|
||||
"title": "xxxxxxxx",
|
||||
"servers": [
|
||||
{
|
||||
"name": "----",
|
||||
"serverAddress": "localhost",
|
||||
"serverPort": 25565,
|
||||
"isDefault": true
|
||||
}
|
||||
],
|
||||
"update": ["servers.dat"],
|
||||
"updateExclusions": [],
|
||||
"updateShared": [],
|
||||
"updateVerify": [
|
||||
"libraries", "natives", "mods",
|
||||
"minecraft.jar", "forge.jar", "liteloader.jar"
|
||||
],
|
||||
"updateOptional": [
|
||||
],
|
||||
"updateFastCheck": true,
|
||||
"useWhitelist": false,
|
||||
"mainClass": "net.minecraft.launchwrapper.Launch",
|
||||
"jvmArgs": [
|
||||
"-Dfml.ignorePatchDiscrepancies=true",
|
||||
"-Dfml.ignoreInvalidMinecraftCertificates=true",
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
"-XX:+CMSIncrementalMode",
|
||||
"-XX:-UseAdaptiveSizePolicy",
|
||||
"-Xmn128M",
|
||||
"-XX:+DisableAttachMechanism"
|
||||
],
|
||||
"classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"],
|
||||
"clientArgs": [
|
||||
"--tweakClass", "com.mumfrey.liteloader.launch.LiteLoaderTweaker",
|
||||
"--tweakClass", "net.minecraftforge.fml.common.launcher.FMLTweaker"
|
||||
],
|
||||
"optionalJVMArgs": [],
|
||||
"optionalClientArgs": [],
|
||||
"optionalClassPath": [],
|
||||
"whitelist": []
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
{
|
||||
"version": "1.13.1",
|
||||
"assetIndex": "1.13.1",
|
||||
"assetDir": "asset1.13.1",
|
||||
"dir": "HiTech",
|
||||
"info": "Информация о сервере",
|
||||
"sortIndex": 0,
|
||||
"title": "xxxxxxxx",
|
||||
"servers": [
|
||||
{
|
||||
"name": "----",
|
||||
"serverAddress": "localhost",
|
||||
"serverPort": 25565,
|
||||
"isDefault": true
|
||||
}
|
||||
],
|
||||
"update": ["servers.dat"],
|
||||
"updateExclusions": [],
|
||||
"updateShared": [],
|
||||
"updateVerify": [
|
||||
"libraries", "natives", "mods",
|
||||
"minecraft.jar", "forge.jar", "liteloader.jar"
|
||||
],
|
||||
"updateOptional": [
|
||||
],
|
||||
"updateFastCheck": true,
|
||||
"useWhitelist": false,
|
||||
"mainClass": "net.minecraft.client.main.Main",
|
||||
"jvmArgs": [
|
||||
"-Dfml.ignorePatchDiscrepancies=true",
|
||||
"-Dfml.ignoreInvalidMinecraftCertificates=true",
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
"-XX:+CMSIncrementalMode",
|
||||
"-XX:-UseAdaptiveSizePolicy",
|
||||
"-Xmn128M",
|
||||
"-XX:+DisableAttachMechanism"
|
||||
],
|
||||
"classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"],
|
||||
"clientArgs": [
|
||||
],
|
||||
"optionalJVMArgs": [],
|
||||
"optionalClientArgs": [],
|
||||
"optionalClassPath": [],
|
||||
"whitelist": []
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
{
|
||||
"version": "1.13",
|
||||
"assetIndex": "1.13",
|
||||
"assetDir": "asset1.13",
|
||||
"dir": "HiTech",
|
||||
"info": "Информация о сервере",
|
||||
"sortIndex": 0,
|
||||
"title": "xxxxxxxx",
|
||||
"servers": [
|
||||
{
|
||||
"name": "----",
|
||||
"serverAddress": "localhost",
|
||||
"serverPort": 25565,
|
||||
"isDefault": true
|
||||
}
|
||||
],
|
||||
"update": ["servers.dat"],
|
||||
"updateExclusions": [],
|
||||
"updateShared": [],
|
||||
"updateVerify": [
|
||||
"libraries", "natives", "mods",
|
||||
"minecraft.jar", "forge.jar", "liteloader.jar"
|
||||
],
|
||||
"updateOptional": [
|
||||
],
|
||||
"updateFastCheck": true,
|
||||
"useWhitelist": false,
|
||||
"mainClass": "net.minecraft.client.main.Main",
|
||||
"jvmArgs": [
|
||||
"-Dfml.ignorePatchDiscrepancies=true",
|
||||
"-Dfml.ignoreInvalidMinecraftCertificates=true",
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
"-XX:+CMSIncrementalMode",
|
||||
"-XX:-UseAdaptiveSizePolicy",
|
||||
"-Xmn128M",
|
||||
"-XX:+DisableAttachMechanism"
|
||||
],
|
||||
"classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"],
|
||||
"clientArgs": [
|
||||
],
|
||||
"optionalJVMArgs": [],
|
||||
"optionalClientArgs": [],
|
||||
"optionalClassPath": [],
|
||||
"whitelist": []
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
{
|
||||
"version": "1.14.4",
|
||||
"assetIndex": "1.14.4",
|
||||
"assetDir": "asset1.14.4",
|
||||
"dir": "HiTech",
|
||||
"info": "Информация о сервере",
|
||||
"sortIndex": 0,
|
||||
"title": "xxxxxxxx",
|
||||
"servers": [
|
||||
{
|
||||
"name": "----",
|
||||
"serverAddress": "localhost",
|
||||
"serverPort": 25565,
|
||||
"isDefault": true
|
||||
}
|
||||
],
|
||||
"update": [
|
||||
"servers.dat"
|
||||
],
|
||||
"updateExclusions": [],
|
||||
"updateShared": [],
|
||||
"updateVerify": [
|
||||
"libraries",
|
||||
"natives",
|
||||
"minecraft.jar"
|
||||
],
|
||||
"updateOptional": [],
|
||||
"updateFastCheck": true,
|
||||
"useWhitelist": false,
|
||||
"mainClass": "net.minecraft.client.main.Main",
|
||||
"jvmArgs": [
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
"-XX:+CMSIncrementalMode",
|
||||
"-XX:-UseAdaptiveSizePolicy",
|
||||
"-Xmn128M",
|
||||
"-XX:+DisableAttachMechanism"
|
||||
],
|
||||
"classPath": [
|
||||
"minecraft.jar",
|
||||
"libraries"
|
||||
],
|
||||
"clientArgs": [],
|
||||
"whitelist": []
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
{
|
||||
"version": "1.15.1",
|
||||
"assetIndex": "1.15.1",
|
||||
"assetDir": "asset1.15.1",
|
||||
"dir": "HiTech",
|
||||
"info": "Информация о сервере",
|
||||
"sortIndex": 0,
|
||||
"title": "xxxxxxxx",
|
||||
"servers": [
|
||||
{
|
||||
"name": "----",
|
||||
"serverAddress": "localhost",
|
||||
"serverPort": 25565,
|
||||
"isDefault": true
|
||||
}
|
||||
],
|
||||
"update": [
|
||||
"servers.dat"
|
||||
],
|
||||
"updateExclusions": [],
|
||||
"updateShared": [],
|
||||
"updateVerify": [
|
||||
"libraries",
|
||||
"natives",
|
||||
"minecraft.jar"
|
||||
],
|
||||
"updateOptional": [],
|
||||
"updateFastCheck": true,
|
||||
"useWhitelist": false,
|
||||
"mainClass": "net.minecraft.client.main.Main",
|
||||
"jvmArgs": [
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
"-XX:+CMSIncrementalMode",
|
||||
"-XX:-UseAdaptiveSizePolicy",
|
||||
"-Xmn128M",
|
||||
"-XX:+DisableAttachMechanism"
|
||||
],
|
||||
"classPath": [
|
||||
"minecraft.jar",
|
||||
"libraries"
|
||||
],
|
||||
"clientArgs": [],
|
||||
"whitelist": []
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
{
|
||||
"version": "1.15.2",
|
||||
"assetIndex": "1.15.2",
|
||||
"assetDir": "asset1.15.2",
|
||||
"dir": "HiTech",
|
||||
"info": "Информация о сервере",
|
||||
"sortIndex": 0,
|
||||
"title": "xxxxxxxx",
|
||||
"servers": [
|
||||
{
|
||||
"name": "----",
|
||||
"serverAddress": "localhost",
|
||||
"serverPort": 25565,
|
||||
"isDefault": true
|
||||
}
|
||||
],
|
||||
"update": [
|
||||
"servers.dat"
|
||||
],
|
||||
"updateExclusions": [],
|
||||
"updateShared": [],
|
||||
"updateVerify": [
|
||||
"libraries",
|
||||
"natives",
|
||||
"minecraft.jar"
|
||||
],
|
||||
"updateOptional": [],
|
||||
"updateFastCheck": true,
|
||||
"useWhitelist": false,
|
||||
"mainClass": "net.minecraft.client.main.Main",
|
||||
"jvmArgs": [
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
"-XX:+CMSIncrementalMode",
|
||||
"-XX:-UseAdaptiveSizePolicy",
|
||||
"-Xmn128M",
|
||||
"-XX:+DisableAttachMechanism"
|
||||
],
|
||||
"classPath": [
|
||||
"minecraft.jar",
|
||||
"libraries"
|
||||
],
|
||||
"clientArgs": [],
|
||||
"whitelist": []
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
{
|
||||
"version": "1.16.1",
|
||||
"assetIndex": "1.16.1",
|
||||
"assetDir": "asset1.16.1",
|
||||
"dir": "HiTech",
|
||||
"info": "Информация о сервере",
|
||||
"sortIndex": 0,
|
||||
"title": "xxxxxxxx",
|
||||
"servers": [
|
||||
{
|
||||
"name": "----",
|
||||
"serverAddress": "localhost",
|
||||
"serverPort": 25565,
|
||||
"isDefault": true
|
||||
}
|
||||
],
|
||||
"update": [
|
||||
"servers.dat"
|
||||
],
|
||||
"updateExclusions": [],
|
||||
"updateShared": [],
|
||||
"updateVerify": [
|
||||
"libraries",
|
||||
"natives",
|
||||
"minecraft.jar"
|
||||
],
|
||||
"updateOptional": [],
|
||||
"updateFastCheck": true,
|
||||
"useWhitelist": false,
|
||||
"mainClass": "net.minecraft.client.main.Main",
|
||||
"jvmArgs": [
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
"-XX:+CMSIncrementalMode",
|
||||
"-XX:-UseAdaptiveSizePolicy",
|
||||
"-Xmn128M",
|
||||
"-XX:+DisableAttachMechanism"
|
||||
],
|
||||
"classPath": [
|
||||
"minecraft.jar",
|
||||
"libraries"
|
||||
],
|
||||
"clientArgs": [],
|
||||
"whitelist": []
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
{
|
||||
"version": "1.4.7",
|
||||
"assetIndex": "---",
|
||||
"assetDir": "asset1.4.7",
|
||||
"dir": "xxxxxxx",
|
||||
"info": "Информация о сервере",
|
||||
"sortIndex": 0,
|
||||
"title": "Test1.4.7",
|
||||
"servers": [
|
||||
{
|
||||
"name": "----",
|
||||
"serverAddress": "localhost",
|
||||
"serverPort": 25565,
|
||||
"isDefault": true
|
||||
}
|
||||
],
|
||||
"update": ["servers.dat"],
|
||||
"updateExclusions": [],
|
||||
"updateShared": [],
|
||||
"updateVerify": [
|
||||
"libraries", "natives", "mods",
|
||||
"minecraft.jar"
|
||||
],
|
||||
"updateOptional": [
|
||||
],
|
||||
"updateFastCheck": true,
|
||||
"useWhitelist": false,
|
||||
"mainClass": "net.minecraft.launchwrapper.Launch",
|
||||
"jvmArgs": [
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
"-XX:+CMSIncrementalMode",
|
||||
"-XX:-UseAdaptiveSizePolicy",
|
||||
"-Xmn128M",
|
||||
"-XX:+DisableAttachMechanism",
|
||||
"-Dlauncher.legacy.skinsURL=http://skins.minecraft.net/MinecraftSkins/%username%.png",
|
||||
"-Dlauncher.legacy.cloaksURL=http://skins.minecraft.net/MinecraftCloaks/%username%.png"
|
||||
],
|
||||
"classPath": ["minecraft.jar", "libraries"],
|
||||
"clientArgs": [],
|
||||
"optionalJVMArgs": [],
|
||||
"optionalClientArgs": [],
|
||||
"optionalClassPath": [],
|
||||
"whitelist": []
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
{
|
||||
"version": "1.5.2",
|
||||
"assetIndex": "---",
|
||||
"assetDir": "asset1.5.2",
|
||||
"dir": "xxxxxxx",
|
||||
"info": "Информация о сервере",
|
||||
"sortIndex": 0,
|
||||
"title": "Test1.5.2",
|
||||
"servers": [
|
||||
{
|
||||
"name": "----",
|
||||
"serverAddress": "localhost",
|
||||
"serverPort": 25565,
|
||||
"isDefault": true
|
||||
}
|
||||
],
|
||||
"update": ["servers.dat"],
|
||||
"updateExclusions": [],
|
||||
"updateShared": [],
|
||||
"updateVerify": [
|
||||
"libraries", "natives", "mods",
|
||||
"minecraft.jar"
|
||||
],
|
||||
"updateOptional": [
|
||||
],
|
||||
"updateFastCheck": true,
|
||||
"useWhitelist": false,
|
||||
"mainClass": "net.minecraft.launchwrapper.Launch",
|
||||
"jvmArgs": [
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
"-XX:+CMSIncrementalMode",
|
||||
"-XX:-UseAdaptiveSizePolicy",
|
||||
"-Xmn128M",
|
||||
"-XX:+DisableAttachMechanism",
|
||||
"-Dlauncher.legacy.skinsURL=http://skins.minecraft.net/MinecraftSkins/%username%.png",
|
||||
"-Dlauncher.legacy.cloaksURL=http://skins.minecraft.net/MinecraftCloaks/%username%.png"
|
||||
],
|
||||
"classPath": ["minecraft.jar", "libraries"],
|
||||
"clientArgs": [],
|
||||
"optionalJVMArgs": [],
|
||||
"optionalClientArgs": [],
|
||||
"optionalClassPath": [],
|
||||
"whitelist": []
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
{
|
||||
"version": "1.6.4",
|
||||
"assetIndex": "---",
|
||||
"assetDir": "asset1.6.4",
|
||||
"dir": "xxxxxxx",
|
||||
"info": "Информация о сервере",
|
||||
"sortIndex": 0,
|
||||
"title": "Test1.6.4",
|
||||
"servers": [
|
||||
{
|
||||
"name": "----",
|
||||
"serverAddress": "localhost",
|
||||
"serverPort": 25565,
|
||||
"isDefault": true
|
||||
}
|
||||
],
|
||||
"update": ["servers.dat"],
|
||||
"updateExclusions": [],
|
||||
"updateShared": [],
|
||||
"updateVerify": [
|
||||
"libraries", "natives", "mods",
|
||||
"minecraft.jar", "forge.jar", "liteloader.jar"
|
||||
],
|
||||
"updateOptional": [
|
||||
],
|
||||
"updateFastCheck": true,
|
||||
"useWhitelist": false,
|
||||
"mainClass": "net.minecraft.launchwrapper.Launch",
|
||||
"jvmArgs": [
|
||||
"-Dfml.ignorePatchDiscrepancies=true",
|
||||
"-Dfml.ignoreInvalidMinecraftCertificates=true",
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
"-XX:+CMSIncrementalMode",
|
||||
"-XX:-UseAdaptiveSizePolicy",
|
||||
"-Xmn128M",
|
||||
"-XX:+DisableAttachMechanism",
|
||||
"-Dlauncher.legacy.skinsURL=http://skins.minecraft.net/MinecraftSkins/%username%.png",
|
||||
"-Dlauncher.legacy.cloaksURL=http://skins.minecraft.net/MinecraftCloaks/%username%.png"
|
||||
],
|
||||
"classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"],
|
||||
"clientArgs": [
|
||||
"--tweakClass", "cpw.mods.fml.common.launcher.FMLTweaker",
|
||||
"--tweakClass", "com.mumfrey.liteloader.launch.LiteLoaderTweaker"
|
||||
],
|
||||
"optionalJVMArgs": [],
|
||||
"optionalClientArgs": [],
|
||||
"optionalClassPath": [],
|
||||
"whitelist": []
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
{
|
||||
"version": "1.7.10",
|
||||
"assetIndex": "1.7.10",
|
||||
"assetDir": "asset1.7.10",
|
||||
"dir": "xxxxxxx",
|
||||
"info": "Информация о сервере",
|
||||
"sortIndex": 0,
|
||||
"title": "Test1.7.10",
|
||||
"servers": [
|
||||
{
|
||||
"name": "----",
|
||||
"serverAddress": "localhost",
|
||||
"serverPort": 25565,
|
||||
"isDefault": true
|
||||
}
|
||||
],
|
||||
"update": ["servers.dat"],
|
||||
"updateExclusions": [],
|
||||
"updateShared": [],
|
||||
"updateVerify": [
|
||||
"libraries", "natives", "mods",
|
||||
"minecraft.jar", "forge.jar", "liteloader.jar"
|
||||
],
|
||||
"updateOptional": [
|
||||
],
|
||||
"updateFastCheck": true,
|
||||
"useWhitelist": false,
|
||||
"mainClass": "net.minecraft.launchwrapper.Launch",
|
||||
"jvmArgs": [
|
||||
"-Dfml.ignorePatchDiscrepancies=true",
|
||||
"-Dfml.ignoreInvalidMinecraftCertificates=true",
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
"-XX:+CMSIncrementalMode",
|
||||
"-XX:-UseAdaptiveSizePolicy",
|
||||
"-Xmn128M",
|
||||
"-XX:+DisableAttachMechanism"
|
||||
],
|
||||
"classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"],
|
||||
"clientArgs": [
|
||||
"--tweakClass", "cpw.mods.fml.common.launcher.FMLTweaker",
|
||||
"--tweakClass", "com.mumfrey.liteloader.launch.LiteLoaderTweaker"
|
||||
],
|
||||
"optionalJVMArgs": [],
|
||||
"optionalClientArgs": [],
|
||||
"optionalClassPath": [],
|
||||
"whitelist": []
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
{
|
||||
"version": "1.7.2",
|
||||
"assetIndex": "1.7.2",
|
||||
"assetDir": "asset1.7.2",
|
||||
"dir": "xxxxxxx",
|
||||
"info": "Информация о сервере",
|
||||
"sortIndex": 0,
|
||||
"title": "Test1.7.2",
|
||||
"servers": [
|
||||
{
|
||||
"name": "----",
|
||||
"serverAddress": "localhost",
|
||||
"serverPort": 25565,
|
||||
"isDefault": true
|
||||
}
|
||||
],
|
||||
"update": ["servers.dat"],
|
||||
"updateExclusions": [],
|
||||
"updateShared": [],
|
||||
"updateVerify": [
|
||||
"libraries", "natives", "mods",
|
||||
"minecraft.jar", "forge.jar", "liteloader.jar"
|
||||
],
|
||||
"updateOptional": [
|
||||
],
|
||||
"updateFastCheck": true,
|
||||
"useWhitelist": false,
|
||||
"mainClass": "net.minecraft.launchwrapper.Launch",
|
||||
"jvmArgs": [
|
||||
"-Dfml.ignorePatchDiscrepancies=true",
|
||||
"-Dfml.ignoreInvalidMinecraftCertificates=true",
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
"-XX:+CMSIncrementalMode",
|
||||
"-XX:-UseAdaptiveSizePolicy",
|
||||
"-Xmn128M",
|
||||
"-XX:+DisableAttachMechanism"
|
||||
],
|
||||
"classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"],
|
||||
"clientArgs": [
|
||||
"--tweakClass", "cpw.mods.fml.common.launcher.FMLTweaker",
|
||||
"--tweakClass", "com.mumfrey.liteloader.launch.LiteLoaderTweaker"
|
||||
],
|
||||
"optionalJVMArgs": [],
|
||||
"optionalClientArgs": [],
|
||||
"optionalClassPath": [],
|
||||
"whitelist": []
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
{
|
||||
"version": "1.8.9",
|
||||
"assetIndex": "1.8.9",
|
||||
"assetDir": "asset1.8.9",
|
||||
"dir": "xxxxxxx",
|
||||
"info": "Информация о сервере",
|
||||
"sortIndex": 0,
|
||||
"title": "Test1.8.9",
|
||||
"servers": [
|
||||
{
|
||||
"name": "----",
|
||||
"serverAddress": "localhost",
|
||||
"serverPort": 25565,
|
||||
"isDefault": true
|
||||
}
|
||||
],
|
||||
"update": ["servers.dat"],
|
||||
"updateExclusions": [],
|
||||
"updateShared": [],
|
||||
"updateVerify": [
|
||||
"libraries", "natives", "mods",
|
||||
"minecraft.jar", "forge.jar", "liteloader.jar"
|
||||
],
|
||||
"updateOptional": [
|
||||
],
|
||||
"updateFastCheck": true,
|
||||
"useWhitelist": false,
|
||||
"mainClass": "net.minecraft.launchwrapper.Launch",
|
||||
"jvmArgs": [
|
||||
"-Dfml.ignorePatchDiscrepancies=true",
|
||||
"-Dfml.ignoreInvalidMinecraftCertificates=true",
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
"-XX:+CMSIncrementalMode",
|
||||
"-XX:-UseAdaptiveSizePolicy",
|
||||
"-Xmn128M",
|
||||
"-XX:+DisableAttachMechanism"
|
||||
],
|
||||
"classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"],
|
||||
"clientArgs": [
|
||||
"--tweakClass", "net.minecraftforge.fml.common.launcher.FMLTweaker",
|
||||
"--tweakClass", "com.mumfrey.liteloader.launch.LiteLoaderTweaker"
|
||||
],
|
||||
"optionalJVMArgs": [],
|
||||
"optionalClientArgs": [],
|
||||
"optionalClassPath": [],
|
||||
"whitelist": []
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
{
|
||||
"version": "1.9.4",
|
||||
"assetIndex": "1.9.4",
|
||||
"assetDir": "asset1.9.4",
|
||||
"dir": "xxxxxxx",
|
||||
"info": "Информация о сервере",
|
||||
"sortIndex": 0,
|
||||
"title": "Test1.9.4",
|
||||
"servers": [
|
||||
{
|
||||
"name": "----",
|
||||
"serverAddress": "localhost",
|
||||
"serverPort": 25565,
|
||||
"isDefault": true
|
||||
}
|
||||
],
|
||||
"update": ["servers.dat"],
|
||||
"updateExclusions": [],
|
||||
"updateShared": [],
|
||||
"updateVerify": [
|
||||
"libraries", "natives", "mods",
|
||||
"minecraft.jar", "forge.jar", "liteloader.jar"
|
||||
],
|
||||
"updateOptional": [
|
||||
],
|
||||
"updateFastCheck": true,
|
||||
"useWhitelist": false,
|
||||
"mainClass": "net.minecraft.launchwrapper.Launch",
|
||||
"jvmArgs": [
|
||||
"-Dfml.ignorePatchDiscrepancies=true",
|
||||
"-Dfml.ignoreInvalidMinecraftCertificates=true",
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
"-XX:+CMSIncrementalMode",
|
||||
"-XX:-UseAdaptiveSizePolicy",
|
||||
"-Xmn128M",
|
||||
"-XX:+DisableAttachMechanism"
|
||||
],
|
||||
"classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"],
|
||||
"clientArgs": [
|
||||
"--tweakClass", "net.minecraftforge.fml.common.launcher.FMLTweaker",
|
||||
"--tweakClass", "com.mumfrey.liteloader.launch.LiteLoaderTweaker"
|
||||
],
|
||||
"optionalJVMArgs": [],
|
||||
"optionalClientArgs": [],
|
||||
"optionalClassPath": [],
|
||||
"whitelist": []
|
||||
}
|
|
@ -8,9 +8,6 @@
|
|||
import pro.gravit.launcher.console.ModulesCommand;
|
||||
import pro.gravit.launcher.console.SignDataCommand;
|
||||
import pro.gravit.launcher.events.request.*;
|
||||
import pro.gravit.launcher.guard.LauncherGuard;
|
||||
import pro.gravit.launcher.guard.LauncherNoGuard;
|
||||
import pro.gravit.launcher.guard.LauncherWrapperGuard;
|
||||
import pro.gravit.launcher.gui.NoRuntimeProvider;
|
||||
import pro.gravit.launcher.gui.RuntimeProvider;
|
||||
import pro.gravit.launcher.managers.ClientGsonManager;
|
||||
|
@ -49,7 +46,6 @@
|
|||
|
||||
public class LauncherEngine {
|
||||
public static ClientLauncherProcess.ClientParams clientParams;
|
||||
public static LauncherGuard guard;
|
||||
public static ClientModuleManager modulesManager;
|
||||
public final boolean clientInstance;
|
||||
// Instance
|
||||
|
@ -153,16 +149,6 @@ public static void verifyNoAgent() {
|
|||
throw new SecurityException("JavaAgent found");
|
||||
}
|
||||
|
||||
public static LauncherGuard tryGetStdGuard() {
|
||||
switch (Launcher.getConfig().guardType) {
|
||||
case "no":
|
||||
return new LauncherNoGuard();
|
||||
case "wrapper":
|
||||
return new LauncherWrapperGuard();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static RequestService initOffline() {
|
||||
OfflineRequestService service = new OfflineRequestService();
|
||||
applyBasicOfflineProcessors(service);
|
||||
|
@ -232,7 +218,6 @@ public void readKeys() throws IOException, InvalidKeySpecException {
|
|||
|
||||
public void start(String... args) throws Throwable {
|
||||
//Launcher.modulesManager = new ClientModuleManager(this);
|
||||
LauncherEngine.guard = tryGetStdGuard();
|
||||
ClientPreGuiPhase event = new ClientPreGuiPhase(null);
|
||||
LauncherEngine.modulesManager.invokeEvent(event);
|
||||
runtimeProvider = event.runtimeProvider;
|
||||
|
|
|
@ -5,10 +5,15 @@
|
|||
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ClientClassLoader extends URLClassLoader {
|
||||
private static final ClassLoader SYSTEM_CLASS_LOADER = ClassLoader.getSystemClassLoader();
|
||||
public String nativePath;
|
||||
|
||||
private List<String> packages = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Constructs a new URLClassLoader for the specified URLs using the
|
||||
* default delegation parent {@code ClassLoader}. The URLs will
|
||||
|
@ -31,6 +36,8 @@ public class ClientClassLoader extends URLClassLoader {
|
|||
*/
|
||||
public ClientClassLoader(URL[] urls) {
|
||||
super(urls);
|
||||
packages.add("pro.gravit.launcher.");
|
||||
packages.add("pro.gravit.utils.");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -58,6 +65,18 @@ public ClientClassLoader(URL[] urls, ClassLoader parent) {
|
|||
super(urls, parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
|
||||
if(name != null) {
|
||||
for(String pkg : packages) {
|
||||
if(name.startsWith(pkg)) {
|
||||
return SYSTEM_CLASS_LOADER.loadClass(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.loadClass(name, resolve);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String findLibrary(String name) {
|
||||
return nativePath.concat(IOHelper.PLATFORM_SEPARATOR).concat(getNativePrefix()).concat(name).concat(getNativeEx());
|
||||
|
@ -81,6 +100,10 @@ else if (JVMHelper.OS_TYPE == JVMHelper.OS.MACOSX)
|
|||
return "";
|
||||
}
|
||||
|
||||
public void addAllowedPackage(String pkg) {
|
||||
packages.add(pkg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addURL(URL url) {
|
||||
super.addURL(url);
|
||||
|
|
|
@ -107,7 +107,6 @@ public static void main(String[] args) throws Throwable {
|
|||
} else if (params.session != null) {
|
||||
throw new UnsupportedOperationException("Legacy session not supported");
|
||||
}
|
||||
checkJVMBitsAndVersion(params.profile.getMinJavaVersion(), params.profile.getRecommendJavaVersion(), params.profile.getMaxJavaVersion(), params.profile.isWarnMissJavaVersion());
|
||||
LauncherEngine.modulesManager.invokeEvent(new ClientProcessInitPhase(engine, params));
|
||||
|
||||
Path clientDir = Paths.get(params.clientDir);
|
||||
|
@ -144,7 +143,7 @@ public static void main(String[] args) throws Throwable {
|
|||
LogHelper.debug("Natives dir %s", params.nativesDir);
|
||||
ClientProfile.ClassLoaderConfig classLoaderConfig = profile.getClassLoaderConfig();
|
||||
if (classLoaderConfig == ClientProfile.ClassLoaderConfig.LAUNCHER) {
|
||||
ClientClassLoader classLoader = new ClientClassLoader(classpathURLs.toArray(new URL[0]), ClassLoader.getSystemClassLoader());
|
||||
ClientClassLoader classLoader = new ClientClassLoader(classpathURLs.toArray(new URL[0]), ClientLauncherEntryPoint.class.getClassLoader());
|
||||
System.setProperty("java.class.path", classpath.stream().map(Path::toString).collect(Collectors.joining(File.pathSeparator)));
|
||||
ClientLauncherEntryPoint.classLoader = classLoader;
|
||||
Thread.currentThread().setContextClassLoader(classLoader);
|
||||
|
@ -174,15 +173,6 @@ public static void main(String[] args) throws Throwable {
|
|||
AuthService.username = params.playerProfile.username;
|
||||
AuthService.uuid = params.playerProfile.uuid;
|
||||
KeyService.serverRsaPublicKey = Launcher.getConfig().rsaPublicKey;
|
||||
if (params.profile.getRuntimeInClientConfig() != ClientProfile.RuntimeInClientConfig.NONE) {
|
||||
CommonHelper.newThread("Client Launcher Thread", true, () -> {
|
||||
try {
|
||||
engine.start(args);
|
||||
} catch (Throwable throwable) {
|
||||
LogHelper.error(throwable);
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
LauncherEngine.modulesManager.invokeEvent(new ClientProcessReadyEvent(engine, params));
|
||||
LogHelper.debug("Starting JVM and client WatchService");
|
||||
FileNameMatcher assetMatcher = profile.getAssetUpdateMatcher();
|
||||
|
@ -268,28 +258,6 @@ public static void verifyHDir(Path dir, HashedDir hdir, FileNameMatcher matcher,
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean checkJVMBitsAndVersion(int minVersion, int recommendVersion, int maxVersion, boolean showMessage) {
|
||||
boolean ok = true;
|
||||
if (JVMHelper.JVM_BITS == 64 && JVMHelper.ARCH_TYPE == JVMHelper.ARCH.X86) {
|
||||
String error = "У Вас установлена Java x64, но Ваша система определена как x32. Установите Java правильной разрядности";
|
||||
LogHelper.error(error);
|
||||
if (showMessage)
|
||||
JOptionPane.showMessageDialog(null, error);
|
||||
ok = false;
|
||||
}
|
||||
String jvmVersion = JVMHelper.RUNTIME_MXBEAN.getVmVersion();
|
||||
LogHelper.info(jvmVersion);
|
||||
int version = JVMHelper.getVersion();
|
||||
if (version < minVersion || version > maxVersion) {
|
||||
String error = String.format("У Вас установлена Java %d, но этот клиент требует Java %d", JVMHelper.getVersion(), recommendVersion);
|
||||
LogHelper.error(error);
|
||||
if (showMessage)
|
||||
JOptionPane.showMessageDialog(null, error);
|
||||
ok = false;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
private static LinkedList<Path> resolveClassPathList(Path clientDir, String... classPath) throws IOException {
|
||||
return resolveClassPathStream(clientDir, classPath).collect(Collectors.toCollection(LinkedList::new));
|
||||
}
|
||||
|
@ -353,7 +321,7 @@ private static void launch(ClientProfile profile, ClientLauncherProcess.ClientPa
|
|||
List<String> compatClasses = profile.getCompatClasses();
|
||||
for (String e : compatClasses) {
|
||||
Class<?> clazz = classLoader.loadClass(e);
|
||||
MethodHandle runMethod = MethodHandles.publicLookup().findStatic(clazz, "run", MethodType.methodType(void.class));
|
||||
MethodHandle runMethod = MethodHandles.lookup().findStatic(clazz, "run", MethodType.methodType(void.class));
|
||||
runMethod.invoke();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,9 +76,14 @@ public ClientLauncherProcess(Path clientDir, Path assetDir, JavaHelper.JavaVersi
|
|||
this.params.clientDir = this.workDir.toString();
|
||||
this.params.resourcePackDir = resourcePackDir.toAbsolutePath().toString();
|
||||
this.params.assetDir = assetDir.toAbsolutePath().toString();
|
||||
Path nativesPath = workDir.resolve("natives").resolve(JVMHelper.OS_TYPE.name).resolve(javaVersion.arch.name);
|
||||
if (!Files.isDirectory(nativesPath)) {
|
||||
Path nativesPath;
|
||||
if(profile.hasFlag(ClientProfile.CompatibilityFlags.LEGACY_NATIVES_DIR)) {
|
||||
nativesPath = workDir.resolve("natives");
|
||||
} else {
|
||||
nativesPath = workDir.resolve("natives").resolve(JVMHelper.OS_TYPE.name).resolve(javaVersion.arch.name);
|
||||
}
|
||||
if (!Files.isDirectory(nativesPath)) {
|
||||
throw new RuntimeException(String.format("Natives dir %s not exist! Your operating system or architecture not supported", nativesPath.toAbsolutePath()));
|
||||
}
|
||||
this.params.nativesDir = nativesPath.toString();
|
||||
this.params.profile = profile;
|
||||
|
@ -123,22 +128,11 @@ private void applyClientProfile() {
|
|||
}
|
||||
this.jvmModules.addAll(this.params.profile.getModules());
|
||||
this.jvmModulesPaths.addAll(this.params.profile.getModulePath());
|
||||
if (this.params.profile.getRuntimeInClientConfig() != ClientProfile.RuntimeInClientConfig.NONE) {
|
||||
jvmModules.add("javafx.base");
|
||||
jvmModules.add("javafx.graphics");
|
||||
jvmModules.add("javafx.fxml");
|
||||
jvmModules.add("javafx.controls");
|
||||
jvmModules.add("javafx.swing");
|
||||
jvmModules.add("javafx.media");
|
||||
jvmModules.add("javafx.web");
|
||||
}
|
||||
|
||||
LauncherEngine.modulesManager.invokeEvent(new ClientProcessBuilderCreateEvent(this));
|
||||
}
|
||||
|
||||
public void start(boolean pipeOutput) throws IOException, InterruptedException {
|
||||
if (isStarted) throw new IllegalStateException("Process already started");
|
||||
if (LauncherEngine.guard != null) LauncherEngine.guard.applyGuardParams(this);
|
||||
LauncherEngine.modulesManager.invokeEvent(new ClientProcessBuilderPreLaunchEvent(this));
|
||||
List<String> processArgs = new LinkedList<>();
|
||||
processArgs.add(executeFile.toString());
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
package pro.gravit.launcher.guard;
|
||||
|
||||
import pro.gravit.launcher.client.ClientLauncherProcess;
|
||||
|
||||
public interface LauncherGuard {
|
||||
String getName();
|
||||
|
||||
void applyGuardParams(ClientLauncherProcess process);
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package pro.gravit.launcher.guard;
|
||||
|
||||
import pro.gravit.launcher.client.ClientLauncherProcess;
|
||||
|
||||
public class LauncherNoGuard implements LauncherGuard {
|
||||
@Override
|
||||
public String getName() {
|
||||
return "noGuard";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyGuardParams(ClientLauncherProcess process) {
|
||||
//IGNORED
|
||||
}
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
package pro.gravit.launcher.guard;
|
||||
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.launcher.client.ClientLauncherProcess;
|
||||
import pro.gravit.launcher.client.DirBridge;
|
||||
import pro.gravit.utils.helper.JVMHelper;
|
||||
import pro.gravit.utils.helper.UnpackHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class LauncherWrapperGuard implements LauncherGuard {
|
||||
|
||||
public LauncherWrapperGuard() {
|
||||
try {
|
||||
String wrapperName = JVMHelper.JVM_BITS == 64 ? "wrapper64.exe" : "wrapper32.exe";
|
||||
String projectName = Launcher.getConfig().projectName;
|
||||
String wrapperUnpackName = JVMHelper.JVM_BITS == 64 ? projectName.concat("64.exe") : projectName.concat("32.exe");
|
||||
String antiInjectName = JVMHelper.JVM_BITS == 64 ? "AntiInject64.dll" : "AntiInject32.dll";
|
||||
UnpackHelper.unpack(Launcher.getResourceURL(wrapperName, "guard"), DirBridge.getGuardDir().resolve(wrapperUnpackName));
|
||||
UnpackHelper.unpack(Launcher.getResourceURL(antiInjectName, "guard"), DirBridge.getGuardDir().resolve(antiInjectName));
|
||||
} catch (IOException e) {
|
||||
throw new SecurityException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "wrapper";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyGuardParams(ClientLauncherProcess process) {
|
||||
if (JVMHelper.OS_TYPE == JVMHelper.OS.MUSTDIE) {
|
||||
String projectName = Launcher.getConfig().projectName;
|
||||
String wrapperUnpackName = JVMHelper.JVM_BITS == 64 ? projectName.concat("64.exe") : projectName.concat("32.exe");
|
||||
process.executeFile = DirBridge.getGuardDir().resolve(wrapperUnpackName);
|
||||
process.useLegacyJavaClassPathProperty = true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -41,7 +41,6 @@ public final class Launcher {
|
|||
public static final String RUNTIME_DIR = "runtime";
|
||||
|
||||
// Constants
|
||||
public static final String GUARD_DIR = "guard";
|
||||
public static final String CONFIG_FILE = "config.bin";
|
||||
private static final AtomicReference<LauncherConfig> CONFIG = new AtomicReference<>();
|
||||
private static final Pattern UUID_PATTERN = Pattern.compile("-", Pattern.LITERAL);
|
||||
|
|
|
@ -32,8 +32,6 @@ public final class LauncherConfig extends StreamObject {
|
|||
public final ECPublicKey ecdsaPublicKey;
|
||||
public final RSAPublicKey rsaPublicKey;
|
||||
public final Map<String, byte[]> runtime;
|
||||
@LauncherInject("launcher.guardType")
|
||||
public final String guardType;
|
||||
@LauncherInject("runtimeconfig.secureCheckHash")
|
||||
public final String secureCheckHash;
|
||||
@LauncherInject("runtimeconfig.secureCheckSalt")
|
||||
|
@ -68,7 +66,6 @@ public LauncherConfig(HInput input) throws IOException, InvalidKeySpecException
|
|||
} catch (CertificateException e) {
|
||||
throw new IOException(e);
|
||||
}
|
||||
guardType = null;
|
||||
address = null;
|
||||
environment = LauncherEnvironment.STD;
|
||||
Launcher.applyLauncherEnv(environment);
|
||||
|
@ -91,7 +88,6 @@ public LauncherConfig(String address, ECPublicKey ecdsaPublicKey, RSAPublicKey r
|
|||
this.runtime = Collections.unmodifiableMap(new HashMap<>(runtime));
|
||||
this.projectName = projectName;
|
||||
this.clientPort = 32148;
|
||||
guardType = "no";
|
||||
environment = LauncherEnvironment.STD;
|
||||
secureCheckSalt = null;
|
||||
secureCheckHash = null;
|
||||
|
@ -109,7 +105,6 @@ public LauncherConfig(String address, Map<String, byte[]> runtime, String projec
|
|||
this.rsaPublicKey = null;
|
||||
this.ecdsaPublicKey = null;
|
||||
environment = env;
|
||||
guardType = "no";
|
||||
secureCheckSalt = null;
|
||||
secureCheckHash = null;
|
||||
passwordEncryptKey = null;
|
||||
|
|
|
@ -62,13 +62,10 @@ public final class ClientProfile implements Comparable<ClientProfile> {
|
|||
@LauncherNetworkAPI
|
||||
private List<ServerProfile> servers;
|
||||
@LauncherNetworkAPI
|
||||
private SecurityManagerConfig securityManagerConfig;
|
||||
@LauncherNetworkAPI
|
||||
private ClassLoaderConfig classLoaderConfig;
|
||||
|
||||
@LauncherNetworkAPI
|
||||
private SignedClientConfig signedClientConfig;
|
||||
@LauncherNetworkAPI
|
||||
private RuntimeInClientConfig runtimeInClientConfig;
|
||||
private List<CompatibilityFlags> flags;
|
||||
@LauncherNetworkAPI
|
||||
private int recommendJavaVersion = 8;
|
||||
@LauncherNetworkAPI
|
||||
|
@ -76,8 +73,6 @@ public final class ClientProfile implements Comparable<ClientProfile> {
|
|||
@LauncherNetworkAPI
|
||||
private int maxJavaVersion = 999;
|
||||
@LauncherNetworkAPI
|
||||
private boolean warnMissJavaVersion = true;
|
||||
@LauncherNetworkAPI
|
||||
private ProfileDefaultSettings settings = new ProfileDefaultSettings();
|
||||
@LauncherNetworkAPI
|
||||
private boolean limited;
|
||||
|
@ -99,13 +94,11 @@ public ClientProfile() {
|
|||
compatClasses = new ArrayList<>();
|
||||
properties = new HashMap<>();
|
||||
servers = new ArrayList<>(1);
|
||||
securityManagerConfig = SecurityManagerConfig.CLIENT;
|
||||
classLoaderConfig = ClassLoaderConfig.LAUNCHER;
|
||||
signedClientConfig = SignedClientConfig.NONE;
|
||||
runtimeInClientConfig = RuntimeInClientConfig.NONE;
|
||||
flags = new ArrayList<>();
|
||||
}
|
||||
|
||||
public ClientProfile(List<String> update, List<String> updateExclusions, List<String> updateShared, List<String> updateVerify, Set<OptionalFile> updateOptional, List<String> jvmArgs, List<String> classPath, List<String> modulePath, List<String> modules, List<String> altClassPath, List<String> clientArgs, List<String> compatClasses, Map<String, String> properties, List<ServerProfile> servers, SecurityManagerConfig securityManagerConfig, ClassLoaderConfig classLoaderConfig, SignedClientConfig signedClientConfig, RuntimeInClientConfig runtimeInClientConfig, String version, String assetIndex, String dir, String assetDir, int recommendJavaVersion, int minJavaVersion, int maxJavaVersion, boolean warnMissJavaVersion, ProfileDefaultSettings settings, int sortIndex, UUID uuid, String title, String info, String mainClass) {
|
||||
public ClientProfile(List<String> update, List<String> updateExclusions, List<String> updateShared, List<String> updateVerify, Set<OptionalFile> updateOptional, List<String> jvmArgs, List<String> classPath, List<String> modulePath, List<String> modules, List<String> altClassPath, List<String> clientArgs, List<String> compatClasses, Map<String, String> properties, List<ServerProfile> servers, ClassLoaderConfig classLoaderConfig, List<CompatibilityFlags> flags, String version, String assetIndex, String dir, String assetDir, int recommendJavaVersion, int minJavaVersion, int maxJavaVersion, ProfileDefaultSettings settings, int sortIndex, UUID uuid, String title, String info, String mainClass) {
|
||||
this.update = update;
|
||||
this.updateExclusions = updateExclusions;
|
||||
this.updateShared = updateShared;
|
||||
|
@ -120,10 +113,7 @@ public ClientProfile(List<String> update, List<String> updateExclusions, List<St
|
|||
this.compatClasses = compatClasses;
|
||||
this.properties = properties;
|
||||
this.servers = servers;
|
||||
this.securityManagerConfig = securityManagerConfig;
|
||||
this.classLoaderConfig = classLoaderConfig;
|
||||
this.signedClientConfig = signedClientConfig;
|
||||
this.runtimeInClientConfig = runtimeInClientConfig;
|
||||
this.version = version;
|
||||
this.assetIndex = assetIndex;
|
||||
this.dir = dir;
|
||||
|
@ -131,13 +121,13 @@ public ClientProfile(List<String> update, List<String> updateExclusions, List<St
|
|||
this.recommendJavaVersion = recommendJavaVersion;
|
||||
this.minJavaVersion = minJavaVersion;
|
||||
this.maxJavaVersion = maxJavaVersion;
|
||||
this.warnMissJavaVersion = warnMissJavaVersion;
|
||||
this.settings = settings;
|
||||
this.sortIndex = sortIndex;
|
||||
this.uuid = uuid;
|
||||
this.title = title;
|
||||
this.info = info;
|
||||
this.mainClass = mainClass;
|
||||
this.flags = flags;
|
||||
}
|
||||
|
||||
public ServerProfile getDefaultServerProfile() {
|
||||
|
@ -245,10 +235,6 @@ public int getMaxJavaVersion() {
|
|||
return maxJavaVersion;
|
||||
}
|
||||
|
||||
public boolean isWarnMissJavaVersion() {
|
||||
return warnMissJavaVersion;
|
||||
}
|
||||
|
||||
public ProfileDefaultSettings getSettings() {
|
||||
return settings;
|
||||
}
|
||||
|
@ -331,6 +317,10 @@ public void setUUID(UUID uuid) {
|
|||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public boolean hasFlag(CompatibilityFlags flag) {
|
||||
return flags.contains(flag);
|
||||
}
|
||||
|
||||
public void verify() {
|
||||
// Version
|
||||
getVersion();
|
||||
|
@ -432,18 +422,14 @@ public void setClassLoaderConfig(ClassLoaderConfig classLoaderConfig) {
|
|||
this.classLoaderConfig = classLoaderConfig;
|
||||
}
|
||||
|
||||
public RuntimeInClientConfig getRuntimeInClientConfig() {
|
||||
return runtimeInClientConfig;
|
||||
}
|
||||
|
||||
public void setRuntimeInClientConfig(RuntimeInClientConfig runtimeInClientConfig) {
|
||||
this.runtimeInClientConfig = runtimeInClientConfig;
|
||||
}
|
||||
|
||||
public boolean isLimited() {
|
||||
return limited;
|
||||
}
|
||||
|
||||
public List<CompatibilityFlags> getFlags() {
|
||||
return flags;
|
||||
}
|
||||
|
||||
public enum Version {
|
||||
MC125("1.2.5", 29),
|
||||
MC147("1.4.7", 51),
|
||||
|
@ -513,20 +499,12 @@ public String toString() {
|
|||
}
|
||||
}
|
||||
|
||||
public enum SecurityManagerConfig {
|
||||
NONE, CLIENT, LAUNCHER, MIXED
|
||||
}
|
||||
|
||||
public enum ClassLoaderConfig {
|
||||
AGENT, LAUNCHER, MODULE, SYSTEM_ARGS
|
||||
}
|
||||
|
||||
public enum SignedClientConfig {
|
||||
NONE, SIGNED
|
||||
}
|
||||
|
||||
public enum RuntimeInClientConfig {
|
||||
NONE, BASIC, FULL
|
||||
public enum CompatibilityFlags {
|
||||
LEGACY_NATIVES_DIR
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
|
|
|
@ -19,10 +19,8 @@ public class ClientProfileBuilder {
|
|||
private List<String> compatClasses = new ArrayList<>();
|
||||
private Map<String, String> properties = new HashMap<>();
|
||||
private List<ClientProfile.ServerProfile> servers = new ArrayList<>();
|
||||
private ClientProfile.SecurityManagerConfig securityManagerConfig = ClientProfile.SecurityManagerConfig.LAUNCHER;
|
||||
private ClientProfile.ClassLoaderConfig classLoaderConfig = ClientProfile.ClassLoaderConfig.LAUNCHER;
|
||||
private ClientProfile.SignedClientConfig signedClientConfig = ClientProfile.SignedClientConfig.NONE;
|
||||
private ClientProfile.RuntimeInClientConfig runtimeInClientConfig = ClientProfile.RuntimeInClientConfig.NONE;
|
||||
private List<ClientProfile.CompatibilityFlags> flags = new ArrayList<>();
|
||||
private String version;
|
||||
private String assetIndex;
|
||||
private String dir;
|
||||
|
@ -30,7 +28,6 @@ public class ClientProfileBuilder {
|
|||
private int recommendJavaVersion = 8;
|
||||
private int minJavaVersion = 8;
|
||||
private int maxJavaVersion = 999;
|
||||
private boolean warnMissJavaVersion = true;
|
||||
private ClientProfile.ProfileDefaultSettings settings = new ClientProfile.ProfileDefaultSettings();
|
||||
private int sortIndex;
|
||||
private UUID uuid;
|
||||
|
@ -98,26 +95,11 @@ public ClientProfileBuilder setServers(List<ClientProfile.ServerProfile> servers
|
|||
return this;
|
||||
}
|
||||
|
||||
public ClientProfileBuilder setSecurityManagerConfig(ClientProfile.SecurityManagerConfig securityManagerConfig) {
|
||||
this.securityManagerConfig = securityManagerConfig;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ClientProfileBuilder setClassLoaderConfig(ClientProfile.ClassLoaderConfig classLoaderConfig) {
|
||||
this.classLoaderConfig = classLoaderConfig;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ClientProfileBuilder setSignedClientConfig(ClientProfile.SignedClientConfig signedClientConfig) {
|
||||
this.signedClientConfig = signedClientConfig;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ClientProfileBuilder setRuntimeInClientConfig(ClientProfile.RuntimeInClientConfig runtimeInClientConfig) {
|
||||
this.runtimeInClientConfig = runtimeInClientConfig;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ClientProfileBuilder setVersion(String version) {
|
||||
this.version = version;
|
||||
return this;
|
||||
|
@ -163,11 +145,6 @@ public ClientProfileBuilder setMaxJavaVersion(int maxJavaVersion) {
|
|||
return this;
|
||||
}
|
||||
|
||||
public ClientProfileBuilder setWarnMissJavaVersion(boolean warnMissJavaVersion) {
|
||||
this.warnMissJavaVersion = warnMissJavaVersion;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ClientProfileBuilder setSettings(ClientProfile.ProfileDefaultSettings settings) {
|
||||
this.settings = settings;
|
||||
return this;
|
||||
|
@ -198,7 +175,12 @@ public ClientProfileBuilder setMainClass(String mainClass) {
|
|||
return this;
|
||||
}
|
||||
|
||||
public ClientProfileBuilder setFlags(List<ClientProfile.CompatibilityFlags> flags) {
|
||||
this.flags = flags;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ClientProfile createClientProfile() {
|
||||
return new ClientProfile(update, updateExclusions, updateShared, updateVerify, updateOptional, jvmArgs, classPath, modulePath, modules, altClassPath, clientArgs, compatClasses, properties, servers, securityManagerConfig, classLoaderConfig, signedClientConfig, runtimeInClientConfig, version, assetIndex, dir, assetDir, recommendJavaVersion, minJavaVersion, maxJavaVersion, warnMissJavaVersion, settings, sortIndex, uuid, title, info, mainClass);
|
||||
return new ClientProfile(update, updateExclusions, updateShared, updateVerify, updateOptional, jvmArgs, classPath, modulePath, modules, altClassPath, clientArgs, compatClasses, properties, servers, classLoaderConfig, flags, version, assetIndex, dir, assetDir, recommendJavaVersion, minJavaVersion, maxJavaVersion, settings, sortIndex, uuid, title, info, mainClass);
|
||||
}
|
||||
}
|
|
@ -11,8 +11,6 @@ public final class PlayerProfile {
|
|||
|
||||
public final UUID uuid;
|
||||
public final String username;
|
||||
@Deprecated
|
||||
public final Texture skin, cloak;
|
||||
public final Map<String, Texture> assets;
|
||||
public final Map<String, String> properties;
|
||||
|
||||
|
@ -26,8 +24,6 @@ public PlayerProfile(UUID uuid, String username, Texture skin, Texture cloak) {
|
|||
public PlayerProfile(UUID uuid, String username, Texture skin, Texture cloak, Map<String, String> properties) {
|
||||
this.uuid = Objects.requireNonNull(uuid, "uuid");
|
||||
this.username = username;
|
||||
this.skin = skin;
|
||||
this.cloak = cloak;
|
||||
this.assets = new HashMap<>();
|
||||
if (skin != null) {
|
||||
this.assets.put("SKIN", skin);
|
||||
|
@ -43,8 +39,6 @@ public PlayerProfile(UUID uuid, String username, Map<String, Texture> assets, Ma
|
|||
this.username = username;
|
||||
this.assets = assets;
|
||||
this.properties = properties;
|
||||
this.skin = assets.get("SKIN");
|
||||
this.cloak = assets.get("CAPE");
|
||||
}
|
||||
|
||||
public static PlayerProfile newOfflineProfile(String username) {
|
||||
|
|
|
@ -28,6 +28,7 @@ public abstract class ClientWebSocketService extends ClientJSONPoint {
|
|||
private static boolean resultsRegistered = false;
|
||||
public final Gson gson;
|
||||
public final Boolean onConnect;
|
||||
public final Object waitObject = new Object();
|
||||
public OnCloseCallback onCloseCallback;
|
||||
public ReconnectCallback reconnectCallback;
|
||||
|
||||
|
@ -71,8 +72,8 @@ void onDisconnect() {
|
|||
|
||||
@Override
|
||||
void onOpen() {
|
||||
synchronized (onConnect) {
|
||||
onConnect.notifyAll();
|
||||
synchronized (waitObject) {
|
||||
waitObject.notifyAll();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -80,7 +81,6 @@ public void registerRequests() {
|
|||
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void registerResults() {
|
||||
if (!resultsRegistered) {
|
||||
results.register("auth", AuthRequestEvent.class);
|
||||
|
|
|
@ -51,13 +51,16 @@ public UniversalJsonAdapter(ProviderMap<R> providerMap, String name, String PROP
|
|||
|
||||
public R deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
|
||||
String typename = json.getAsJsonObject().getAsJsonPrimitive(PROP_NAME).getAsString();
|
||||
if(typename == null) {
|
||||
throw new JsonParseException(String.format("%s: missing type property", name));
|
||||
}
|
||||
Class<? extends R> cls = providerMap.getClass(typename);
|
||||
if (cls == null) {
|
||||
//if (printErrorIfUnknownType) LogHelper.error("%s %s not found", name, typename);
|
||||
if (defaultClass != null) {
|
||||
return context.deserialize(json, defaultClass);
|
||||
} else {
|
||||
throw new JsonParseException(String.format("%s: type %s not registered", name, typename));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return context.deserialize(json, cls);
|
||||
}
|
||||
|
@ -72,6 +75,8 @@ public JsonElement serialize(R src, Type typeOfSrc, JsonSerializationContext con
|
|||
}
|
||||
if (classPath != null) {
|
||||
jo.add(PROP_NAME, new JsonPrimitive(classPath));
|
||||
} else {
|
||||
throw new JsonParseException(String.format("Class %s not registered", src.getClass().getName()));
|
||||
}
|
||||
return jo;
|
||||
}
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
public final class Version implements Comparable<Version> {
|
||||
|
||||
public static final int MAJOR = 5;
|
||||
public static final int MINOR = 3;
|
||||
public static final int PATCH = 6;
|
||||
public static final int MINOR = 4;
|
||||
public static final int PATCH = 0;
|
||||
public static final int BUILD = 1;
|
||||
public static final Version.Type RELEASE = Type.DEV;
|
||||
public static final Version.Type RELEASE = Type.EXPERIMENTAL;
|
||||
public final int major;
|
||||
public final int minor;
|
||||
public final int patch;
|
||||
|
|
|
@ -26,7 +26,6 @@ public final class JVMHelper {
|
|||
public static final String OS_VERSION = OPERATING_SYSTEM_MXBEAN.getVersion();
|
||||
public static final ARCH ARCH_TYPE = getArch(System.getProperty("os.arch"));
|
||||
public static final int JVM_BITS = Integer.parseInt(System.getProperty("sun.arch.data.model"));
|
||||
public static final SecurityManager SECURITY_MANAGER = System.getSecurityManager();
|
||||
// Public static fields
|
||||
public static final Runtime RUNTIME = Runtime.getRuntime();
|
||||
public static final ClassLoader LOADER = ClassLoader.getSystemClassLoader();
|
||||
|
|
Loading…
Reference in a new issue