diff --git a/launcher-bootstrap/build.gradle b/launcher-bootstrap/build.gradle index c165d7bad..872063e26 100644 --- a/launcher-bootstrap/build.gradle +++ b/launcher-bootstrap/build.gradle @@ -10,7 +10,7 @@ application { dependencies { implementation 'com.googlecode.json-simple:json-simple:1.1.1' - implementation 'javax.xml.bind:jaxb-api:2.3.0' + implementation 'javax.xml.bind:jaxb-api:2.3.1' } processResources { diff --git a/launcher-builder/build.gradle b/launcher-builder/build.gradle index 91ddff48a..008cfa69e 100644 --- a/launcher-builder/build.gradle +++ b/launcher-builder/build.gradle @@ -11,8 +11,7 @@ application { dependencies { api project(':launcher') - implementation 'org.tukaani:xz:1.0' - implementation 'org.apache.commons:commons-compress:1.9' + implementation 'org.apache.commons:commons-compress:1.21' } shadowJar { diff --git a/launcher-builder/src/main/java/com/skcraft/launcher/builder/PackageBuilder.java b/launcher-builder/src/main/java/com/skcraft/launcher/builder/PackageBuilder.java index 92f54fdf9..6b85f989a 100644 --- a/launcher-builder/src/main/java/com/skcraft/launcher/builder/PackageBuilder.java +++ b/launcher-builder/src/main/java/com/skcraft/launcher/builder/PackageBuilder.java @@ -367,7 +367,7 @@ public void writeManifest(@NonNull File path) throws IOException { private static BuilderOptions parseArgs(String[] args) { BuilderOptions options = new BuilderOptions(); - new JCommander(options, args); + new JCommander(options).parse(args); options.choosePaths(); return options; } diff --git a/launcher/build.gradle b/launcher/build.gradle index 8d1cff443..28c4bc651 100644 --- a/launcher/build.gradle +++ b/launcher/build.gradle @@ -10,18 +10,17 @@ application { } dependencies { - api 'javax.xml.bind:jaxb-api:2.2.4' - api 'com.fasterxml.jackson.core:jackson-databind:2.3.0' + api 'javax.xml.bind:jaxb-api:2.3.1' + api 'com.fasterxml.jackson.core:jackson-databind:2.13.2.2' api 'commons-lang:commons-lang:2.6' api 'commons-io:commons-io:1.2' api 'com.google.guava:guava:15.0' - api 'com.beust:jcommander:1.32' + api 'com.beust:jcommander:1.82' api 'com.miglayout:miglayout:3.7.4' - api 'com.google.code.findbugs:jsr305:3.0.0' + api 'com.google.code.findbugs:jsr305:3.0.2' implementation 'com.googlecode.plist:dd-plist:1.23' - - implementation 'net.java.dev.jna:jna-platform:5.10.0' + implementation 'net.java.dev.jna:jna-platform:5.11.0' } processResources { diff --git a/launcher/src/main/java/com/skcraft/launcher/Launcher.java b/launcher/src/main/java/com/skcraft/launcher/Launcher.java index b2c950896..962f64f8a 100644 --- a/launcher/src/main/java/com/skcraft/launcher/Launcher.java +++ b/launcher/src/main/java/com/skcraft/launcher/Launcher.java @@ -415,7 +415,7 @@ public void showLauncherWindow() { */ public static Launcher createFromArguments(String[] args) throws ParameterException, IOException { LauncherArguments options = new LauncherArguments(); - new JCommander(options, args); + new JCommander(options).parse(args); Integer bsVersion = options.getBootstrapVersion(); log.info(bsVersion != null ? "Bootstrap version " + bsVersion + " detected" : "Not bootstrapped"); diff --git a/launcher/src/main/java/com/skcraft/launcher/auth/MicrosoftLoginService.java b/launcher/src/main/java/com/skcraft/launcher/auth/MicrosoftLoginService.java index b79aa32e6..5244b2ac4 100644 --- a/launcher/src/main/java/com/skcraft/launcher/auth/MicrosoftLoginService.java +++ b/launcher/src/main/java/com/skcraft/launcher/auth/MicrosoftLoginService.java @@ -1,7 +1,7 @@ package com.skcraft.launcher.auth; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.databind.PropertyNamingStrategy; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import com.skcraft.launcher.auth.microsoft.MicrosoftWebAuthorizer; import com.skcraft.launcher.auth.microsoft.MinecraftServicesAuthorizer; @@ -163,7 +163,7 @@ public SavedSession toSavedSession() { } @Data - @JsonNaming(PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy.class) + @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) @JsonIgnoreProperties(ignoreUnknown = true) private static class TokenError { private String error; diff --git a/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/McAuthResponse.java b/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/McAuthResponse.java index 768c05fcf..c047d12fe 100644 --- a/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/McAuthResponse.java +++ b/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/McAuthResponse.java @@ -2,12 +2,12 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.databind.PropertyNamingStrategy; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Data; @Data -@JsonNaming(PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy.class) +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) @JsonIgnoreProperties(ignoreUnknown = true) public class McAuthResponse { private String accessToken; diff --git a/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/TokenResponse.java b/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/TokenResponse.java index d6aeb60be..2348afc02 100644 --- a/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/TokenResponse.java +++ b/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/TokenResponse.java @@ -1,12 +1,12 @@ package com.skcraft.launcher.auth.microsoft.model; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.databind.PropertyNamingStrategy; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Data; @Data -@JsonNaming(PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy.class) +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) @JsonIgnoreProperties(ignoreUnknown = true) public class TokenResponse { private String tokenType; diff --git a/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/XblAuthProperties.java b/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/XblAuthProperties.java index 141468784..989187564 100644 --- a/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/XblAuthProperties.java +++ b/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/XblAuthProperties.java @@ -1,12 +1,12 @@ package com.skcraft.launcher.auth.microsoft.model; -import com.fasterxml.jackson.databind.PropertyNamingStrategy; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Data; import lombok.NonNull; @Data -@JsonNaming(PropertyNamingStrategy.PascalCaseStrategy.class) +@JsonNaming(PropertyNamingStrategies.UpperCamelCaseStrategy.class) public class XblAuthProperties { private String authMethod = "RPS"; private String siteName = "user.auth.xboxlive.com"; diff --git a/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/XboxAuthRequest.java b/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/XboxAuthRequest.java index 53c449815..388835748 100644 --- a/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/XboxAuthRequest.java +++ b/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/XboxAuthRequest.java @@ -1,12 +1,12 @@ package com.skcraft.launcher.auth.microsoft.model; -import com.fasterxml.jackson.databind.PropertyNamingStrategy; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Data; import lombok.NonNull; @Data -@JsonNaming(PropertyNamingStrategy.PascalCaseStrategy.class) +@JsonNaming(PropertyNamingStrategies.UpperCamelCaseStrategy.class) public class XboxAuthRequest { @NonNull private T properties; private String relyingParty = "http://auth.xboxlive.com"; diff --git a/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/XboxAuthResponse.java b/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/XboxAuthResponse.java index c7893a81a..e989e3889 100644 --- a/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/XboxAuthResponse.java +++ b/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/XboxAuthResponse.java @@ -2,14 +2,14 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.databind.PropertyNamingStrategy; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Data; import java.util.List; @Data -@JsonNaming(PropertyNamingStrategy.PascalCaseStrategy.class) +@JsonNaming(PropertyNamingStrategies.UpperCamelCaseStrategy.class) @JsonIgnoreProperties(ignoreUnknown = true) public class XboxAuthResponse { private String token; diff --git a/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/XstsAuthProperties.java b/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/XstsAuthProperties.java index 63fcef881..5d59693b2 100644 --- a/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/XstsAuthProperties.java +++ b/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/XstsAuthProperties.java @@ -1,6 +1,6 @@ package com.skcraft.launcher.auth.microsoft.model; -import com.fasterxml.jackson.databind.PropertyNamingStrategy; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Data; @@ -8,7 +8,7 @@ import java.util.List; @Data -@JsonNaming(PropertyNamingStrategy.PascalCaseStrategy.class) +@JsonNaming(PropertyNamingStrategies.UpperCamelCaseStrategy.class) public class XstsAuthProperties { private String sandboxId = "RETAIL"; private List userTokens; diff --git a/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/XstsError.java b/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/XstsError.java index d279d42b6..aec313ff8 100644 --- a/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/XstsError.java +++ b/launcher/src/main/java/com/skcraft/launcher/auth/microsoft/model/XstsError.java @@ -2,12 +2,12 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.PropertyNamingStrategy; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Data; @Data -@JsonNaming(PropertyNamingStrategy.PascalCaseStrategy.class) +@JsonNaming(PropertyNamingStrategies.UpperCamelCaseStrategy.class) @JsonIgnoreProperties(ignoreUnknown = true) public class XstsError { @JsonProperty("XErr") diff --git a/launcher/src/main/java/com/skcraft/launcher/model/minecraft/mapper/ArgumentValueDeserializer.java b/launcher/src/main/java/com/skcraft/launcher/model/minecraft/mapper/ArgumentValueDeserializer.java index 7bf74d471..de9931300 100644 --- a/launcher/src/main/java/com/skcraft/launcher/model/minecraft/mapper/ArgumentValueDeserializer.java +++ b/launcher/src/main/java/com/skcraft/launcher/model/minecraft/mapper/ArgumentValueDeserializer.java @@ -30,6 +30,6 @@ public List deserialize(JsonParser jp, DeserializationContext ctxt) thro return Lists.newArrayList(value); } - throw new InvalidFormatException("Invalid JSON type for deserializer (not string or array)", null, List.class); + throw new InvalidFormatException(jp, "Invalid JSON type for deserializer (not string or array)", null, List.class); } } diff --git a/launcher/src/main/java/com/skcraft/launcher/model/minecraft/mapper/MinecraftArgumentsDeserializer.java b/launcher/src/main/java/com/skcraft/launcher/model/minecraft/mapper/MinecraftArgumentsDeserializer.java index a6436a260..f297d372e 100644 --- a/launcher/src/main/java/com/skcraft/launcher/model/minecraft/mapper/MinecraftArgumentsDeserializer.java +++ b/launcher/src/main/java/com/skcraft/launcher/model/minecraft/mapper/MinecraftArgumentsDeserializer.java @@ -26,6 +26,6 @@ public GameArgument deserialize(JsonParser jp, DeserializationContext ctxt) thro return new GameArgument(argument); } - throw new InvalidFormatException("Invalid JSON type for deserializer (not string or object)", null, GameArgument.class); + throw new InvalidFormatException(jp, "Invalid JSON type for deserializer (not string or object)", null, GameArgument.class); } } diff --git a/launcher/src/main/java/com/skcraft/launcher/persistence/Persistence.java b/launcher/src/main/java/com/skcraft/launcher/persistence/Persistence.java index 8f1e264bf..529a2b5a0 100644 --- a/launcher/src/main/java/com/skcraft/launcher/persistence/Persistence.java +++ b/launcher/src/main/java/com/skcraft/launcher/persistence/Persistence.java @@ -7,8 +7,8 @@ package com.skcraft.launcher.persistence; import com.fasterxml.jackson.core.PrettyPrinter; +import com.fasterxml.jackson.core.util.DefaultIndenter; import com.fasterxml.jackson.core.util.DefaultPrettyPrinter; -import com.fasterxml.jackson.core.util.DefaultPrettyPrinter.Lf2SpacesIndenter; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.io.ByteSink; import com.google.common.io.ByteSource; @@ -43,7 +43,7 @@ public final class Persistence { static { L2F_LIST_PRETTY_PRINTER = new DefaultPrettyPrinter(); - L2F_LIST_PRETTY_PRINTER.indentArraysWith(Lf2SpacesIndenter.instance); + L2F_LIST_PRETTY_PRINTER.indentArraysWith(DefaultIndenter.SYSTEM_LINEFEED_INSTANCE); } private Persistence() { diff --git a/launcher/src/main/java/com/skcraft/launcher/util/HttpRequest.java b/launcher/src/main/java/com/skcraft/launcher/util/HttpRequest.java index 6bf14572a..e97b55814 100644 --- a/launcher/src/main/java/com/skcraft/launcher/util/HttpRequest.java +++ b/launcher/src/main/java/com/skcraft/launcher/util/HttpRequest.java @@ -558,7 +558,7 @@ public T asJson(Class cls) throws IOException { * @return the object * @throws java.io.IOException on I/O error */ - public T asJson(TypeReference type) throws IOException { + public T asJson(TypeReference type) throws IOException { return mapper.readValue(asString("UTF-8"), type); }