Skip to content

Commit

Permalink
Merge pull request #124 from prey/support-android-7
Browse files Browse the repository at this point in the history
Fix, event stopped wipe
  • Loading branch information
oaliaga authored Mar 31, 2017
2 parents 537ec17 + 3939247 commit bec59a9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ public List<HttpDataService> runActionJson(Context ctx, List<JSONObject> jsonObj
try {
for(int i=0;jsonObjectList!=null&&i<jsonObjectList.size();i++){
JSONObject jsonObject=jsonObjectList.get(i);
try {
jsonObject = jsonObject.getJSONObject("cmd");
}catch(Exception e){

}
PreyLogger.d("jsonObject:"+jsonObject);
String nameAction = jsonObject.getString("target");
String methodAction = jsonObject.getString("command");
Expand Down
13 changes: 7 additions & 6 deletions app/src/main/java/com/prey/actions/wipe/WipeThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,23 @@ public void run() {
try{
if(deleteSD){
WipeUtil.deleteSD();
if(!wipe){
PreyWebServices.getInstance().sendNotifyActionResultPreyHttp(ctx, UtilJson.makeMapParam("start","wipe","stopped",null));
}
}
}catch(Exception e){
PreyWebServices.getInstance().sendNotifyActionResultPreyHttp(ctx, UtilJson.makeMapParam("start","wipe","failed",e.getMessage()));
PreyLogger.e("Error Wipe:"+e.getMessage(), e);
}
try{
if (wipe&&preyConfig.isFroyoOrAbove()){
PreyLogger.d("Wiping the device!!");
PreyWebServices.getInstance().sendNotifyActionResultPreyHttp(ctx, UtilJson.makeMapParam("start","wipe","stopped",null));
FroyoSupport.getInstance(ctx).wipe();
}
}catch(Exception e){
PreyLogger.e("Error Wipe1:"+e.getMessage(), e);
}
try{
PreyWebServices.getInstance().sendNotifyActionResultPreyHttp(ctx, UtilJson.makeMapParam("start","wipe","stopped",null));
}catch(Exception e){
PreyWebServices.getInstance().sendNotifyActionResultPreyHttp(ctx, UtilJson.makeMapParam("start","wipe","failed",e.getMessage()));
PreyLogger.e("Error Wipe2:"+e.getMessage(), e);
PreyLogger.e("Error Wipe:"+e.getMessage(), e);
}
}

Expand Down

0 comments on commit bec59a9

Please sign in to comment.