拼多多跨境 v1.0.0版本的 MD5 值为:46d7e086dc764eefcdcf4fedc6f7a054

以下内容为反编译后的 a.java 源代码,内容仅作参考


package L0;

import L0.l;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.SystemClock;
import android.util.Log;
import android.widget.Toast;
import java.io.BufferedInputStream;
import java.io.BufferedWriter;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
import java.util.Timer;
import java.util.TimerTask;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import v0.C0565a;

public class a {
    private static a w4;

    public double f1108A;

    public Integer f1109A0;

    public int f1110A1;
    public boolean A2;
    public boolean A3;

    public e f1111B;

    public Integer f1112B0;

    public boolean f1113B1;
    public String B2;
    public boolean B3;

    public boolean f1114C;

    public Integer f1115C0;

    public boolean f1116C1;
    public boolean C2;
    public boolean C3;

    public boolean f1117D;

    public Integer f1118D0;
    public String D2;
    public String D3;

    public boolean f1120E;

    public boolean f1121E0;

    public boolean f1122E1;
    public boolean E2;
    public String E3;

    public boolean f1123F;

    public boolean f1124F0;

    public String f1125F1;
    public boolean F2;
    public boolean F3;

    public boolean f1126G;

    public boolean f1127G0;

    public String f1128G1;
    public String G2;
    public boolean G3;

    public boolean f1129H;

    public boolean f1130H0;

    public boolean f1131H1;
    public boolean H2;
    public boolean H3;

    public int f1132I;

    public double f1133I0;

    public boolean f1134I1;
    public String I2;
    public String I3;

    public boolean f1135J;

    public boolean f1136J0;

    public boolean f1137J1;
    public boolean J2;
    public String J3;

    public HashMap f1138K;

    public String f1139K0;

    public M0.a f1140K1;
    public boolean K2;

    public boolean f1141L;

    public Integer f1142L0;

    public boolean f1143L1;
    public boolean L2;

    public List f1144M;

    public Integer f1145M0;

    public String f1146M1;
    public String M2;

    public List f1147N;

    public boolean f1148N0;

    public String f1149N1;
    public String N2;

    public String f1150O;

    public double f1151O0;

    public boolean f1152O1;
    public boolean O2;

    public String f1153P;

    public String f1154P0;

    public String f1155P1;
    public boolean P2;
    private HashMap P3;

    public ArrayList f1156Q;

    public boolean f1157Q0;

    public boolean f1158Q1;
    public String Q2;
    private List Q3;

    public ArrayList f1159R;

    public boolean f1160R0;

    public boolean f1161R1;
    public String R2;
    private HashMap R3;

    public ArrayList f1162S;

    public boolean f1163S0;

    public JSONObject f1164S1;
    public String S2;
    private HashMap S3;

    public ArrayList f1165T;

    public boolean f1166T0;

    public boolean f1167T1;
    public String T2;
    private boolean T3;

    public ArrayList f1168U;

    public boolean f1169U0;

    public String f1170U1;
    public boolean U2;
    public boolean U3;

    public String f1171V;

    public boolean f1172V0;

    public boolean f1173V1;
    public boolean V2;
    public boolean V3;

    public l f1174W;

    public String f1175W0;
    public String W1;
    public int W2;
    public boolean W3;

    private HashMap f1176X;

    public M0.b f1177X0;
    public String X1;
    public String X2;
    public boolean X3;

    public boolean f1178Y;

    public ArrayList f1179Y0;
    public boolean Y1;
    public String Y2;
    public boolean Y3;

    public boolean f1180Z;

    public float f1181Z0;
    public boolean Z1;
    public boolean Z2;
    public boolean Z3;

    private Context f1182a;

    public boolean f1183a0;

    public Integer f1184a1;
    public boolean a2;
    public boolean a3;
    public boolean a4;

    private JSONObject f1185b;

    public boolean f1186b0;

    public Integer f1187b1;
    public String b2;
    public int b3;
    public boolean b4;

    public Exception f1188c;

    public ArrayList f1189c0;

    public Integer f1190c1;
    public boolean c2;
    public String c3;
    public boolean c4;

    private String f1191d;

    public HashMap f1192d0;

    public Integer f1193d1;
    public String d2;
    public boolean d3;
    public boolean d4;

    public String f1194e;

    public ArrayList f1195e0;

    public Integer f1196e1;
    public String e2;
    public String e3;
    public String e4;

    public String f1197f;

    public ArrayList f1198f0;

    public Integer f1199f1;
    public String f2;
    public String f3;
    public int f4;

    public String f1200g;

    public HashMap f1201g0;

    public Integer f1202g1;
    public boolean g2;
    public boolean g3;
    public boolean g4;

    public String f1203h;

    public ArrayList f1204h0;

    public Integer f1205h1;
    public List h2;
    public boolean h3;
    public String h4;

    private String f1206i;

    public ArrayList f1207i0;

    public boolean f1208i1;
    public String i2;
    public String i3;
    public String i4;

    public String f1209j;

    public ArrayList f1210j0;

    public double f1211j1;
    public JSONArray j2;
    public String j3;
    public String j4;

    public String f1212k;

    public ArrayList f1213k0;

    public double f1214k1;
    public JSONArray k2;
    public boolean k3;
    public boolean k4;

    public int f1215l;

    public Integer f1216l0;

    public boolean f1217l1;
    public boolean l2;
    public boolean l3;
    public String l4;

    public ArrayList f1218m;

    public Integer f1219m0;

    public int f1220m1;
    public String m2;
    public String m3;
    public boolean m4;

    public ArrayList f1221n;

    public Integer f1222n0;

    public String f1223n1;
    public String n2;
    public String n3;
    public boolean n4;

    public boolean f1224o;

    public Integer f1225o0;

    public String f1226o1;
    public boolean o2;
    public String o3;
    public boolean o4;

    public boolean f1227p;

    public Integer f1228p0;

    public JSONObject f1229p1;
    public boolean p2;
    public String p3;
    public boolean p4;

    public boolean f1230q;

    public Integer f1231q0;

    public boolean f1232q1;
    public boolean q2;
    public String q3;
    public boolean q4;

    public boolean f1233r;

    public Integer f1234r0;

    public String f1235r1;
    public boolean r2;
    public boolean r3;
    public boolean r4;

    public boolean f1236s;

    public Integer f1237s0;

    public JSONObject f1238s1;
    public String s2;
    public String s3;
    public String s4;

    public EnumC0011a f1239t;

    public Integer f1240t0;

    public boolean f1241t1;
    public ArrayList t2;
    public String t3;
    public boolean t4;

    public EnumC0011a f1242u;

    public Integer f1243u0;

    public boolean f1244u1;
    public boolean u2;
    public String u3;
    public String u4;

    public EnumC0011a f1245v;

    public Integer f1246v0;

    public boolean f1247v1;
    public String v3;
    public boolean v4;

    public boolean f1248w;

    public Integer f1249w0;

    public boolean f1250w1;
    public boolean w2;
    public boolean w3;

    public boolean f1251x;

    public Integer f1252x0;

    public boolean f1253x1;
    public String x2;
    public boolean x3;

    public Map f1254y;

    public Integer f1255y0;

    public boolean f1256y1;
    public boolean y2;
    public boolean y3;

    public List f1257z;

    public Integer f1258z0;

    public int f1259z1;
    public String z2;
    public boolean z3;

    private boolean f1119D1 = false;
    public ArrayList v2 = new ArrayList();
    private long K3 = 0;
    private boolean L3 = true;
    private boolean M3 = true;
    private boolean N3 = true;
    private boolean O3 = false;

    public enum EnumC0011a {
        UNSPECIFIED,
        PORTRAIT,
        LANDSCAPE
    }

    final class b extends TimerTask {

        final Timer f1264g;

        b(Timer timer) {
            this.f1264g = timer;
        }

        @Override
        public final void run() {
            a aVar = a.this;
            aVar.f1176X = aVar.P3;
            this.f1264g.cancel();
        }
    }

    public class c extends AsyncTask {
        private c() {
        }

        @Override
        protected final Object doInBackground(Object[] objArr) {
            ByteArrayOutputStream byteArrayOutputStream;
            a.this.K3 = SystemClock.elapsedRealtime();
            try {
                JSONObject jSONObject = new JSONObject(a.this.H());
                byte[] bArr = {-21, 41, 13, -62, 113, 29, -7, 48, 26, -97, 4, 125, -107, 4, -80, 115, 26, -127, 22, 50, -39, -33, 96, -105, 25, -46, 123, -62, -90, 109, -33, 58, 71, -100, -107, 56, -20, -16, -5, 116};
                byte[] bArr2 = {-125, 93, 121, -78, 2, 39, -42, 31, 118, -10, 103, 24, -5, 119, -43, 93, 125, -18, 120, 83, -83, -74, 22, -14, 55, -69, 20, -19, -54, 4, -68, 95, 41, -17, -16, 91, -124, -107, -104, 31};
                byte[] bArr3 = new byte[40];
                for (int i2 = 0; i2 < 40; i2++) {
                    bArr3[i2] = (byte) (bArr[i2] ^ bArr2[i2]);
                }
                HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(new String(bArr3, Charset.forName("US-ASCII"))).openConnection();
                httpURLConnection.setRequestMethod("POST");
                httpURLConnection.setRequestProperty("Content-Type", "application/json");
                httpURLConnection.setDoOutput(true);
                OutputStreamWriter outputStreamWriter = new OutputStreamWriter(httpURLConnection.getOutputStream(), "UTF-8");
                outputStreamWriter.write(jSONObject.toString());
                outputStreamWriter.close();
                httpURLConnection.connect();
                if (httpURLConnection.getResponseCode() == 200) {
                    if (httpURLConnection.getContentLength() > 0) {
                        byteArrayOutputStream = new ByteArrayOutputStream(httpURLConnection.getContentLength());
                    } else {
                        byteArrayOutputStream = new ByteArrayOutputStream();
                    }
                    BufferedInputStream bufferedInputStream = new BufferedInputStream(httpURLConnection.getInputStream());
                    j.b(bufferedInputStream, byteArrayOutputStream);
                    bufferedInputStream.close();
                    byteArrayOutputStream.close();
                    return new JSONObject(byteArrayOutputStream.toString("UTF-8"));
                }
                throw new Exception("Non-200 response");
            } catch (Exception unused) {
                return null;
            }
        }

        @Override
        protected final void onPostExecute(Object obj) {
            JSONObject L2;
            JSONObject jSONObject = (JSONObject) obj;
            if (jSONObject != null) {
                boolean optBoolean = jSONObject.optBoolean("isLicensed", true);
                if (optBoolean && (L2 = a.this.L("splashpage.json")) != null && L2.has("splashPageUrl")) {
                    a aVar = a.this;
                    aVar.f1176X = aVar.P3;
                    aVar.G("splashpage.json").delete();
                }
                boolean optBoolean2 = jSONObject.optBoolean("isLicensedForPush", true);
                a.this.N3 = jSONObject.optBoolean("isPublished", false);
                String Z2 = a.Z(jSONObject, "alert");
                if (Z2 != null && !Z2.isEmpty()) {
                    if (!optBoolean) {
                        a aVar2 = a.this;
                        if (aVar2.N3) {
                            JSONObject L3 = aVar2.L("splashpage.json");
                            if (L3 != null) {
                            }
                        }
                    }
                    Toast.makeText(a.this.f1182a, Z2, 1).show();
                }
                if (!optBoolean) {
                    optBoolean2 = false;
                }
                if (!optBoolean) {
                    a aVar3 = a.this;
                    if (aVar3.L3) {
                        aVar3.L3 = false;
                        if (aVar3.N3) {
                            JSONObject optJSONObject = jSONObject.optJSONObject("splashPageConfig");
                            if (optJSONObject != null) {
                                String Z3 = a.Z(optJSONObject, "splashPageUrl");
                                String Z4 = a.Z(optJSONObject, "splashPageRegex");
                                if (Z3 != null && !Z3.isEmpty() && Z4 != null && !Z4.isEmpty()) {
                                    try {
                                        JSONObject jSONObject2 = new JSONObject();
                                        jSONObject2.put("splashPageUrl", Z3);
                                        jSONObject2.put("splashPageRegex", Z4);
                                        a.this.E(jSONObject2, "splashpage.json");
                                    } catch (JSONException e2) {
                                        e2.printStackTrace();
                                    }
                                }
                            }
                        } else {
                            aVar3.G("splashpage.json").delete();
                            String c2 = m.c(jSONObject, "unlicensedUrl");
                            if (c2 == null) {
                                c2 = "https://gonative.io/unlicensed";
                            }
                            String c3 = m.c(jSONObject, "unlicensedLabel");
                            if (c3 == null) {
                                c3 = "Disabled";
                            }
                            a aVar4 = a.this;
                            aVar4.f1194e = aVar4.f1191d;
                            aVar4.f1191d = c2;
                            if (jSONObject.optBoolean("disableRedirects")) {
                                a.this.f1176X = null;
                            } else {
                                a.this.f1176X = new HashMap();
                                a.this.f1176X.put("*", c2);
                            }
                            a aVar5 = a.this;
                            aVar5.Q3 = aVar5.f1174W.d();
                            a.this.f1174W.b();
                            JSONArray optJSONArray = jSONObject.optJSONArray("regexInternalExternalRules");
                            if (optJSONArray != null) {
                                a.this.C(optJSONArray);
                            } else {
                                a.this.f1174W.a(new l.a("internal", Pattern.compile(".*")));
                            }
                            a.this.R3 = new HashMap(a.this.f1138K);
                            for (String str : a.this.f1138K.keySet()) {
                                try {
                                    JSONObject jSONObject3 = new JSONObject();
                                    jSONObject3.put("url", c2);
                                    jSONObject3.put("label", c3);
                                    JSONArray jSONArray = new JSONArray();
                                    jSONArray.put(jSONObject3);
                                    a.this.f1138K.put(str, jSONArray);
                                } catch (JSONException unused) {
                                }
                            }
                            a.this.S3 = new HashMap(a.this.f1192d0);
                            for (String str2 : a.this.f1192d0.keySet()) {
                                try {
                                    JSONObject jSONObject4 = new JSONObject();
                                    jSONObject4.put("url", c2);
                                    jSONObject4.put("label", c3);
                                    jSONObject4.put("icon", "fa-ban");
                                    JSONArray jSONArray2 = new JSONArray();
                                    jSONArray2.put(jSONObject4);
                                    a.this.f1192d0.put(str2, jSONArray2);
                                } catch (JSONException unused2) {
                                }
                            }
                            C0565a.b(a.this.f1182a).d(new Intent("io.gonative.android.AppConfig.processedMenu"));
                            C0565a.b(a.this.f1182a).d(new Intent("io.gonative.android.AppConfig.processedTabNavigation"));
                        }
                    }
                }
                if (!optBoolean2) {
                    a aVar6 = a.this;
                    if (aVar6.M3) {
                        aVar6.M3 = false;
                        aVar6.T3 = aVar6.f1122E1;
                        aVar6.f1122E1 = false;
                    }
                }
                if (optBoolean) {
                    a aVar7 = a.this;
                    if (!aVar7.L3) {
                        aVar7.L3 = true;
                        aVar7.f1191d = aVar7.f1194e;
                        aVar7.f1176X = aVar7.P3;
                        aVar7.f1174W.f(aVar7.Q3);
                        a aVar8 = a.this;
                        aVar8.f1138K = aVar8.R3;
                        aVar8.f1192d0 = aVar8.S3;
                        C0565a.b(aVar8.f1182a).d(new Intent("io.gonative.android.AppConfig.processedMenu"));
                        C0565a.b(a.this.f1182a).d(new Intent("io.gonative.android.AppConfig.processedTabNavigation"));
                    }
                }
                if (optBoolean2) {
                    a aVar9 = a.this;
                    if (!aVar9.M3) {
                        aVar9.M3 = true;
                        aVar9.f1122E1 = aVar9.T3;
                    }
                }
            }
        }
    }

    private a(Context context) {
        Throwable th;
        Closeable closeable;
        Closeable closeable2;
        Exception exc;
        Closeable closeable3;
        Closeable closeable4;
        Exception exc2;
        BufferedInputStream bufferedInputStream;
        JSONObject optJSONObject;
        JSONObject optJSONObject2;
        JSONObject optJSONObject3;
        Closeable closeable5;
        String str;
        JSONObject optJSONObject4;
        Integer d2;
        JSONObject optJSONObject5;
        JSONObject optJSONObject6;
        JSONObject optJSONObject7;
        JSONObject optJSONObject8;
        JSONObject L2;
        JSONObject optJSONObject9;
        JSONObject optJSONObject10;
        JSONObject optJSONObject11;
        JSONObject optJSONObject12;
        JSONObject optJSONObject13;
        String Z2;
        double optDouble;
        boolean optBoolean;
        JSONObject L3;
        JSONObject L4;
        JSONArray optJSONArray;
        JSONArray optJSONArray2;
        Object opt;
        JSONObject optJSONObject14;
        JSONArray optJSONArray3;
        int i2;
        String str2;
        JSONArray jSONArray;
        String optString;
        JSONArray optJSONArray4;
        String optString2;
        EnumC0011a enumC0011a;
        EnumC0011a enumC0011a2;
        EnumC0011a enumC0011a3;
        this.f1230q = true;
        this.f1108A = 10.0d;
        this.f1111B = e.DEFAULT;
        this.f1114C = true;
        this.f1117D = true;
        this.f1121E0 = false;
        this.f1124F0 = false;
        this.f1127G0 = false;
        this.f1130H0 = false;
        this.f1148N0 = true;
        this.f1241t1 = false;
        this.f1244u1 = false;
        this.f1247v1 = false;
        this.f1250w1 = false;
        this.f1253x1 = false;
        this.f1256y1 = false;
        ?? r9 = -2147483648;
        this.f1259z1 = Integer.MIN_VALUE;
        this.f1110A1 = Integer.MIN_VALUE;
        this.f1122E1 = false;
        this.f1131H1 = false;
        this.f1134I1 = true;
        this.f1137J1 = true;
        this.f1143L1 = false;
        this.f1152O1 = false;
        this.f1158Q1 = true;
        this.f1161R1 = false;
        this.f1167T1 = false;
        this.f1173V1 = false;
        this.Y1 = false;
        this.a2 = false;
        this.c2 = false;
        this.g2 = false;
        this.l2 = false;
        this.o2 = true;
        this.p2 = false;
        this.q2 = false;
        this.r2 = false;
        this.t2 = new ArrayList();
        this.u2 = false;
        this.w2 = false;
        this.x2 = null;
        this.y2 = false;
        this.z2 = null;
        this.A2 = false;
        this.C2 = false;
        this.D2 = null;
        this.E2 = true;
        this.F2 = false;
        this.G2 = null;
        this.H2 = false;
        this.I2 = null;
        this.J2 = false;
        this.K2 = false;
        this.L2 = false;
        this.O2 = false;
        this.P2 = false;
        this.Q2 = null;
        this.R2 = null;
        this.S2 = null;
        this.T2 = null;
        this.U2 = true;
        this.V2 = false;
        this.Z2 = false;
        this.a3 = false;
        this.b3 = 0;
        this.d3 = false;
        this.g3 = false;
        this.h3 = false;
        this.k3 = false;
        this.r3 = false;
        this.w3 = false;
        this.x3 = false;
        this.y3 = false;
        this.z3 = false;
        this.A3 = false;
        this.B3 = false;
        this.C3 = false;
        this.F3 = false;
        this.G3 = true;
        this.H3 = false;
        this.U3 = false;
        this.V3 = false;
        this.W3 = false;
        this.X3 = false;
        this.Y3 = false;
        this.Z3 = false;
        this.a4 = false;
        this.b4 = false;
        this.c4 = false;
        this.g4 = false;
        this.k4 = false;
        this.m4 = true;
        this.n4 = false;
        this.o4 = false;
        this.p4 = false;
        this.q4 = false;
        this.r4 = false;
        this.t4 = true;
        this.v4 = false;
        this.f1182a = context;
        try {
            try {
                if (S().exists()) {
                    try {
                        try {
                            bufferedInputStream = new BufferedInputStream(new FileInputStream(S()));
                        } catch (Exception e2) {
                            exc2 = e2;
                            bufferedInputStream = null;
                        }
                        try {
                            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                            j.b(bufferedInputStream, byteArrayOutputStream);
                            byteArrayOutputStream.close();
                            this.f1185b = new JSONObject(byteArrayOutputStream.toString("UTF-8"));
                        } catch (Exception e3) {
                            exc2 = e3;
                            try {
                                f.a().c("co.median.median_core.AppConfig", exc2.getMessage(), exc2);
                                j.a(bufferedInputStream);
                                if (this.f1185b != null) {
                                }
                                this.f1174W = new l();
                                optJSONObject = this.f1185b.optJSONObject("general");
                                String str3 = "";
                                if (optJSONObject != null) {
                                }
                                optJSONObject2 = this.f1185b.optJSONObject("forms");
                                if (optJSONObject2 != null) {
                                }
                                optJSONObject3 = this.f1185b.optJSONObject("navigation");
                                if (optJSONObject3 == null) {
                                }
                                optJSONObject4 = this.f1185b.optJSONObject("styling");
                                if (optJSONObject4 != null) {
                                }
                                this.f1216l0 = m.d(Z(optJSONObject4, "androidActionBarBackgroundColor"));
                                this.f1219m0 = m.d(Z(optJSONObject4, "androidActionBarBackgroundColorDark"));
                                this.f1222n0 = m.d(Z(optJSONObject4, "androidSidebarBackgroundColor"));
                                this.f1225o0 = m.d(Z(optJSONObject4, "androidSidebarBackgroundColorDark"));
                                this.f1228p0 = m.d(Z(optJSONObject4, "androidSidebarForegroundColor"));
                                this.f1231q0 = m.d(Z(optJSONObject4, "androidSidebarForegroundColorDark"));
                                this.f1234r0 = m.d(Z(optJSONObject4, "androidSidebarHighlightColor"));
                                this.f1237s0 = m.d(Z(optJSONObject4, "androidSidebarHighlightColorDark"));
                                this.f1240t0 = m.d(Z(optJSONObject4, "androidTintColor"));
                                this.f1249w0 = m.d(Z(optJSONObject4, "androidTabBarBackgroundColor"));
                                this.f1252x0 = m.d(Z(optJSONObject4, "androidTabBarBackgroundColorDark"));
                                this.f1243u0 = m.d(Z(optJSONObject4, "androidTabBarTextColor"));
                                this.f1246v0 = m.d(Z(optJSONObject4, "androidTabBarTextColorDark"));
                                this.f1255y0 = m.d(Z(optJSONObject4, "androidTabBarIndicatorColor"));
                                this.f1258z0 = m.d(Z(optJSONObject4, "androidTabBarIndicatorColorDark"));
                                this.f1109A0 = m.d(Z(optJSONObject4, "androidTabPressedBackgroundColor"));
                                this.f1112B0 = m.d(Z(optJSONObject4, "androidTabPressedBackgroundColorDark"));
                                this.f1151O0 = optJSONObject4.optDouble("transitionInteractiveDelayMax", Double.NaN);
                                boolean optBoolean2 = optJSONObject4.optBoolean("androidHideTitleInActionBar", false);
                                this.f1157Q0 = optBoolean2;
                                this.f1160R0 = optJSONObject4.optBoolean("androidShowLogoInActionBar", optBoolean2);
                                this.f1163S0 = optJSONObject4.optBoolean("androidShowLogoInSideBar", true);
                                this.f1166T0 = optJSONObject4.optBoolean("androidShowAppNameInSideBar", true);
                                this.f1172V0 = optJSONObject4.optBoolean("androidEnableOverlayInStatusBar", false);
                                this.f1175W0 = Z(optJSONObject4, "androidStatusBarStyle");
                                this.f1177X0 = new M0.b(optJSONObject4);
                                d2 = m.d(Z(optJSONObject4, "androidActionBarForegroundColor"));
                                this.f1142L0 = d2;
                                if (d2 == null) {
                                }
                                this.f1145M0 = m.d(Z(optJSONObject4, "androidActionBarForegroundColorDark"));
                                I(optJSONObject4.opt("navigationTitleImage"));
                                this.f1181Z0 = (float) optJSONObject4.optDouble("hideWebviewAlpha", 0.0d);
                                this.f1184a1 = m.d(Z(optJSONObject4, "androidPullToRefreshColor"));
                                this.f1187b1 = m.d(Z(optJSONObject4, "androidPullToRefreshColorDark"));
                                this.f1190c1 = m.d(Z(optJSONObject4, "androidSwipeNavigationBackgroundColor"));
                                this.f1193d1 = m.d(Z(optJSONObject4, "androidSwipeNavigationBackgroundColorDark"));
                                this.f1196e1 = m.d(Z(optJSONObject4, "androidSwipeNavigationActiveColor"));
                                this.f1199f1 = m.d(Z(optJSONObject4, "androidSwipeNavigationActiveColorDark"));
                                this.f1202g1 = m.d(Z(optJSONObject4, "androidSwipeNavigationInactiveColor"));
                                this.f1205h1 = m.d(Z(optJSONObject4, "androidSwipeNavigationInactiveColorDark"));
                                this.f1208i1 = optJSONObject4.optBoolean("androidShowSplash", false);
                                this.f1211j1 = optJSONObject4.optDouble("androidShowSplashMaxTime", 1.5d);
                                this.f1214k1 = optJSONObject4.optDouble("androidShowSplashForceTime", Double.NaN);
                                this.f1115C0 = m.d(Z(optJSONObject4, "androidSplashBackgroundColor"));
                                this.f1118D0 = m.d(Z(optJSONObject4, "androidSplashBackgroundColorDark"));
                                this.f1217l1 = optJSONObject4.optBoolean("disableAnimations", false);
                                this.f1220m1 = optJSONObject4.optInt("androidWebviewTextZoom", -1);
                                optJSONObject5 = this.f1185b.optJSONObject("script");
                                if (optJSONObject5 != null) {
                                }
                                optJSONObject6 = this.f1185b.optJSONObject("permissions");
                                if (optJSONObject6 != null) {
                                }
                                optJSONObject7 = this.f1185b.optJSONObject("services");
                                if (optJSONObject7 != null) {
                                }
                                optJSONObject8 = this.f1185b.optJSONObject("performance");
                                if (optJSONObject8 != null) {
                                }
                                this.G3 = this.f1185b.optBoolean("allowZoom", true);
                                L2 = L("splashpage.json");
                                if (L2 != null) {
                                    HashMap hashMap = new HashMap();
                                    this.f1176X = hashMap;
                                    hashMap.put("*", L2.getString("splashPageUrl"));
                                }
                                optJSONObject9 = this.f1185b.optJSONObject("security");
                                if (optJSONObject9 != null) {
                                    this.J3 = optJSONObject11.optString("androidConfigXML");
                                }
                                optJSONObject10 = this.f1185b.optJSONObject("developmentTools");
                                if (optJSONObject10 != null) {
                                    this.U3 = true;
                                }
                                j.a(null);
                                j.a(closeable5);
                            } catch (Exception e4) {
                                exc = e4;
                                closeable3 = null;
                                f.a().c("co.median.median_core.AppConfig", exc.getMessage(), exc);
                                this.f1188c = exc;
                                j.a(null);
                                j.a(closeable3);
                                B();
                            }
                            B();
                        }
                    } catch (Throwable th2) {
                        th = th2;
                        closeable = null;
                        closeable2 = null;
                        j.a(closeable);
                        j.a(closeable2);
                        throw th;
                    }
                }
                if (this.f1185b != null) {
                    r9 = context.getAssets().open("appConfig.json");
                    try {
                        try {
                            ByteArrayOutputStream byteArrayOutputStream2 = new ByteArrayOutputStream();
                            j.b(r9, byteArrayOutputStream2);
                            j.a(byteArrayOutputStream2);
                            this.f1185b = new JSONObject(byteArrayOutputStream2.toString("UTF-8"));
                            r9 = r9;
                        } catch (Exception e5) {
                            e = e5;
                            exc = e;
                            closeable3 = r9;
                            f.a().c("co.median.median_core.AppConfig", exc.getMessage(), exc);
                            this.f1188c = exc;
                            j.a(null);
                            j.a(closeable3);
                            B();
                        }
                    } catch (Throwable th3) {
                        th = th3;
                        closeable = null;
                        closeable2 = r9;
                        j.a(closeable);
                        j.a(closeable2);
                        throw th;
                    }
                } else {
                    r9 = 0;
                }
            } catch (Throwable th4) {
                th = th4;
            }
        } catch (Exception e6) {
            exc = e6;
            closeable3 = null;
        } catch (Throwable th5) {
            th = th5;
            closeable = null;
            closeable2 = null;
        }
        try {
            this.f1174W = new l();
            optJSONObject = this.f1185b.optJSONObject("general");
            String str32 = "";
            if (optJSONObject != null) {
                JSONObject L5 = L("initurl.json");
                if (L5 == null || !L5.has("initialUrl")) {
                    String Z3 = Z(optJSONObject, "initialUrl");
                    this.f1194e = Z3;
                    this.f1191d = Z3;
                } else {
                    String string = L5.getString("initialUrl");
                    this.f1194e = string;
                    this.f1191d = string;
                }
                String host = Uri.parse(this.f1191d).getHost();
                this.f1197f = host;
                if (host.startsWith("www.")) {
                    this.f1197f = this.f1197f.substring(4);
                }
                this.f1200g = Z(optJSONObject, "appName");
                String Z4 = Z(optJSONObject, "androidForceUserAgent");
                this.f1206i = Z4;
                if (Z4 == null || Z4.isEmpty()) {
                    this.f1206i = Z(optJSONObject, "forceUserAgent");
                }
                String str4 = this.f1206i;
                if (str4 == null || str4.isEmpty()) {
                    String Z5 = Z(optJSONObject, "androidUserAgentAdd");
                    this.f1209j = Z5;
                    if (Z5 == null || Z5.isEmpty()) {
                        this.f1209j = Z(optJSONObject, "userAgentAdd");
                    }
                    if (this.f1209j == null) {
                        this.f1209j = "gonative";
                    }
                    if (this.f1209j.equals("gonative")) {
                        this.f1209j = "GoNativeAndroid/1.0 gonative";
                    }
                } else {
                    this.f1212k = this.f1206i;
                }
                this.f1203h = Z(optJSONObject, "publicKey");
                int optInt = optJSONObject.optInt("forceSessionCookieExpiry", 0);
                this.f1215l = optInt;
                if (optInt > 0) {
                    this.H3 = true;
                }
                J(optJSONObject.optJSONArray("userAgentRegexes"));
                this.f1224o = optJSONObject.optBoolean("disableConfigUpdater", false);
                this.f1227p = optJSONObject.optBoolean("disableEventRecorder", false);
                this.f1230q = optJSONObject.optBoolean("androidDirectCameraUploads", true);
                this.f1233r = optJSONObject.optBoolean("androidClearCache", false);
                this.f1236s = optJSONObject.optBoolean("enableWindowOpen", false);
                String Z6 = Z(optJSONObject, "forceScreenOrientation");
                if (Z6 != null) {
                    if (Z6.equalsIgnoreCase("portrait")) {
                        enumC0011a3 = EnumC0011a.PORTRAIT;
                    } else {
                        enumC0011a3 = Z6.equalsIgnoreCase("landscape") ? EnumC0011a.LANDSCAPE : enumC0011a3;
                    }
                    this.f1239t = enumC0011a3;
                }
                JSONObject optJSONObject15 = optJSONObject.optJSONObject("screenOrientation");
                if (optJSONObject15 != null) {
                    String optString3 = optJSONObject15.optString("androidPhone", "");
                    if ("portrait".equalsIgnoreCase(optString3)) {
                        enumC0011a2 = EnumC0011a.PORTRAIT;
                    } else {
                        enumC0011a2 = "landscape".equalsIgnoreCase(optString3) ? EnumC0011a.LANDSCAPE : enumC0011a2;
                        optString2 = optJSONObject15.optString("androidTablet", "");
                        if ("portrait".equalsIgnoreCase(optString2)) {
                            enumC0011a = "landscape".equalsIgnoreCase(optString2) ? EnumC0011a.LANDSCAPE : enumC0011a;
                        } else {
                            enumC0011a = EnumC0011a.PORTRAIT;
                        }
                        this.f1245v = enumC0011a;
                    }
                    this.f1242u = enumC0011a2;
                    optString2 = optJSONObject15.optString("androidTablet", "");
                    if ("portrait".equalsIgnoreCase(optString2)) {
                    }
                    this.f1245v = enumC0011a;
                }
                this.f1248w = optJSONObject.optBoolean("keepScreenOn", false);
                this.f1251x = optJSONObject.optBoolean("androidFullScreen", false);
                JSONObject optJSONObject16 = optJSONObject.optJSONObject("androidCustomHeaders");
                optJSONObject16 = optJSONObject16 == null ? optJSONObject.optJSONObject("customHeaders") : optJSONObject16;
                if (optJSONObject16 != null) {
                    this.f1254y = new HashMap();
                    Iterator<String> keys = optJSONObject16.keys();
                    while (keys.hasNext()) {
                        String next = keys.next();
                        String Z7 = Z(optJSONObject16, next);
                        if (next != null && Z7 != null && !next.isEmpty() && !Z7.isEmpty()) {
                            this.f1254y.put(next, Z7);
                        }
                    }
                }
                this.I3 = Z(optJSONObject, "postLoadJavascript");
                this.f1257z = A(optJSONObject.opt("nativeBridgeUrls"));
                this.f1111B = e.b(optJSONObject.optString("androidCacheMode", "default"));
                this.f1114C = optJSONObject.optBoolean("sslToastErrorsEnabled", true);
                this.f1117D = optJSONObject.optBoolean("injectMedianJS", this.f1117D);
            }
            optJSONObject2 = this.f1185b.optJSONObject("forms");
            if (optJSONObject2 != null) {
                JSONObject optJSONObject17 = optJSONObject2.optJSONObject("search");
                if (optJSONObject17 != null && optJSONObject17.optBoolean("active", false)) {
                    this.f1223n1 = Z(optJSONObject17, "searchTemplateURL");
                }
                JSONObject optJSONObject18 = optJSONObject2.optJSONObject("loginConfig");
                if (optJSONObject18 != null && optJSONObject18.optBoolean("active", false)) {
                    this.f1229p1 = optJSONObject18;
                    this.f1226o1 = Z(optJSONObject18, "interceptUrl");
                    this.f1232q1 = optJSONObject18.optBoolean("loginIsFirstPage", false);
                }
                JSONObject optJSONObject19 = optJSONObject2.optJSONObject("signupConfig");
                if (optJSONObject19 != null && optJSONObject19.optBoolean("active", false)) {
                    this.f1238s1 = optJSONObject19;
                    this.f1235r1 = Z(optJSONObject19, "interceptUrl");
                }
            }
            optJSONObject3 = this.f1185b.optJSONObject("navigation");
            if (optJSONObject3 == null) {
                this.f1120E = optJSONObject3.optBoolean("androidPullToRefresh");
                this.f1123F = optJSONObject3.optBoolean("swipeGestures");
                this.f1126G = optJSONObject3.optBoolean("swipeGesturesEdge");
                JSONObject L6 = L("maxwindows.json");
                if (L6 != null) {
                    this.f1129H = L6.optBoolean("enabled", false);
                    this.f1132I = L6.optInt("numWindows", 100);
                    optBoolean = L6.optBoolean("autoClose", false);
                } else {
                    JSONObject optJSONObject20 = optJSONObject3.optJSONObject("maxWindows");
                    if (optJSONObject20 != null && optJSONObject20.optBoolean("enabled")) {
                        this.f1129H = true;
                        this.f1132I = optJSONObject20.optInt("numWindows", 100);
                        optBoolean = optJSONObject20.optBoolean("autoClose", false);
                    }
                    L3 = L("sidebarnav.json");
                    if (L3 != null || !L3.has("menus")) {
                        Q(optJSONObject3.optJSONObject("sidebarNavigation"));
                    } else {
                        Q(L3);
                    }
                    JSONObject L7 = L("navlevels.json");
                    L7 = L7 == null ? optJSONObject3.optJSONObject("androidNavigationLevels") : L7;
                    K(L7 == null ? optJSONObject3.optJSONObject("navigationLevels") : L7);
                    JSONObject L8 = L("navtitles.json");
                    N(L8 == null ? optJSONObject3.optJSONObject("navigationTitles") : L8);
                    this.f1171V = Z(optJSONObject3, "profilePickerJS");
                    L4 = L("regexintext.json");
                    if (L4 == null && L4.has("rules")) {
                        optJSONArray4 = L4.getJSONArray("rules");
                    } else {
                        JSONObject optJSONObject21 = optJSONObject3.optJSONObject("regexInternalExternal");
                        optJSONArray4 = (optJSONObject21 != null && optJSONObject21.optBoolean("active")) ? optJSONObject21.optJSONArray("rules") : optJSONArray4;
                        R(optJSONObject3.optJSONObject("tabNavigation"));
                        D(optJSONObject3.optJSONObject("actionConfig"));
                        this.f1169U0 = optJSONObject3.optBoolean("androidShowRefreshButton", true);
                        optJSONArray = optJSONObject3.optJSONArray("ignorePageFinishedRegexes");
                        this.f1210j0 = new ArrayList();
                        if (optJSONArray != null) {
                            int i3 = 0;
                            r9 = r9;
                            while (i3 < optJSONArray.length()) {
                                if (optJSONArray.isNull(i3) || (optString = optJSONArray.optString(i3)) == null) {
                                    closeable5 = r9;
                                    str2 = str32;
                                    jSONArray = optJSONArray;
                                } else {
                                    try {
                                        jSONArray = optJSONArray;
                                        try {
                                            this.f1210j0.add(Pattern.compile(optString));
                                            closeable5 = r9;
                                            str2 = str32;
                                        } catch (PatternSyntaxException e7) {
                                            e = e7;
                                            PatternSyntaxException patternSyntaxException = e;
                                            f a2 = f.a();
                                            closeable5 = r9;
                                            try {
                                                StringBuilder sb = new StringBuilder();
                                                str2 = str32;
                                                sb.append("Error parsing regex ");
                                                sb.append(optString);
                                                a2.c("co.median.median_core.AppConfig", sb.toString(), patternSyntaxException);
                                                i3++;
                                                optJSONArray = jSONArray;
                                                r9 = closeable5;
                                                str32 = str2;
                                            } catch (Exception e8) {
                                                exc = e8;
                                                closeable3 = closeable5;
                                                f.a().c("co.median.median_core.AppConfig", exc.getMessage(), exc);
                                                this.f1188c = exc;
                                                j.a(null);
                                                j.a(closeable3);
                                                B();
                                            } catch (Throwable th6) {
                                                th = th6;
                                                closeable4 = closeable5;
                                                closeable = null;
                                                closeable2 = closeable4;
                                                j.a(closeable);
                                                j.a(closeable2);
                                                throw th;
                                            }
                                        }
                                    } catch (PatternSyntaxException e9) {
                                        e = e9;
                                        jSONArray = optJSONArray;
                                    }
                                }
                                i3++;
                                optJSONArray = jSONArray;
                                r9 = closeable5;
                                str32 = str2;
                            }
                        }
                        closeable5 = r9;
                        str = str32;
                        optJSONArray2 = optJSONObject3.optJSONArray("redirects");
                        if (optJSONArray2 != null) {
                            this.f1176X = new HashMap(optJSONArray2.length());
                            for (int i4 = 0; i4 < optJSONArray2.length(); i4++) {
                                String c2 = m.c(optJSONArray2.optJSONObject(i4), "from");
                                String c3 = m.c(optJSONArray2.optJSONObject(i4), "to");
                                if (c2 != null && c3 != null) {
                                    this.f1176X.put(c2, c3);
                                }
                            }
                        } else {
                            this.f1176X = null;
                        }
                        this.P3 = this.f1176X;
                        O(optJSONObject3.optJSONObject("segmentedControl"));
                        this.f1180Z = optJSONObject3.optBoolean("androidShowOfflinePage", true);
                        this.f1183a0 = optJSONObject3.optBoolean("androidShakeToClearCache", false);
                        this.f1186b0 = optJSONObject3.optBoolean("androidDisableBackButton", false);
                        opt = optJSONObject3.opt("androidConnectionOfflineTime");
                        if (opt != null) {
                            if (!(opt instanceof Boolean) || ((Boolean) opt).booleanValue()) {
                                this.f1108A = optJSONObject3.optDouble("androidConnectionOfflineTime", this.f1108A);
                            } else {
                                this.f1108A = Double.NaN;
                            }
                        }
                        optJSONObject14 = optJSONObject3.optJSONObject("deepLinkDomains");
                        if (optJSONObject14 != null && (optJSONArray3 = optJSONObject14.optJSONArray("domains")) != null) {
                            this.f1213k0 = new ArrayList();
                            for (i2 = 0; i2 < optJSONArray3.length(); i2++) {
                                try {
                                    this.f1213k0.add(optJSONArray3.getString(i2));
                                } catch (JSONException unused) {
                                }
                            }
                        }
                    }
                    C(optJSONArray4);
                    R(optJSONObject3.optJSONObject("tabNavigation"));
                    D(optJSONObject3.optJSONObject("actionConfig"));
                    this.f1169U0 = optJSONObject3.optBoolean("androidShowRefreshButton", true);
                    optJSONArray = optJSONObject3.optJSONArray("ignorePageFinishedRegexes");
                    this.f1210j0 = new ArrayList();
                    if (optJSONArray != null) {
                    }
                    closeable5 = r9;
                    str = str32;
                    optJSONArray2 = optJSONObject3.optJSONArray("redirects");
                    if (optJSONArray2 != null) {
                    }
                    this.P3 = this.f1176X;
                    O(optJSONObject3.optJSONObject("segmentedControl"));
                    this.f1180Z = optJSONObject3.optBoolean("androidShowOfflinePage", true);
                    this.f1183a0 = optJSONObject3.optBoolean("androidShakeToClearCache", false);
                    this.f1186b0 = optJSONObject3.optBoolean("androidDisableBackButton", false);
                    opt = optJSONObject3.opt("androidConnectionOfflineTime");
                    if (opt != null) {
                    }
                    optJSONObject14 = optJSONObject3.optJSONObject("deepLinkDomains");
                    if (optJSONObject14 != null) {
                        this.f1213k0 = new ArrayList();
                        while (i2 < optJSONArray3.length()) {
                        }
                    }
                }
                this.f1135J = optBoolean;
                L3 = L("sidebarnav.json");
                if (L3 != null) {
                }
                Q(optJSONObject3.optJSONObject("sidebarNavigation"));
                JSONObject L72 = L("navlevels.json");
                if (L72 == null) {
                }
                K(L72 == null ? optJSONObject3.optJSONObject("navigationLevels") : L72);
                JSONObject L82 = L("navtitles.json");
                N(L82 == null ? optJSONObject3.optJSONObject("navigationTitles") : L82);
                this.f1171V = Z(optJSONObject3, "profilePickerJS");
                L4 = L("regexintext.json");
                if (L4 == null) {
                }
                JSONObject optJSONObject212 = optJSONObject3.optJSONObject("regexInternalExternal");
                if (optJSONObject212 != null) {
                    C(optJSONArray4);
                }
                R(optJSONObject3.optJSONObject("tabNavigation"));
                D(optJSONObject3.optJSONObject("actionConfig"));
                this.f1169U0 = optJSONObject3.optBoolean("androidShowRefreshButton", true);
                optJSONArray = optJSONObject3.optJSONArray("ignorePageFinishedRegexes");
                this.f1210j0 = new ArrayList();
                if (optJSONArray != null) {
                }
                closeable5 = r9;
                str = str32;
                optJSONArray2 = optJSONObject3.optJSONArray("redirects");
                if (optJSONArray2 != null) {
                }
                this.P3 = this.f1176X;
                O(optJSONObject3.optJSONObject("segmentedControl"));
                this.f1180Z = optJSONObject3.optBoolean("androidShowOfflinePage", true);
                this.f1183a0 = optJSONObject3.optBoolean("androidShakeToClearCache", false);
                this.f1186b0 = optJSONObject3.optBoolean("androidDisableBackButton", false);
                opt = optJSONObject3.opt("androidConnectionOfflineTime");
                if (opt != null) {
                }
                optJSONObject14 = optJSONObject3.optJSONObject("deepLinkDomains");
                if (optJSONObject14 != null) {
                }
            } else {
                closeable5 = r9;
                str = "";
            }
            optJSONObject4 = this.f1185b.optJSONObject("styling");
            if (optJSONObject4 != null) {
                if (Z(optJSONObject4, "customCSS") != null) {
                    if (!Z(optJSONObject4, "customCSS").isEmpty()) {
                    }
                    this.f1121E0 = true;
                    if (Z(optJSONObject4, "androidCustomCSS") != null) {
                        if (!Z(optJSONObject4, "androidCustomCSS").isEmpty()) {
                        }
                        this.f1124F0 = true;
                        optDouble = optJSONObject4.optDouble("forceViewportWidth", Double.NaN);
                        this.f1133I0 = optDouble;
                        if (!Double.isNaN(optDouble)) {
                            this.H3 = true;
                        }
                        this.f1136J0 = optJSONObject4.optBoolean("zoomableForceViewport", false);
                        this.f1148N0 = optJSONObject4.optBoolean("showActionBar", true);
                        this.f1139K0 = Z(optJSONObject4, "androidTheme");
                    }
                    if (Z(optJSONObject4, "androidCustomCSSUrl") != null && !Z(optJSONObject4, "androidCustomCSSUrl").isEmpty()) {
                        this.f1124F0 = true;
                    }
                    optDouble = optJSONObject4.optDouble("forceViewportWidth", Double.NaN);
                    this.f1133I0 = optDouble;
                    if (!Double.isNaN(optDouble)) {
                    }
                    this.f1136J0 = optJSONObject4.optBoolean("zoomableForceViewport", false);
                    this.f1148N0 = optJSONObject4.optBoolean("showActionBar", true);
                    this.f1139K0 = Z(optJSONObject4, "androidTheme");
                }
                if (Z(optJSONObject4, "customCSSUrl") != null && !Z(optJSONObject4, "customCSSUrl").isEmpty()) {
                    this.f1121E0 = true;
                }
                if (Z(optJSONObject4, "androidCustomCSS") != null) {
                }
                if (Z(optJSONObject4, "androidCustomCSSUrl") != null) {
                    this.f1124F0 = true;
                }
                optDouble = optJSONObject4.optDouble("forceViewportWidth", Double.NaN);
                this.f1133I0 = optDouble;
                if (!Double.isNaN(optDouble)) {
                }
                this.f1136J0 = optJSONObject4.optBoolean("zoomableForceViewport", false);
                this.f1148N0 = optJSONObject4.optBoolean("showActionBar", true);
                this.f1139K0 = Z(optJSONObject4, "androidTheme");
            }
            this.f1216l0 = m.d(Z(optJSONObject4, "androidActionBarBackgroundColor"));
            this.f1219m0 = m.d(Z(optJSONObject4, "androidActionBarBackgroundColorDark"));
            this.f1222n0 = m.d(Z(optJSONObject4, "androidSidebarBackgroundColor"));
            this.f1225o0 = m.d(Z(optJSONObject4, "androidSidebarBackgroundColorDark"));
            this.f1228p0 = m.d(Z(optJSONObject4, "androidSidebarForegroundColor"));
            this.f1231q0 = m.d(Z(optJSONObject4, "androidSidebarForegroundColorDark"));
            this.f1234r0 = m.d(Z(optJSONObject4, "androidSidebarHighlightColor"));
            this.f1237s0 = m.d(Z(optJSONObject4, "androidSidebarHighlightColorDark"));
            this.f1240t0 = m.d(Z(optJSONObject4, "androidTintColor"));
            this.f1249w0 = m.d(Z(optJSONObject4, "androidTabBarBackgroundColor"));
            this.f1252x0 = m.d(Z(optJSONObject4, "androidTabBarBackgroundColorDark"));
            this.f1243u0 = m.d(Z(optJSONObject4, "androidTabBarTextColor"));
            this.f1246v0 = m.d(Z(optJSONObject4, "androidTabBarTextColorDark"));
            this.f1255y0 = m.d(Z(optJSONObject4, "androidTabBarIndicatorColor"));
            this.f1258z0 = m.d(Z(optJSONObject4, "androidTabBarIndicatorColorDark"));
            this.f1109A0 = m.d(Z(optJSONObject4, "androidTabPressedBackgroundColor"));
            this.f1112B0 = m.d(Z(optJSONObject4, "androidTabPressedBackgroundColorDark"));
            this.f1151O0 = optJSONObject4.optDouble("transitionInteractiveDelayMax", Double.NaN);
            boolean optBoolean22 = optJSONObject4.optBoolean("androidHideTitleInActionBar", false);
            this.f1157Q0 = optBoolean22;
            this.f1160R0 = optJSONObject4.optBoolean("androidShowLogoInActionBar", optBoolean22);
            this.f1163S0 = optJSONObject4.optBoolean("androidShowLogoInSideBar", true);
            this.f1166T0 = optJSONObject4.optBoolean("androidShowAppNameInSideBar", true);
            this.f1172V0 = optJSONObject4.optBoolean("androidEnableOverlayInStatusBar", false);
            this.f1175W0 = Z(optJSONObject4, "androidStatusBarStyle");
            this.f1177X0 = new M0.b(optJSONObject4);
            d2 = m.d(Z(optJSONObject4, "androidActionBarForegroundColor"));
            this.f1142L0 = d2;
            if (d2 == null) {
                String str5 = this.f1139K0;
                this.f1142L0 = str5 == null ? -1 : str5.equalsIgnoreCase("light") ? -16777216 : -1;
            }
            this.f1145M0 = m.d(Z(optJSONObject4, "androidActionBarForegroundColorDark"));
            I(optJSONObject4.opt("navigationTitleImage"));
            this.f1181Z0 = (float) optJSONObject4.optDouble("hideWebviewAlpha", 0.0d);
            this.f1184a1 = m.d(Z(optJSONObject4, "androidPullToRefreshColor"));
            this.f1187b1 = m.d(Z(optJSONObject4, "androidPullToRefreshColorDark"));
            this.f1190c1 = m.d(Z(optJSONObject4, "androidSwipeNavigationBackgroundColor"));
            this.f1193d1 = m.d(Z(optJSONObject4, "androidSwipeNavigationBackgroundColorDark"));
            this.f1196e1 = m.d(Z(optJSONObject4, "androidSwipeNavigationActiveColor"));
            this.f1199f1 = m.d(Z(optJSONObject4, "androidSwipeNavigationActiveColorDark"));
            this.f1202g1 = m.d(Z(optJSONObject4, "androidSwipeNavigationInactiveColor"));
            this.f1205h1 = m.d(Z(optJSONObject4, "androidSwipeNavigationInactiveColorDark"));
            this.f1208i1 = optJSONObject4.optBoolean("androidShowSplash", false);
            this.f1211j1 = optJSONObject4.optDouble("androidShowSplashMaxTime", 1.5d);
            this.f1214k1 = optJSONObject4.optDouble("androidShowSplashForceTime", Double.NaN);
            this.f1115C0 = m.d(Z(optJSONObject4, "androidSplashBackgroundColor"));
            this.f1118D0 = m.d(Z(optJSONObject4, "androidSplashBackgroundColorDark"));
            this.f1217l1 = optJSONObject4.optBoolean("disableAnimations", false);
            this.f1220m1 = optJSONObject4.optInt("androidWebviewTextZoom", -1);
            optJSONObject5 = this.f1185b.optJSONObject("script");
            if (optJSONObject5 != null) {
                if (Z(optJSONObject5, "customJS") != null) {
                    if (!Z(optJSONObject5, "customJS").isEmpty()) {
                    }
                    this.f1127G0 = true;
                    if (Z(optJSONObject5, "androidCustomJS") != null) {
                        if (!Z(optJSONObject5, "androidCustomJS").isEmpty()) {
                        }
                        this.f1130H0 = true;
                    }
                    if (Z(optJSONObject5, "androidCustomJSUrl") != null && !Z(optJSONObject5, "androidCustomJSUrl").isEmpty()) {
                        this.f1130H0 = true;
                    }
                }
                if (Z(optJSONObject5, "customJSUrl") != null && !Z(optJSONObject5, "customJSUrl").isEmpty()) {
                    this.f1127G0 = true;
                }
                if (Z(optJSONObject5, "androidCustomJS") != null) {
                }
                if (Z(optJSONObject5, "androidCustomJSUrl") != null) {
                    this.f1130H0 = true;
                }
            }
            optJSONObject6 = this.f1185b.optJSONObject("permissions");
            if (optJSONObject6 != null) {
                this.f1241t1 = optJSONObject6.optBoolean("usesGeolocation", false);
                this.f1244u1 = optJSONObject6.optBoolean("androidDownloadToPublicStorage", false);
                this.f1247v1 = optJSONObject6.optBoolean("enableWebRTCBluetoothAudio", false);
                this.f1250w1 = optJSONObject6.optBoolean("enableWebRTCCamera", false);
                this.f1253x1 = optJSONObject6.optBoolean("enableWebRTCMicrophone", false);
            }
            optJSONObject7 = this.f1185b.optJSONObject("services");
            if (optJSONObject7 != null) {
                JSONObject optJSONObject22 = optJSONObject7.optJSONObject("backgroundLocation");
                if (optJSONObject22 != null) {
                    this.f1113B1 = optJSONObject22.optBoolean("active");
                    this.f1116C1 = optJSONObject22.optBoolean("foregroundOnly");
                }
                JSONObject optJSONObject23 = optJSONObject7.optJSONObject("autorefresh");
                if (optJSONObject23 != null) {
                    this.Z2 = optJSONObject23.optBoolean("active", false);
                    this.a3 = optJSONObject23.optBoolean("enabled", false);
                    this.b3 = optJSONObject23.optInt("interval", 0);
                    this.c3 = Z(optJSONObject23, "url");
                }
                JSONObject optJSONObject24 = optJSONObject7.optJSONObject("cordial");
                if (optJSONObject24 != null) {
                    this.d3 = optJSONObject24.optBoolean("active");
                    this.e3 = optJSONObject24.optString("accountKey");
                    this.f3 = optJSONObject24.optString("channelKey");
                    this.g3 = optJSONObject24.optJSONObject("pushNotifications").optBoolean("active");
                }
                JSONObject optJSONObject25 = optJSONObject7.optJSONObject("intercom");
                if (optJSONObject25 != null) {
                    this.h3 = optJSONObject25.optBoolean("active", false);
                    this.i3 = Z(optJSONObject25, "androidApiKey");
                    this.j3 = Z(optJSONObject25, "androidAppId");
                }
                JSONObject optJSONObject26 = optJSONObject7.optJSONObject("braze");
                if (optJSONObject26 != null) {
                    this.k3 = optJSONObject26.optBoolean("active", false);
                    this.l3 = optJSONObject26.optBoolean("autoRegister", false);
                    this.m3 = optJSONObject26.optString("androidApiKey");
                    this.n3 = optJSONObject26.optString("androidEndpointKey");
                    this.o3 = optJSONObject26.optString("firebaseSenderId");
                    this.p3 = optJSONObject26.optString("androidNotificationChannelName");
                    this.q3 = optJSONObject26.optString("androidNotificationDescription");
                }
                JSONObject optJSONObject27 = optJSONObject7.optJSONObject("analytics");
                if (optJSONObject27 != null && optJSONObject27.optBoolean("active", false)) {
                    this.f1259z1 = optJSONObject27.optInt("idsite_test", Integer.MIN_VALUE);
                    int optInt2 = optJSONObject27.optInt("idsite_prod", Integer.MIN_VALUE);
                    this.f1110A1 = optInt2;
                    if (this.f1259z1 != Integer.MIN_VALUE && optInt2 != Integer.MIN_VALUE) {
                        this.f1256y1 = true;
                    }
                    Log.w("co.median.median_core.AppConfig", "Analytics requires idsite_test and idsite_prod");
                    this.f1256y1 = false;
                }
                JSONObject optJSONObject28 = optJSONObject7.optJSONObject("oneSignal");
                if (optJSONObject28 != null && optJSONObject28.optBoolean("active")) {
                    String Z8 = Z(optJSONObject28, "applicationId");
                    this.f1125F1 = Z8;
                    this.f1122E1 = Z8 != null;
                    this.f1128G1 = Z(optJSONObject28, "tagsJsonUrl");
                    this.f1131H1 = optJSONObject28.optBoolean("requiresUserPrivacyConsent");
                    this.f1134I1 = optJSONObject28.optBoolean("autoRegister", true);
                    this.f1137J1 = optJSONObject28.optBoolean("showForegroundNotifications", true);
                }
                JSONObject optJSONObject29 = optJSONObject7.optJSONObject("oneSignalV5");
                if (optJSONObject29 != null) {
                    this.f1140K1 = new M0.a(optJSONObject29);
                }
                JSONObject optJSONObject30 = optJSONObject7.optJSONObject("xtremepushAndroid");
                optJSONObject30 = optJSONObject30 == null ? optJSONObject7.optJSONObject("xtremepush") : optJSONObject30;
                if (optJSONObject30 != null && optJSONObject30.optBoolean("active")) {
                    String Z9 = Z(optJSONObject30, "appKey");
                    this.f1146M1 = Z9;
                    this.f1143L1 = Z9 != null;
                    this.f1149N1 = Z(optJSONObject30, "googleProjectId");
                }
                JSONObject optJSONObject31 = optJSONObject7.optJSONObject("cleverpush");
                if (optJSONObject31 != null && optJSONObject31.optBoolean("active")) {
                    this.f1152O1 = true;
                    this.f1155P1 = Z(optJSONObject31, "channelId");
                    this.f1158Q1 = optJSONObject31.optBoolean("autoRegister", true);
                }
                JSONObject optJSONObject32 = optJSONObject7.optJSONObject("ibmpushAndroid");
                optJSONObject32 = optJSONObject32 == null ? optJSONObject7.optJSONObject("ibmpush") : optJSONObject32;
                if (optJSONObject32 != null && optJSONObject32.optBoolean("active")) {
                    this.f1161R1 = true;
                    this.f1164S1 = optJSONObject32;
                }
                JSONObject optJSONObject33 = optJSONObject7.optJSONObject("moxo");
                if (optJSONObject33 != null && optJSONObject33.optBoolean("active")) {
                    this.f1167T1 = true;
                    this.f1170U1 = Z(optJSONObject33, "moxoDomain");
                }
                JSONObject optJSONObject34 = optJSONObject7.optJSONObject("facebook");
                if (optJSONObject34 != null && optJSONObject34.optBoolean("active")) {
                    this.W1 = Z(optJSONObject34, "appId");
                    this.X1 = Z(optJSONObject34, "displayName");
                    this.f1173V1 = this.W1 != null;
                    this.Y1 = optJSONObject34.optBoolean("autoLogging");
                }
                JSONObject optJSONObject35 = optJSONObject7.optJSONObject("socialLogin");
                if (optJSONObject35 != null) {
                    JSONObject optJSONObject36 = optJSONObject35.optJSONObject("facebookLogin");
                    if (optJSONObject36 != null && optJSONObject36.optBoolean("active")) {
                        String str6 = this.W1;
                        if (str6 == null || str6.isEmpty()) {
                            this.W1 = optJSONObject36.optString("appId");
                        }
                        String str7 = this.X1;
                        if (str7 == null || str7.isEmpty()) {
                            this.X1 = optJSONObject36.optString("displayName");
                        }
                        this.Z1 = this.W1 != null;
                    }
                    JSONObject optJSONObject37 = optJSONObject35.optJSONObject("googleSignIn");
                    if (optJSONObject37 != null && optJSONObject37.optBoolean("active")) {
                        String optString4 = optJSONObject37.optString("androidClientID");
                        if (!optString4.isEmpty()) {
                            this.a2 = true;
                            this.b2 = optString4;
                        }
                    }
                }
                JSONObject optJSONObject38 = optJSONObject7.optJSONObject("adjust");
                if (optJSONObject38 != null && optJSONObject38.optBoolean("active")) {
                    this.c2 = true;
                    this.d2 = Z(optJSONObject38, "appToken");
                    this.e2 = Z(optJSONObject38, "environment");
                }
                JSONObject optJSONObject39 = optJSONObject7.optJSONObject("appsflyer");
                if (optJSONObject39 != null && optJSONObject39.optBoolean("active")) {
                    this.g2 = true;
                    String Z10 = Z(optJSONObject39, "androidDevKey");
                    this.f2 = Z10;
                    if (Z10 == null) {
                        this.f2 = Z(optJSONObject39, "devKey");
                    }
                }
                JSONObject optJSONObject40 = optJSONObject7.optJSONObject("identity");
                if (optJSONObject40 != null && optJSONObject40.optBoolean("active")) {
                    LinkedList linkedList = new LinkedList();
                    this.h2 = linkedList;
                    Object opt2 = optJSONObject40.opt("checkIdentityUrl");
                    if (opt2 != null && (opt2 instanceof String)) {
                        linkedList.add(Pattern.compile((String) opt2));
                    } else if (opt2 != null && (opt2 instanceof JSONArray)) {
                        JSONArray jSONArray2 = (JSONArray) opt2;
                        for (int i5 = 0; i5 < jSONArray2.length(); i5++) {
                            String optString5 = jSONArray2.optString(i5);
                            if (optString5 != null && !optString5.isEmpty()) {
                                linkedList.add(Pattern.compile(optString5));
                            }
                        }
                    }
                    this.i2 = Z(optJSONObject40, "identityEndpointUrl");
                }
                JSONObject optJSONObject41 = optJSONObject7.optJSONObject("registration");
                if (optJSONObject41 != null && optJSONObject41.optBoolean("active")) {
                    this.j2 = optJSONObject41.optJSONArray("endpoints");
                }
                JSONObject optJSONObject42 = optJSONObject7.optJSONObject("admob");
                if (optJSONObject42 != null && optJSONObject42.optBoolean("active") && (optJSONObject13 = optJSONObject42.optJSONObject("admobAndroid")) != null && optJSONObject13.optBoolean("active") && (Z2 = Z(optJSONObject13, "applicationId")) != null && !Z2.isEmpty()) {
                    this.l2 = true;
                    String Z11 = Z(optJSONObject13, "bannerAdUnitId");
                    this.m2 = Z11;
                    if (Z11 != null && Z11.isEmpty()) {
                        this.m2 = null;
                    }
                    String Z12 = Z(optJSONObject13, "interstitialAdUnitId");
                    this.n2 = Z12;
                    if (Z12 != null && Z12.isEmpty()) {
                        this.n2 = null;
                    }
                    this.o2 = optJSONObject13.optBoolean("showBanner", true);
                    this.p2 = optJSONObject13.optBoolean("autoConsentPrompt", this.p2);
                }
                JSONObject optJSONObject43 = optJSONObject7.optJSONObject("cardIO");
                if (optJSONObject43 != null && optJSONObject43.optBoolean("active")) {
                    this.q2 = true;
                }
                JSONObject optJSONObject44 = optJSONObject7.optJSONObject("auth");
                if (optJSONObject44 != null && optJSONObject44.optBoolean("active")) {
                    this.u2 = true;
                    Object opt3 = optJSONObject44.opt("allowedUrls");
                    if (opt3 instanceof String) {
                        this.v2.add(Pattern.compile((String) opt3));
                    } else if (opt3 instanceof JSONArray) {
                        JSONArray jSONArray3 = (JSONArray) opt3;
                        for (int i6 = 0; i6 < jSONArray3.length(); i6++) {
                            String optString6 = jSONArray3.optString(i6);
                            if (optString6 != null) {
                                this.v2.add(Pattern.compile(optString6));
                            }
                        }
                    }
                }
                JSONObject optJSONObject45 = optJSONObject7.optJSONObject("chromecast");
                if (optJSONObject45 != null && optJSONObject45.optBoolean("active")) {
                    this.r2 = true;
                    this.s2 = Z(optJSONObject45, "receiverAppId");
                }
                if (this.r2) {
                    this.t2 = new ArrayList();
                    Object opt4 = optJSONObject45.opt("showCastButtonRegex");
                    if (opt4 instanceof String) {
                        this.t2.add(Pattern.compile((String) opt4));
                    } else if (opt4 instanceof JSONArray) {
                        JSONArray jSONArray4 = (JSONArray) opt4;
                        for (int i7 = 0; i7 < jSONArray4.length(); i7++) {
                            String optString7 = jSONArray4.optString(i7);
                            if (optString7 != null) {
                                this.t2.add(Pattern.compile(optString7));
                            }
                        }
                    } else {
                        this.t2.add(Pattern.compile(".*"));
                    }
                }
                JSONObject optJSONObject46 = optJSONObject7.optJSONObject("documentScanner");
                if (optJSONObject46 != null && optJSONObject46.optBoolean("active")) {
                    this.w2 = true;
                    String Z13 = Z(optJSONObject46, "androidAnylineLicenseKey");
                    this.x2 = Z13;
                    if (Z13 == null) {
                        this.x2 = Z(optJSONObject46, "anylineLicenseKey");
                    }
                }
                JSONObject optJSONObject47 = optJSONObject7.optJSONObject("scandit");
                if (optJSONObject47 != null && optJSONObject47.optBoolean("active")) {
                    String Z14 = Z(optJSONObject47, "androidLicenseKey");
                    this.z2 = Z14;
                    if (Z14 == null) {
                        this.z2 = Z(optJSONObject47, "licenseKey");
                    }
                    if (this.z2 != null) {
                        this.y2 = true;
                    }
                }
                JSONObject optJSONObject48 = optJSONObject7.optJSONObject("barcode");
                if (optJSONObject48 != null && optJSONObject48.optBoolean("active")) {
                    this.A2 = true;
                    this.B2 = Z(optJSONObject48, "prompt");
                }
                JSONObject optJSONObject49 = optJSONObject7.optJSONObject("iap");
                if (optJSONObject49 != null && optJSONObject49.optBoolean("active") && (optJSONObject12 = optJSONObject49.optJSONObject("googleIAP")) != null) {
                    this.C2 = optJSONObject12.optBoolean("active");
                    this.D2 = Z(optJSONObject12, "productsUrl");
                    this.E2 = optJSONObject12.optBoolean("legacyMode", this.E2);
                }
                JSONObject optJSONObject50 = optJSONObject7.optJSONObject("couples");
                if (optJSONObject50 != null && optJSONObject50.optBoolean("active")) {
                    this.F2 = true;
                    String Z15 = Z(optJSONObject50, "androidLicenseKey");
                    this.G2 = Z15;
                    if (Z15 == null) {
                        this.G2 = Z(optJSONObject50, "licenseKey");
                    }
                }
                JSONObject optJSONObject51 = optJSONObject7.optJSONObject("episerver");
                if (optJSONObject51 != null && optJSONObject51.optBoolean("active")) {
                    this.H2 = true;
                    String Z16 = Z(optJSONObject51, "androidAuthToken");
                    this.I2 = Z16;
                    if (Z16 == null) {
                        this.I2 = Z(optJSONObject51, "authToken");
                    }
                }
                JSONObject optJSONObject52 = optJSONObject7.optJSONObject("rootDetect");
                if (optJSONObject52 != null && optJSONObject52.optBoolean("active")) {
                    this.J2 = true;
                }
                JSONObject optJSONObject53 = optJSONObject7.optJSONObject("twilio");
                if (optJSONObject53 != null && optJSONObject53.optBoolean("active")) {
                    this.K2 = true;
                }
                JSONObject optJSONObject54 = optJSONObject7.optJSONObject("beacon");
                if (optJSONObject54 != null && optJSONObject54.optBoolean("active")) {
                    this.L2 = true;
                    this.M2 = optJSONObject54.optString("beaconsJsonUrl");
                    this.N2 = optJSONObject54.optString("updateFrequency");
                }
                JSONObject optJSONObject55 = optJSONObject7.optJSONObject("mobilepush");
                if (optJSONObject55 != null && optJSONObject55.optBoolean("active")) {
                    this.O2 = true;
                    this.P2 = optJSONObject55.optBoolean("requiresUserPrivacyConsent");
                    this.Q2 = optJSONObject55.optString("appID");
                    this.R2 = optJSONObject55.optString("accessToken");
                    this.S2 = optJSONObject55.optString("appEndpoint");
                    this.T2 = optJSONObject55.optString("mid");
                    this.U2 = optJSONObject55.optBoolean("delayRegistrationUntilContactKeyIsSet", true);
                }
                JSONObject optJSONObject56 = optJSONObject7.optJSONObject("kaltura");
                if (optJSONObject56 != null && optJSONObject56.optBoolean("active")) {
                    this.V2 = true;
                    this.W2 = optJSONObject56.optInt("partnerId");
                    this.X2 = optJSONObject56.optString("castReceiverAppId");
                    this.Y2 = optJSONObject56.optString("serverUrl");
                }
                JSONObject optJSONObject57 = optJSONObject7.optJSONObject("localSettings");
                if (optJSONObject57 != null && optJSONObject57.optBoolean("active")) {
                    this.w3 = true;
                    this.x3 = optJSONObject57.optBoolean("androidBackup");
                }
                JSONObject optJSONObject58 = optJSONObject7.optJSONObject("firebaseAnalytics");
                if (optJSONObject58 != null && optJSONObject58.optBoolean("active")) {
                    this.A3 = true;
                }
                JSONObject optJSONObject59 = optJSONObject7.optJSONObject("opentok");
                if (optJSONObject59 != null && optJSONObject59.optBoolean("active")) {
                    this.y3 = true;
                }
                if (optJSONObject59 != null && optJSONObject59.optBoolean("blockOtherCalls")) {
                    this.z3 = true;
                }
                JSONObject optJSONObject60 = optJSONObject7.optJSONObject("enterprisePlugin");
                if (optJSONObject60 != null && optJSONObject60.optBoolean("active")) {
                    this.V3 = true;
                    JSONObject optJSONObject61 = optJSONObject60.optJSONObject("blockCopyPaste");
                    if (optJSONObject61 != null) {
                        this.W3 = optJSONObject61.optBoolean("active", false);
                    }
                    JSONObject optJSONObject62 = optJSONObject60.optJSONObject("blockScreenCapture");
                    if (optJSONObject62 != null) {
                        this.X3 = optJSONObject62.optBoolean("active", false);
                    }
                    JSONObject optJSONObject63 = optJSONObject60.optJSONObject("maskBackgroundedAppImage");
                    if (optJSONObject63 != null) {
                        this.Y3 = optJSONObject63.optBoolean("active", false);
                    }
                }
                JSONObject optJSONObject64 = optJSONObject7.optJSONObject("nfc");
                if (optJSONObject64 != null && optJSONObject64.optBoolean("active")) {
                    this.Z3 = true;
                }
                JSONObject optJSONObject65 = optJSONObject7.optJSONObject("plaid");
                if (optJSONObject65 != null && optJSONObject65.optBoolean("active")) {
                    this.a4 = true;
                }
                JSONObject optJSONObject66 = optJSONObject7.optJSONObject("geckoView");
                if (optJSONObject66 != null && optJSONObject66.optBoolean("active")) {
                    this.b4 = true;
                }
                JSONObject optJSONObject67 = optJSONObject7.optJSONObject("moengage");
                if (optJSONObject67 != null && optJSONObject67.optBoolean("active")) {
                    this.c4 = true;
                    this.d4 = optJSONObject67.optBoolean("autoRegister", true);
                    this.e4 = optJSONObject67.optString("appId", str);
                    this.f4 = optJSONObject67.optInt("dataCenter", 0);
                }
                JSONObject optJSONObject68 = optJSONObject7.optJSONObject("auth0");
                if (optJSONObject68 != null && optJSONObject68.optBoolean("active")) {
                    this.g4 = true;
                    this.h4 = optJSONObject68.optString("clientId");
                    this.i4 = optJSONObject68.optString("domain");
                    this.j4 = optJSONObject68.optString("scheme");
                }
                JSONObject optJSONObject69 = optJSONObject7.optJSONObject("sendbird");
                if (optJSONObject69 != null && optJSONObject69.optBoolean("active")) {
                    this.k4 = true;
                    this.l4 = optJSONObject69.optString("appId");
                    this.m4 = optJSONObject69.optBoolean("autoRegister", this.m4);
                }
                JSONObject optJSONObject70 = optJSONObject7.optJSONObject("firebaseCrashlytics");
                if (optJSONObject70 != null && optJSONObject70.optBoolean("active", true)) {
                    this.n4 = true;
                    this.o4 = optJSONObject70.optBoolean("webviewErrorsEnabled");
                    this.p4 = optJSONObject70.optBoolean("toastErrorsEnabled");
                    this.q4 = optJSONObject70.optBoolean("requestOptIn");
                }
                JSONObject optJSONObject71 = optJSONObject7.optJSONObject("msdynamics");
                if (optJSONObject71 != null && optJSONObject71.optBoolean("active")) {
                    this.r3 = true;
                    this.s3 = optJSONObject71.optString("organizationId");
                    this.t3 = optJSONObject71.optString("publicEndpoint");
                    this.u3 = optJSONObject71.optString("mobileAppId");
                    this.v3 = optJSONObject71.optString("apiAccessToken");
                }
                JSONObject optJSONObject72 = optJSONObject7.optJSONObject("revenueCat");
                if (optJSONObject72 != null && optJSONObject72.optBoolean("active")) {
                    this.B3 = true;
                }
                JSONObject optJSONObject73 = optJSONObject7.optJSONObject("iterable");
                if (optJSONObject73 != null && optJSONObject73.optBoolean("active")) {
                    this.r4 = true;
                    this.s4 = optJSONObject73.optString("apiKey");
                    this.t4 = optJSONObject73.optBoolean("autoRegister", this.t4);
                    this.u4 = optJSONObject73.optString("dataRegion");
                }
                JSONObject optJSONObject74 = optJSONObject7.optJSONObject("branch");
                if (optJSONObject74 != null && optJSONObject74.optBoolean("active")) {
                    this.C3 = true;
                    this.D3 = optJSONObject74.optString("liveKey");
                    this.E3 = optJSONObject74.optString("testKey");
                    this.F3 = optJSONObject74.optBoolean("enableTestMode");
                }
                JSONObject optJSONObject75 = optJSONObject7.optJSONObject("zoom");
                if (optJSONObject75 != null && optJSONObject75.optBoolean("active")) {
                    this.v4 = true;
                }
            }
            optJSONObject8 = this.f1185b.optJSONObject("performance");
            if (optJSONObject8 != null) {
                M(optJSONObject8.optJSONArray("webviewPools"));
            }
            this.G3 = this.f1185b.optBoolean("allowZoom", true);
            L2 = L("splashpage.json");
            if (L2 != null && L2.has("splashPageUrl")) {
                HashMap hashMap2 = new HashMap();
                this.f1176X = hashMap2;
                hashMap2.put("*", L2.getString("splashPageUrl"));
            }
            optJSONObject9 = this.f1185b.optJSONObject("security");
            if (optJSONObject9 != null && (optJSONObject11 = optJSONObject9.optJSONObject("network")) != null) {
                this.J3 = optJSONObject11.optString("androidConfigXML");
            }
            optJSONObject10 = this.f1185b.optJSONObject("developmentTools");
            if (optJSONObject10 != null && optJSONObject10.optBoolean("enableWebConsoleLogs")) {
                this.U3 = true;
            }
            j.a(null);
            j.a(closeable5);
        } catch (Exception e10) {
            e = e10;
            exc = e;
            closeable3 = r9;
            f.a().c("co.median.median_core.AppConfig", exc.getMessage(), exc);
            this.f1188c = exc;
            j.a(null);
            j.a(closeable3);
            B();
        } catch (Throwable th7) {
            th = th7;
            th = th;
            closeable4 = r9;
            closeable = null;
            closeable2 = closeable4;
            j.a(closeable);
            j.a(closeable2);
            throw th;
        }
        B();
    }

    private static ArrayList A(Object obj) {
        ArrayList arrayList = new ArrayList();
        if (obj instanceof String) {
            try {
                arrayList.add(Pattern.compile((String) obj));
            } catch (Exception unused) {
            }
        } else if (obj instanceof JSONArray) {
            JSONArray jSONArray = (JSONArray) obj;
            for (int i2 = 0; i2 < jSONArray.length(); i2++) {
                try {
                    Object obj2 = jSONArray.get(i2);
                    if (obj2 instanceof String) {
                        arrayList.add(Pattern.compile((String) obj2));
                    }
                } catch (Exception unused2) {
                }
            }
        }
        return arrayList;
    }

    private void B() {
        if (this.L3 && this.K3 > 0 && SystemClock.elapsedRealtime() - this.K3 < 1800000) {
            return;
        }
        if (!this.L3 && this.K3 > 0 && SystemClock.elapsedRealtime() - this.K3 < 60000) {
            return;
        }
        new c().execute(new Void[0]);
    }

    public void C(JSONArray jSONArray) {
        if (jSONArray != null) {
            ArrayList arrayList = new ArrayList();
            int i2 = 0;
            while (true) {
                String str = "internal";
                if (i2 < jSONArray.length()) {
                    JSONObject optJSONObject = jSONArray.optJSONObject(i2);
                    if (optJSONObject != null && optJSONObject.has("regex")) {
                        String Z2 = Z(optJSONObject, "regex");
                        if (Z2 == null) {
                            return;
                        }
                        if (optJSONObject.has("mode")) {
                            str = Z(optJSONObject, "mode");
                        } else if (optJSONObject.has("internal") && !optJSONObject.optBoolean("internal", true)) {
                            str = "external";
                        }
                        arrayList.add(new l.a(str, Pattern.compile(Z2)));
                    }
                    i2++;
                } else {
                    JSONObject L2 = L("splashpage.json");
                    if (L2 != null && L2.has("splashPageRegex")) {
                        try {
                            arrayList.add(0, new l.a("internal", Pattern.compile(L2.getString("splashPageRegex"))));
                        } catch (JSONException e2) {
                            e2.printStackTrace();
                        }
                    }
                    this.f1174W.f(arrayList);
                    try {
                        JSONObject jSONObject = new JSONObject();
                        jSONObject.put("rules", jSONArray);
                        E(jSONObject, "regexintext.json");
                        return;
                    } catch (JSONException e3) {
                        e3.printStackTrace();
                        return;
                    }
                }
            }
        }
    }

