diff --git a/LaunchServer/source/LaunchServer.java b/LaunchServer/source/LaunchServer.java index ddbf113..b6ab303 100644 --- a/LaunchServer/source/LaunchServer.java +++ b/LaunchServer/source/LaunchServer.java @@ -510,7 +510,9 @@ if (url.isEmpty()) { return null; } - return CommonHelper.replace(url, "username", username, "uuid", uuid.toString(), "hash", ClientLauncher.toHash(uuid)); + return CommonHelper.replace(url, "username", IOHelper.urlEncode(username), + "uuid", IOHelper.urlEncode(uuid.toString()), + "hash", IOHelper.urlEncode(ClientLauncher.toHash(uuid))); } } } diff --git a/LaunchServer/source/auth/provider/URLAuthProvider.java b/LaunchServer/source/auth/provider/URLAuthProvider.java index e0d3b94..8cbcba2 100644 --- a/LaunchServer/source/auth/provider/URLAuthProvider.java +++ b/LaunchServer/source/auth/provider/URLAuthProvider.java @@ -39,6 +39,6 @@ } private String getFormattedURL(String login, String password) { - return CommonHelper.replace(url, "login", login, "password", password); + return CommonHelper.replace(url, "login", IOHelper.urlEncode(login), "password", IOHelper.urlEncode(password)); } } diff --git a/LaunchServer/source/command/hash/DownloadAssetCommand.java b/LaunchServer/source/command/hash/DownloadAssetCommand.java index 1a463cc..5242820 100644 --- a/LaunchServer/source/command/hash/DownloadAssetCommand.java +++ b/LaunchServer/source/command/hash/DownloadAssetCommand.java @@ -44,7 +44,7 @@ // Download required asset LogHelper.subInfo("Downloading asset, it may take some time"); - unpack(new URL(String.format(ASSET_URL_MASK, version.name)), assetDir); + unpack(new URL(String.format(ASSET_URL_MASK, IOHelper.urlEncode(version.name))), assetDir); // Finished server.syncUpdatesDir(Collections.singleton(dirName)); diff --git a/LaunchServer/source/command/hash/DownloadClientCommand.java b/LaunchServer/source/command/hash/DownloadClientCommand.java index 2240d0a..5f792c1 100644 --- a/LaunchServer/source/command/hash/DownloadClientCommand.java +++ b/LaunchServer/source/command/hash/DownloadClientCommand.java @@ -48,7 +48,8 @@ // Download required client LogHelper.subInfo("Downloading client, it may take some time"); - DownloadAssetCommand.unpack(new URL(String.format(CLIENT_URL_MASK, version.name)), clientDir); + DownloadAssetCommand.unpack(new URL(String.format(CLIENT_URL_MASK, + IOHelper.urlEncode(version.name))), clientDir); // Create profile file LogHelper.subInfo("Creaing profile file: '%s'", dirName); @@ -59,7 +60,8 @@ } client.setTitle(dirName); client.block.getEntry("dir", StringConfigEntry.class).setValue(dirName); - try (BufferedWriter writer = IOHelper.newWriter(IOHelper.resolveIncremental(LaunchServer.PROFILES_DIR, dirName, "cfg"))) { + try (BufferedWriter writer = IOHelper.newWriter(IOHelper.resolveIncremental(LaunchServer.PROFILES_DIR, + dirName, "cfg"))) { TextConfigWriter.write(client.block, writer, true); } diff --git a/LauncherAuthlib/source/yggdrasil/LegacyBridge.java b/LauncherAuthlib/source/yggdrasil/LegacyBridge.java index e7558b0..e4c6bb7 100644 --- a/LauncherAuthlib/source/yggdrasil/LegacyBridge.java +++ b/LauncherAuthlib/source/yggdrasil/LegacyBridge.java @@ -2,6 +2,7 @@ import launcher.client.ClientLauncher; import launcher.helper.CommonHelper; +import launcher.helper.IOHelper; import launcher.helper.LogHelper; import launcher.request.auth.CheckServerRequest; import launcher.request.auth.JoinServerRequest; @@ -20,14 +21,14 @@ public static String getCloakURL(String username) { LogHelper.debug("LegacyBridge.getCloakURL: '%s'", username); return CommonHelper.replace(System.getProperty("launcher.legacy.cloaksURL", - "http://skins.minecraft.net/MinecraftCloaks/%username%.png"), "username", username); + "http://skins.minecraft.net/MinecraftCloaks/%username%.png"), "username", IOHelper.urlEncode(username)); } @SuppressWarnings("unused") public static String getSkinURL(String username) { LogHelper.debug("LegacyBridge.getSkinURL: '%s'", username); return CommonHelper.replace(System.getProperty("launcher.legacy.skinsURL", - "http://skins.minecraft.net/MinecraftSkins/%username%.png"), "username", username); + "http://skins.minecraft.net/MinecraftSkins/%username%.png"), "username", IOHelper.urlEncode(username)); } @SuppressWarnings("unused")