From 04ea5136274b93ed0a3128366aec210f401a051d 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 b112d00b..4b9866f8 100644 --- a/src/org/lineageos/updater/download/HttpURLConnectionClient.java +++ b/src/org/lineageos/updater/download/HttpURLConnectionClient.java @@ -16,6 +16,8 @@ package org.lineageos.updater.download; import android.os.SystemClock; +import android.os.SystemProperties; + import android.util.Log; import java.io.File; @@ -64,7 +66,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 74b0b6159870147c2f990f3d2aa585186de68132 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 241f2ae8..8bf7956d 100644 --- a/src/org/lineageos/updater/misc/Utils.java +++ b/src/org/lineageos/updater/misc/Utils.java @@ -273,10 +273,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 16368bf699e112a7f591d6efef7270049b596203 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 4b9866f8..10f726c4 100644 --- a/src/org/lineageos/updater/download/HttpURLConnectionClient.java +++ b/src/org/lineageos/updater/download/HttpURLConnectionClient.java @@ -34,6 +34,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 a38b2749a81b4cb096a000cb3cc756888533e4bc Mon Sep 17 00:00:00 2001 From: Fahim Salam Chowdhury Date: Thu, 13 Oct 2022 12:54:04 +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 10f726c4..573a2492 100644 --- a/src/org/lineageos/updater/download/HttpURLConnectionClient.java +++ b/src/org/lineageos/updater/download/HttpURLConnectionClient.java @@ -68,7 +68,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