diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java index d87400c6..9c966a20 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java @@ -460,6 +460,9 @@ public LaunchServer(Path dir, String[] args) throws IOException, InvalidKeySpecE // Set launcher EXE binary launcherBinary = new JARLauncherBinary(this); launcherEXEBinary = binary(); + + launcherBinary.init(); + launcherEXEBinary.init(); syncLauncherBinaries(); // Sync updates dir diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/EXEL4JLauncherBinary.java b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/EXEL4JLauncherBinary.java index a70fa951..e69b17d0 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/EXEL4JLauncherBinary.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/EXEL4JLauncherBinary.java @@ -41,7 +41,6 @@ public void clear() { public EXEL4JLauncherBinary(LaunchServer server) { super(server, server.dir.resolve(server.config.binaryName + ".exe")); faviconFile = server.dir.resolve("favicon.ico"); - //setConfig(); } @Override diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java index d2439615..e05962d2 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java @@ -32,12 +32,16 @@ public JARLauncherBinary(LaunchServer server) throws IOException { guardDir = server.dir.resolve(Launcher.GUARD_DIR); buildDir = server.dir.resolve("build"); tasks = new ArrayList<>(); + } + + @Override + public void init() { tasks.add(new UnpackBuildTask(server)); tasks.add(new MainBuildTask(server)); if(server.config.enabledProGuard) tasks.add(new ProGuardBuildTask(server)); if(server.config.stripLineNumbers) tasks.add(new StripLineNumbersTask(server)); } - + @Override public void build() throws IOException { LogHelper.info("Building launcher binary file"); diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/LauncherBinary.java b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/LauncherBinary.java index 63bb9f32..15adcfe2 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/LauncherBinary.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/LauncherBinary.java @@ -9,25 +9,20 @@ import ru.gravit.utils.helper.SecurityHelper; public abstract class LauncherBinary { - public final LaunchServer server; - public Path syncBinaryFile; private volatile DigestBytesHolder binary; private volatile byte[] sign; - protected LauncherBinary(LaunchServer server, Path binaryFile) { this.server = server; syncBinaryFile = binaryFile; } - protected LauncherBinary(LaunchServer server) { this.server = server; } - public abstract void build() throws IOException; @@ -44,6 +39,8 @@ public final byte[] getSign() { return sign; } + public void init() { + } public final boolean sync() throws IOException { boolean exists = exists();