package com.rnscm;

import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.Callback;

import java.util.Map;
import java.util.HashMap;
import java.lang.reflect.Field;

public class SecretConfigManager extends ReactContextBaseJavaModule {

    public Class config;

    public SecretConfigManager(ReactApplicationContext reactContext, Class _config) {
        super(reactContext);
        config = _config;
    }

    @Override
    public String getName() {
        return "SecretConfigManager";
    }

    private Map<String,String> configToMap() {
        Field[] declaredFields = config.getDeclaredFields();
        Map<String, String> configMap = new HashMap<String, String>();
        for (Field field : declaredFields) {
            if (java.lang.reflect.Modifier.isStatic(field.getModifiers())) {
                String key = field.getName();
                String val = (String)field.get(null);
                configMap.put(key, val);
            }
        }
        return configMap;
    }

    @ReactMethod
    public void getConfig(String name, Callback callback) {
        callback.invoke(configToMap());
    }

}
@@ -775,16 +775,46 @@
 gToMap()
+ throws IllegalAccessException
  %7B%0A     
@@ -1333,24 +1333,42 @@
 callback) %7B%0A
+        try %7B%0A    
         call
@@ -1395,16 +1395,107 @@
 Map());%0A
+        %7D catch (IllegalAccessException err) %7B%0A            callback.invoke(err);%0A        %7D%0A
     %7D%0A%0A%7D

Fix all errors in java code