package org.apache.cordova.appsettings;

import java.util.Locale;

import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaPlugin;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;


public class AppSettings extends CordovaPlugin {


    @Override
    public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
    	JSONObject options = new JSONObject();
        if (action.equals("get")) {
        	try{
                for(int i=0;i<args.length();i++){
        	        String key=args.getString(i);
                    String keyvalue = cordova.getActivity().getIntent().getStringExtra(key.toLowerCase(Locale.getDefault()));        		
                    if (keyvalue != null) {
                        options.put(key, keyvalue);
                    }
                }
                callbackContext.success(options);
        	} catch (Exception ex) {
            	callbackContext.error(0);
            }
            return true;
        }
        return false;
    }
}

@@ -144,16 +144,62 @@
 Plugin;%0A
+import org.apache.cordova.CordovaPreferences;%0A
 import o
@@ -551,16 +551,91 @@
   %09try%7B%0A
+                CordovaPreferences preferences = webView.getPreferences();%0A
         
@@ -765,105 +765,41 @@
 e = 
-cordova.getActivity().getIntent().getStringExtra(key.toLowerCase(Locale.getDefault()));        %09%09
+preferences.getString(key, null);
 %0A   

Fix for Cordova Android 4.x to use CordovaPreferences.