mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-04-11 18:57:30 +03:00
[FEATURE] Вы можете поставить листы ClientProfile модулем.
This commit is contained in:
parent
b99b7dbedd
commit
6cc7f214b3
1 changed files with 18 additions and 1 deletions
|
@ -45,6 +45,7 @@
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.ProcessBuilder.Redirect;
|
import java.lang.ProcessBuilder.Redirect;
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.SocketAddress;
|
import java.net.SocketAddress;
|
||||||
import java.nio.file.*;
|
import java.nio.file.*;
|
||||||
|
@ -354,6 +355,8 @@ public static void main(String... args) throws Throwable {
|
||||||
|
|
||||||
public final JARLauncherBinary launcherBinary;
|
public final JARLauncherBinary launcherBinary;
|
||||||
|
|
||||||
|
public Class<LauncherBinary> launcherEXEBinaryClass;
|
||||||
|
|
||||||
public final LauncherBinary launcherEXEBinary;
|
public final LauncherBinary launcherEXEBinary;
|
||||||
// HWID ban + anti-brutforce
|
// HWID ban + anti-brutforce
|
||||||
|
|
||||||
|
@ -459,6 +462,9 @@ public LaunchServer(Path dir, String[] args) throws IOException, InvalidKeySpecE
|
||||||
crc.update(publicKey.getModulus().toByteArray()); // IDEA говорит, что это Java 9 API. WTF?
|
crc.update(publicKey.getModulus().toByteArray()); // IDEA говорит, что это Java 9 API. WTF?
|
||||||
LogHelper.subInfo("Modulus CRC32: 0x%08x", crc.getValue());
|
LogHelper.subInfo("Modulus CRC32: 0x%08x", crc.getValue());
|
||||||
|
|
||||||
|
// Load class bindings.
|
||||||
|
launcherEXEBinaryClass = null;
|
||||||
|
|
||||||
// pre init modules
|
// pre init modules
|
||||||
modulesManager = new ModulesManager(this);
|
modulesManager = new ModulesManager(this);
|
||||||
modulesManager.autoload(dir.resolve("modules"));
|
modulesManager.autoload(dir.resolve("modules"));
|
||||||
|
@ -589,6 +595,14 @@ public static void initGson() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private LauncherBinary binary() {
|
private LauncherBinary binary() {
|
||||||
|
if (launcherEXEBinaryClass != null) {
|
||||||
|
try {
|
||||||
|
return (LauncherBinary)launcherEXEBinaryClass.getConstructor(LaunchServer.class).newInstance(this);
|
||||||
|
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
|
||||||
|
| InvocationTargetException | NoSuchMethodException | SecurityException e) {
|
||||||
|
LogHelper.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
Class.forName("net.sf.launch4j.Builder");
|
Class.forName("net.sf.launch4j.Builder");
|
||||||
if (config.launch4j.enabled) return new EXEL4JLauncherBinary(this);
|
if (config.launch4j.enabled) return new EXEL4JLauncherBinary(this);
|
||||||
|
@ -686,10 +700,13 @@ private void generateConfigIfNotExists() throws IOException {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<ClientProfile> getProfiles() {
|
public List<ClientProfile> getProfiles() {
|
||||||
return profilesList;
|
return profilesList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setProfiles(List<ClientProfile> profilesList) {
|
||||||
|
this.profilesList = Collections.unmodifiableList(profilesList);
|
||||||
|
}
|
||||||
|
|
||||||
public SignedObjectHolder<HashedDir> getUpdateDir(String name) {
|
public SignedObjectHolder<HashedDir> getUpdateDir(String name) {
|
||||||
return updatesDirMap.get(name);
|
return updatesDirMap.get(name);
|
||||||
|
|
Loading…
Reference in a new issue