package co.ab180.airbridge.reactnative.extension import android.content.Context import android.util.Log import org.json.JSONException import org.json.JSONObject import java.io.IOException object LibraryInfoJSON { fun load(context: Context): JSONObject? { try { return context.assets.open("libraryInfo.json") .bufferedReader() .use { JSONObject(it.readText()) } } catch (exception: IOException) { Log.w("AirbridgeReactNative", "The file libraryInfo.json could not be read.", exception) } catch (exception: JSONException) { Log.w("AirbridgeReactNative", "The file libraryInfo.json is not in json format") } catch (throwable: Throwable) { Log.w("AirbridgeReactNative", "Unknown error processing libraryInfo.json", throwable) } return null } }