rename existing `SerialAutoChecker.getWhitelabel` method to `getSignatureWhitelabelPrefix`

This commit is contained in:
kifir 2024-07-03 15:12:39 +03:00 committed by rusefillc
parent 8d7fe95fe7
commit d1d8644c7c
4 changed files with 10 additions and 10 deletions

View File

@ -1,2 +1,2 @@
auto_update_root_url=https://rusefi.com/build_server auto_update_root_url=https://rusefi.com/build_server
WHITELABEL=rusEFI signature_white_label=rusEFI

View File

@ -30,11 +30,11 @@ else
echo "! Current branch is: $branchname" >> ${TEMP_FILE} echo "! Current branch is: $branchname" >> ${TEMP_FILE}
fi fi
if [ -z "${WHITELABEL}" ]; then if [ -z "${signature_white_label}" ]; then
WHITELABEL=rusEFI signature_white_label=rusEFI
fi fi
echo "#define TS_SIGNATURE \"${WHITELABEL} $branchname.$date.${SHORT_BOARD_NAME}.@@SIGNATURE_HASH@@\"" >> ${TEMP_FILE} echo "#define TS_SIGNATURE \"${signature_white_label} $branchname.$date.${SHORT_BOARD_NAME}.@@SIGNATURE_HASH@@\"" >> ${TEMP_FILE}
# We will generate the signature in a temp file, then only use it if it has changed. # We will generate the signature in a temp file, then only use it if it has changed.
# This is to avoid updating the timestamp of the signature file, which would cause the configs to regenerate when they don't need to. # This is to avoid updating the timestamp of the signature file, which would cause the configs to regenerate when they don't need to.

View File

@ -65,8 +65,8 @@ public class SerialAutoChecker {
private static boolean isSignatureWithValidPrefix(String signature) { private static boolean isSignatureWithValidPrefix(String signature) {
if (signature.startsWith(Fields.PROTOCOL_SIGNATURE_PREFIX)) if (signature.startsWith(Fields.PROTOCOL_SIGNATURE_PREFIX))
return true; return true;
String whitelabel = ConnectionAndMeta.getWhitelabel(); String signatureWhiteLabel = ConnectionAndMeta.getSignatureWhiteLabel();
return whitelabel != null && signature.startsWith(whitelabel + " "); return signatureWhiteLabel != null && signature.startsWith(signatureWhiteLabel + " ");
} }
public void openAndCheckResponse(PortDetector.DetectorMode mode, AtomicReference<AutoDetectResult> result, Function<CallbackContext, Void> callback) { public void openAndCheckResponse(PortDetector.DetectorMode mode, AtomicReference<AutoDetectResult> result, Function<CallbackContext, Void> callback) {

View File

@ -33,10 +33,10 @@ public class ConnectionAndMeta {
return result; return result;
} }
public static String getWhitelabel() { public static String getSignatureWhiteLabel() {
String whitelabel = getProperties().getProperty("WHITELABEL"); String signatureWhiteLabel = getProperties().getProperty("signature_white_label");
whitelabel = whitelabel == null ? null : whitelabel.trim(); signatureWhiteLabel = signatureWhiteLabel == null ? null : signatureWhiteLabel.trim();
return whitelabel; return signatureWhiteLabel;
} }
private static Properties getProperties() throws RuntimeException { private static Properties getProperties() throws RuntimeException {