summaryrefslogtreecommitdiff
path: root/src/se/leap/leapclient/ProviderAPI.java
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2013-06-13 17:37:37 +0200
committerParménides GV <parmegv@sdf.org>2013-06-13 17:37:37 +0200
commit30c7bab5d8618df665e602fdd08bafa010a15497 (patch)
tree2c6c55568e73c06e10f475425e21365fd8961ce2 /src/se/leap/leapclient/ProviderAPI.java
parent2f69eb6eb9aa3993354e8de295df68558ab7b71e (diff)
bitmask json files are downloaded.
There was a problem on the assets file "bitmask.url". It had an error in the eip-service url. We should use this file only for main url, and proceed as if it were a new provider but with a preseeded main url.
Diffstat (limited to 'src/se/leap/leapclient/ProviderAPI.java')
-rw-r--r--src/se/leap/leapclient/ProviderAPI.java18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/se/leap/leapclient/ProviderAPI.java b/src/se/leap/leapclient/ProviderAPI.java
index 10f04c5d..471eb6cf 100644
--- a/src/se/leap/leapclient/ProviderAPI.java
+++ b/src/se/leap/leapclient/ProviderAPI.java
@@ -216,9 +216,7 @@ public class ProviderAPI extends IntentService {
} else {
ConfigHelper.saveSharedPref(ConfigHelper.ALLOWED_ANON, provider_json.getJSONObject(ConfigHelper.SERVICE_KEY).getBoolean(ConfigHelper.ALLOWED_ANON));
- String filename = provider_name + "_provider.json".replaceFirst("__", "_");
-
- ProviderListContent.addItem(new ProviderItem(provider_name, provider_json_url, filename, custom, danger_on));
+ ProviderListContent.addItem(new ProviderItem(provider_name, provider_json_url, provider_json, custom, danger_on));
result.putBoolean(ConfigHelper.RESULT_KEY, true);
result.putString(ConfigHelper.PROVIDER_KEY, provider_json.toString());
result.putBoolean(ConfigHelper.DANGER_ON, danger_on);
@@ -237,17 +235,17 @@ public class ProviderAPI extends IntentService {
String provider_main_url = (String) task.get(ConfigHelper.PROVIDER_MAIN_URL);
String provider_name = provider_main_url.replaceFirst("http[s]?://", "").replaceFirst("\\/", "_");
String provider_json_url = guessURL(provider_main_url);
- JSONObject provider_json = null;
+
+ JSONObject provider_json;
try {
provider_json = getJSONFromProvider(provider_json_url, danger_on);
-
- String filename = provider_name + "_provider.json".replaceFirst("__", "_");
-
- ProviderListContent.addItem(new ProviderItem(provider_name, provider_json_url, filename, custom, danger_on));
- return true;
+ ProviderListContent.addItem(new ProviderItem(provider_name, provider_json_url, provider_json, custom, danger_on));
} catch (JSONException e) {
- return false;
+ // TODO Auto-generated catch block
+ e.printStackTrace();
}
+
+ return true;
}
private String getStringFromProviderWithoutValidate(