package com.bridge;

import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CallbackContext;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

/**
 * This class echoes a string called from JavaScript.
 */
public class Open extends CordovaPlugin {

    @Override
    public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
        if (action.equals("open")) {
            String path = args.getString(0);
            this.chooseIntent(path, callbackContext);
            return true;
        }
        return false;
    }

    private void chooseIntent(String path, CallbackContext callbackContext) {
        if (path != null && path.length() > 0) {
            callbackContext.success(path);
        } else {
            callbackContext.error("Expected one non-empty string argument.");
        }
    }
}

@@ -293,16 +293,66 @@
 in %7B%0A%0A  
+public static final String OPEN_ACTION = %22open%22;%0A%0A
   @Overr
@@ -355,18 +355,16 @@
 verride%0A
-  
   public
@@ -467,20 +467,16 @@
 ption %7B%0A
-    
     if (
@@ -493,25 +493,24 @@
 als(
-%22open%22)) %7B%0A      
+OPEN_ACTION)) %7B%0A
     
@@ -550,22 +550,16 @@
 ;%0A      
-  
-    
 this.cho
@@ -592,22 +592,16 @@
 ntext);%0A
-      
       re
@@ -619,22 +619,14 @@
     
-    %7D%0A  
+%7D%0A
     
-  
 retu
@@ -639,17 +639,13 @@
 se;%0A
-  
   %7D%0A%0A
-  
   pr
@@ -712,28 +712,24 @@
 kContext) %7B%0A
-    
     if (path
@@ -761,22 +761,16 @@
  %3E 0) %7B%0A
-      
       ca
@@ -798,20 +798,16 @@
 (path);%0A
-    
     %7D el
@@ -811,22 +811,16 @@
  else %7B%0A
-      
       ca
@@ -887,22 +887,16 @@
 %22);%0A    
-    %7D%0A  
+%7D%0A
   %7D%0A%7D%0A

Use constant and fix formatting issues