Skip to content

Commit

Permalink
Upgrade dependencies & fix deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgehog1029 committed Apr 26, 2022
1 parent 54c05d1 commit 8684264
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 32 deletions.
2 changes: 1 addition & 1 deletion launcher-bootstrap/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions launcher-builder/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
11 changes: 5 additions & 6 deletions launcher/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion launcher/src/main/java/com/skcraft/launcher/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
Original file line number Diff line number Diff line change
@@ -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<T> {
@NonNull private T properties;
private String relyingParty = "http://auth.xboxlive.com";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
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 java.util.Collections;
import java.util.List;

@Data
@JsonNaming(PropertyNamingStrategy.PascalCaseStrategy.class)
@JsonNaming(PropertyNamingStrategies.UpperCamelCaseStrategy.class)
public class XstsAuthProperties {
private String sandboxId = "RETAIL";
private List<String> userTokens;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ public List<String> 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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ public <T> T asJson(Class<T> cls) throws IOException {
* @return the object
* @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);
}

Expand Down

0 comments on commit 8684264

Please sign in to comment.