mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-31 20:59:54 +03:00
Fixed launcherBinary NPE.
This commit is contained in:
parent
5ba69c155a
commit
78def447ce
4 changed files with 10 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue