|
|
@ -78,6 +78,8 @@ public class SetupUtils { |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (json.has("current")) { |
|
|
|
if (json.has("current")) { |
|
|
@ -87,6 +89,8 @@ public class SetupUtils { |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
LinkedHashMap<String, String> infoMap = new LinkedHashMap<>(); |
|
|
|
LinkedHashMap<String, String> infoMap = new LinkedHashMap<>(); |
|
|
@ -112,25 +116,12 @@ public class SetupUtils { |
|
|
|
public void getConfig() { |
|
|
|
public void getConfig() { |
|
|
|
Logger.logD("START"); |
|
|
|
Logger.logD("START"); |
|
|
|
String serialNumber = DeviceUtils.getSerialNumber(); |
|
|
|
String serialNumber = DeviceUtils.getSerialNumber(); |
|
|
|
//String serialNumber = "1640011627";
|
|
|
|
|
|
|
|
RetrofitAPICollection service = RetrofitClient.getRetrofitClient(BuildConfig.CONFIG_URL).create(RetrofitAPICollection.class); |
|
|
|
RetrofitAPICollection service = RetrofitClient.getRetrofitClient(BuildConfig.CONFIG_URL).create(RetrofitAPICollection.class); |
|
|
|
Call<String> call = service.getConfig(serialNumber, BuildConfig.AUTH_KEY, serialNumber); |
|
|
|
Call<String> call = service.getConfig(serialNumber, BuildConfig.AUTH_KEY, serialNumber); |
|
|
|
|
|
|
|
|
|
|
|
Logger.logAPI(serialNumber); |
|
|
|
Logger.logAPI(serialNumber); |
|
|
|
|
|
|
|
|
|
|
|
/*call.enqueue(new Callback<String>() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void onResponse(@NonNull Call<String> call, @NonNull Response<String> response) { |
|
|
|
|
|
|
|
onResponseGetConfig(response); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { |
|
|
|
|
|
|
|
assert true; |
|
|
|
|
|
|
|
//onFailureGetConfig(t);
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
});*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
Response<String> response = call.execute(); |
|
|
|
Response<String> response = call.execute(); |
|
|
|
onResponseGetConfig(response); |
|
|
|
onResponseGetConfig(response); |
|
|
|