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) {
|
private static void downloadAndUnzipAutoupdate(BundleUtil.BundleInfo info, UpdateMode mode, String baseUrl) {
|
||||||
try {
|
try {
|
||||||
String suffix = FindFileHelper.isObfuscated() ? "_obfuscated_public" : "";
|
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);
|
ConnectionAndMeta connectionAndMeta = new ConnectionAndMeta(zipFileName).invoke(baseUrl);
|
||||||
System.out.println("Remote file " + zipFileName);
|
System.out.println("Remote file " + zipFileName);
|
||||||
System.out.println("Server has " + connectionAndMeta.getCompleteFileSize() + " from " + new Date(connectionAndMeta.getLastModified()));
|
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.SecureRandom;
|
||||||
import java.security.cert.X509Certificate;
|
import java.security.cert.X509Certificate;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
public class ConnectionAndMeta {
|
public class ConnectionAndMeta {
|
||||||
public static final String BASE_URL_RELEASE = "https://github.com/rusefi/rusefi/releases/latest/download/";
|
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/";
|
public static final String AUTOUPDATE = "/autoupdate/";
|
||||||
|
|
||||||
private static final int BUFFER_SIZE = 32 * 1024;
|
private static final int BUFFER_SIZE = 32 * 1024;
|
||||||
|
@ -33,6 +35,11 @@ public class ConnectionAndMeta {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getWhiteLabel() {
|
||||||
|
return Optional.ofNullable(getProperties().getProperty("white_label")).map(String::trim)
|
||||||
|
.orElse(DEFAULT_WHITE_LABEL);
|
||||||
|
}
|
||||||
|
|
||||||
public static String getSignatureWhiteLabel() {
|
public static String getSignatureWhiteLabel() {
|
||||||
String signatureWhiteLabel = getProperties().getProperty("signature_white_label");
|
String signatureWhiteLabel = getProperties().getProperty("signature_white_label");
|
||||||
signatureWhiteLabel = signatureWhiteLabel == null ? null : signatureWhiteLabel.trim();
|
signatureWhiteLabel = signatureWhiteLabel == null ? null : signatureWhiteLabel.trim();
|
||||||
|
|
Loading…
Reference in New Issue