diff --git a/java_console/autoupdate/src/main/java/com/rusefi/autoupdate/Autoupdate.java b/java_console/autoupdate/src/main/java/com/rusefi/autoupdate/Autoupdate.java index f5bbc739aa..265cd69120 100644 --- a/java_console/autoupdate/src/main/java/com/rusefi/autoupdate/Autoupdate.java +++ b/java_console/autoupdate/src/main/java/com/rusefi/autoupdate/Autoupdate.java @@ -30,7 +30,7 @@ import static com.rusefi.core.FindFileHelper.findSrecFile; public class Autoupdate { private static final Logging log = getLogging(Autoupdate.class); - private static final int VERSION = 20240812; + private static final int VERSION = 20240815; private static final String LOGO_PATH = "/com/rusefi/"; private static final String LOGO = LOGO_PATH + "logo.png"; @@ -110,12 +110,13 @@ public class Autoupdate { } private static void startConsole(String[] args) { - URLClassLoader jarClassLoader = null; + URLClassLoader jarClassLoader; + String consoleJarFileName = ConnectionAndMeta.getRusEfiConsoleJarName(); try { - jarClassLoader = AutoupdateUtil.getClassLoaderByJar(RUSEFI_CONSOLE_JAR); + jarClassLoader = AutoupdateUtil.getClassLoaderByJar(consoleJarFileName); } catch (MalformedURLException e) { log.error("Failed to start", e); - throw new IllegalStateException("Problem with " + RUSEFI_CONSOLE_JAR, e); + throw new IllegalStateException("Problem with " + consoleJarFileName, e); } // we want to make sure that files are available to write so we use reflection to get lazy class initialization log.info("Running console with " + Arrays.toString(args)); diff --git a/java_console/shared_io/src/main/java/com/rusefi/core/net/ConnectionAndMeta.java b/java_console/shared_io/src/main/java/com/rusefi/core/net/ConnectionAndMeta.java index b83d8d1d04..c601a566cb 100644 --- a/java_console/shared_io/src/main/java/com/rusefi/core/net/ConnectionAndMeta.java +++ b/java_console/shared_io/src/main/java/com/rusefi/core/net/ConnectionAndMeta.java @@ -1,5 +1,7 @@ package com.rusefi.core.net; +import org.jetbrains.annotations.NotNull; + import javax.net.ssl.*; import java.io.*; import java.net.HttpURLConnection; @@ -36,8 +38,16 @@ public class ConnectionAndMeta { } public static String getWhiteLabel(Properties properties) { - return Optional.ofNullable(properties.getProperty("white_label")).map(String::trim) - .orElse(DEFAULT_WHITE_LABEL); + return getStringProperty(properties, "white_label", DEFAULT_WHITE_LABEL); + } + + public static String getRusEfiConsoleJarName() { + return getStringProperty(getProperties(), "console_jar", "rusefi_console.jar"); + } + + private static @NotNull String getStringProperty(Properties properties, String key, String defaultValue) { + return Optional.ofNullable(properties.getProperty(key)).map(String::trim) + .orElse(defaultValue); } public static String getSignatureWhiteLabel() {