2017-05-30 15:05:36 -04:00
|
|
|
From dd8a7a049bb22eb8a4245f848bdef3cadae7f667 Mon Sep 17 00:00:00 2001
|
2017-05-30 14:31:08 -04:00
|
|
|
From: Tad <tad@spotco.us>
|
2017-05-30 15:05:36 -04:00
|
|
|
Date: Tue, 30 May 2017 15:05:11 -0400
|
2017-05-30 14:31:08 -04:00
|
|
|
Subject: [PATCH] Switch to our update server
|
|
|
|
|
2017-05-30 15:05:36 -04:00
|
|
|
Change-Id: I6964ad96bc65d1ba055d48c6df5a631327d434a8
|
2017-05-30 14:31:08 -04:00
|
|
|
---
|
|
|
|
.../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(-)
|
|
|
|
|
|
|
|
diff --git a/src/com/cyanogenmod/updater/requests/UpdatesJsonObjectRequest.java b/src/com/cyanogenmod/updater/requests/UpdatesJsonObjectRequest.java
|
|
|
|
index 13d22b7..10975df 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;
|
|
|
|
|
|
|
|
import com.android.volley.AuthFailureError;
|
|
|
|
+import com.android.volley.Request;
|
|
|
|
import com.android.volley.Response;
|
|
|
|
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
|
2017-05-30 15:05:36 -04:00
|
|
|
index 319f68b..729708b 100644
|
2017-05-30 14:31:08 -04:00
|
|
|
--- 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();
|
|
|
|
}
|
|
|
|
|
|
|
|
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() + "/" + getRomType() + "/" + incrementalVersion;
|
|
|
|
-
|
|
|
|
- return URI.create(updateUri);
|
2017-05-30 15:05:36 -04:00
|
|
|
+ return URI.create("https://spotco.us/de/updater.php?device=" + Utils.getDeviceType());
|
2017-05-30 14:31:08 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
|