1
0
mirror of https://github.com/SKCraft/Launcher.git synced 2024-11-27 12:46:22 +01:00

Upgrade dependencies & fix deprecations

This commit is contained in:
Henry Le Grys 2022-04-26 23:02:58 +01:00
parent 54c05d1f9b
commit 868426498f
17 changed files with 30 additions and 32 deletions

View File

@ -10,7 +10,7 @@ application {
dependencies { dependencies {
implementation 'com.googlecode.json-simple:json-simple:1.1.1' 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 { processResources {

View File

@ -11,8 +11,7 @@ application {
dependencies { dependencies {
api project(':launcher') api project(':launcher')
implementation 'org.tukaani:xz:1.0' implementation 'org.apache.commons:commons-compress:1.21'
implementation 'org.apache.commons:commons-compress:1.9'
} }
shadowJar { shadowJar {

View File

@ -367,7 +367,7 @@ public class PackageBuilder {
private static BuilderOptions parseArgs(String[] args) { private static BuilderOptions parseArgs(String[] args) {
BuilderOptions options = new BuilderOptions(); BuilderOptions options = new BuilderOptions();
new JCommander(options, args); new JCommander(options).parse(args);
options.choosePaths(); options.choosePaths();
return options; return options;
} }

View File

@ -10,18 +10,17 @@ application {
} }
dependencies { dependencies {
api 'javax.xml.bind:jaxb-api:2.2.4' api 'javax.xml.bind:jaxb-api:2.3.1'
api 'com.fasterxml.jackson.core:jackson-databind:2.3.0' api 'com.fasterxml.jackson.core:jackson-databind:2.13.2.2'
api 'commons-lang:commons-lang:2.6' api 'commons-lang:commons-lang:2.6'
api 'commons-io:commons-io:1.2' api 'commons-io:commons-io:1.2'
api 'com.google.guava:guava:15.0' 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.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 'com.googlecode.plist:dd-plist:1.23'
implementation 'net.java.dev.jna:jna-platform:5.11.0'
implementation 'net.java.dev.jna:jna-platform:5.10.0'
} }
processResources { processResources {

View File

@ -415,7 +415,7 @@ public final class Launcher {
*/ */
public static Launcher createFromArguments(String[] args) throws ParameterException, IOException { public static Launcher createFromArguments(String[] args) throws ParameterException, IOException {
LauncherArguments options = new LauncherArguments(); LauncherArguments options = new LauncherArguments();
new JCommander(options, args); new JCommander(options).parse(args);
Integer bsVersion = options.getBootstrapVersion(); Integer bsVersion = options.getBootstrapVersion();
log.info(bsVersion != null ? "Bootstrap version " + bsVersion + " detected" : "Not bootstrapped"); log.info(bsVersion != null ? "Bootstrap version " + bsVersion + " detected" : "Not bootstrapped");

View File

@ -1,7 +1,7 @@
package com.skcraft.launcher.auth; package com.skcraft.launcher.auth;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 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.fasterxml.jackson.databind.annotation.JsonNaming;
import com.skcraft.launcher.auth.microsoft.MicrosoftWebAuthorizer; import com.skcraft.launcher.auth.microsoft.MicrosoftWebAuthorizer;
import com.skcraft.launcher.auth.microsoft.MinecraftServicesAuthorizer; import com.skcraft.launcher.auth.microsoft.MinecraftServicesAuthorizer;
@ -163,7 +163,7 @@ public class MicrosoftLoginService implements LoginService {
} }
@Data @Data
@JsonNaming(PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy.class) @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
private static class TokenError { private static class TokenError {
private String error; private String error;

View File

@ -2,12 +2,12 @@ package com.skcraft.launcher.auth.microsoft.model;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 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.fasterxml.jackson.databind.annotation.JsonNaming;
import lombok.Data; import lombok.Data;
@Data @Data
@JsonNaming(PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy.class) @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class McAuthResponse { public class McAuthResponse {
private String accessToken; private String accessToken;

View File

@ -1,12 +1,12 @@
package com.skcraft.launcher.auth.microsoft.model; package com.skcraft.launcher.auth.microsoft.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 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.fasterxml.jackson.databind.annotation.JsonNaming;
import lombok.Data; import lombok.Data;
@Data @Data
@JsonNaming(PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy.class) @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class TokenResponse { public class TokenResponse {
private String tokenType; private String tokenType;

View File

@ -1,12 +1,12 @@
package com.skcraft.launcher.auth.microsoft.model; 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 com.fasterxml.jackson.databind.annotation.JsonNaming;
import lombok.Data; import lombok.Data;
import lombok.NonNull; import lombok.NonNull;
@Data @Data
@JsonNaming(PropertyNamingStrategy.PascalCaseStrategy.class) @JsonNaming(PropertyNamingStrategies.UpperCamelCaseStrategy.class)
public class XblAuthProperties { public class XblAuthProperties {
private String authMethod = "RPS"; private String authMethod = "RPS";
private String siteName = "user.auth.xboxlive.com"; private String siteName = "user.auth.xboxlive.com";

View File

@ -1,12 +1,12 @@
package com.skcraft.launcher.auth.microsoft.model; 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 com.fasterxml.jackson.databind.annotation.JsonNaming;
import lombok.Data; import lombok.Data;
import lombok.NonNull; import lombok.NonNull;
@Data @Data
@JsonNaming(PropertyNamingStrategy.PascalCaseStrategy.class) @JsonNaming(PropertyNamingStrategies.UpperCamelCaseStrategy.class)
public class XboxAuthRequest<T> { public class XboxAuthRequest<T> {
@NonNull private T properties; @NonNull private T properties;
private String relyingParty = "http://auth.xboxlive.com"; private String relyingParty = "http://auth.xboxlive.com";

View File

@ -2,14 +2,14 @@ package com.skcraft.launcher.auth.microsoft.model;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 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.fasterxml.jackson.databind.annotation.JsonNaming;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
@Data @Data
@JsonNaming(PropertyNamingStrategy.PascalCaseStrategy.class) @JsonNaming(PropertyNamingStrategies.UpperCamelCaseStrategy.class)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class XboxAuthResponse { public class XboxAuthResponse {
private String token; private String token;

View File

@ -1,6 +1,6 @@
package com.skcraft.launcher.auth.microsoft.model; 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 com.fasterxml.jackson.databind.annotation.JsonNaming;
import lombok.Data; import lombok.Data;
@ -8,7 +8,7 @@ import java.util.Collections;
import java.util.List; import java.util.List;
@Data @Data
@JsonNaming(PropertyNamingStrategy.PascalCaseStrategy.class) @JsonNaming(PropertyNamingStrategies.UpperCamelCaseStrategy.class)
public class XstsAuthProperties { public class XstsAuthProperties {
private String sandboxId = "RETAIL"; private String sandboxId = "RETAIL";
private List<String> userTokens; private List<String> userTokens;

View File

@ -2,12 +2,12 @@ package com.skcraft.launcher.auth.microsoft.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty; 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 com.fasterxml.jackson.databind.annotation.JsonNaming;
import lombok.Data; import lombok.Data;
@Data @Data
@JsonNaming(PropertyNamingStrategy.PascalCaseStrategy.class) @JsonNaming(PropertyNamingStrategies.UpperCamelCaseStrategy.class)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class XstsError { public class XstsError {
@JsonProperty("XErr") @JsonProperty("XErr")

View File

@ -30,6 +30,6 @@ public class ArgumentValueDeserializer extends StdDeserializer<List<String>> {
return Lists.newArrayList(value); 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);
} }
} }

View File

@ -26,6 +26,6 @@ public class MinecraftArgumentsDeserializer extends StdDeserializer<GameArgument
return new GameArgument(argument); 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);
} }
} }

View File

@ -7,8 +7,8 @@
package com.skcraft.launcher.persistence; package com.skcraft.launcher.persistence;
import com.fasterxml.jackson.core.PrettyPrinter; 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;
import com.fasterxml.jackson.core.util.DefaultPrettyPrinter.Lf2SpacesIndenter;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.io.ByteSink; import com.google.common.io.ByteSink;
import com.google.common.io.ByteSource; import com.google.common.io.ByteSource;
@ -43,7 +43,7 @@ public final class Persistence {
static { static {
L2F_LIST_PRETTY_PRINTER = new DefaultPrettyPrinter(); L2F_LIST_PRETTY_PRINTER = new DefaultPrettyPrinter();
L2F_LIST_PRETTY_PRINTER.indentArraysWith(Lf2SpacesIndenter.instance); L2F_LIST_PRETTY_PRINTER.indentArraysWith(DefaultIndenter.SYSTEM_LINEFEED_INSTANCE);
} }
private Persistence() { private Persistence() {

View File

@ -558,7 +558,7 @@ public class HttpRequest implements Closeable, ProgressObservable {
* @return the object * @return the object
* @throws java.io.IOException on I/O error * @throws java.io.IOException on I/O error
*/ */
public <T> T asJson(TypeReference type) throws IOException { public <T> T asJson(TypeReference<T> type) throws IOException {
return mapper.readValue(asString("UTF-8"), type); return mapper.readValue(asString("UTF-8"), type);
} }