[FIX] WARN non signed modules

This commit is contained in:
Gravit 2020-02-21 11:17:16 +07:00
parent a3800958db
commit f8aab10609
No known key found for this signature in database
GPG key ID: 061981E1E85D3216
4 changed files with 8 additions and 19 deletions

View file

@ -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;

View file

@ -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() {
}

View file

@ -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);

View file

@ -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);
}