    private void D(JSONObject jSONObject) {
        if (jSONObject == null) {
            return;
        }
        this.f1201g0 = new HashMap();
        this.f1207i0 = new ArrayList();
        this.f1204h0 = new ArrayList();
        if (!jSONObject.optBoolean("active")) {
            return;
        }
        JSONArray optJSONArray = jSONObject.optJSONArray("actions");
        if (optJSONArray != null) {
            for (int i2 = 0; i2 < optJSONArray.length(); i2++) {
                JSONObject optJSONObject = optJSONArray.optJSONObject(i2);
                if (optJSONObject != null) {
                    String Z2 = Z(optJSONObject, "id");
                    JSONArray optJSONArray2 = optJSONObject.optJSONArray("items");
                    if (Z2 != null && optJSONArray2 != null) {
                        this.f1201g0.put(Z2, optJSONArray2);
                    }
                }
            }
        }
        JSONArray optJSONArray3 = jSONObject.optJSONArray("actionSelection");
        if (optJSONArray3 != null) {
            for (int i3 = 0; i3 < optJSONArray3.length(); i3++) {
                JSONObject optJSONObject2 = optJSONArray3.optJSONObject(i3);
                if (optJSONObject2 != null) {
                    String Z3 = Z(optJSONObject2, "regex");
                    String Z4 = Z(optJSONObject2, "id");
                    if (Z3 != null && Z4 != null) {
                        try {
                            this.f1204h0.add(Pattern.compile(Z3));
                            this.f1207i0.add(Z4);
                        } catch (PatternSyntaxException e2) {
                            Log.w("co.median.median_core.AppConfig", "Problem with actionSelection pattern. " + e2.getMessage());
                        }
                    }
                }
            }
        }
    }

