Merge branch 'master' of github.com:GravitLauncher/Launcher

This commit is contained in:
Gravit 2018-10-13 12:00:57 +07:00
commit bae9a511bc
No known key found for this signature in database
GPG key ID: 061981E1E85D3216
5 changed files with 14 additions and 11 deletions

View file

@ -24,11 +24,7 @@
-keeppackagenames com.eclipsesource.json.**,com.mojang.**,org.apache.**,com.google.gson.** -keeppackagenames com.eclipsesource.json.**,com.mojang.**,org.apache.**,com.google.gson.**
-keep class com.eclipsesource.json.**,com.mojang.**,com.google.gson.** { -keep class com.mojang.**,org.apache.**,com.google.gson.**,com.eclipsesource.json.** {
<fields>;
<methods>;
}
-keep class org.apache.** {
*; *;
} }

View file

@ -205,7 +205,7 @@ public void start(String... args) throws Throwable {
loadScript("dialog/dialog.js"); loadScript("dialog/dialog.js");
LogHelper.info("Invoking start() function"); LogHelper.info("Invoking start() function");
Invocable invoker = (Invocable) engine; Invocable invoker = (Invocable) engine;
if (JVMHelper.OS_TYPE == JVMHelper.OS.MUSTDIE) { if (Launcher.isUsingAvanguard()) {
AvanguardStarter.start((Path) invoker.invokeFunction("getPathDirHelper")); AvanguardStarter.start((Path) invoker.invokeFunction("getPathDirHelper"));
AvanguardStarter.loadVared(); AvanguardStarter.loadVared();
AvanguardStarter.main(false); AvanguardStarter.main(false);

View file

@ -320,7 +320,7 @@ public static Process launch(
checkJVMBitsAndVersion(); checkJVMBitsAndVersion();
// Fill CLI arguments // Fill CLI arguments
List<String> args = new LinkedList<>(); List<String> args = new LinkedList<>();
boolean wrapper = isUsingWrapper(); boolean wrapper = isUsingWrapper() && Launcher.isUsingAvanguard();
Path javaBin; Path javaBin;
if (wrapper) javaBin = JVMHelper.JVM_BITS == 64 ? AvanguardStarter.wrap64 : AvanguardStarter.wrap32; if (wrapper) javaBin = JVMHelper.JVM_BITS == 64 ? AvanguardStarter.wrap64 : AvanguardStarter.wrap32;
else else
@ -383,7 +383,7 @@ public static void main(String... args) throws Throwable {
Launcher.modulesManager = new ClientModuleManager(null); Launcher.modulesManager = new ClientModuleManager(null);
LauncherConfig.getAutogenConfig().initModules(); //INIT LauncherConfig.getAutogenConfig().initModules(); //INIT
Launcher.modulesManager.preInitModules(); Launcher.modulesManager.preInitModules();
if (JVMHelper.OS_TYPE == OS.MUSTDIE) { if (Launcher.isUsingAvanguard()) {
AvanguardStarter.loadVared(); AvanguardStarter.loadVared();
AvanguardStarter.main(false); AvanguardStarter.main(false);
} }

View file

@ -69,9 +69,9 @@ protected Result requestDo(HInput input, HOutput output) throws IOException {
output.writeString(login, SerializeLimits.MAX_LOGIN); output.writeString(login, SerializeLimits.MAX_LOGIN);
output.writeString(Launcher.profile.getTitle(), SerializeLimits.MAX_CLIENT); output.writeString(Launcher.profile.getTitle(), SerializeLimits.MAX_CLIENT);
output.writeInt(auth_id); output.writeInt(auth_id);
output.writeLong(JVMHelper.OS_TYPE == JVMHelper.OS.MUSTDIE ? GuardBind.avnGetHddId() : 0); output.writeLong(Launcher.isUsingAvanguard() ? GuardBind.avnGetHddId() : 0);
output.writeLong(JVMHelper.OS_TYPE == JVMHelper.OS.MUSTDIE ? GuardBind.avnGetCpuid() : 0); output.writeLong(Launcher.isUsingAvanguard() ? GuardBind.avnGetCpuid() : 0);
output.writeLong(JVMHelper.OS_TYPE == JVMHelper.OS.MUSTDIE ? GuardBind.avnGetSmbiosId() : 0); output.writeLong(Launcher.isUsingAvanguard() ? GuardBind.avnGetSmbiosId() : 0);
output.writeByteArray(encryptedPassword, SecurityHelper.CRYPTO_MAX_LENGTH); output.writeByteArray(encryptedPassword, SecurityHelper.CRYPTO_MAX_LENGTH);
output.flush(); output.flush();

View file

@ -13,6 +13,7 @@
import ru.gravit.launcher.profiles.ClientProfile; import ru.gravit.launcher.profiles.ClientProfile;
import ru.gravit.utils.Version; import ru.gravit.utils.Version;
import ru.gravit.utils.helper.IOHelper; import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.JVMHelper;
import ru.gravit.utils.helper.SecurityHelper; import ru.gravit.utils.helper.SecurityHelper;
import ru.gravit.launcher.modules.ModulesManagerInterface; import ru.gravit.launcher.modules.ModulesManagerInterface;
import ru.gravit.launcher.serialize.HInput; import ru.gravit.launcher.serialize.HInput;
@ -109,4 +110,10 @@ public static String toHash(UUID uuid) {
public static Version getVersion() { public static Version getVersion() {
return new Version(MAJOR, MINOR, PATCH, BUILD, RELEASE); return new Version(MAJOR, MINOR, PATCH, BUILD, RELEASE);
} }
public static final boolean useAvanguard = true;
public static boolean isUsingAvanguard() {
return JVMHelper.OS_TYPE == JVMHelper.OS.MUSTDIE && useAvanguard;
}
} }