Switch from CM to LAOS updater

This commit is contained in:
Tad 2017-08-26 15:11:54 -04:00
parent 343cb8ee5b
commit 70ad6ff700
3 changed files with 35 additions and 62 deletions

View File

@ -1,58 +0,0 @@
From 1de0dbda5227a5f6be82df0575db75f354de486b Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Wed, 12 Jul 2017 05:18:42 -0400
Subject: [PATCH] Switch to our update server
Change-Id: Ia0faf61ab2dd3b300ac65841f1ce7e15d403552c
---
.../updater/requests/UpdatesJsonObjectRequest.java | 3 ++-
src/com/cyanogenmod/updater/service/UpdateCheckService.java | 12 ++----------
2 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/src/com/cyanogenmod/updater/requests/UpdatesJsonObjectRequest.java b/src/com/cyanogenmod/updater/requests/UpdatesJsonObjectRequest.java
index 13d22b7..af9980b 100644
--- a/src/com/cyanogenmod/updater/requests/UpdatesJsonObjectRequest.java
+++ b/src/com/cyanogenmod/updater/requests/UpdatesJsonObjectRequest.java
@@ -11,6 +11,7 @@ package com.cyanogenmod.updater.requests;
import com.android.volley.AuthFailureError;
import com.android.volley.Response;
+import com.android.volley.Request;
import com.android.volley.toolbox.JsonObjectRequest;
import org.json.JSONObject;
@@ -23,7 +24,7 @@ public class UpdatesJsonObjectRequest extends JsonObjectRequest {
public UpdatesJsonObjectRequest(String url, String userAgent, JSONObject jsonRequest,
Response.Listener<JSONObject> listener, Response.ErrorListener errorListener) {
- super(url, jsonRequest, listener, errorListener);
+ super(Request.Method.GET, url, jsonRequest, listener, errorListener);
mUserAgent = userAgent;
}
diff --git a/src/com/cyanogenmod/updater/service/UpdateCheckService.java b/src/com/cyanogenmod/updater/service/UpdateCheckService.java
index 9fc81d6..18a3bf0 100644
--- a/src/com/cyanogenmod/updater/service/UpdateCheckService.java
+++ b/src/com/cyanogenmod/updater/service/UpdateCheckService.java
@@ -200,16 +200,8 @@ public class UpdateCheckService extends IntentService
}
private URI getServerURI() {
- String updateUri = SystemProperties.get("cm.updater.uri");
- if (TextUtils.isEmpty(updateUri)) {
- updateUri = getString(R.string.conf_update_server_url_def);
- }
-
- String incrementalVersion = SystemProperties.get("ro.build.version.incremental");
- updateUri += "/v1/" + Utils.getDeviceType() + "/" +
- Utils.getInstalledBuildType() + "/" + incrementalVersion;
-
- return URI.create(updateUri);
+ String incrementalVersion = SystemProperties.get("ro.build.version.incremental");
+ return URI.create("https://divestos.xyz/updater.php?device=" + Utils.getDeviceType() + "&inc=" + incrementalVersion);
}
private void getAvailableUpdates() {
--
2.13.2

View File

@ -0,0 +1,33 @@
From 91f6cf3814a5d7e90068683f5526a8a6abc1b7fd Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Sat, 26 Aug 2017 16:06:23 -0400
Subject: [PATCH] Switch to our update server
Change-Id: I81967fd97e7c151100b93327501caf8d436a08e5
---
src/org/lineageos/updater/misc/Utils.java | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/src/org/lineageos/updater/misc/Utils.java b/src/org/lineageos/updater/misc/Utils.java
index f15be50..8e4fcb1 100644
--- a/src/org/lineageos/updater/misc/Utils.java
+++ b/src/org/lineageos/updater/misc/Utils.java
@@ -144,14 +144,9 @@ 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_DEVICE);
- String type = SystemProperties.get(Constants.PROP_RELEASE_TYPE).toLowerCase(Locale.ROOT);
- return serverUrl + "/v1/" + device + "/" + type + "/" + incrementalVersion;
+ return "https://divestos.xyz/updater.php?device=" + device + "&inc=" + incrementalVersion;
}
public static void triggerUpdate(Context context, String downloadId) {
--
2.14.1

View File

@ -104,10 +104,8 @@ rm -rf src/org/cyanogenmod/cmparts/cmstats/ res/xml/anonymous_stats.xml res/xml/
git fetch https://review.lineageos.org/LineageOS/android_packages_apps_CMParts refs/changes/15/113415/25 && git cherry-pick FETCH_HEAD #network traffic
patch -p1 < $patches"android_packages_apps_CMParts/0001-Remove_Analytics.patch" #Remove the rest of CMStats
enter "packages/apps/CMUpdater"
patch -p1 < $patches"android_packages_apps_CMUpdater/0001-Server.patch" #Switch to our server
sed -i 's/CM_RELEASE_TYPE_DEFAULT = "UNOFFICIAL";/CM_RELEASE_TYPE_DEFAULT = "dos";/' src/com/cyanogenmod/updater/misc/Constants.java; #Change buildtype
sed -i 's/subStrings\[3\]\.length() < 7/subStrings\[3\]\.length() < 3/' src/com/cyanogenmod/updater/utils/Utils.java; #Fix not allowing buildtypes length < 7
enter "packages/apps/Updater"
patch -p1 < $patches"android_packages_apps_Updater/0001-Server.patch" #Switch to our server
enter "packages/apps/Dialer"
sed -i 's/FLP_DEFAULT = FLP_GOOGLE;/FLP_DEFAULT = FLP_OPENSTREETMAP;/' src/com/android/dialer/lookup/LookupSettings.java; #Change default FLP to OpenStreetMap