    public void E(JSONObject jSONObject, String str) {
        try {
            BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(G(str)));
            bufferedWriter.write(jSONObject.toString(4));
            bufferedWriter.close();
        } catch (Exception e2) {
            f.a().c("co.median.median_core.AppConfig", "Error writing to file ".concat(str), e2);
            G(str).delete();
        }
    }

    private static boolean F(String str) {
        try {
            Class.forName(str);
            return true;
        } catch (ClassNotFoundException unused) {
            return false;
        }
    }

    public File G(String str) {
        File file = new File(this.f1182a.getFilesDir(), "gonative-config");
        file.mkdirs();
        return new File(file, str);
    }

    public HashMap H() {
        HashMap hashMap = new HashMap();
        hashMap.put("platform", "android");
        String str = this.f1203h;
        if (str != null) {
            hashMap.put("publicKey", str);
        }
        String packageName = this.f1182a.getPackageName();
        hashMap.put("appId", packageName);
        PackageManager packageManager = this.f1182a.getPackageManager();
        try {
            PackageInfo packageInfo = packageManager.getPackageInfo(this.f1182a.getPackageName(), 0);
            hashMap.put("appVersion", packageInfo.versionName);
            hashMap.put("appVersionCode", Integer.valueOf(packageInfo.versionCode));
        } catch (PackageManager.NameNotFoundException unused) {
        }
        hashMap.put("coreVersion", "2.3.8");
        hashMap.put("isDebuggable", Boolean.valueOf((this.f1182a.getApplicationInfo().flags & 2) != 0));
        String installerPackageName = packageManager.getInstallerPackageName(packageName);
        if (installerPackageName == null) {
            installerPackageName = "none";
        }
        hashMap.put("installer", installerPackageName);
        hashMap.put("language", Locale.getDefault().getLanguage());
        hashMap.put("os", "Android");
        hashMap.put("osVersion", Build.VERSION.RELEASE);
        hashMap.put("model", Build.MANUFACTURER + " " + Build.MODEL);
        hashMap.put("hardware", Build.FINGERPRINT);
        hashMap.put("timeZone", TimeZone.getDefault().getID());
        hashMap.put("initialUrl", this.f1191d);
        JSONObject optJSONObject = this.f1185b.optJSONObject("styling");
        hashMap.put("splashBackgroundColor", Z(optJSONObject, "androidSplashBackgroundColor"));
        hashMap.put("splashBackgroundColorDark", Z(optJSONObject, "androidSplashBackgroundColorDark"));
        hashMap.put("appIcon", Z(optJSONObject, Z(optJSONObject, "androidIcon") == null ? "icon" : "androidIcon"));
        hashMap.put("oneSignalEnabled", Boolean.valueOf(this.f1122E1));
        hashMap.put("isLicensed", Boolean.valueOf(this.L3));
        HashMap hashMap2 = new HashMap();
        hashMap2.put("onesignal", Boolean.valueOf(this.f1122E1));
        hashMap2.put("xtremepush", Boolean.valueOf(this.f1143L1));
        hashMap2.put("cleverpush", Boolean.valueOf(this.f1152O1));
        hashMap2.put("facebook", Boolean.valueOf(this.f1173V1));
        hashMap2.put("adjust", Boolean.valueOf(this.c2));
        hashMap2.put("admob", Boolean.valueOf(this.l2));
        hashMap2.put("cardIO", Boolean.valueOf(this.q2));
        hashMap2.put("chromecast", Boolean.valueOf(this.r2));
        hashMap2.put("auth", Boolean.valueOf(this.u2));
        hashMap2.put("documentScanner", Boolean.valueOf(this.w2));
        hashMap2.put("scandit", Boolean.valueOf(this.y2));
        hashMap2.put("googleIAP", Boolean.valueOf(this.C2));
        hashMap2.put("iap", Boolean.valueOf(this.C2));
        hashMap2.put("couples", Boolean.valueOf(this.F2));
        hashMap2.put("episerver", Boolean.valueOf(this.H2));
        hashMap2.put("rootDetect", Boolean.valueOf(this.J2));
        hashMap2.put("twilio", Boolean.valueOf(this.K2));
        hashMap2.put("beacon", Boolean.valueOf(this.L2));
        hashMap2.put("mobilepush", Boolean.valueOf(this.O2));
        hashMap2.put("kaltura", Boolean.valueOf(this.V2));
        hashMap2.put("localSettings", Boolean.valueOf(this.w3));
        hashMap2.put("firebaseAnalytics", Boolean.valueOf(this.A3));
        hashMap.put("activeServices", hashMap2);
        HashMap hashMap3 = new HashMap();
        hashMap3.put("io.gonative.android.CardScanner", Boolean.valueOf(F("io.gonative.android.CardScanner")));
        hashMap3.put("io.gonative.android.CastManager", Boolean.valueOf(F("io.gonative.android.CastManager")));
        hashMap3.put("io.gonative.android.Authentication", Boolean.valueOf(F("io.gonative.android.Authentication")));
        hashMap3.put("io.gonative.android.ScanditBarcodeScannerActivity", Boolean.valueOf(F("io.gonative.android.ScanditBarcodeScannerActivity")));
        hashMap3.put("io.gonative.android.downloadmanager.DownloadsActivity", Boolean.valueOf(F("io.gonative.android.downloadmanager.DownloadsActivity")));
        hashMap3.put("io.gonative.android.documentscanner.ScanDocumentActivity", Boolean.valueOf(F("io.gonative.android.documentscanner.ScanDocumentActivity")));
        hashMap3.put("io.gonative.android.SharingUtils", Boolean.valueOf(F("io.gonative.android.SharingUtils")));
        hashMap.put("gonativeClasses", hashMap3);
        try {
            Class<? super Object> superclass = Class.forName("io.gonative.android.LeanWebView").getSuperclass();
            if (superclass != null) {
                hashMap.put("webviewParentClass", superclass.getName());
            }
        } catch (ClassNotFoundException unused2) {
        }
        return hashMap;
    }

    private void I(Object obj) {
        if (obj == null || (obj instanceof Boolean)) {
            return;
        }
        this.f1179Y0 = new ArrayList();
        if (obj instanceof JSONArray) {
            JSONArray jSONArray = (JSONArray) obj;
            for (int i2 = 0; i2 < jSONArray.length(); i2++) {
                String optString = jSONArray.optString(i2);
                if (optString != null) {
                    try {
                        this.f1179Y0.add(Pattern.compile(optString));
                    } catch (PatternSyntaxException e2) {
                        f.a().c("co.median.median_core.AppConfig", "Problem with navigation title image regex: " + e2.getMessage(), e2);
                    }
                }
            }
        }
    }

    private void J(JSONArray jSONArray) {
        if (jSONArray == null) {
            return;
        }
        this.f1218m = new ArrayList(jSONArray.length());
        this.f1221n = new ArrayList(jSONArray.length());
        for (int i2 = 0; i2 < jSONArray.length(); i2++) {
            JSONObject optJSONObject = jSONArray.optJSONObject(i2);
            if (optJSONObject != null) {
                String Z2 = Z(optJSONObject, "regex");
                String Z3 = Z(optJSONObject, "userAgent");
                if (Z2 != null && Z3 != null) {
                    try {
                        this.f1218m.add(Pattern.compile(Z2));
                        this.f1221n.add(Z3);
                        this.H3 = true;
                    } catch (PatternSyntaxException e2) {
                        f.a().c("co.median.median_core.AppConfig", "Syntax error with user agent regex", e2);
                    }
                }
            }
        }
    }

    private void K(JSONObject jSONObject) {
        this.f1165T = null;
        this.f1162S = null;
        if (jSONObject != null && jSONObject.optBoolean("active")) {
            this.f1162S = new ArrayList();
            this.f1165T = new ArrayList();
            JSONArray optJSONArray = jSONObject.optJSONArray("levels");
            if (optJSONArray != null) {
                for (int i2 = 0; i2 < optJSONArray.length(); i2++) {
                    JSONObject optJSONObject = optJSONArray.optJSONObject(i2);
                    if (optJSONObject != null) {
                        String Z2 = Z(optJSONObject, "regex");
                        int optInt = optJSONObject.optInt("level", -1);
                        if (Z2 != null && optInt != -1) {
                            this.f1162S.add(Pattern.compile(Z2));
                            this.f1165T.add(Integer.valueOf(optInt));
                        }
                    }
                }
            }
        }
        C0565a.b(this.f1182a).d(new Intent("io.gonative.android.AppConfig.processedNavigationLevels"));
    }

    public JSONObject L(String str) {
        try {
            FileInputStream fileInputStream = new FileInputStream(G(str));
            byte[] bArr = new byte[fileInputStream.available()];
            fileInputStream.read(bArr);
            fileInputStream.close();
            return new JSONObject(new String(bArr, "UTF-8"));
        } catch (FileNotFoundException unused) {
            return null;
        } catch (Exception e2) {
            f.a().c("co.median.median_core.AppConfig", "Error reading ".concat(str), e2);
            G(str).delete();
            return null;
        }
    }

    private void M(JSONArray jSONArray) {
        if (jSONArray == null) {
            return;
        }
        this.k2 = jSONArray;
        C0565a.b(this.f1182a).d(new Intent("io.gonative.android.AppConfig.processedWebViewPools"));
    }

    private void N(JSONObject jSONObject) {
        String Z2;
        this.f1168U = null;
        if (jSONObject != null && jSONObject.optBoolean("active")) {
            this.f1168U = new ArrayList();
            JSONArray optJSONArray = jSONObject.optJSONArray("titles");
            if (optJSONArray != null) {
                for (int i2 = 0; i2 < optJSONArray.length(); i2++) {
                    JSONObject optJSONObject = optJSONArray.optJSONObject(i2);
                    if (optJSONObject != null && (Z2 = Z(optJSONObject, "regex")) != null) {
                        try {
                            HashMap hashMap = new HashMap();
                            hashMap.put("regex", Pattern.compile(Z2));
                            String Z3 = Z(optJSONObject, "title");
                            boolean optBoolean = optJSONObject.optBoolean("showImage", false);
                            if (Z3 != null) {
                                hashMap.put("title", Z3);
                            }
                            hashMap.put("showImage", Boolean.valueOf(optBoolean));
                            this.f1168U.add(hashMap);
                        } catch (PatternSyntaxException e2) {
                            f.a().c("co.median.median_core.AppConfig", e2.getMessage(), e2);
                        }
                    }
                }
            }
        }
        C0565a.b(this.f1182a).d(new Intent("io.gonative.android.AppConfig.processedNavigationTitles"));
    }

    private void O(JSONObject jSONObject) {
        if (jSONObject == null) {
            return;
        }
        this.f1189c0 = new ArrayList();
        JSONArray optJSONArray = jSONObject.optJSONArray("items");
        for (int i2 = 0; i2 < optJSONArray.length(); i2++) {
            JSONObject optJSONObject = optJSONArray.optJSONObject(i2);
            if (optJSONObject != null) {
                this.f1189c0.add(optJSONObject);
            }
        }
        C0565a.b(this.f1182a).d(new Intent("io.gonative.android.AppConfig.processedSegmentedControl"));
    }

    private void Q(JSONObject jSONObject) {
        int i2;
        String Z2;
        String str;
        if (jSONObject == null) {
            return;
        }
        this.f1138K = new HashMap();
        this.f1156Q = new ArrayList();
        this.f1159R = new ArrayList();
        JSONArray optJSONArray = jSONObject.optJSONArray("menus");
        if (optJSONArray != null) {
            i2 = 0;
            for (int i3 = 0; i3 < optJSONArray.length(); i3++) {
                JSONObject optJSONObject = optJSONArray.optJSONObject(i3);
                if (optJSONObject != null && optJSONObject.optBoolean("active", false)) {
                    i2++;
                    String Z3 = Z(optJSONObject, "name");
                    JSONArray optJSONArray2 = optJSONObject.optJSONArray("items");
                    if (Z3 != null && optJSONArray2 != null) {
                        this.f1138K.put(Z3, optJSONArray2);
                        if (Z3.equals("default")) {
                            this.f1141L = true;
                        }
                    }
                }
            }
        } else {
            i2 = 0;
        }
        C0565a.b(this.f1182a).d(new Intent("io.gonative.android.AppConfig.processedMenu"));
        this.f1150O = Z(jSONObject, "userIdRegex");
        JSONObject optJSONObject2 = jSONObject.optJSONObject("menuSelectionConfig");
        if ((i2 > 1 || this.f1232q1) && optJSONObject2 != null) {
            this.f1153P = Z(optJSONObject2, "testURL");
            JSONArray optJSONArray3 = optJSONObject2.optJSONArray("redirectLocations");
            if (optJSONArray3 != null) {
                for (int i4 = 0; i4 < optJSONArray3.length(); i4++) {
                    JSONObject optJSONObject3 = optJSONArray3.optJSONObject(i4);
                    if (optJSONObject3 != null && (Z2 = Z(optJSONObject3, "regex")) != null) {
                        this.f1156Q.add(Pattern.compile(Z2));
                        this.f1159R.add(optJSONObject3);
                    }
                }
            }
        }
        this.f1144M = new ArrayList();
        this.f1147N = new ArrayList();
        Object opt = jSONObject.opt("sidebarEnabledRegex");
        if (opt != null) {
            if (opt instanceof String) {
                try {
                    this.f1144M.add(Pattern.compile((String) opt));
                    this.f1147N.add(Boolean.TRUE);
                    return;
                } catch (PatternSyntaxException e2) {
                    f.a().c("co.median.median_core.AppConfig", "Invalid regex for sidebarEnabledRegex", e2);
                    return;
                }
            }
            if (opt instanceof JSONArray) {
                JSONArray jSONArray = (JSONArray) opt;
                for (int i5 = 0; i5 < jSONArray.length(); i5++) {
                    Object opt2 = jSONArray.opt(i5);
                    if (opt2 != null) {
                        Boolean bool = Boolean.TRUE;
                        if (opt2 instanceof String) {
                            str = (String) opt2;
                        } else if (opt2 instanceof JSONObject) {
                            JSONObject jSONObject2 = (JSONObject) opt2;
                            String Z4 = Z(jSONObject2, "regex");
                            bool = Boolean.valueOf(jSONObject2.optBoolean("value", true));
                            str = Z4;
                        } else {
                            str = null;
                        }
                        if (str != null) {
                            try {
                                this.f1144M.add(Pattern.compile(str));
                                this.f1147N.add(bool);
                            } catch (PatternSyntaxException e3) {
                                f.a().c("co.median.median_core.AppConfig", "Invalid regex in sidebarEnabledRegex", e3);
                            }
                        }
                    }
                }
            }
        }
    }

    private void R(JSONObject jSONObject) {
        if (jSONObject == null) {
            return;
        }
        this.f1192d0 = new HashMap();
        this.f1198f0 = new ArrayList();
        this.f1195e0 = new ArrayList();
        if (!jSONObject.optBoolean("active")) {
            return;
        }
        JSONArray optJSONArray = jSONObject.optJSONArray("tabMenus");
        if (optJSONArray != null) {
            for (int i2 = 0; i2 < optJSONArray.length(); i2++) {
                JSONObject optJSONObject = optJSONArray.optJSONObject(i2);
                if (optJSONObject != null) {
                    String Z2 = Z(optJSONObject, "id");
                    JSONArray optJSONArray2 = optJSONObject.optJSONArray("items");
                    if (Z2 != null && optJSONArray2 != null) {
                        this.f1192d0.put(Z2, optJSONArray2);
                    }
                }
            }
        }
        JSONArray optJSONArray3 = jSONObject.optJSONArray("tabSelectionConfig");
        if (optJSONArray3 != null) {
            for (int i3 = 0; i3 < optJSONArray3.length(); i3++) {
                JSONObject optJSONObject2 = optJSONArray3.optJSONObject(i3);
                if (optJSONObject2 != null) {
                    String Z3 = Z(optJSONObject2, "regex");
                    String Z4 = Z(optJSONObject2, "id");
                    if (Z3 != null && Z4 != null) {
                        try {
                            this.f1195e0.add(Pattern.compile(Z3));
                            this.f1198f0.add(Z4);
                        } catch (PatternSyntaxException e2) {
                            Log.w("co.median.median_core.AppConfig", "Problem with tabSelectionConfig pattern. " + e2.getMessage());
                        }
                    }
                }
            }
        }
        C0565a.b(this.f1182a).d(new Intent("io.gonative.android.AppConfig.processedTabNavigation"));
    }

    public static synchronized a U(Context context) {
        a aVar;
        synchronized (a.class) {
            try {
                if (w4 == null) {
                    w4 = new a(context.getApplicationContext());
                }
                aVar = w4;
            } catch (Throwable th) {
                throw th;
            }
        }
        return aVar;
    }

    public static String Z(JSONObject jSONObject, String str) {
        if (jSONObject.isNull(str)) {
            return null;
        }
        return jSONObject.optString(str, null);
    }

    public void P() {
        G("regexintext.json").delete();
    }

    public File S() {
        return new File(this.f1182a.getFilesDir(), "appConfig.json");
    }

    public String T() {
        JSONObject L2;
        if (!this.O3 && (L2 = L("splashpage.json")) != null && L2.has("splashPageUrl")) {
            this.O3 = true;
            Timer timer = new Timer();
            timer.schedule(new b(timer), 2000L);
        }
        return this.f1191d;
    }

    public HashMap V(String str) {
        ArrayList arrayList;
        if (str != null && (arrayList = this.f1168U) != null) {
            Iterator it = arrayList.iterator();
            while (it.hasNext()) {
                HashMap hashMap = (HashMap) it.next();
                Pattern pattern = (Pattern) hashMap.get("regex");
                if (pattern == null) {
                    return null;
                }
                if (pattern.matcher(str).matches()) {
                    return hashMap;
                }
            }
        }
        return null;
    }

    public HashMap W() {
        return this.f1176X;
    }

    public JSONObject X() {
        try {
            return new JSONObject(this.f1138K);
        } catch (Exception unused) {
            return null;
        }
    }

    public boolean Y() {
        return this.L3;
    }

    public void a0(String str, boolean z2) {
        if (str != null && str.length() != 0) {
            if (!str.contains("://")) {
                str = "http://".concat(str);
            }
            this.f1191d = str;
            if (z2) {
                try {
                    JSONObject jSONObject = new JSONObject();
                    jSONObject.put("initialUrl", this.f1191d);
                    E(jSONObject, "initurl.json");
                } catch (JSONException e2) {
                    e2.printStackTrace();
                }
            }
        }
    }

    public void b0(boolean z2, int i2, boolean z3, boolean z4) {
        this.f1129H = z2;
        this.f1132I = i2;
        this.f1135J = z3;
        if (z4) {
            try {
                JSONObject jSONObject = new JSONObject();
                jSONObject.put("enabled", z2);
                jSONObject.put("numWindows", i2);
                jSONObject.put("autoClose", z3);
                E(jSONObject, "maxwindows.json");
            } catch (JSONException e2) {
                e2.printStackTrace();
            }
        }
    }

    public void c0(JSONObject jSONObject, boolean z2) {
        if (jSONObject != null) {
            K(jSONObject);
            if (z2) {
                E(jSONObject, "navlevels.json");
                return;
            }
            return;
        }
        JSONObject optJSONObject = this.f1185b.optJSONObject("navigation");
        JSONObject optJSONObject2 = optJSONObject.optJSONObject("androidNaviationLevels");
        if (optJSONObject2 == null) {
            optJSONObject2 = optJSONObject.optJSONObject("navigationLevels");
        }
        K(optJSONObject2);
        if (z2) {
            G("navlevels.json").delete();
        }
    }

    public void d0(JSONObject jSONObject, boolean z2) {
        JSONObject jSONObject2;
        if (jSONObject != null) {
            N(jSONObject);
            if (z2) {
                E(jSONObject, "navtitles.json");
                return;
            }
            return;
        }
        JSONObject optJSONObject = this.f1185b.optJSONObject("navigation");
        if (optJSONObject != null) {
            jSONObject2 = optJSONObject.optJSONObject("navigationTitles");
        } else {
            jSONObject2 = null;
        }
        N(jSONObject2);
        if (z2) {
            G("navtitles.json").delete();
        }
    }

    public void e0(JSONArray jSONArray) {
        JSONObject optJSONObject;
        if (!this.L3) {
            return;
        }
        if (jSONArray == null || jSONArray.length() == 0) {
            JSONObject optJSONObject2 = this.f1185b.optJSONObject("navigation");
            if (optJSONObject2 != null && optJSONObject2.has("regexInternalExternal") && (optJSONObject = optJSONObject2.optJSONObject("regexInternalExternal")) != null && optJSONObject.has("rules")) {
                jSONArray = optJSONObject.optJSONArray("rules");
            } else {
                return;
            }
        }
        C(jSONArray);
    }

    public void f0(Object obj) {
        if (obj == null) {
            return;
        }
        if (obj instanceof Boolean) {
            this.f1141L = ((Boolean) obj).booleanValue();
        } else if (obj instanceof JSONArray) {
            ArrayList arrayList = new ArrayList(Arrays.asList("default", "loggedIn"));
            if (this.f1159R != null) {
                for (int i2 = 0; i2 < this.f1159R.size(); i2++) {
                    String Z2 = Z((JSONObject) this.f1159R.get(i2), "status");
                    if (Z2 != null) {
                        arrayList.add(Z2);
                    }
                }
            }
            this.f1138K = new HashMap();
            for (int i3 = 0; i3 < arrayList.size(); i3++) {
                this.f1138K.put((String) arrayList.get(i3), (JSONArray) obj);
            }
        }
        C0565a.b(this.f1182a).d(new Intent("io.gonative.android.AppConfig.processedMenu"));
    }

    public void g0(Object obj, boolean z2, boolean z3) {
        try {
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("items", obj);
            jSONObject.put("name", "default");
            jSONObject.put("active", z2);
            JSONArray jSONArray = new JSONArray();
            jSONArray.put(jSONObject);
            JSONObject jSONObject2 = new JSONObject();
            jSONObject2.put("menus", jSONArray);
            if (z3) {
                E(jSONObject2, "sidebarnav.json");
            }
        } catch (JSONException e2) {
            e2.printStackTrace();
        }
        f0(obj);
    }

    public boolean h0(String str) {
        ArrayList arrayList;
        ArrayList arrayList2;
        B();
        if (str != null && (arrayList2 = this.f1168U) != null) {
            Iterator it = arrayList2.iterator();
            while (true) {
                if (!it.hasNext()) {
                    break;
                }
                HashMap hashMap = (HashMap) it.next();
                if (((Pattern) hashMap.get("regex")).matcher(str).matches()) {
                    if (hashMap.containsKey("showImage") && hashMap.get("showImage") != null && ((Boolean) hashMap.get("showImage")).booleanValue()) {
                        return true;
                    }
                }
            }
        }
        if (str != null && (arrayList = this.f1179Y0) != null) {
            Iterator it2 = arrayList.iterator();
            while (it2.hasNext()) {
                if (((Pattern) it2.next()).matcher(str).matches()) {
                    return true;
                }
            }
            return false;
        }
        return this.f1160R0;
    }

    public boolean i0(String str) {
        List list = this.f1144M;
        if (list != null && !list.isEmpty()) {
            if (str == null) {
                str = "";
            }
            for (int i2 = 0; i2 < this.f1144M.size(); i2++) {
                if (((Pattern) this.f1144M.get(i2)).matcher(str).matches()) {
                    return ((Boolean) this.f1147N.get(i2)).booleanValue();
                }
            }
            return false;
        }
        return true;
    }

    public String j0(String str) {
        if (str == null) {
            str = "";
        }
        if (this.f1218m != null) {
            for (int i2 = 0; i2 < this.f1218m.size(); i2++) {
                if (((Pattern) this.f1218m.get(i2)).matcher(str).matches()) {
                    return (String) this.f1221n.get(i2);
                }
            }
        }
        return this.f1212k;
    }
}