From 704659fb307132198992a20180c3700fd82d85c4 Mon Sep 17 00:00:00 2001 From: Alexandre Roux D'Anzi Date: Mon, 12 Sep 2022 18:09:44 +0200 Subject: [PATCH 1/4] remove eels from agent string + adding /e/ version --- .../lineageos/updater/download/HttpURLConnectionClient.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/org/lineageos/updater/download/HttpURLConnectionClient.java b/src/org/lineageos/updater/download/HttpURLConnectionClient.java index 609ac817..079fcdd0 100644 --- a/src/org/lineageos/updater/download/HttpURLConnectionClient.java +++ b/src/org/lineageos/updater/download/HttpURLConnectionClient.java @@ -17,6 +17,8 @@ package org.lineageos.updater.download; import android.os.SystemClock; +import android.os.SystemProperties; + import android.util.Log; import java.io.File; @@ -61,7 +63,7 @@ public class HttpURLConnectionClient implements DownloadClient { mClient = (HttpURLConnection) new URL(url).openConnection(); String defaultUserAgent = mClient.getRequestProperty("User-Agent"); - String newUserAgent = defaultUserAgent+" ota_007_eels"; + String newUserAgent = defaultUserAgent+" eOS v"+SystemProperties.get(Constants.PROP_BUILD_VERSION); mClient.setRequestProperty("User-Agent", newUserAgent); mDestination = destination; -- GitLab From c2bf3969dff9064df54ed5396c314cf3fbb07a8b Mon Sep 17 00:00:00 2001 From: Alexandre Roux D'Anzi Date: Mon, 12 Sep 2022 18:11:40 +0200 Subject: [PATCH 2/4] don't crash when receiving maintenance number --- src/org/lineageos/updater/misc/Utils.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/org/lineageos/updater/misc/Utils.java b/src/org/lineageos/updater/misc/Utils.java index 050fcd7b..cdd187df 100644 --- a/src/org/lineageos/updater/misc/Utils.java +++ b/src/org/lineageos/updater/misc/Utils.java @@ -271,10 +271,8 @@ public class Utils { public static boolean checkForNewUpdates(File newJson) throws IOException, JSONException { List newList = parseJson(newJson, true); - float currentVersion = Float.parseFloat(BuildInfoUtils.getBuildVersion()); - for (UpdateInfo update : newList) { - if (Float.parseFloat(update.getVersion()) > currentVersion) { + if (isCompatible(update)) { Log.d(TAG, "New compatiable update available"); return true; } -- GitLab From 41fc0b9387ef33d05ad8a8efe46ccdaca902cadf Mon Sep 17 00:00:00 2001 From: Phie Date: Tue, 13 Sep 2022 11:26:17 +0200 Subject: [PATCH 3/4] forgotten import --- src/org/lineageos/updater/download/HttpURLConnectionClient.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/org/lineageos/updater/download/HttpURLConnectionClient.java b/src/org/lineageos/updater/download/HttpURLConnectionClient.java index 079fcdd0..df4dbc19 100644 --- a/src/org/lineageos/updater/download/HttpURLConnectionClient.java +++ b/src/org/lineageos/updater/download/HttpURLConnectionClient.java @@ -35,6 +35,8 @@ import java.util.PriorityQueue; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.lineageos.updater.misc.Constants; + public class HttpURLConnectionClient implements DownloadClient { private final static String TAG = "HttpURLConnectionClient"; -- GitLab From 288b45cd24be9ac1f2acbe90d5ace99e3ef66bf6 Mon Sep 17 00:00:00 2001 From: Fahim Salam Chowdhury Date: Thu, 13 Oct 2022 12:53:50 +0000 Subject: [PATCH 4/4] Apply 1 suggestion(s) to 1 file(s) --- src/org/lineageos/updater/download/HttpURLConnectionClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/lineageos/updater/download/HttpURLConnectionClient.java b/src/org/lineageos/updater/download/HttpURLConnectionClient.java index df4dbc19..3bbc2dc1 100644 --- a/src/org/lineageos/updater/download/HttpURLConnectionClient.java +++ b/src/org/lineageos/updater/download/HttpURLConnectionClient.java @@ -65,7 +65,7 @@ public class HttpURLConnectionClient implements DownloadClient { mClient = (HttpURLConnection) new URL(url).openConnection(); String defaultUserAgent = mClient.getRequestProperty("User-Agent"); - String newUserAgent = defaultUserAgent+" eOS v"+SystemProperties.get(Constants.PROP_BUILD_VERSION); + String newUserAgent = defaultUserAgent + " eOS v" + SystemProperties.get(Constants.PROP_BUILD_VERSION); mClient.setRequestProperty("User-Agent", newUserAgent); mDestination = destination; -- GitLab