Skip to content

Commit

Permalink
Add detach action
Browse files Browse the repository at this point in the history
  • Loading branch information
oaliaga committed Apr 24, 2015
1 parent e003beb commit 467bd09
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/com/prey/json/actions/Detach.java
@@ -0,0 +1,25 @@
package com.prey.json.actions;

import java.util.List;

import org.json.JSONObject;

import android.content.Context;

import com.prey.PreyConfig;
import com.prey.actions.observer.ActionResult;
import com.prey.backwardcompatibility.FroyoSupport;

public class Detach {


public void start(Context ctx,List<ActionResult> lista,JSONObject parameters){
FroyoSupport fSupport = FroyoSupport.getInstance(ctx);
if (fSupport.isAdminActive()){
fSupport.removeAdminPrivileges();
}
PreyConfig.getPreyConfig(ctx).unregisterC2dm(false);
PreyConfig.getPreyConfig(ctx).setSecurityPrivilegesAlreadyPrompted(false);
PreyConfig.getPreyConfig(ctx).wipeData();
}
}
4 changes: 4 additions & 0 deletions src/com/prey/json/parser/JSONParser.java
Expand Up @@ -105,6 +105,10 @@ public List<JSONObject> getJSONFromUrl(Context ctx, String url) {

// json="[{\"command\":\"get\",\"target\":\"report\",\"options\":{\"interval\":\"2\",\"exclude\":[\"picture\",false]}}]";


// json = "[ {\"command\": \"start\",\"target\": \"detach\",\"options\": {}}]";


if ("[]".equals(json)) {
return null;
}
Expand Down

0 comments on commit 467bd09

Please sign in to comment.