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;
    }
}

@@ -60,16 +60,131 @@
 ocale;%0A%0A
+import android.app.Activity;%0A%0Aimport android.content.pm.ApplicationInfo;%0Aimport android.content.pm.PackageManager;%0A
 import o
@@ -218,16 +218,16 @@
 ontext;%0A
-
 import o
@@ -396,18 +396,16 @@
 lugin %7B%0A
-%0A%0A
     @Ove
@@ -528,17 +528,20 @@
 n %7B%0A    
-%09
+    
 JSONObje
@@ -607,24 +607,29 @@
 et%22)) %7B%0A
+%0A    
         
 %09try%7B%0A  
@@ -620,17 +620,16 @@
         
-%09
 try%7B%0A   
@@ -683,17 +683,20 @@
         
-%09
+    
         
@@ -749,23 +749,25 @@
     
-String keyvalue
+PackageManager pm
  = c
@@ -794,80 +794,311 @@
 .get
-Intent().getStringExtra(key.toLowerCase(Locale.getDefault()));        %09%09
+Application().getPackageManager();%0A                    String packageName = cordova.getActivity().getApplication().getPackageName();%0A                    ApplicationInfo appInfo = pm.getApplicationInfo(packageName, pm.GET_META_DATA);%0A                    String keyvalue = appInfo.metaData.getString(key);
 %0A   
@@ -1288,17 +1288,20 @@
         
-%09
+    
 %7D catch 
@@ -1333,9 +1333,12 @@
     
-%09
+    
 call

Update src to read top level metatags for android