mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 11:39:11 +03:00
[FEATURE] Использование Java 11 по умолчанию
This commit is contained in:
parent
9766cd69e5
commit
a4355d1d05
6 changed files with 10 additions and 34 deletions
|
@ -12,8 +12,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceCompatibility = '1.8'
|
sourceCompatibility = '11'
|
||||||
targetCompatibility = '1.8'
|
targetCompatibility = '11'
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
compileOnlyA
|
compileOnlyA
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public final class JsonAuthProvider extends AuthProvider {
|
public final class JsonAuthProvider extends AuthProvider {
|
||||||
public URL url;
|
public URL url;
|
||||||
|
@ -25,10 +26,7 @@ public AuthProviderResult auth(String login, AuthRequest.AuthPasswordInterface p
|
||||||
authResult result = Launcher.gsonManager.gson.fromJson(content, authResult.class);
|
authResult result = Launcher.gsonManager.gson.fromJson(content, authResult.class);
|
||||||
if (result.username != null)
|
if (result.username != null)
|
||||||
return new AuthProviderResult(result.username, SecurityHelper.randomStringToken(), new ClientPermissions(result.permissions, result.flags));
|
return new AuthProviderResult(result.username, SecurityHelper.randomStringToken(), new ClientPermissions(result.permissions, result.flags));
|
||||||
else if (result.error != null)
|
else return authError(Objects.requireNonNullElse(result.error, "Authentication server response is malformed"));
|
||||||
return authError(result.error);
|
|
||||||
else
|
|
||||||
return authError("Authentication server response is malformed");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -27,32 +27,7 @@
|
||||||
|
|
||||||
public class SignHelper {
|
public class SignHelper {
|
||||||
|
|
||||||
public static final OutputStream NULL = new OutputStream() {
|
public static final OutputStream NULL = OutputStream.nullOutputStream();
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "NullOutputStream";
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Discards the specified byte array. */
|
|
||||||
@Override
|
|
||||||
public void write(byte[] b) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Discards the specified byte array. */
|
|
||||||
@Override
|
|
||||||
public void write(byte[] b, int off, int len) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Discards the specified byte. */
|
|
||||||
@Override
|
|
||||||
public void write(int b) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Never closes */
|
|
||||||
@Override
|
|
||||||
public void close() {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public static final String hashFunctionName = "SHA-256";
|
public static final String hashFunctionName = "SHA-256";
|
||||||
|
|
||||||
private SignHelper() {
|
private SignHelper() {
|
||||||
|
|
|
@ -177,7 +177,7 @@ public void readTrustStore(Path dir) throws IOException, CertificateException {
|
||||||
}
|
}
|
||||||
List<X509Certificate> certificates = new ArrayList<>();
|
List<X509Certificate> certificates = new ArrayList<>();
|
||||||
CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
|
CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
|
||||||
IOHelper.walk(dir, new SimpleFileVisitor<Path>() {
|
IOHelper.walk(dir, new SimpleFileVisitor<>() {
|
||||||
@Override
|
@Override
|
||||||
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
|
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
|
||||||
if (file.toFile().getName().endsWith(".crt")) {
|
if (file.toFile().getName().endsWith(".crt")) {
|
||||||
|
|
|
@ -9,6 +9,9 @@
|
||||||
compileOnly group: 'org.bouncycastle', name: 'bcprov-jdk15', version: rootProject['verBcprov']
|
compileOnly group: 'org.bouncycastle', name: 'bcprov-jdk15', version: rootProject['verBcprov']
|
||||||
api group: 'com.google.code.gson', name: 'gson', version: rootProject['verGson']
|
api group: 'com.google.code.gson', name: 'gson', version: rootProject['verGson']
|
||||||
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: rootProject['verJunit']
|
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: rootProject['verJunit']
|
||||||
|
testImplementation group: 'org.jline', name: 'jline', version: rootProject['verJline']
|
||||||
|
testImplementation group: 'org.jline', name: 'jline-reader', version: rootProject['verJline']
|
||||||
|
testImplementation group: 'org.jline', name: 'jline-terminal', version: rootProject['verJline']
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
|
|
2
modules
2
modules
|
@ -1 +1 @@
|
||||||
Subproject commit 4795b7a967af69ddea48116c718bb32b96e43f83
|
Subproject commit 71c224e4d7a0950d3b5599ba4dec8d6fd04ededd
|
Loading…
Reference in a new issue