diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerStarter.java b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerStarter.java index 9dfe712f..3e31b828 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerStarter.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerStarter.java @@ -69,10 +69,10 @@ public static void main(String[] args) throws Exception { throw new IOException(e); } { - LauncherTrustManager.CheckMode mode = (Version.RELEASE == Version.Type.LTS || Version.RELEASE == Version.Type.STABLE) ? - (allowUnsigned ? LauncherTrustManager.CheckMode.WARN_IN_NOT_SIGNED : LauncherTrustManager.CheckMode.EXCEPTION_IN_NOT_SIGNED) : - (allowUnsigned ? LauncherTrustManager.CheckMode.NONE_IN_NOT_SIGNED : LauncherTrustManager.CheckMode.WARN_IN_NOT_SIGNED); - certificateManager.checkClass(LaunchServer.class, mode); + //LauncherTrustManager.CheckMode mode = (Version.RELEASE == Version.Type.LTS || Version.RELEASE == Version.Type.STABLE) ? + // (allowUnsigned ? LauncherTrustManager.CheckMode.WARN_IN_NOT_SIGNED : LauncherTrustManager.CheckMode.EXCEPTION_IN_NOT_SIGNED) : + // (allowUnsigned ? LauncherTrustManager.CheckMode.NONE_IN_NOT_SIGNED : LauncherTrustManager.CheckMode.WARN_IN_NOT_SIGNED); + certificateManager.checkClass(LaunchServer.class, LauncherTrustManager.CheckMode.NONE_IN_NOT_SIGNED); } LaunchServerRuntimeConfig runtimeConfig; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/asm/NodeUtils.java b/LaunchServer/src/main/java/pro/gravit/launchserver/asm/NodeUtils.java index 1aabfbcf..ea8f00f1 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/asm/NodeUtils.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/asm/NodeUtils.java @@ -5,6 +5,7 @@ import org.objectweb.asm.Type; import org.objectweb.asm.tree.*; import pro.gravit.utils.helper.IOHelper; +import pro.gravit.utils.helper.JVMHelper; import pro.gravit.utils.helper.JarHelper; import java.io.IOException; @@ -16,17 +17,7 @@ import static org.objectweb.asm.Opcodes.*; public final class NodeUtils { - public static final boolean JAVA9; - static { - boolean java9 = false; - try { - Class.forName("java.lang.StackWalker"); - java9 = true; - } catch (final Throwable e) { - } - JAVA9 = java9; - } private NodeUtils() { } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/ProguardConf.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/ProguardConf.java index 9201cad4..7b3bf8fc 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/ProguardConf.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/ProguardConf.java @@ -2,10 +2,7 @@ import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.asm.NodeUtils; -import pro.gravit.utils.helper.IOHelper; -import pro.gravit.utils.helper.LogHelper; -import pro.gravit.utils.helper.SecurityHelper; -import pro.gravit.utils.helper.UnpackHelper; +import pro.gravit.utils.helper.*; import java.io.IOException; import java.io.OutputStreamWriter; @@ -61,7 +58,7 @@ public String[] buildConfig(Path inputJar, Path outputJar) { confStrs.add("-obfuscationdictionary \'" + words.toFile().getName() + "\'"); confStrs.add("-injar \'" + inputJar.toAbsolutePath() + "\'"); confStrs.add("-outjar \'" + outputJar.toAbsolutePath() + "\'"); - Collections.addAll(confStrs, NodeUtils.JAVA9 ? JAVA9_OPTS : JAVA8_OPTS); + Collections.addAll(confStrs, JVMHelper.JVM_VERSION >= 9 ? JAVA9_OPTS : JAVA8_OPTS); srv.launcherBinary.coreLibs.stream() .map(e -> "-libraryjars \'" + e.toAbsolutePath().toString() + "\'") .forEach(confStrs::add); diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerModulesManager.java b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerModulesManager.java index 409435e9..cdc61bd8 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerModulesManager.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerModulesManager.java @@ -16,6 +16,7 @@ public class LaunchServerModulesManager extends SimpleModuleManager { public LaunchServerModulesManager(Path modulesDir, Path configDir, LauncherTrustManager trustManager) { super(modulesDir, configDir, trustManager); coreModule = new LaunchServerCoreModule(); + checkMode = LauncherTrustManager.CheckMode.NONE_IN_NOT_SIGNED; modules.add(coreModule); }