mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 11:39:11 +03:00
[FIX] Использование GravitGuard вместе с своей Java
This commit is contained in:
parent
06c33a47ad
commit
0e278b715b
1 changed files with 12 additions and 8 deletions
|
@ -23,7 +23,7 @@ public class LauncherGravitGuard implements LauncherGuardInterface {
|
|||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "wrapper";
|
||||
return "gravitguard";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -31,7 +31,7 @@ public Path getJavaBinPath() {
|
|||
if (JVMHelper.OS_TYPE == JVMHelper.OS.MUSTDIE) {
|
||||
javaBinPath = ClientLauncher.getJavaBinPath();
|
||||
String projectName = Launcher.getConfig().projectname;
|
||||
String wrapperUnpackName = JVMHelper.JVM_BITS == 64 ? projectName.concat("64.exe") : projectName.concat("32.exe");
|
||||
String wrapperUnpackName = ( javaBinPath == null ? JVMHelper.JVM_BITS : JVMHelper.OS_BITS ) == 64 ? projectName.concat("64.exe") : projectName.concat("32.exe");
|
||||
return DirBridge.getGuardDir().resolve(wrapperUnpackName);
|
||||
} else
|
||||
return IOHelper.resolveJavaBin(Paths.get(System.getProperty("java.home")));
|
||||
|
@ -39,18 +39,22 @@ public Path getJavaBinPath() {
|
|||
|
||||
@Override
|
||||
public int getClientJVMBits() {
|
||||
return JVMHelper.JVM_BITS;
|
||||
//При использовании GravitGuard без своей джавы
|
||||
//Если при запуске лаунчера используется 32 бит джава, а ОС 64бит
|
||||
//То в окне настроек будет отображаться >1.5Гб доступной памяти
|
||||
//Однако при выставлении >1.5Гб JVM x32 работать откажеться
|
||||
return JVMHelper.OS_BITS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(boolean clientInstance) {
|
||||
try {
|
||||
String wrapperName = JVMHelper.JVM_BITS == 64 ? "wrapper64.exe" : "wrapper32.exe";
|
||||
String projectName = Launcher.getConfig().projectname;
|
||||
String wrapperUnpackName = JVMHelper.JVM_BITS == 64 ? projectName.concat("64.exe") : projectName.concat("32.exe");
|
||||
String antiInjectName = JVMHelper.JVM_BITS == 64 ? "AntiInject64.dll" : "AntiInject32.dll";
|
||||
UnpackHelper.unpack(Launcher.getResourceURL(wrapperName, "guard"), DirBridge.getGuardDir().resolve(wrapperUnpackName));
|
||||
UnpackHelper.unpack(Launcher.getResourceURL(antiInjectName, "guard"), DirBridge.getGuardDir().resolve(antiInjectName));
|
||||
UnpackHelper.unpack(Launcher.getResourceURL("wrapper32.exe", "guard"), DirBridge.getGuardDir().resolve(projectName.concat("64.exe")));
|
||||
UnpackHelper.unpack(Launcher.getResourceURL("AntiInject64.dll", "guard"), DirBridge.getGuardDir().resolve("AntiInject64.dll"));
|
||||
|
||||
UnpackHelper.unpack(Launcher.getResourceURL("wrapper32.exe", "guard"), DirBridge.getGuardDir().resolve(projectName.concat("32.exe")));
|
||||
UnpackHelper.unpack(Launcher.getResourceURL("AntiInject32.dll", "guard"), DirBridge.getGuardDir().resolve("AntiInject32.dll"));
|
||||
} catch (IOException e) {
|
||||
throw new SecurityException(e);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue