mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-01-03 22:30:31 +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
|
// Set launcher EXE binary
|
||||||
launcherBinary = new JARLauncherBinary(this);
|
launcherBinary = new JARLauncherBinary(this);
|
||||||
launcherEXEBinary = binary();
|
launcherEXEBinary = binary();
|
||||||
|
|
||||||
|
launcherBinary.init();
|
||||||
|
launcherEXEBinary.init();
|
||||||
syncLauncherBinaries();
|
syncLauncherBinaries();
|
||||||
|
|
||||||
// Sync updates dir
|
// Sync updates dir
|
||||||
|
|
|
@ -41,7 +41,6 @@ public void clear() {
|
||||||
public EXEL4JLauncherBinary(LaunchServer server) {
|
public EXEL4JLauncherBinary(LaunchServer server) {
|
||||||
super(server, server.dir.resolve(server.config.binaryName + ".exe"));
|
super(server, server.dir.resolve(server.config.binaryName + ".exe"));
|
||||||
faviconFile = server.dir.resolve("favicon.ico");
|
faviconFile = server.dir.resolve("favicon.ico");
|
||||||
//setConfig();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -32,12 +32,16 @@ public JARLauncherBinary(LaunchServer server) throws IOException {
|
||||||
guardDir = server.dir.resolve(Launcher.GUARD_DIR);
|
guardDir = server.dir.resolve(Launcher.GUARD_DIR);
|
||||||
buildDir = server.dir.resolve("build");
|
buildDir = server.dir.resolve("build");
|
||||||
tasks = new ArrayList<>();
|
tasks = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() {
|
||||||
tasks.add(new UnpackBuildTask(server));
|
tasks.add(new UnpackBuildTask(server));
|
||||||
tasks.add(new MainBuildTask(server));
|
tasks.add(new MainBuildTask(server));
|
||||||
if(server.config.enabledProGuard) tasks.add(new ProGuardBuildTask(server));
|
if(server.config.enabledProGuard) tasks.add(new ProGuardBuildTask(server));
|
||||||
if(server.config.stripLineNumbers) tasks.add(new StripLineNumbersTask(server));
|
if(server.config.stripLineNumbers) tasks.add(new StripLineNumbersTask(server));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void build() throws IOException {
|
public void build() throws IOException {
|
||||||
LogHelper.info("Building launcher binary file");
|
LogHelper.info("Building launcher binary file");
|
||||||
|
|
|
@ -9,25 +9,20 @@
|
||||||
import ru.gravit.utils.helper.SecurityHelper;
|
import ru.gravit.utils.helper.SecurityHelper;
|
||||||
|
|
||||||
public abstract class LauncherBinary {
|
public abstract class LauncherBinary {
|
||||||
|
|
||||||
public final LaunchServer server;
|
public final LaunchServer server;
|
||||||
|
|
||||||
public Path syncBinaryFile;
|
public Path syncBinaryFile;
|
||||||
private volatile DigestBytesHolder binary;
|
private volatile DigestBytesHolder binary;
|
||||||
private volatile byte[] sign;
|
private volatile byte[] sign;
|
||||||
|
|
||||||
|
|
||||||
protected LauncherBinary(LaunchServer server, Path binaryFile) {
|
protected LauncherBinary(LaunchServer server, Path binaryFile) {
|
||||||
this.server = server;
|
this.server = server;
|
||||||
syncBinaryFile = binaryFile;
|
syncBinaryFile = binaryFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected LauncherBinary(LaunchServer server) {
|
protected LauncherBinary(LaunchServer server) {
|
||||||
this.server = server;
|
this.server = server;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public abstract void build() throws IOException;
|
public abstract void build() throws IOException;
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,6 +39,8 @@ public final byte[] getSign() {
|
||||||
return sign;
|
return sign;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void init() {
|
||||||
|
}
|
||||||
|
|
||||||
public final boolean sync() throws IOException {
|
public final boolean sync() throws IOException {
|
||||||
boolean exists = exists();
|
boolean exists = exists();
|
||||||
|
|
Loading…
Reference in a new issue