package co.ab180.airbridge.reactnative.common import android.content.Context import android.util.Log import org.json.JSONException import org.json.JSONObject import java.io.IOException object AirbridgeJSON { internal val loaderFunc: (Context) -> JSONObject? = block@{ try { return@block JSONObject(it.assets.open("airbridge.json").reader().readText()) } catch (ignored: IOException) { // when do not use airbridge.json file } catch (exception: JSONException) { Log.w("AirbridgeReactNative", "File airbridge.json is not in json format") } catch (throwable: Throwable) { // unknown exception } return@block null } }