package org.apache.cordova.appsettings;

import java.util.Locale;

import android.app.Activity;

import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
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("fetch")) {
            try{
                for(int i=0;i<args.length();i++){
                    String key=args.getString(i);
                    PackageManager pm = cordova.getActivity().getApplication().getPackageManager();
                    String packageName = cordova.getActivity().getApplication().getPackageName();
                    ApplicationInfo appInfo = pm.getApplicationInfo(packageName, pm.GET_META_DATA);
                    String keyvalue = appInfo.metaData.getString(key);
                    if (keyvalue != null) {
                        options.put(key, keyvalue);
                    }
                }
                callbackContext.success(options);
            } catch (Exception ex) {
                callbackContext.error(0);
            }
            return true;
        }
        return false;
    }
}

@@ -630,112 +630,9 @@
 ry%7B%0A
-                for(int i=0;i%3Cargs.length();i++)%7B%0A                    String key=args.getString(i);%0A    
+%0A
     
@@ -735,28 +735,24 @@
             
-  
-  
 String packa
@@ -833,20 +833,16 @@
         
-  
-  
 Applicat
@@ -913,16 +913,17 @@
 _DATA);%0A
+%0A
         
@@ -926,28 +926,29 @@
             
-    
+for (
 String keyva
@@ -949,15 +949,10 @@
  key
-value =
+ :
  app
@@ -969,64 +969,16 @@
 ata.
-getString(key);%0A                    if (keyvalue != null
+keySet()
 ) %7B%0A
@@ -997,20 +997,16 @@
         
-    
 options.
@@ -1018,40 +1018,41 @@
 ey, 
-keyvalue);%0A                    %7D
+appInfo.metaData.getString(key));
 %0A   

Update android src to seralize all metadata