diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/ConfigDefinition.java b/java_tools/configuration_definition/src/main/java/com/rusefi/ConfigDefinition.java index 4a38976f34..28ad965bf2 100644 --- a/java_tools/configuration_definition/src/main/java/com/rusefi/ConfigDefinition.java +++ b/java_tools/configuration_definition/src/main/java/com/rusefi/ConfigDefinition.java @@ -175,7 +175,7 @@ public class ConfigDefinition { ParseState parseState = new ParseState(state.enumsReader); // Add the variable for the config signature - long uniqueId = IoUtil2.getCrc32(state.inputFiles); + FirmwareVersion uniqueId = new FirmwareVersion(IoUtil2.getCrc32(state.inputFiles)); SignatureConsumer.storeUniqueBuildId(state, parseState, tsInputFileFolder, uniqueId); ExtraUtil.handleFiringOrder(firingEnumFileName, state.variableRegistry, parseState); @@ -227,7 +227,7 @@ public class ConfigDefinition { VariableRegistry tmpRegistry = new VariableRegistry(); // store the CRC32 as a built-in variable - tmpRegistry.register(SIGNATURE_HASH, "" + uniqueId); + tmpRegistry.register(SIGNATURE_HASH, uniqueId.encode()); tmpRegistry.readPrependValues(signaturePrependFile); state.destinations.add(new SignatureConsumer(signatureDestination, tmpRegistry)); } diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/FirmwareVersion.java b/java_tools/configuration_definition/src/main/java/com/rusefi/FirmwareVersion.java new file mode 100644 index 0000000000..ee86922495 --- /dev/null +++ b/java_tools/configuration_definition/src/main/java/com/rusefi/FirmwareVersion.java @@ -0,0 +1,17 @@ +package com.rusefi; + +import org.jetbrains.annotations.NotNull; + +public class FirmwareVersion { + private final long crc32; + + public FirmwareVersion(long crc32) { + + this.crc32 = crc32; + } + + @NotNull + public String encode() { + return Long.toString(crc32); + } +} diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/output/SignatureConsumer.java b/java_tools/configuration_definition/src/main/java/com/rusefi/output/SignatureConsumer.java index f05e4ebd56..d291c5c82b 100644 --- a/java_tools/configuration_definition/src/main/java/com/rusefi/output/SignatureConsumer.java +++ b/java_tools/configuration_definition/src/main/java/com/rusefi/output/SignatureConsumer.java @@ -20,13 +20,13 @@ public class SignatureConsumer implements ConfigurationConsumer { this.registry = registry; } - public static void storeUniqueBuildId(ReaderState state, ParseState parseState, String tsPath, long uniqueId) { + public static void storeUniqueBuildId(ReaderState state, ParseState parseState, String tsPath, FirmwareVersion uniqueId) { // store a hash as a built-in variable // nasty trick - do not insert signature into live data files if (tsPath != null) { parseState.addDefinition(state.variableRegistry, - ConfigDefinition.SIGNATURE_HASH, Long.toString(uniqueId), Definition.OverwritePolicy.NotAllowed); + ConfigDefinition.SIGNATURE_HASH, uniqueId.encode(), Definition.OverwritePolicy.NotAllowed); } }