package e.l.c.l.j.p; import e.l.c.l.j.j.r0; import e.l.c.l.j.p.j.a; import e.l.c.l.j.p.j.b; import e.l.c.l.j.p.j.c; import e.l.c.l.j.p.j.e; import java.util.Locale; import java.util.Objects; import org.json.JSONException; import org.json.JSONObject; public class i implements h { @Override // e.l.c.l.j.p.h public e a(r0 r0Var, JSONObject jSONObject) throws JSONException { String str; long j2; int optInt = jSONObject.optInt("settings_version", 0); int optInt2 = jSONObject.optInt("cache_duration", 3600); JSONObject jSONObject2 = jSONObject.getJSONObject("fabric"); JSONObject jSONObject3 = jSONObject.getJSONObject("app"); String string = jSONObject3.getString("status"); boolean equals = "new".equals(string); String string2 = jSONObject2.getString("bundle_id"); String string3 = jSONObject2.getString("org_id"); if (equals) { str = "https://update.crashlytics.com/spi/v1/platforms/android/apps"; } else { str = String.format(Locale.US, "https://update.crashlytics.com/spi/v1/platforms/android/apps/%s", string2); } Locale locale = Locale.US; a aVar = new a(string, str, String.format(locale, "https://reports.crashlytics.com/spi/v1/platforms/android/apps/%s/reports", string2), String.format(locale, "https://reports.crashlytics.com/sdk-api/v1/platforms/android/apps/%s/minidumps", string2), string2, string3, jSONObject3.optBoolean("update_required", false), jSONObject3.optInt("report_upload_variant", 0), jSONObject3.optInt("native_report_upload_variant", 0)); c cVar = new c(8, 4); JSONObject jSONObject4 = jSONObject.getJSONObject("features"); b bVar = new b(jSONObject4.optBoolean("collect_reports", true), jSONObject4.optBoolean("collect_anrs", false)); long j3 = (long) optInt2; if (jSONObject.has("expires_at")) { j2 = jSONObject.optLong("expires_at"); } else { Objects.requireNonNull(r0Var); j2 = (j3 * 1000) + System.currentTimeMillis(); } return new e(j2, aVar, cVar, bVar, optInt, optInt2); } }