support white-labels in autoupdate
This commit is contained in:
parent
d1d8644c7c
commit
fdb752b4fe
|
@ -119,7 +119,7 @@ public class Autoupdate {
|
|||
private static void downloadAndUnzipAutoupdate(BundleUtil.BundleInfo info, UpdateMode mode, String baseUrl) {
|
||||
try {
|
||||
String suffix = FindFileHelper.isObfuscated() ? "_obfuscated_public" : "";
|
||||
String zipFileName = "rusefi_bundle_" + info.getTarget() + suffix + "_autoupdate" + ".zip";
|
||||
String zipFileName = ConnectionAndMeta.getWhiteLabel() + "_bundle_" + info.getTarget() + suffix + "_autoupdate" + ".zip";
|
||||
ConnectionAndMeta connectionAndMeta = new ConnectionAndMeta(zipFileName).invoke(baseUrl);
|
||||
System.out.println("Remote file " + zipFileName);
|
||||
System.out.println("Server has " + connectionAndMeta.getCompleteFileSize() + " from " + new Date(connectionAndMeta.getLastModified()));
|
||||
|
|
|
@ -9,10 +9,12 @@ import java.security.NoSuchAlgorithmException;
|
|||
import java.security.SecureRandom;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Properties;
|
||||
|
||||
public class ConnectionAndMeta {
|
||||
public static final String BASE_URL_RELEASE = "https://github.com/rusefi/rusefi/releases/latest/download/";
|
||||
private static final String DEFAULT_WHITE_LABEL = "rusefi";
|
||||
public static final String AUTOUPDATE = "/autoupdate/";
|
||||
|
||||
private static final int BUFFER_SIZE = 32 * 1024;
|
||||
|
@ -33,6 +35,11 @@ public class ConnectionAndMeta {
|
|||
return result;
|
||||
}
|
||||
|
||||
public static String getWhiteLabel() {
|
||||
return Optional.ofNullable(getProperties().getProperty("white_label")).map(String::trim)
|
||||
.orElse(DEFAULT_WHITE_LABEL);
|
||||
}
|
||||
|
||||
public static String getSignatureWhiteLabel() {
|
||||
String signatureWhiteLabel = getProperties().getProperty("signature_white_label");
|
||||
signatureWhiteLabel = signatureWhiteLabel == null ? null : signatureWhiteLabel.trim();
|
||||
|
|
Loading…
Reference in New Issue