Release v1.0.0 #345

Merged
greg6775 merged 68 commits from greg-dev into master 2020-01-24 17:49:10 +01:00
Showing only changes of commit d53f92f573 - Show all commits

View file

@ -2,6 +2,7 @@ package com.bbn.hadder.utils;
import okhttp3.OkHttpClient;
import okhttp3.Response;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
@ -20,9 +21,13 @@ public class Request {
try {
Response response = caller.newCall(request).execute();
JSONObject json = new JSONObject(response.body().string());
JSONObject data = json.getJSONObject("data");
JSONObject response1 = data.getJSONObject("response");
return response1.toString().replace("{\"url\":\"", "").replace("\"}", "");
try {
JSONObject data = json.getJSONObject("data");
JSONObject response1 = data.getJSONObject("response");
return response1.toString().replace("{\"url\":\"", "").replace("\"}", "");
} catch (Exception ignore) {
return json.getString("url");
}
} catch (IOException ex) {
ex.printStackTrace();
}