From 089c111585d0fcfad9ad7980566b28cbd2331685 Mon Sep 17 00:00:00 2001 From: Tad Date: Sun, 4 Jun 2017 12:47:14 -0400 Subject: [PATCH] Switch to our update server Change-Id: I6fa83db5ca685dc3539eb142bf9514b785c1f10a --- .../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 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 319f68b..93876f4 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(); } 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); + 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