diff --git a/res/values/strings.xml b/res/values/strings.xml index 91c3d2f9..7b814e16 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -26,7 +26,13 @@ The path is relative to the root of the external storage.--> LineageOS updates/ - https://download.lineageos.org/api + + https://download.lineageos.org/api/v1/{device}/{type}/{incr} Verification failed Verifying update diff --git a/src/org/lineageos/updater/misc/Utils.java b/src/org/lineageos/updater/misc/Utils.java index 5a6b42bd..6b15e2d4 100644 --- a/src/org/lineageos/updater/misc/Utils.java +++ b/src/org/lineageos/updater/misc/Utils.java @@ -144,15 +144,19 @@ public class Utils { } public static String getServerURL(Context context) { - String serverUrl = SystemProperties.get(Constants.PROP_UPDATER_URI); - if (serverUrl.trim().isEmpty()) { - serverUrl = context.getString(R.string.conf_update_server_url_def); - } String incrementalVersion = SystemProperties.get(Constants.PROP_BUILD_VERSION_INCREMENTAL); String device = SystemProperties.get(Constants.PROP_NEXT_DEVICE, SystemProperties.get(Constants.PROP_DEVICE)); String type = SystemProperties.get(Constants.PROP_RELEASE_TYPE).toLowerCase(Locale.ROOT); - return serverUrl + "/v1/" + device + "/" + type + "/" + incrementalVersion; + + String serverUrl = SystemProperties.get(Constants.PROP_UPDATER_URI); + if (serverUrl.trim().isEmpty()) { + serverUrl = context.getString(R.string.updater_server_url); + } + + return serverUrl.replace("{device}", device) + .replace("{type}", type) + .replace("{incr}", incrementalVersion); } public static String getChangelogURL(Context context) {