mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 19:49:11 +03:00
Compare commits
No commits in common. "b1a5ecdc136bbcdf96474893f3dbb9211c48803c" and "79fc42e86a6e4970b0ea2c2df25fdce1bbc43da3" have entirely different histories.
b1a5ecdc13
...
79fc42e86a
21 changed files with 60 additions and 108 deletions
12
.github/workflows/push.yml
vendored
12
.github/workflows/push.yml
vendored
|
@ -6,28 +6,26 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Cache Gradle
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: gravit-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-launcher
|
||||
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 21
|
||||
distribution: temurin
|
||||
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build
|
||||
|
||||
- name: Generate and submit dependency graph
|
||||
uses: gradle/actions/dependency-submission@417ae3ccd767c252f5661f1ace9f835f9654f2b5
|
||||
|
||||
|
@ -44,7 +42,7 @@ jobs:
|
|||
cp modules/*_lmodule/build/libs/*.jar artifacts/modules || true
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Launcher
|
||||
path: artifacts
|
||||
|
@ -65,7 +63,7 @@ jobs:
|
|||
|
||||
- name: Create release
|
||||
id: create_release
|
||||
uses: softprops/action-gh-release@v2
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: startsWith(github.event.ref, 'refs/tags')
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
dependsOn jar
|
||||
archiveClassifier.set('clean')
|
||||
manifest.attributes("Main-Class": mainClassName,
|
||||
"Premain-Class": mainAgentName,
|
||||
"Automatic-Module-Name": "launchserver"
|
||||
)
|
||||
from sourceSets.main.output
|
||||
|
@ -70,6 +71,7 @@
|
|||
dependencies {
|
||||
pack project(':LauncherAPI')
|
||||
bundle group: 'me.tongfei', name: 'progressbar', version: '0.10.1'
|
||||
bundle group: 'com.github.Marcono1234', name: 'gson-record-type-adapter-factory', version: 'v0.3.0'
|
||||
bundle group: 'org.fusesource.jansi', name: 'jansi', version: rootProject['verJansi']
|
||||
bundle group: 'org.jline', name: 'jline', version: rootProject['verJline']
|
||||
bundle group: 'org.jline', name: 'jline-reader', version: rootProject['verJline']
|
||||
|
@ -91,16 +93,20 @@ 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.code.gson', name: 'gson', version: rootProject['verGson']
|
||||
annotationProcessor(group: 'org.apache.logging.log4j', name: 'log4j-core', version: rootProject['verLog4j'])
|
||||
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: rootProject['verJunit']
|
||||
|
||||
hikari 'io.micrometer:micrometer-core:1.13.1'
|
||||
hikari('com.zaxxer:HikariCP:5.1.0') {
|
||||
hikari 'io.micrometer:micrometer-core:1.8.4'
|
||||
hikari('com.zaxxer:HikariCP:5.0.1') {
|
||||
exclude group: 'javassist'
|
||||
exclude group: 'io.micrometer'
|
||||
exclude group: 'org.slf4j'
|
||||
}
|
||||
|
||||
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'
|
||||
}
|
||||
|
||||
tasks.register('hikari', Copy) {
|
||||
|
|
|
@ -82,9 +82,6 @@ public final class LaunchServer implements Runnable, AutoCloseable, Reconfigurab
|
|||
*/
|
||||
public final Path profilesDir;
|
||||
public final Path tmpDir;
|
||||
public final Path modulesDir;
|
||||
public final Path launcherModulesDir;
|
||||
public final Path librariesDir;
|
||||
/**
|
||||
* This object contains runtime configuration
|
||||
*/
|
||||
|
@ -139,9 +136,6 @@ public LaunchServer(LaunchServerDirectories directories, LaunchServerEnv env, La
|
|||
launcherLibraries = directories.launcherLibrariesDir;
|
||||
launcherLibrariesCompile = directories.launcherLibrariesCompileDir;
|
||||
launcherPack = directories.launcherPackDir;
|
||||
modulesDir = directories.modules;
|
||||
launcherModulesDir = directories.launcherModules;
|
||||
librariesDir = directories.librariesDir;
|
||||
this.shardId = shardId;
|
||||
if(!Files.isDirectory(launcherPack)) {
|
||||
Files.createDirectories(launcherPack);
|
||||
|
@ -357,17 +351,14 @@ public void run() {
|
|||
// Sync updates dir
|
||||
CommonHelper.newThread("Profiles and updates sync", true, () -> {
|
||||
try {
|
||||
// Sync profiles dir
|
||||
if (!IOHelper.isDir(profilesDir))
|
||||
Files.createDirectory(profilesDir);
|
||||
syncProfilesDir();
|
||||
|
||||
// Sync updates dir
|
||||
if (!IOHelper.isDir(updatesDir))
|
||||
Files.createDirectory(updatesDir);
|
||||
updatesManager.readUpdatesDir();
|
||||
|
||||
|
||||
// Sync profiles dir
|
||||
if (!IOHelper.isDir(profilesDir))
|
||||
Files.createDirectory(profilesDir);
|
||||
syncProfilesDir();
|
||||
modulesManager.invokeEvent(new LaunchServerProfilesSyncEvent(this));
|
||||
} catch (IOException e) {
|
||||
logger.error("Updates/Profiles not synced", e);
|
||||
|
@ -497,10 +488,9 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IO
|
|||
public static class LaunchServerDirectories {
|
||||
public static final String UPDATES_NAME = "updates", PROFILES_NAME = "profiles",
|
||||
TRUSTSTORE_NAME = "truststore", LAUNCHERLIBRARIES_NAME = "launcher-libraries",
|
||||
LAUNCHERLIBRARIESCOMPILE_NAME = "launcher-libraries-compile", LAUNCHERPACK_NAME = "launcher-pack", KEY_NAME = ".keys", MODULES = "modules", LAUNCHER_MODULES = "launcher-modules", LIBRARIES = "libraries";
|
||||
LAUNCHERLIBRARIESCOMPILE_NAME = "launcher-libraries-compile", LAUNCHERPACK_NAME = "launcher-pack", KEY_NAME = ".keys";
|
||||
public Path updatesDir;
|
||||
public Path profilesDir;
|
||||
public Path librariesDir;
|
||||
public Path launcherLibrariesDir;
|
||||
public Path launcherLibrariesCompileDir;
|
||||
public Path launcherPackDir;
|
||||
|
@ -508,8 +498,6 @@ public static class LaunchServerDirectories {
|
|||
public Path dir;
|
||||
public Path trustStore;
|
||||
public Path tmpDir;
|
||||
public Path modules;
|
||||
public Path launcherModules;
|
||||
|
||||
public void collect() {
|
||||
if (updatesDir == null) updatesDir = getPath(UPDATES_NAME);
|
||||
|
@ -521,9 +509,6 @@ public void collect() {
|
|||
if(launcherPackDir == null)
|
||||
launcherPackDir = getPath(LAUNCHERPACK_NAME);
|
||||
if (keyDirectory == null) keyDirectory = getPath(KEY_NAME);
|
||||
if (modules == null) modules = getPath(MODULES);
|
||||
if (launcherModules == null) launcherModules = getPath(LAUNCHER_MODULES);
|
||||
if (librariesDir == null) librariesDir = getPath(LIBRARIES);
|
||||
if (tmpDir == null)
|
||||
tmpDir = Paths.get(System.getProperty("java.io.tmpdir")).resolve("launchserver-%s".formatted(SecurityHelper.randomStringToken()));
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
import java.nio.file.Path;
|
||||
import java.security.Security;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LaunchServerStarter {
|
||||
|
@ -52,13 +51,10 @@ public static void main(String[] args) throws Exception {
|
|||
try {
|
||||
Class.forName("org.bouncycastle.jce.provider.BouncyCastleProvider");
|
||||
Security.addProvider(new BouncyCastleProvider());
|
||||
} catch (ClassNotFoundException | NoClassDefFoundError ex) {
|
||||
} catch (ClassNotFoundException ex) {
|
||||
LogHelper.error("Library BouncyCastle not found! Is directory 'libraries' empty?");
|
||||
return;
|
||||
}
|
||||
LaunchServer.LaunchServerDirectories directories = new LaunchServer.LaunchServerDirectories();
|
||||
directories.dir = dir;
|
||||
directories.collect();
|
||||
CertificateManager certificateManager = new CertificateManager();
|
||||
try {
|
||||
certificateManager.readTrustStore(dir.resolve("truststore"));
|
||||
|
@ -82,7 +78,7 @@ public static void main(String[] args) throws Exception {
|
|||
LaunchServerRuntimeConfig runtimeConfig;
|
||||
LaunchServerConfig config;
|
||||
LaunchServer.LaunchServerEnv env = LaunchServer.LaunchServerEnv.PRODUCTION;
|
||||
LaunchServerModulesManager modulesManager = new LaunchServerModulesManager(directories.modules, dir.resolve("config"), certificateManager.trustManager);
|
||||
LaunchServerModulesManager modulesManager = new LaunchServerModulesManager(dir.resolve("modules"), dir.resolve("config"), certificateManager.trustManager);
|
||||
modulesManager.autoload();
|
||||
modulesManager.initModules(null);
|
||||
registerAll();
|
||||
|
@ -127,6 +123,8 @@ public static void main(String[] args) throws Exception {
|
|||
}
|
||||
|
||||
LaunchServer.LaunchServerConfigManager launchServerConfigManager = new BasicLaunchServerConfigManager(configFile, runtimeConfigFile);
|
||||
LaunchServer.LaunchServerDirectories directories = new LaunchServer.LaunchServerDirectories();
|
||||
directories.dir = dir;
|
||||
LaunchServer server = new LaunchServerBuilder()
|
||||
.setDirectories(directories)
|
||||
.setEnv(env)
|
||||
|
@ -137,24 +135,7 @@ public static void main(String[] args) throws Exception {
|
|||
.setLaunchServerConfigManager(launchServerConfigManager)
|
||||
.setCertificateManager(certificateManager)
|
||||
.build();
|
||||
List<String> allArgs = List.of(args);
|
||||
boolean isPrepareMode = prepareMode || allArgs.contains("--prepare");
|
||||
boolean isRunCommand = false;
|
||||
String runCommand = null;
|
||||
for(var e : allArgs) {
|
||||
if(e.equals("--run")) {
|
||||
isRunCommand = true;
|
||||
continue;
|
||||
}
|
||||
if(isRunCommand) {
|
||||
runCommand = e;
|
||||
isRunCommand = false;
|
||||
}
|
||||
}
|
||||
if(runCommand != null) {
|
||||
localCommandHandler.eval(runCommand, false);
|
||||
}
|
||||
if (!isPrepareMode) {
|
||||
if (!prepareMode) {
|
||||
server.run();
|
||||
} else {
|
||||
server.close();
|
||||
|
@ -220,7 +201,7 @@ public static void generateConfigIfNotExists(Path configFile, CommandHandler com
|
|||
address = System.getProperty("launchserver.address", null);
|
||||
}
|
||||
if (address == null) {
|
||||
System.out.println("External launchServer address:port (default: localhost:9274): ");
|
||||
System.out.println("LaunchServer address(default: localhost): ");
|
||||
address = commandHandler.readLine();
|
||||
}
|
||||
String projectName = System.getenv("PROJECTNAME");
|
||||
|
@ -234,29 +215,18 @@ public static void generateConfigIfNotExists(Path configFile, CommandHandler com
|
|||
newConfig.setProjectName(projectName);
|
||||
}
|
||||
if (address == null || address.isEmpty()) {
|
||||
logger.error("Address null. Using localhost:9274");
|
||||
address = "localhost:9274";
|
||||
logger.error("Address null. Using localhost");
|
||||
address = "localhost";
|
||||
}
|
||||
if (newConfig.projectName == null || newConfig.projectName.isEmpty()) {
|
||||
logger.error("ProjectName null. Using MineCraft");
|
||||
newConfig.projectName = "MineCraft";
|
||||
}
|
||||
int port = 9274;
|
||||
if(address.contains(":")) {
|
||||
String portString = address.substring(address.indexOf(':')+1);
|
||||
try {
|
||||
port = Integer.parseInt(portString);
|
||||
} catch (NumberFormatException e) {
|
||||
logger.warn("Unknown port {}, using 9274", portString);
|
||||
}
|
||||
} else {
|
||||
logger.info("Address {} doesn't contains port (you want to use nginx?)", address);
|
||||
}
|
||||
newConfig.netty.address = "ws://" + address + "/api";
|
||||
newConfig.netty.downloadURL = "http://" + address + "/%dirname%/";
|
||||
newConfig.netty.launcherURL = "http://" + address + "/Launcher.jar";
|
||||
newConfig.netty.launcherEXEURL = "http://" + address + "/Launcher.exe";
|
||||
newConfig.netty.binds[0].port = port;
|
||||
|
||||
newConfig.netty.address = "ws://" + address + ":9274/api";
|
||||
newConfig.netty.downloadURL = "http://" + address + ":9274/%dirname%/";
|
||||
newConfig.netty.launcherURL = "http://" + address + ":9274/Launcher.jar";
|
||||
newConfig.netty.launcherEXEURL = "http://" + address + ":9274/Launcher.exe";
|
||||
|
||||
// Write LaunchServer config
|
||||
logger.info("Writing LaunchServer config file");
|
||||
|
|
|
@ -21,7 +21,6 @@ public class Main {
|
|||
private static final List<String> classpathOnly = List.of("proguard", "jline", "progressbar", "kotlin", "epoll");
|
||||
private static final String LOG4J_PROPERTY = "log4j2.configurationFile";
|
||||
private static final String DEBUG_PROPERTY = "launchserver.main.debug";
|
||||
private static final String LIBRARIES_PROPERTY = "launchserver.dir.libraries";
|
||||
private static boolean isClasspathOnly(Path path) {
|
||||
var fileName = path.getFileName().toString();
|
||||
for(var e : classpathOnly) {
|
||||
|
@ -57,9 +56,8 @@ public static void main(String[] args) throws Throwable {
|
|||
ModuleLaunch launch = new ModuleLaunch();
|
||||
LaunchOptions options = new LaunchOptions();
|
||||
options.moduleConf = new LaunchOptions.ModuleConf();
|
||||
Path librariesPath = Path.of(System.getProperty(LIBRARIES_PROPERTY, "libraries"));
|
||||
List<Path> libraries;
|
||||
try(Stream<Path> files = Files.walk(librariesPath, FileVisitOption.FOLLOW_LINKS)) {
|
||||
try(Stream<Path> files = Files.walk(Path.of("libraries"), FileVisitOption.FOLLOW_LINKS)) {
|
||||
libraries = new ArrayList<>(files.filter(e -> e.getFileName().toString().endsWith(".jar")).toList());
|
||||
}
|
||||
List<Path> classpath = new ArrayList<>();
|
||||
|
|
|
@ -276,7 +276,7 @@ public void close() {
|
|||
|
||||
protected SQLUser constructUser(ResultSet set) throws SQLException {
|
||||
return set.next() ? new SQLUser(UUID.fromString(set.getString(uuidColumn)), set.getString(usernameColumn),
|
||||
set.getString(accessTokenColumn), set.getString(serverIDColumn), set.getString(passwordColumn)) : null;
|
||||
set.getString(accessTokenColumn), set.getString(serverIDColumn), set.getString(passwordColumn), requestPermissions(set.getString(uuidColumn))) : null;
|
||||
}
|
||||
|
||||
public ClientPermissions requestPermissions (String uuid) throws SQLException
|
||||
|
@ -286,17 +286,14 @@ public ClientPermissions requestPermissions (String uuid) throws SQLException
|
|||
}
|
||||
|
||||
private SQLUser queryUser(String sql, String value) throws SQLException {
|
||||
SQLUser user;
|
||||
try (Connection c = getSQLConfig().getConnection()) {
|
||||
PreparedStatement s = c.prepareStatement(sql);
|
||||
s.setString(1, value);
|
||||
s.setQueryTimeout(MySQLSourceConfig.TIMEOUT);
|
||||
try (ResultSet set = s.executeQuery()) {
|
||||
user = constructUser(set);
|
||||
return constructUser(set);
|
||||
}
|
||||
}
|
||||
user.permissions = requestPermissions(user.uuid.toString());
|
||||
return user;
|
||||
}
|
||||
|
||||
private List<String> queryPermissions(String sql, String value) throws SQLException {
|
||||
|
@ -343,14 +340,15 @@ public static class SQLUser implements User {
|
|||
protected String accessToken;
|
||||
protected String serverId;
|
||||
protected final String password;
|
||||
protected ClientPermissions permissions;
|
||||
protected final ClientPermissions permissions;
|
||||
|
||||
public SQLUser(UUID uuid, String username, String accessToken, String serverId, String password) {
|
||||
public SQLUser(UUID uuid, String username, String accessToken, String serverId, String password, ClientPermissions permissions) {
|
||||
this.uuid = uuid;
|
||||
this.username = username;
|
||||
this.accessToken = accessToken;
|
||||
this.serverId = serverId;
|
||||
this.password = password;
|
||||
this.permissions = permissions;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -72,7 +72,7 @@ protected String makeUserCols() {
|
|||
@Override
|
||||
protected MySQLUser constructUser(ResultSet set) throws SQLException {
|
||||
return set.next() ? new MySQLUser(UUID.fromString(set.getString(uuidColumn)), set.getString(usernameColumn),
|
||||
set.getString(accessTokenColumn), set.getString(serverIDColumn), set.getString(passwordColumn), set.getLong(hardwareIdColumn)) : null;
|
||||
set.getString(accessTokenColumn), set.getString(serverIDColumn), set.getString(passwordColumn), requestPermissions(set.getString(uuidColumn)), set.getLong(hardwareIdColumn)) : null;
|
||||
}
|
||||
|
||||
private MySQLUserHardware fetchHardwareInfo(ResultSet set) throws SQLException, IOException {
|
||||
|
@ -336,8 +336,8 @@ public String toString() {
|
|||
public static class MySQLUser extends SQLUser {
|
||||
protected long hwidId;
|
||||
|
||||
public MySQLUser(UUID uuid, String username, String accessToken, String serverId, String password, long hwidId) {
|
||||
super(uuid, username, accessToken, serverId, password);
|
||||
public MySQLUser(UUID uuid, String username, String accessToken, String serverId, String password, ClientPermissions permissions, long hwidId) {
|
||||
super(uuid, username, accessToken, serverId, password, permissions);
|
||||
this.hwidId = hwidId;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,9 +37,7 @@ public Path process(Path inputFile) throws IOException {
|
|||
server.launcherBinary.addonLibs.clear();
|
||||
server.launcherBinary.files.clear();
|
||||
IOHelper.walk(server.launcherLibraries, new ListFileVisitor(server.launcherBinary.coreLibs), false);
|
||||
if(Files.isDirectory(server.launcherLibrariesCompile)) {
|
||||
IOHelper.walk(server.launcherLibrariesCompile, new ListFileVisitor(server.launcherBinary.addonLibs), false);
|
||||
}
|
||||
try(Stream<Path> stream = Files.walk(server.launcherPack).filter((e) -> {
|
||||
try {
|
||||
return !Files.isDirectory(e) && !Files.isHidden(e);
|
||||
|
|
|
@ -213,7 +213,7 @@ public Path process(Path inputFile) throws IOException {
|
|||
args.add(IOHelper.resolveJavaBin(IOHelper.JVM_DIR).toAbsolutePath().toString());
|
||||
args.addAll(component.jvmArgs);
|
||||
args.add("-cp");
|
||||
try(Stream<Path> files = Files.walk(server.librariesDir, FileVisitOption.FOLLOW_LINKS)) {
|
||||
try(Stream<Path> files = Files.walk(Path.of("libraries"), FileVisitOption.FOLLOW_LINKS)) {
|
||||
args.add(files
|
||||
.filter(e -> e.getFileName().toString().endsWith(".jar"))
|
||||
.map(path -> path.toAbsolutePath().toString())
|
||||
|
|
|
@ -103,7 +103,6 @@ public static ClientProfile makeProfile(ClientProfile.Version version, String ti
|
|||
}
|
||||
if (fabric.isPresent()) {
|
||||
builder.setAltClassPath(fabric.orElseThrow().getAltClassPath());
|
||||
jvmArgs.add("-Dsodium.checks.issue2561=false"); // Please don't check LWJL3 version (Sodium: https://github.com/CaffeineMC/sodium-fabric/issues/2561 )
|
||||
}
|
||||
if(quilt.isPresent()) {
|
||||
builder.setClassLoaderConfig(ClientProfile.ClassLoaderConfig.SYSTEM_ARGS);
|
||||
|
@ -197,9 +196,6 @@ public static String getMainClassByVersion(ClientProfile.Version version, MakePr
|
|||
if(version.compareTo(ClientProfileVersions.MINECRAFT_1_7_10) == 0) {
|
||||
return "com.gtnewhorizons.retrofuturabootstrap.Main";
|
||||
}
|
||||
if(version.compareTo(ClientProfileVersions.MINECRAFT_1_12_2) == 0) {
|
||||
return "top.outlands.foundation.boot.Foundation"; // Cleanroom
|
||||
}
|
||||
if (findOption(options, MakeProfileOptionLaunchWrapper.class).isPresent()) {
|
||||
return "net.minecraft.launchwrapper.Launch";
|
||||
}
|
||||
|
@ -207,7 +203,7 @@ public static String getMainClassByVersion(ClientProfile.Version version, MakePr
|
|||
return "cpw.mods.modlauncher.Launcher";
|
||||
}
|
||||
if (findOption(options, MakeProfileOptionFabric.class).isPresent()) {
|
||||
return "net.fabricmc.loader.impl.launch.knot.KnotClient";
|
||||
return "net.fabricmc.loader.launch.knot.KnotClient";
|
||||
}
|
||||
if(findOption(options, MakeProfilesOptionsQuilt.class).isPresent()) {
|
||||
return "org.quiltmc.loader.impl.launch.knot.KnotClient";
|
||||
|
|
|
@ -33,7 +33,7 @@ public class LauncherModuleLoader {
|
|||
|
||||
public LauncherModuleLoader(LaunchServer server) {
|
||||
this.server = server;
|
||||
modulesDir = server.launcherModulesDir;
|
||||
modulesDir = server.dir.resolve("launcher-modules");
|
||||
}
|
||||
|
||||
public void init() {
|
||||
|
|
|
@ -22,7 +22,6 @@ public class KeyAgreementManager {
|
|||
public final RSAPublicKey rsaPublicKey;
|
||||
public final RSAPrivateKey rsaPrivateKey;
|
||||
public final String legacySalt;
|
||||
public final Path keyDirectory;
|
||||
|
||||
public KeyAgreementManager(ECPublicKey ecdsaPublicKey, ECPrivateKey ecdsaPrivateKey, RSAPublicKey rsaPublicKey, RSAPrivateKey rsaPrivateKey, String legacySalt) {
|
||||
this.ecdsaPublicKey = ecdsaPublicKey;
|
||||
|
@ -30,11 +29,9 @@ public KeyAgreementManager(ECPublicKey ecdsaPublicKey, ECPrivateKey ecdsaPrivate
|
|||
this.rsaPublicKey = rsaPublicKey;
|
||||
this.rsaPrivateKey = rsaPrivateKey;
|
||||
this.legacySalt = legacySalt;
|
||||
this.keyDirectory = null;
|
||||
}
|
||||
|
||||
public KeyAgreementManager(Path keyDirectory) throws IOException, InvalidKeySpecException {
|
||||
this.keyDirectory = keyDirectory;
|
||||
Path ecdsaPublicKeyPath = keyDirectory.resolve("ecdsa_id.pub"), ecdsaPrivateKeyPath = keyDirectory.resolve("ecdsa_id");
|
||||
Logger logger = LogManager.getLogger();
|
||||
if (IOHelper.isFile(ecdsaPublicKeyPath) && IOHelper.isFile(ecdsaPrivateKeyPath)) {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package pro.gravit.launchserver.manangers;
|
||||
|
||||
import com.google.gson.GsonBuilder;
|
||||
import marcono1234.gson.recordadapter.RecordTypeAdapterFactory;
|
||||
import pro.gravit.launcher.base.events.request.GetAvailabilityAuthRequestEvent;
|
||||
import pro.gravit.launcher.core.managers.GsonManager;
|
||||
import pro.gravit.launcher.base.modules.events.PreGsonPhase;
|
||||
|
@ -33,6 +34,9 @@ public LaunchServerGsonManager(LaunchServerModulesManager modulesManager) {
|
|||
@Override
|
||||
public void registerAdapters(GsonBuilder builder) {
|
||||
super.registerAdapters(builder);
|
||||
builder.registerTypeAdapterFactory(RecordTypeAdapterFactory.builder()
|
||||
.allowMissingComponentValues()
|
||||
.create());
|
||||
builder.registerTypeAdapter(ClientProfile.Version.class, new ClientProfile.Version.GsonSerializer());
|
||||
builder.registerTypeAdapter(TextureProvider.class, new UniversalJsonAdapter<>(TextureProvider.providers));
|
||||
builder.registerTypeAdapter(AuthCoreProvider.class, new UniversalJsonAdapter<>(AuthCoreProvider.providers));
|
||||
|
|
|
@ -256,7 +256,7 @@ protected HttpRequest makeHttpRequest(URI baseUri, String filePath) throws URISy
|
|||
}
|
||||
|
||||
protected ProgressTrackingBodyHandler<Path> makeBodyHandler(Path file, DownloadCallback callback) {
|
||||
return new ProgressTrackingBodyHandler<>(HttpResponse.BodyHandlers.ofFile(file, StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING), callback);
|
||||
return new ProgressTrackingBodyHandler<>(HttpResponse.BodyHandlers.ofFile(file, StandardOpenOption.CREATE, StandardOpenOption.WRITE), callback);
|
||||
}
|
||||
|
||||
public interface DownloadCallback {
|
||||
|
|
|
@ -79,7 +79,6 @@ public ClientProfileBuilder(ClientProfile profile) {
|
|||
this.loadNatives = new ArrayList<>(profile.getLoadNatives());
|
||||
this.properties = new HashMap<>(profile.getProperties());
|
||||
this.servers = new ArrayList<>(profile.getServers());
|
||||
this.classLoaderConfig = profile.getClassLoaderConfig();
|
||||
this.flags = new ArrayList<>(profile.getFlags());
|
||||
this.recommendJavaVersion = profile.getRecommendJavaVersion();
|
||||
this.minJavaVersion = profile.getMinJavaVersion();
|
||||
|
|
|
@ -88,7 +88,7 @@ public Set<OptionalAction> getEnabledActions() {
|
|||
public void fixDependencies() {
|
||||
Set<OptionalFile> disabled = all.stream().filter(t -> !isEnabled(t)).collect(Collectors.toSet());
|
||||
for (OptionalFile file : disabled) {
|
||||
if (file.group != null && file.group.length > 0 && Arrays.stream(file.group).noneMatch(this::isEnabled)) {
|
||||
if (file.group != null && Arrays.stream(file.group).noneMatch(this::isEnabled)) {
|
||||
enable(file.group[0], false, null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
compileOnly group: 'org.jline', name: 'jline', version: rootProject['verJline']
|
||||
compileOnly group: 'org.jline', name: 'jline-reader', version: rootProject['verJline']
|
||||
compileOnly group: 'org.jline', name: 'jline-terminal', version: rootProject['verJline']
|
||||
compileOnly group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: rootProject['verBcprov']
|
||||
compileOnly group: 'org.slf4j', name: 'slf4j-api', version: rootProject['verSlf4j']
|
||||
api group: 'com.google.code.gson', name: 'gson', version: rootProject['verGson']
|
||||
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: rootProject['verJunit']
|
||||
|
|
|
@ -6,7 +6,7 @@ public final class Version implements Comparable<Version> {
|
|||
|
||||
public static final int MAJOR = 5;
|
||||
public static final int MINOR = 6;
|
||||
public static final int PATCH = 5;
|
||||
public static final int PATCH = 2;
|
||||
public static final int BUILD = 1;
|
||||
public static final Version.Type RELEASE = Type.STABLE;
|
||||
public final int major;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
id 'org.openjfx.javafxplugin' version '0.1.0' apply false
|
||||
}
|
||||
group = 'pro.gravit.launcher'
|
||||
version = '5.6.5'
|
||||
version = '5.6.2'
|
||||
|
||||
apply from: 'props.gradle'
|
||||
|
||||
|
|
2
modules
2
modules
|
@ -1 +1 @@
|
|||
Subproject commit 9f1ccd0bbc767d04a8a2d2909cc050980c8a458f
|
||||
Subproject commit a52b9cc8552445167b95e8933f4289bbaa70677d
|
|
@ -1,16 +1,18 @@
|
|||
project.ext {
|
||||
verAsm = '9.7'
|
||||
verNetty = '4.1.111.Final'
|
||||
verNetty = '4.1.110.Final'
|
||||
verOshiCore = '6.6.1'
|
||||
verJunit = '5.10.2'
|
||||
verGuavaC = '30.1.1-jre'
|
||||
verJansi = '2.4.1'
|
||||
verJline = '3.26.1'
|
||||
verJwt = '0.12.5'
|
||||
verBcprov = '1.70'
|
||||
verGson = '2.11.0'
|
||||
verBcpkix = '1.78.1'
|
||||
verSlf4j = '2.0.13'
|
||||
verLog4j = '2.23.1'
|
||||
verMySQLConn = '9.0.0'
|
||||
verMySQLConn = '8.4.0'
|
||||
verMariaDBConn = '3.4.0'
|
||||
verPostgreSQLConn = '42.7.3'
|
||||
verH2Conn = '2.2.224'
|
||||
|
|
Loading…
Reference in a new issue