From b40f819b5cf4f1c5e08a7bc6337af4074af8056d Mon Sep 17 00:00:00 2001 From: microwin7 Date: Fri, 7 Jul 2023 20:43:48 +0300 Subject: [PATCH] [FIX] Using guava in get links method --- LaunchServer/build.gradle | 2 +- .../pro/gravit/launchserver/config/LaunchServerConfig.java | 5 +++-- props.gradle | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/LaunchServer/build.gradle b/LaunchServer/build.gradle index db37159c..6b621bcd 100644 --- a/LaunchServer/build.gradle +++ b/LaunchServer/build.gradle @@ -93,6 +93,7 @@ pack project(':LauncherAPI') bundle group: 'io.jsonwebtoken', name: 'jjwt-api', version: rootProject['verJwt'] bundle group: 'io.jsonwebtoken', name: 'jjwt-impl', version: rootProject['verJwt'] bundle group: 'io.jsonwebtoken', name: 'jjwt-gson', version: rootProject['verJwt'] + bundle group: 'com.google.guava', name: 'guava', version: rootProject['verGuavaC'] testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: rootProject['verJunit'] hikari 'io.micrometer:micrometer-core:1.8.4' @@ -112,7 +113,6 @@ pack project(':LauncherAPI') launch4j('net.sf.launch4j:launch4j:' + rootProject['verLaunch4j'] + ':workdir-win32') { transitive = false } launch4j('net.sf.launch4j:launch4j:' + rootProject['verLaunch4j'] + ':workdir-linux64') { transitive = false } - compileOnlyA group: 'com.google.guava', name: 'guava', version: rootProject['verGuavaC'] // Do not update (laggy deps). compileOnlyA 'log4j:log4j:1.2.17' compileOnlyA 'org.apache.logging.log4j:log4j-core:2.14.1' diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java b/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java index c754f74f..9cf2b5ab 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java @@ -1,5 +1,6 @@ package pro.gravit.launchserver.config; +import com.google.common.net.UrlEscapers; import io.netty.channel.epoll.Epoll; import io.netty.handler.logging.LogLevel; import org.apache.logging.log4j.LogManager; @@ -137,11 +138,11 @@ public void setBinaryName(String binaryName) { } public String getLauncherURL() { - return URLEncoder.encode(this.netty.launcherURL.replaceAll("%binaryName%", this.binaryName), StandardCharsets.UTF_8); + return UrlEscapers.urlFragmentEscaper().escape(this.netty.launcherURL.replaceAll("%binaryName%",this.binaryName)); } public String getLauncherEXEURL() { - return URLEncoder.encode(this.netty.launcherEXEURL.replaceAll("%binaryName%", this.binaryName), StandardCharsets.UTF_8); + return UrlEscapers.urlFragmentEscaper().escape(this.netty.launcherEXEURL.replaceAll("%binaryName%",this.binaryName)); } public void setEnv(LauncherConfig.LauncherEnvironment env) { diff --git a/props.gradle b/props.gradle index 3fba03e4..e845c409 100644 --- a/props.gradle +++ b/props.gradle @@ -3,7 +3,7 @@ verNetty = '4.1.87.Final' verOshiCore = '6.4.0' verJunit = '5.9.2' - verGuavaC = '30.1.1-jre' + verGuavaC = '32.1.1-jre' verJansi = '2.4.0' verJline = '3.22.0' verJwt = '0.11.5'