Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Commit

Permalink
fix(app): validate information packagee
Browse files Browse the repository at this point in the history
Signed-off-by: Rafa Hernandez <[email protected]>
  • Loading branch information
rafaelje authored and Hector Rondon committed Sep 21, 2018
1 parent aa41508 commit 43a58d8
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ protected Integer doInBackground(String... args) {
args[1].isEmpty() ||
args[2].isEmpty() ||
args[3].isEmpty()) {
AppThreadManager manager = MDMAgent.getAppThreadManager();
manager.finishProcess(context);
return 0;
}

Expand Down Expand Up @@ -142,12 +144,16 @@ public Boolean downloadApk(String appName, String id, String sessionToken) {
try {
filePath = new StorageFolder(context).getApkDir();
} catch (Exception ex) {
AppThreadManager manager = MDMAgent.getAppThreadManager();
manager.finishProcess(context);
FlyveLog.e(ex.getMessage());
}

final String url = routes.pluginFlyvemdmPackage(id, sessionToken);
String completeFilePath = download(url, filePath);
if(completeFilePath.equalsIgnoreCase("")) {
AppThreadManager manager = MDMAgent.getAppThreadManager();
manager.finishProcess(context);
return false;
} else {

Expand Down Expand Up @@ -178,7 +184,10 @@ private String download(final String url, final String path) {
String data = ConnectionHTTP.getSyncWebData(url, "GET",null);
if(data.contains("ERROR")) {
Helpers.sendToNotificationBar(context, context.getResources().getString(R.string.download_file_fail));
FlyveLog.e(data);
AppThreadManager manager = MDMAgent.getAppThreadManager();
manager.finishProcess(context);

FlyveLog.e(data + "\n" + url);
} else {
try {
JSONObject jsonObjDownload = new JSONObject(data);
Expand Down

0 comments on commit 43a58d8

Please sign in to comment.