Rebase update server patch

This commit is contained in:
Tad 2017-06-18 10:20:47 -04:00
parent 1a38464779
commit edc740e60c

View File

@ -1,27 +1,26 @@
From 089c111585d0fcfad9ad7980566b28cbd2331685 Mon Sep 17 00:00:00 2001
From c4f32c685eb310b57285e26136c999be9cd2b770 Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Sun, 4 Jun 2017 12:47:14 -0400
Date: Sun, 18 Jun 2017 10:20:13 -0400
Subject: [PATCH] Switch to our update server
Change-Id: I6fa83db5ca685dc3539eb142bf9514b785c1f10a
Change-Id: I53fc23e0e51ae03e449cd174591e1d3533bbdd74
---
.../updater/requests/UpdatesJsonObjectRequest.java | 3 ++-
.../updater/service/UpdateCheckService.java | 27 ++--------------------
src/com/cyanogenmod/updater/utils/Utils.java | 17 +-------------
3 files changed, 5 insertions(+), 42 deletions(-)
.../updater/requests/UpdatesJsonObjectRequest.java | 3 ++-
src/com/cyanogenmod/updater/service/UpdateCheckService.java | 11 +----------
2 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/src/com/cyanogenmod/updater/requests/UpdatesJsonObjectRequest.java b/src/com/cyanogenmod/updater/requests/UpdatesJsonObjectRequest.java
index 13d22b7..10975df 100644
index 13d22b7..af9980b 100644
--- a/src/com/cyanogenmod/updater/requests/UpdatesJsonObjectRequest.java
+++ b/src/com/cyanogenmod/updater/requests/UpdatesJsonObjectRequest.java
@@ -10,6 +10,7 @@
package com.cyanogenmod.updater.requests;
@@ -11,6 +11,7 @@ package com.cyanogenmod.updater.requests;
import com.android.volley.AuthFailureError;
+import com.android.volley.Request;
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,
@ -32,31 +31,10 @@ index 13d22b7..10975df 100644
}
diff --git a/src/com/cyanogenmod/updater/service/UpdateCheckService.java b/src/com/cyanogenmod/updater/service/UpdateCheckService.java
index 319f68b..93876f4 100644
index 9fc81d6..f76910a 100644
--- a/src/com/cyanogenmod/updater/service/UpdateCheckService.java
+++ b/src/com/cyanogenmod/updater/service/UpdateCheckService.java
@@ -200,35 +200,12 @@ public class UpdateCheckService extends IntentService
}
private String getRomType() {
- String type;
- switch (Utils.getUpdateType()) {
- case Constants.UPDATE_TYPE_SNAPSHOT:
- type = Constants.CM_RELEASETYPE_SNAPSHOT;
- break;
- case Constants.UPDATE_TYPE_NIGHTLY:
- type = Constants.CM_RELEASETYPE_NIGHTLY;
- break;
- case Constants.UPDATE_TYPE_EXPERIMENTAL:
- type = Constants.CM_RELEASETYPE_EXPERIMENTAL;
- break;
- case Constants.UPDATE_TYPE_UNOFFICIAL:
- default:
- type = Constants.CM_RELEASETYPE_UNOFFICIAL;
- break;
- }
+ String type = Constants.CM_RELEASETYPE_NIGHTLY;
return type.toLowerCase();
@@ -200,16 +200,7 @@ public class UpdateCheckService extends IntentService
}
private URI getServerURI() {
@ -66,41 +44,14 @@ index 319f68b..93876f4 100644
- }
-
- String incrementalVersion = SystemProperties.get("ro.build.version.incremental");
- updateUri += "/v1/" + Utils.getDeviceType() + "/" + getRomType() + "/" + incrementalVersion;
- updateUri += "/v1/" + Utils.getDeviceType() + "/" +
- Utils.getInstalledBuildType() + "/" + incrementalVersion;
-
- return URI.create(updateUri);
+ return URI.create("https://divestos.xyz/updater.php?device=" + Utils.getDeviceType());
}
private void getAvailableUpdates() {
diff --git a/src/com/cyanogenmod/updater/utils/Utils.java b/src/com/cyanogenmod/updater/utils/Utils.java
index 72f12bd..6b89988 100644
--- a/src/com/cyanogenmod/updater/utils/Utils.java
+++ b/src/com/cyanogenmod/updater/utils/Utils.java
@@ -174,22 +174,7 @@ public class Utils {
releaseType = Constants.CM_RELEASETYPE_UNOFFICIAL;
}
- int updateType;
- switch (releaseType) {
- case Constants.CM_RELEASETYPE_SNAPSHOT:
- updateType = Constants.UPDATE_TYPE_SNAPSHOT;
- break;
- case Constants.CM_RELEASETYPE_NIGHTLY:
- updateType = Constants.UPDATE_TYPE_NIGHTLY;
- break;
- case Constants.CM_RELEASETYPE_EXPERIMENTAL:
- updateType = Constants.UPDATE_TYPE_EXPERIMENTAL;
- break;
- case Constants.CM_RELEASETYPE_UNOFFICIAL:
- default:
- updateType = Constants.UPDATE_TYPE_UNOFFICIAL;
- break;
- }
+ int updateType = Constants.UPDATE_TYPE_NIGHTLY;
return updateType;
}
--
2.13.0
2.13.1