Anybuypro - Free followers v1.0.0版本的 MD5 值为:ac97504c3229ff11289cc66f3291d928

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


package t0;

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.webkit.WebView;
import android.widget.Toast;
import java.io.BufferedInputStream;
import java.io.BufferedWriter;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.InputStream;
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;
public class a {
    private static a a4;
    public double A;
    public Integer A0;
    public boolean A1;
    public String A2;
    private HashMap<String, JSONArray> A3;
    public d B;
    public Integer B0;
    public String B1;
    public boolean B2;
    private HashMap<String, JSONArray> B3;
    public boolean C;
    public String C0;
    public String C1;
    public String C2;
    private boolean C3;
    public boolean D;
    public String D0;
    public boolean D1;
    public boolean D2;
    public boolean D3;
    public boolean E;
    public String E0;
    public boolean E1;
    public boolean E2;
    public boolean E3;
    public boolean F;
    public String F0;
    public boolean F1;
    public boolean F2;
    public boolean F3;
    public int G;
    public double G0;
    public boolean G1;
    public boolean G2;
    public boolean G3;
    public boolean H;
    public boolean H0;
    public String H1;
    public boolean H2;
    public boolean H3;
    public HashMap<String, JSONArray> I;
    public String I0;
    public String I1;
    public String I2;
    public boolean I3;
    public boolean J;
    public Integer J0;
    public boolean J1;
    public String J2;
    public boolean J3;
    public List<Pattern> K;
    public Integer K0;
    public String K1;
    public String K2;
    public boolean K3;
    public List<Boolean> L;
    public boolean L0;
    public boolean L1;
    public String L2;
    public boolean L3;
    public String M;
    public double M0;
    public boolean M1;
    public boolean M2;
    public boolean M3;
    public String N;
    public String N0;
    public JSONObject N1;
    public boolean N2;
    public String N3;
    public ArrayList<Pattern> O;
    public boolean O0;
    public boolean O1;
    public int O2;
    public int O3;
    public ArrayList<JSONObject> P;
    public boolean P0;
    public String P1;
    public String P2;
    public boolean P3;
    public ArrayList<Pattern> Q;
    public boolean Q0;
    public boolean Q1;
    public String Q2;
    public String Q3;
    public ArrayList<Integer> R;
    public boolean R0;
    public String R1;
    public boolean R2;
    public String R3;
    public ArrayList<HashMap<String, Object>> S;
    public boolean S0;
    public String S1;
    public boolean S2;
    public String S3;
    public String T;
    public boolean T0;
    public boolean T1;
    public int T2;
    public boolean T3;
    public ArrayList<Pattern> U;
    public String U0;
    public boolean U1;
    public String U2;
    public String U3;
    public ArrayList<Boolean> V;
    public ArrayList<Pattern> V0;
    public boolean V1;
    public boolean V2;
    public boolean V3;
    private HashMap<String, String> W;
    public float W0;
    public String W1;
    public String W2;
    public boolean W3;
    public boolean X;
    public Integer X0;
    public boolean X1;
    public String X2;
    public boolean X3;
    public boolean Y;
    public Integer Y0;
    public String Y1;
    public boolean Y2;
    public boolean Y3;
    public boolean Z;
    public Integer Z0;
    public String Z1;
    public boolean Z2;
    public boolean Z3;
    private Context f6773a;
    public boolean f6774a0;
    public Integer f6775a1;
    public String f6776a2;
    public String a3;
    private JSONObject f6777b;
    public ArrayList<JSONObject> f6778b0;
    public Integer f6779b1;
    public boolean f6780b2;
    public String b3;
    public Exception f6781c;
    public HashMap<String, JSONArray> f6782c0;
    public Integer f6783c1;
    public List<Pattern> f6784c2;
    public boolean c3;
    private String f6785d;
    public ArrayList<Pattern> f6786d0;
    public Integer f6787d1;
    public String f6788d2;
    public boolean d3;
    public String f6789e;
    public ArrayList<String> f6790e0;
    public Integer f6791e1;
    public JSONArray f6792e2;
    public String e3;
    public String f6793f;
    public HashMap<String, JSONArray> f6794f0;
    public boolean f6795f1;
    public JSONArray f6796f2;
    public String f3;
    public String f6797g;
    public ArrayList<Pattern> f6798g0;
    public double f6799g1;
    public boolean f6800g2;
    public String g3;
    public String f6801h;
    public ArrayList<String> f6802h0;
    public double f6803h1;
    public String f6804h2;
    public String h3;
    private String f6805i;
    public ArrayList<Pattern> f6806i0;
    public boolean f6807i1;
    public String f6808i2;
    public String i3;
    private String f6809j;
    public Integer f6810j0;
    public int f6811j1;
    public boolean f6812j2;
    public boolean j3;
    public String f6813k;
    public Integer f6814k0;
    public String f6815k1;
    public boolean f6816k2;
    public boolean k3;
    public int f6817l;
    public Integer f6818l0;
    public String f6819l1;
    public boolean f6820l2;
    public boolean l3;
    public ArrayList<Pattern> f6821m;
    public Integer f6822m0;
    public JSONObject f6823m1;
    public String f6824m2;
    public boolean m3;
    public ArrayList<String> f6825n;
    public Integer f6826n0;
    public boolean f6827n1;
    public ArrayList<Pattern> f6828n2;
    public boolean n3;
    public boolean f6829o;
    public Integer f6830o0;
    public String f6831o1;
    public boolean f6832o2;
    public boolean o3;
    public boolean f6833p;
    public Integer f6834p0;
    public JSONObject f6835p1;
    public boolean p3;
    public boolean f6837q;
    public Integer f6838q0;
    public boolean f6839q1;
    public boolean f6840q2;
    public String q3;
    public boolean f6841r;
    public Integer f6842r0;
    public boolean f6843r1;
    public String f6844r2;
    public String r3;
    public boolean f6845s;
    public Integer f6846s0;
    public boolean f6847s1;
    public boolean s2;
    public EnumC0086a f6848t;
    public Integer f6849t0;
    public boolean f6850t1;
    public String t2;
    public EnumC0086a f6851u;
    public Integer f6852u0;
    public boolean f6853u1;
    public boolean u2;
    public EnumC0086a f6854v;
    public Integer f6855v0;
    public boolean f6856v1;
    public String v2;
    public boolean f6857w;
    public Integer f6858w0;
    public int f6859w1;
    public boolean w2;
    public boolean f6860x;
    public Integer f6861x0;
    public int f6862x1;
    public String x2;
    private HashMap<String, String> x3;
    public Map<String, String> f6863y;
    public Integer f6864y0;
    public boolean f6865y1;
    public boolean y2;
    private ArrayList<Pattern> y3;
    public List<Pattern> f6866z;
    public Integer f6867z0;
    public boolean f6868z1;
    public boolean z2;
    private ArrayList<Boolean> z3;
    public ArrayList<Pattern> f6836p2 = new ArrayList<>();
    private long s3 = 0;
    private boolean t3 = true;
    private boolean u3 = true;
    private boolean v3 = true;
    private boolean w3 = false;

    public enum EnumC0086a {
        UNSPECIFIED,
        PORTRAIT,
        LANDSCAPE
    }

    public final class b extends TimerTask {
        final Timer f6873d;

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

        @Override
        public final void run() {
            a aVar = a.this;
            aVar.W = aVar.x3;
            this.f6873d.cancel();
        }
    }

    public class c extends AsyncTask<Void, Void, JSONObject> {
        private c() {
        }

        c(a aVar, int i3) {
            this();
        }

        @Override
        protected final JSONObject doInBackground(Void[] voidArr) {
            a.this.s3 = SystemClock.elapsedRealtime();
            try {
                JSONObject jSONObject = new JSONObject(a.T(a.this));
                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 i3 = 0; i3 < 40; i3++) {
                    bArr3[i3] = (byte) (bArr[i3] ^ bArr2[i3]);
                }
                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) {
                    ByteArrayOutputStream byteArrayOutputStream = httpURLConnection.getContentLength() > 0 ? new ByteArrayOutputStream(httpURLConnection.getContentLength()) : new ByteArrayOutputStream();
                    BufferedInputStream bufferedInputStream = new BufferedInputStream(httpURLConnection.getInputStream());
                    k.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(JSONObject jSONObject) {
            JSONObject x2;
            JSONObject x3;
            JSONObject jSONObject2 = jSONObject;
            if (jSONObject2 == null) {
                return;
            }
            boolean optBoolean = jSONObject2.optBoolean("isLicensed", true);
            if (optBoolean && (x3 = a.this.x("splashpage.json")) != null && x3.has("splashPageUrl")) {
                a aVar = a.this;
                aVar.W = aVar.x3;
                a.V(a.this);
            }
            boolean optBoolean2 = jSONObject2.optBoolean("isLicensedForPush", true);
            a.this.v3 = jSONObject2.optBoolean("isPublished", false);
            String Z = a.Z(jSONObject2, "alert");
            if (Z != null && !Z.isEmpty() && (optBoolean || !a.this.v3 || (x2 = a.this.x("splashpage.json")) == null || !x2.has("splashPageUrl"))) {
                Toast.makeText(a.this.f6773a, Z, 1).show();
            }
            if (!optBoolean) {
                optBoolean2 = false;
            }
            if (!optBoolean && a.this.t3) {
                a.this.t3 = false;
                if (a.this.v3) {
                    JSONObject optJSONObject = jSONObject2.optJSONObject("splashPageConfig");
                    if (optJSONObject != null) {
                        String Z2 = a.Z(optJSONObject, "splashPageUrl");
                        String Z3 = a.Z(optJSONObject, "splashPageRegex");
                        if (Z2 != null && !Z2.isEmpty() && Z3 != null && !Z3.isEmpty()) {
                            try {
                                JSONObject jSONObject3 = new JSONObject();
                                jSONObject3.put("splashPageUrl", Z2);
                                jSONObject3.put("splashPageRegex", Z3);
                                a.this.f(jSONObject3, "splashpage.json");
                            } catch (JSONException e3) {
                                e3.printStackTrace();
                            }
                        }
                    }
                } else {
                    a.V(a.this);
                    String c3 = m.c(jSONObject2, "unlicensedUrl");
                    if (c3 == null) {
                        c3 = "https://gonative.io/unlicensed";
                    }
                    String c4 = m.c(jSONObject2, "unlicensedLabel");
                    if (c4 == null) {
                        c4 = "Disabled";
                    }
                    a aVar2 = a.this;
                    aVar2.f6789e = aVar2.f6785d;
                    a.this.f6785d = c3;
                    if (jSONObject2.optBoolean("disableRedirects")) {
                        a.this.W = null;
                    } else {
                        a.this.W = new HashMap();
                        a.this.W.put("*", c3);
                    }
                    a aVar3 = a.this;
                    aVar3.y3 = aVar3.U;
                    a aVar4 = a.this;
                    aVar4.z3 = aVar4.V;
                    a.this.U = new ArrayList<>();
                    a.this.V = new ArrayList<>();
                    JSONArray optJSONArray = jSONObject2.optJSONArray("regexInternalExternalRules");
                    if (optJSONArray != null) {
                        a.this.d(optJSONArray);
                    } else {
                        a.this.U.add(Pattern.compile(".*"));
                        a.this.V.add(Boolean.TRUE);
                    }
                    a.this.A3 = new HashMap(a.this.I);
                    for (String str : a.this.I.keySet()) {
                        try {
                            JSONObject jSONObject4 = new JSONObject();
                            jSONObject4.put("url", c3);
                            jSONObject4.put("label", c4);
                            JSONArray jSONArray = new JSONArray();
                            jSONArray.put(jSONObject4);
                            a.this.I.put(str, jSONArray);
                        } catch (JSONException unused) {
                        }
                    }
                    a.this.B3 = new HashMap(a.this.f6782c0);
                    for (String str2 : a.this.f6782c0.keySet()) {
                        try {
                            JSONObject jSONObject5 = new JSONObject();
                            jSONObject5.put("url", c3);
                            jSONObject5.put("label", c4);
                            jSONObject5.put("icon", "fa-ban");
                            JSONArray jSONArray2 = new JSONArray();
                            jSONArray2.put(jSONObject5);
                            a.this.f6782c0.put(str2, jSONArray2);
                        } catch (JSONException unused2) {
                        }
                    }
                    g0.a.b(a.this.f6773a).d(new Intent("io.gonative.android.AppConfig.processedMenu"));
                    g0.a.b(a.this.f6773a).d(new Intent("io.gonative.android.AppConfig.processedTabNavigation"));
                }
            }
            if (!optBoolean2 && a.this.u3) {
                a.this.u3 = false;
                a aVar5 = a.this;
                aVar5.C3 = aVar5.A1;
                a.this.A1 = false;
            }
            if (optBoolean && !a.this.t3) {
                a.this.t3 = true;
                a aVar6 = a.this;
                aVar6.f6785d = aVar6.f6789e;
                a aVar7 = a.this;
                aVar7.W = aVar7.x3;
                a aVar8 = a.this;
                aVar8.U = aVar8.y3;
                a aVar9 = a.this;
                aVar9.V = aVar9.z3;
                a aVar10 = a.this;
                aVar10.I = aVar10.A3;
                a aVar11 = a.this;
                aVar11.f6782c0 = aVar11.B3;
                g0.a.b(a.this.f6773a).d(new Intent("io.gonative.android.AppConfig.processedMenu"));
                g0.a.b(a.this.f6773a).d(new Intent("io.gonative.android.AppConfig.processedTabNavigation"));
            }
            if (!optBoolean2 || a.this.u3) {
                return;
            }
            a.this.u3 = true;
            a aVar12 = a.this;
            aVar12.A1 = aVar12.C3;
        }
    }

    private a(Context context) {
        Throwable th;
        Exception exc;
        InputStream inputStream;
        Exception exc2;
        BufferedInputStream bufferedInputStream;
        JSONObject optJSONObject;
        JSONObject optJSONObject2;
        JSONObject optJSONObject3;
        String Z;
        String Z2;
        double optDouble;
        Integer d3;
        JSONObject optJSONObject4;
        JSONObject optJSONObject5;
        JSONObject optJSONObject6;
        JSONObject optJSONObject7;
        JSONObject x2;
        JSONObject optJSONObject8;
        JSONObject optJSONObject9;
        JSONObject optJSONObject10;
        JSONObject optJSONObject11;
        JSONObject optJSONObject12;
        String Z3;
        boolean optBoolean;
        JSONObject x3;
        JSONArray optJSONArray;
        JSONArray optJSONArray2;
        JSONArray optJSONArray3;
        Object opt;
        String optString;
        String Z4;
        EnumC0086a enumC0086a;
        String optString2;
        EnumC0086a enumC0086a2;
        EnumC0086a enumC0086a3;
        this.f6837q = true;
        this.A = 10.0d;
        this.B = d.DEFAULT;
        this.L0 = true;
        this.f6839q1 = false;
        this.f6843r1 = false;
        this.f6847s1 = false;
        this.f6850t1 = false;
        this.f6853u1 = false;
        this.f6856v1 = false;
        this.f6859w1 = Integer.MIN_VALUE;
        this.f6862x1 = Integer.MIN_VALUE;
        this.A1 = false;
        this.D1 = false;
        this.E1 = true;
        this.F1 = true;
        this.G1 = false;
        this.J1 = false;
        this.L1 = true;
        this.M1 = false;
        this.O1 = false;
        this.Q1 = false;
        this.T1 = false;
        this.V1 = false;
        this.X1 = false;
        this.f6780b2 = false;
        this.f6800g2 = false;
        this.f6812j2 = true;
        this.f6816k2 = false;
        this.f6820l2 = false;
        this.f6828n2 = new ArrayList<>();
        this.f6832o2 = false;
        this.f6840q2 = false;
        this.f6844r2 = null;
        this.s2 = false;
        this.t2 = null;
        this.u2 = false;
        this.w2 = false;
        this.x2 = null;
        this.y2 = true;
        this.z2 = false;
        this.A2 = null;
        this.B2 = false;
        this.C2 = null;
        this.D2 = false;
        this.E2 = false;
        this.F2 = false;
        this.G2 = false;
        this.H2 = false;
        this.I2 = null;
        this.J2 = null;
        this.K2 = null;
        this.L2 = null;
        this.M2 = true;
        this.N2 = false;
        this.R2 = false;
        this.S2 = false;
        this.T2 = 0;
        this.V2 = false;
        this.Y2 = false;
        this.Z2 = false;
        this.c3 = false;
        this.j3 = false;
        this.k3 = false;
        this.l3 = false;
        this.m3 = false;
        this.n3 = false;
        this.o3 = true;
        this.p3 = false;
        ?? r9 = 0;
        this.D3 = false;
        this.E3 = false;
        this.F3 = false;
        this.G3 = false;
        this.H3 = false;
        this.I3 = false;
        this.J3 = false;
        this.K3 = false;
        this.L3 = false;
        this.P3 = false;
        this.T3 = false;
        this.V3 = true;
        this.W3 = false;
        this.X3 = false;
        this.Y3 = false;
        this.Z3 = false;
        this.f6773a = context;
        try {
        } catch (Throwable th2) {
            th = th2;
        }
        try {
            try {
                if (J().exists()) {
                    try {
                        bufferedInputStream = new BufferedInputStream(new FileInputStream(J()));
                    } catch (Exception e3) {
                        exc2 = e3;
                        bufferedInputStream = null;
                    }
                    try {
                        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                        k.b(bufferedInputStream, byteArrayOutputStream);
                        byteArrayOutputStream.close();
                        this.f6777b = new JSONObject(byteArrayOutputStream.toString("UTF-8"));
                    } catch (Exception e4) {
                        exc2 = e4;
                        g.a().c("co.median.median_core.AppConfig", exc2.getMessage(), exc2);
                        k.a(bufferedInputStream);
                        if (this.f6777b != null) {
                        }
                        this.U = new ArrayList<>();
                        this.V = new ArrayList<>();
                        optJSONObject = this.f6777b.optJSONObject("general");
                        if (optJSONObject != null) {
                        }
                        optJSONObject2 = this.f6777b.optJSONObject("forms");
                        if (optJSONObject2 != null) {
                        }
                        optJSONObject3 = this.f6777b.optJSONObject("navigation");
                        if (optJSONObject3 != null) {
                        }
                        JSONObject optJSONObject13 = this.f6777b.optJSONObject("styling");
                        Z = Z(optJSONObject13, "customCSS");
                        this.C0 = Z;
                        if (Z != null) {
                            this.p3 = true;
                        }
                        Z2 = Z(optJSONObject13, "androidCustomCSS");
                        this.D0 = Z2;
                        if (Z2 != null) {
                            this.p3 = true;
                        }
                        optDouble = optJSONObject13.optDouble("forceViewportWidth", Double.NaN);
                        this.G0 = optDouble;
                        if (!Double.isNaN(optDouble)) {
                        }
                        this.H0 = optJSONObject13.optBoolean("zoomableForceViewport", false);
                        this.L0 = optJSONObject13.optBoolean("showActionBar", true);
                        this.I0 = Z(optJSONObject13, "androidTheme");
                        this.f6810j0 = m.d(Z(optJSONObject13, "androidActionBarBackgroundColor"));
                        this.f6814k0 = m.d(Z(optJSONObject13, "androidActionBarBackgroundColorDark"));
                        this.f6818l0 = m.d(Z(optJSONObject13, "androidSidebarBackgroundColor"));
                        this.f6822m0 = m.d(Z(optJSONObject13, "androidSidebarBackgroundColorDark"));
                        this.f6826n0 = m.d(Z(optJSONObject13, "androidSidebarForegroundColor"));
                        this.f6830o0 = m.d(Z(optJSONObject13, "androidSidebarForegroundColorDark"));
                        this.f6834p0 = m.d(Z(optJSONObject13, "androidSidebarHighlightColor"));
                        this.f6838q0 = m.d(Z(optJSONObject13, "androidSidebarHighlightColorDark"));
                        this.f6842r0 = m.d(Z(optJSONObject13, "androidTintColor"));
                        this.f6852u0 = m.d(Z(optJSONObject13, "androidTabBarBackgroundColor"));
                        this.f6855v0 = m.d(Z(optJSONObject13, "androidTabBarBackgroundColorDark"));
                        this.f6846s0 = m.d(Z(optJSONObject13, "androidTabBarTextColor"));
                        this.f6849t0 = m.d(Z(optJSONObject13, "androidTabBarTextColorDark"));
                        this.f6858w0 = m.d(Z(optJSONObject13, "androidTabBarIndicatorColor"));
                        this.f6861x0 = m.d(Z(optJSONObject13, "androidTabBarIndicatorColorDark"));
                        this.f6864y0 = m.d(Z(optJSONObject13, "androidTabPressedBackgroundColor"));
                        this.f6867z0 = m.d(Z(optJSONObject13, "androidTabPressedBackgroundColorDark"));
                        this.M0 = optJSONObject13.optDouble("transitionInteractiveDelayMax", Double.NaN);
                        boolean optBoolean2 = optJSONObject13.optBoolean("androidHideTitleInActionBar", false);
                        this.O0 = optBoolean2;
                        this.P0 = optJSONObject13.optBoolean("androidShowLogoInActionBar", optBoolean2);
                        this.Q0 = optJSONObject13.optBoolean("androidShowLogoInSideBar", true);
                        this.R0 = optJSONObject13.optBoolean("androidShowAppNameInSideBar", true);
                        this.T0 = optJSONObject13.optBoolean("androidEnableOverlayInStatusBar", false);
                        this.U0 = Z(optJSONObject13, "androidStatusBarStyle");
                        d3 = m.d(Z(optJSONObject13, "androidActionBarForegroundColor"));
                        this.J0 = d3;
                        if (d3 == null) {
                        }
                        this.K0 = m.d(Z(optJSONObject13, "androidActionBarForegroundColorDark"));
                        q(optJSONObject13.opt("navigationTitleImage"));
                        this.W0 = (float) optJSONObject13.optDouble("hideWebviewAlpha", 0.0d);
                        this.X0 = m.d(Z(optJSONObject13, "androidPullToRefreshColor"));
                        this.Y0 = m.d(Z(optJSONObject13, "androidPullToRefreshColorDark"));
                        this.Z0 = m.d(Z(optJSONObject13, "androidSwipeNavigationBackgroundColor"));
                        this.f6775a1 = m.d(Z(optJSONObject13, "androidSwipeNavigationBackgroundColorDark"));
                        this.f6779b1 = m.d(Z(optJSONObject13, "androidSwipeNavigationActiveColor"));
                        this.f6783c1 = m.d(Z(optJSONObject13, "androidSwipeNavigationActiveColorDark"));
                        this.f6787d1 = m.d(Z(optJSONObject13, "androidSwipeNavigationInactiveColor"));
                        this.f6791e1 = m.d(Z(optJSONObject13, "androidSwipeNavigationInactiveColorDark"));
                        this.f6795f1 = optJSONObject13.optBoolean("androidShowSplash", false);
                        this.f6799g1 = optJSONObject13.optDouble("androidShowSplashMaxTime", 1.5d);
                        this.f6803h1 = optJSONObject13.optDouble("androidShowSplashForceTime", Double.NaN);
                        this.A0 = m.d(Z(optJSONObject13, "androidSplashBackgroundColor"));
                        this.B0 = m.d(Z(optJSONObject13, "androidSplashBackgroundColorDark"));
                        this.f6807i1 = optJSONObject13.optBoolean("disableAnimations", false);
                        this.f6811j1 = optJSONObject13.optInt("androidWebviewTextZoom", -1);
                        optJSONObject4 = this.f6777b.optJSONObject("script");
                        if (optJSONObject4 != null) {
                        }
                        optJSONObject5 = this.f6777b.optJSONObject("permissions");
                        if (optJSONObject5 != null) {
                        }
                        optJSONObject6 = this.f6777b.optJSONObject("services");
                        if (optJSONObject6 != null) {
                        }
                        optJSONObject7 = this.f6777b.optJSONObject("performance");
                        if (optJSONObject7 != null) {
                        }
                        this.o3 = this.f6777b.optBoolean("allowZoom", true);
                        x2 = x("splashpage.json");
                        if (x2 != null) {
                            HashMap<String, String> hashMap = new HashMap<>();
                            this.W = hashMap;
                            hashMap.put("*", x2.getString("splashPageUrl"));
                        }
                        optJSONObject8 = this.f6777b.optJSONObject("security");
                        if (optJSONObject8 != null) {
                            this.r3 = optJSONObject10.optString("androidConfigXML");
                        }
                        optJSONObject9 = this.f6777b.optJSONObject("developmentTools");
                        if (optJSONObject9 != null) {
                            this.D3 = true;
                        }
                        k.a(null);
                        k.a(inputStream);
                        c();
                    }
                }
                if (this.f6777b != null) {
                    inputStream = context.getAssets().open("appConfig.json");
                    try {
                        ByteArrayOutputStream byteArrayOutputStream2 = new ByteArrayOutputStream();
                        k.b(inputStream, byteArrayOutputStream2);
                        k.a(byteArrayOutputStream2);
                        this.f6777b = new JSONObject(byteArrayOutputStream2.toString("UTF-8"));
                    } catch (Exception e5) {
                        exc = e5;
                        g.a().c("co.median.median_core.AppConfig", exc.getMessage(), exc);
                        this.f6781c = exc;
                        k.a(null);
                        k.a(inputStream);
                        c();
                    }
                } else {
                    inputStream = null;
                }
                this.U = new ArrayList<>();
                this.V = new ArrayList<>();
                optJSONObject = this.f6777b.optJSONObject("general");
                if (optJSONObject != null) {
                    JSONObject x4 = x("initurl.json");
                    if (x4 == null || !x4.has("initialUrl")) {
                        Z4 = Z(optJSONObject, "initialUrl");
                        this.f6789e = Z4;
                    } else {
                        Z4 = x4.getString("initialUrl");
                        this.f6789e = Z4;
                    }
                    this.f6785d = Z4;
                    String host = Uri.parse(this.f6785d).getHost();
                    this.f6793f = host;
                    if (host.startsWith("www.")) {
                        this.f6793f = this.f6793f.substring(4);
                    }
                    this.f6797g = Z(optJSONObject, "appName");
                    String Z5 = Z(optJSONObject, "androidForceUserAgent");
                    this.f6805i = Z5;
                    if (Z5 == null || Z5.isEmpty()) {
                        this.f6805i = Z(optJSONObject, "forceUserAgent");
                    }
                    String str = this.f6805i;
                    if (str == null || str.isEmpty()) {
                        String Z6 = Z(optJSONObject, "androidUserAgentAdd");
                        this.f6809j = Z6;
                        if (Z6 == null || Z6.isEmpty()) {
                            this.f6809j = Z(optJSONObject, "userAgentAdd");
                        }
                        if (this.f6809j == null) {
                            this.f6809j = "gonative";
                        }
                        if (this.f6809j.equals("gonative")) {
                            this.f6809j = "GoNativeAndroid/1.0 gonative";
                        }
                        try {
                            this.f6813k = new WebView(context).getSettings().getUserAgentString() + " " + this.f6809j;
                        } catch (RuntimeException e6) {
                            Log.w("co.median.median_core.AppConfig", "AppConfig: If built using gecko flavor, ignore warning. - Error: " + e6.getLocalizedMessage());
                        }
                    } else {
                        this.f6813k = this.f6805i;
                    }
                    this.f6801h = Z(optJSONObject, "publicKey");
                    int optInt = optJSONObject.optInt("forceSessionCookieExpiry", 0);
                    this.f6817l = optInt;
                    if (optInt > 0) {
                        this.p3 = true;
                    }
                    r(optJSONObject.optJSONArray("userAgentRegexes"));
                    this.f6829o = optJSONObject.optBoolean("disableConfigUpdater", false);
                    this.f6833p = optJSONObject.optBoolean("disableEventRecorder", false);
                    this.f6837q = optJSONObject.optBoolean("androidDirectCameraUploads", true);
                    this.f6841r = optJSONObject.optBoolean("androidClearCache", false);
                    this.f6845s = optJSONObject.optBoolean("enableWindowOpen", false);
                    String Z7 = Z(optJSONObject, "forceScreenOrientation");
                    if (Z7 != null) {
                        if (Z7.equalsIgnoreCase("portrait")) {
                            enumC0086a3 = EnumC0086a.PORTRAIT;
                        } else {
                            enumC0086a3 = Z7.equalsIgnoreCase("landscape") ? EnumC0086a.LANDSCAPE : enumC0086a3;
                        }
                        this.f6848t = enumC0086a3;
                    }
                    JSONObject optJSONObject14 = optJSONObject.optJSONObject("screenOrientation");
                    if (optJSONObject14 != null) {
                        String optString3 = optJSONObject14.optString("androidPhone", "");
                        if ("portrait".equalsIgnoreCase(optString3)) {
                            enumC0086a = EnumC0086a.PORTRAIT;
                        } else {
                            enumC0086a = "landscape".equalsIgnoreCase(optString3) ? EnumC0086a.LANDSCAPE : enumC0086a;
                            optString2 = optJSONObject14.optString("androidTablet", "");
                            if ("portrait".equalsIgnoreCase(optString2)) {
                                enumC0086a2 = "landscape".equalsIgnoreCase(optString2) ? EnumC0086a.LANDSCAPE : enumC0086a2;
                            } else {
                                enumC0086a2 = EnumC0086a.PORTRAIT;
                            }
                            this.f6854v = enumC0086a2;
                        }
                        this.f6851u = enumC0086a;
                        optString2 = optJSONObject14.optString("androidTablet", "");
                        if ("portrait".equalsIgnoreCase(optString2)) {
                        }
                        this.f6854v = enumC0086a2;
                    }
                    this.f6857w = optJSONObject.optBoolean("keepScreenOn", false);
                    this.f6860x = optJSONObject.optBoolean("androidFullScreen", false);
                    JSONObject optJSONObject15 = optJSONObject.optJSONObject("androidCustomHeaders");
                    optJSONObject15 = optJSONObject15 == null ? optJSONObject.optJSONObject("customHeaders") : optJSONObject15;
                    if (optJSONObject15 != null) {
                        this.f6863y = new HashMap();
                        Iterator<String> keys = optJSONObject15.keys();
                        while (keys.hasNext()) {
                            String next = keys.next();
                            String Z8 = Z(optJSONObject15, next);
                            if (next != null && Z8 != null && !next.isEmpty() && !Z8.isEmpty()) {
                                this.f6863y.put(next, Z8);
                            }
                        }
                    }
                    this.q3 = Z(optJSONObject, "postLoadJavascript");
                    this.f6866z = a(optJSONObject.opt("nativeBridgeUrls"));
                    this.B = d.b(optJSONObject.optString("androidCacheMode", "default"));
                }
                optJSONObject2 = this.f6777b.optJSONObject("forms");
                if (optJSONObject2 != null) {
                    JSONObject optJSONObject16 = optJSONObject2.optJSONObject("search");
                    if (optJSONObject16 != null && optJSONObject16.optBoolean("active", false)) {
                        this.f6815k1 = Z(optJSONObject16, "searchTemplateURL");
                    }
                    JSONObject optJSONObject17 = optJSONObject2.optJSONObject("loginConfig");
                    if (optJSONObject17 != null && optJSONObject17.optBoolean("active", false)) {
                        this.f6823m1 = optJSONObject17;
                        this.f6819l1 = Z(optJSONObject17, "interceptUrl");
                        this.f6827n1 = optJSONObject17.optBoolean("loginIsFirstPage", false);
                    }
                    JSONObject optJSONObject18 = optJSONObject2.optJSONObject("signupConfig");
                    if (optJSONObject18 != null && optJSONObject18.optBoolean("active", false)) {
                        this.f6835p1 = optJSONObject18;
                        this.f6831o1 = Z(optJSONObject18, "interceptUrl");
                    }
                }
                optJSONObject3 = this.f6777b.optJSONObject("navigation");
                if (optJSONObject3 != null) {
                    this.C = optJSONObject3.optBoolean("androidPullToRefresh");
                    this.D = optJSONObject3.optBoolean("swipeGestures");
                    this.E = optJSONObject3.optBoolean("swipeGesturesEdge");
                    JSONObject x5 = x("maxwindows.json");
                    if (x5 != null) {
                        this.F = x5.optBoolean("enabled", false);
                        this.G = x5.optInt("numWindows", 100);
                        optBoolean = x5.optBoolean("autoClose", false);
                    } else {
                        JSONObject optJSONObject19 = optJSONObject3.optJSONObject("maxWindows");
                        if (optJSONObject19 != null && optJSONObject19.optBoolean("enabled")) {
                            this.F = true;
                            this.G = optJSONObject19.optInt("numWindows", 100);
                            optBoolean = optJSONObject19.optBoolean("autoClose", false);
                        }
                        JSONObject x6 = x("sidebarnav.json");
                        G((x6 == null && x6.has("menus")) ? x6 : optJSONObject3.optJSONObject("sidebarNavigation"));
                        JSONObject x7 = x("navlevels.json");
                        x7 = x7 == null ? optJSONObject3.optJSONObject("androidNavigationLevels") : x7;
                        s(x7 == null ? optJSONObject3.optJSONObject("navigationLevels") : x7);
                        JSONObject x8 = x("navtitles.json");
                        z(x8 == null ? optJSONObject3.optJSONObject("navigationTitles") : x8);
                        this.T = Z(optJSONObject3, "profilePickerJS");
                        x3 = x("regexintext.json");
                        if (x3 == null && x3.has("rules")) {
                            x3.getJSONArray("rules");
                        } else {
                            JSONObject optJSONObject20 = optJSONObject3.optJSONObject("regexInternalExternal");
                            optJSONArray = optJSONObject20 != null ? optJSONObject20.optJSONArray("rules") : optJSONArray;
                            I(optJSONObject3.optJSONObject("tabNavigation"));
                            e(optJSONObject3.optJSONObject("actionConfig"));
                            this.S0 = optJSONObject3.optBoolean("androidShowRefreshButton", true);
                            optJSONArray2 = optJSONObject3.optJSONArray("ignorePageFinishedRegexes");
                            this.f6806i0 = new ArrayList<>();
                            if (optJSONArray2 != null) {
                                for (int i3 = 0; i3 < optJSONArray2.length(); i3++) {
                                    if (!optJSONArray2.isNull(i3) && (optString = optJSONArray2.optString(i3)) != null) {
                                        try {
                                            this.f6806i0.add(Pattern.compile(optString));
                                        } catch (PatternSyntaxException e7) {
                                            g.a().c("co.median.median_core.AppConfig", "Error parsing regex " + optString, e7);
                                        }
                                    }
                                }
                            }
                            optJSONArray3 = optJSONObject3.optJSONArray("redirects");
                            if (optJSONArray3 != null) {
                                this.W = new HashMap<>(optJSONArray3.length());
                                for (int i4 = 0; i4 < optJSONArray3.length(); i4++) {
                                    String c3 = m.c(optJSONArray3.optJSONObject(i4), "from");
                                    String c4 = m.c(optJSONArray3.optJSONObject(i4), "to");
                                    if (c3 != null && c4 != null) {
                                        this.W.put(c3, c4);
                                    }
                                }
                            } else {
                                this.W = null;
                            }
                            this.x3 = this.W;
                            D(optJSONObject3.optJSONObject("segmentedControl"));
                            this.Y = optJSONObject3.optBoolean("androidShowOfflinePage", true);
                            this.Z = optJSONObject3.optBoolean("androidShakeToClearCache", false);
                            this.f6774a0 = optJSONObject3.optBoolean("androidDisableBackButton", false);
                            opt = optJSONObject3.opt("androidConnectionOfflineTime");
                            if (opt != null) {
                                if (!(opt instanceof Boolean) || ((Boolean) opt).booleanValue()) {
                                    this.A = optJSONObject3.optDouble("androidConnectionOfflineTime", this.A);
                                } else {
                                    this.A = Double.NaN;
                                }
                            }
                        }
                        d(optJSONArray);
                        I(optJSONObject3.optJSONObject("tabNavigation"));
                        e(optJSONObject3.optJSONObject("actionConfig"));
                        this.S0 = optJSONObject3.optBoolean("androidShowRefreshButton", true);
                        optJSONArray2 = optJSONObject3.optJSONArray("ignorePageFinishedRegexes");
                        this.f6806i0 = new ArrayList<>();
                        if (optJSONArray2 != null) {
                        }
                        optJSONArray3 = optJSONObject3.optJSONArray("redirects");
                        if (optJSONArray3 != null) {
                        }
                        this.x3 = this.W;
                        D(optJSONObject3.optJSONObject("segmentedControl"));
                        this.Y = optJSONObject3.optBoolean("androidShowOfflinePage", true);
                        this.Z = optJSONObject3.optBoolean("androidShakeToClearCache", false);
                        this.f6774a0 = optJSONObject3.optBoolean("androidDisableBackButton", false);
                        opt = optJSONObject3.opt("androidConnectionOfflineTime");
                        if (opt != null) {
                        }
                    }
                    this.H = optBoolean;
                    JSONObject x62 = x("sidebarnav.json");
                    G((x62 == null && x62.has("menus")) ? x62 : optJSONObject3.optJSONObject("sidebarNavigation"));
                    JSONObject x72 = x("navlevels.json");
                    if (x72 == null) {
                    }
                    s(x72 == null ? optJSONObject3.optJSONObject("navigationLevels") : x72);
                    JSONObject x82 = x("navtitles.json");
                    z(x82 == null ? optJSONObject3.optJSONObject("navigationTitles") : x82);
                    this.T = Z(optJSONObject3, "profilePickerJS");
                    x3 = x("regexintext.json");
                    if (x3 == null) {
                    }
                    JSONObject optJSONObject202 = optJSONObject3.optJSONObject("regexInternalExternal");
                    if (optJSONObject202 != null) {
                    }
                    I(optJSONObject3.optJSONObject("tabNavigation"));
                    e(optJSONObject3.optJSONObject("actionConfig"));
                    this.S0 = optJSONObject3.optBoolean("androidShowRefreshButton", true);
                    optJSONArray2 = optJSONObject3.optJSONArray("ignorePageFinishedRegexes");
                    this.f6806i0 = new ArrayList<>();
                    if (optJSONArray2 != null) {
                    }
                    optJSONArray3 = optJSONObject3.optJSONArray("redirects");
                    if (optJSONArray3 != null) {
                    }
                    this.x3 = this.W;
                    D(optJSONObject3.optJSONObject("segmentedControl"));
                    this.Y = optJSONObject3.optBoolean("androidShowOfflinePage", true);
                    this.Z = optJSONObject3.optBoolean("androidShakeToClearCache", false);
                    this.f6774a0 = optJSONObject3.optBoolean("androidDisableBackButton", false);
                    opt = optJSONObject3.opt("androidConnectionOfflineTime");
                    if (opt != null) {
                    }
                }
                JSONObject optJSONObject132 = this.f6777b.optJSONObject("styling");
                Z = Z(optJSONObject132, "customCSS");
                this.C0 = Z;
                if (Z != null && !Z.isEmpty()) {
                    this.p3 = true;
                }
                Z2 = Z(optJSONObject132, "androidCustomCSS");
                this.D0 = Z2;
                if (Z2 != null && !Z2.isEmpty()) {
                    this.p3 = true;
                }
                optDouble = optJSONObject132.optDouble("forceViewportWidth", Double.NaN);
                this.G0 = optDouble;
                if (!Double.isNaN(optDouble)) {
                    this.p3 = true;
                }
                this.H0 = optJSONObject132.optBoolean("zoomableForceViewport", false);
                this.L0 = optJSONObject132.optBoolean("showActionBar", true);
                this.I0 = Z(optJSONObject132, "androidTheme");
                this.f6810j0 = m.d(Z(optJSONObject132, "androidActionBarBackgroundColor"));
                this.f6814k0 = m.d(Z(optJSONObject132, "androidActionBarBackgroundColorDark"));
                this.f6818l0 = m.d(Z(optJSONObject132, "androidSidebarBackgroundColor"));
                this.f6822m0 = m.d(Z(optJSONObject132, "androidSidebarBackgroundColorDark"));
                this.f6826n0 = m.d(Z(optJSONObject132, "androidSidebarForegroundColor"));
                this.f6830o0 = m.d(Z(optJSONObject132, "androidSidebarForegroundColorDark"));
                this.f6834p0 = m.d(Z(optJSONObject132, "androidSidebarHighlightColor"));
                this.f6838q0 = m.d(Z(optJSONObject132, "androidSidebarHighlightColorDark"));
                this.f6842r0 = m.d(Z(optJSONObject132, "androidTintColor"));
                this.f6852u0 = m.d(Z(optJSONObject132, "androidTabBarBackgroundColor"));
                this.f6855v0 = m.d(Z(optJSONObject132, "androidTabBarBackgroundColorDark"));
                this.f6846s0 = m.d(Z(optJSONObject132, "androidTabBarTextColor"));
                this.f6849t0 = m.d(Z(optJSONObject132, "androidTabBarTextColorDark"));
                this.f6858w0 = m.d(Z(optJSONObject132, "androidTabBarIndicatorColor"));
                this.f6861x0 = m.d(Z(optJSONObject132, "androidTabBarIndicatorColorDark"));
                this.f6864y0 = m.d(Z(optJSONObject132, "androidTabPressedBackgroundColor"));
                this.f6867z0 = m.d(Z(optJSONObject132, "androidTabPressedBackgroundColorDark"));
                this.M0 = optJSONObject132.optDouble("transitionInteractiveDelayMax", Double.NaN);
                boolean optBoolean22 = optJSONObject132.optBoolean("androidHideTitleInActionBar", false);
                this.O0 = optBoolean22;
                this.P0 = optJSONObject132.optBoolean("androidShowLogoInActionBar", optBoolean22);
                this.Q0 = optJSONObject132.optBoolean("androidShowLogoInSideBar", true);
                this.R0 = optJSONObject132.optBoolean("androidShowAppNameInSideBar", true);
                this.T0 = optJSONObject132.optBoolean("androidEnableOverlayInStatusBar", false);
                this.U0 = Z(optJSONObject132, "androidStatusBarStyle");
                d3 = m.d(Z(optJSONObject132, "androidActionBarForegroundColor"));
                this.J0 = d3;
                if (d3 == null) {
                    String str2 = this.I0;
                    this.J0 = str2 == null ? -1 : str2.equalsIgnoreCase("light") ? -16777216 : -1;
                }
                this.K0 = m.d(Z(optJSONObject132, "androidActionBarForegroundColorDark"));
                q(optJSONObject132.opt("navigationTitleImage"));
                this.W0 = (float) optJSONObject132.optDouble("hideWebviewAlpha", 0.0d);
                this.X0 = m.d(Z(optJSONObject132, "androidPullToRefreshColor"));
                this.Y0 = m.d(Z(optJSONObject132, "androidPullToRefreshColorDark"));
                this.Z0 = m.d(Z(optJSONObject132, "androidSwipeNavigationBackgroundColor"));
                this.f6775a1 = m.d(Z(optJSONObject132, "androidSwipeNavigationBackgroundColorDark"));
                this.f6779b1 = m.d(Z(optJSONObject132, "androidSwipeNavigationActiveColor"));
                this.f6783c1 = m.d(Z(optJSONObject132, "androidSwipeNavigationActiveColorDark"));
                this.f6787d1 = m.d(Z(optJSONObject132, "androidSwipeNavigationInactiveColor"));
                this.f6791e1 = m.d(Z(optJSONObject132, "androidSwipeNavigationInactiveColorDark"));
                this.f6795f1 = optJSONObject132.optBoolean("androidShowSplash", false);
                this.f6799g1 = optJSONObject132.optDouble("androidShowSplashMaxTime", 1.5d);
                this.f6803h1 = optJSONObject132.optDouble("androidShowSplashForceTime", Double.NaN);
                this.A0 = m.d(Z(optJSONObject132, "androidSplashBackgroundColor"));
                this.B0 = m.d(Z(optJSONObject132, "androidSplashBackgroundColorDark"));
                this.f6807i1 = optJSONObject132.optBoolean("disableAnimations", false);
                this.f6811j1 = optJSONObject132.optInt("androidWebviewTextZoom", -1);
                optJSONObject4 = this.f6777b.optJSONObject("script");
                if (optJSONObject4 != null) {
                    this.E0 = Z(optJSONObject4, "customJS");
                    this.F0 = Z(optJSONObject4, "androidCustomJS");
                }
                optJSONObject5 = this.f6777b.optJSONObject("permissions");
                if (optJSONObject5 != null) {
                    this.f6839q1 = optJSONObject5.optBoolean("usesGeolocation", false);
                    this.f6843r1 = optJSONObject5.optBoolean("androidDownloadToPublicStorage", false);
                    this.f6847s1 = optJSONObject5.optBoolean("enableWebRTCBluetoothAudio", false);
                    this.f6850t1 = optJSONObject5.optBoolean("enableWebRTCCamera", false);
                    this.f6853u1 = optJSONObject5.optBoolean("enableWebRTCMicrophone", false);
                }
                optJSONObject6 = this.f6777b.optJSONObject("services");
                if (optJSONObject6 != null) {
                    JSONObject optJSONObject21 = optJSONObject6.optJSONObject("backgroundLocation");
                    if (optJSONObject21 != null) {
                        this.f6865y1 = optJSONObject21.optBoolean("active");
                        this.f6868z1 = optJSONObject21.optBoolean("foregroundOnly");
                    }
                    JSONObject optJSONObject22 = optJSONObject6.optJSONObject("autorefresh");
                    if (optJSONObject22 != null) {
                        this.R2 = optJSONObject22.optBoolean("active", false);
                        this.S2 = optJSONObject22.optBoolean("enabled", false);
                        this.T2 = optJSONObject22.optInt("interval", 0);
                        this.U2 = Z(optJSONObject22, "url");
                    }
                    JSONObject optJSONObject23 = optJSONObject6.optJSONObject("cordial");
                    if (optJSONObject23 != null) {
                        this.V2 = optJSONObject23.optBoolean("active");
                        this.W2 = optJSONObject23.optString("accountKey");
                        this.X2 = optJSONObject23.optString("channelKey");
                        this.Y2 = optJSONObject23.optJSONObject("pushNotifications").optBoolean("active");
                    }
                    JSONObject optJSONObject24 = optJSONObject6.optJSONObject("intercom");
                    if (optJSONObject24 != null) {
                        this.Z2 = optJSONObject24.optBoolean("active", false);
                        this.a3 = Z(optJSONObject24, "androidApiKey");
                        this.b3 = Z(optJSONObject24, "androidAppId");
                    }
                    JSONObject optJSONObject25 = optJSONObject6.optJSONObject("braze");
                    if (optJSONObject25 != null) {
                        this.c3 = optJSONObject25.optBoolean("active", false);
                        this.d3 = optJSONObject25.optBoolean("autoRegister", false);
                        this.e3 = optJSONObject25.optString("androidApiKey");
                        this.f3 = optJSONObject25.optString("androidEndpointKey");
                        this.g3 = optJSONObject25.optString("firebaseSenderId");
                        this.h3 = optJSONObject25.optString("androidNotificationChannelName");
                        this.i3 = optJSONObject25.optString("androidNotificationDescription");
                    }
                    JSONObject optJSONObject26 = optJSONObject6.optJSONObject("analytics");
                    if (optJSONObject26 != null && optJSONObject26.optBoolean("active", false)) {
                        this.f6859w1 = optJSONObject26.optInt("idsite_test", Integer.MIN_VALUE);
                        int optInt2 = optJSONObject26.optInt("idsite_prod", Integer.MIN_VALUE);
                        this.f6862x1 = optInt2;
                        if (this.f6859w1 != Integer.MIN_VALUE && optInt2 != Integer.MIN_VALUE) {
                            this.f6856v1 = true;
                        }
                        Log.w("co.median.median_core.AppConfig", "Analytics requires idsite_test and idsite_prod");
                        this.f6856v1 = false;
                    }
                    JSONObject optJSONObject27 = optJSONObject6.optJSONObject("oneSignal");
                    if (optJSONObject27 != null && optJSONObject27.optBoolean("active")) {
                        String Z9 = Z(optJSONObject27, "applicationId");
                        this.B1 = Z9;
                        this.A1 = Z9 != null;
                        this.C1 = Z(optJSONObject27, "tagsJsonUrl");
                        this.D1 = optJSONObject27.optBoolean("requiresUserPrivacyConsent");
                        this.E1 = optJSONObject27.optBoolean("autoRegister", true);
                        this.F1 = optJSONObject27.optBoolean("showForegroundNotifications", true);
                    }
                    JSONObject optJSONObject28 = optJSONObject6.optJSONObject("xtremepushAndroid");
                    optJSONObject28 = optJSONObject28 == null ? optJSONObject6.optJSONObject("xtremepush") : optJSONObject28;
                    if (optJSONObject28 != null && optJSONObject28.optBoolean("active")) {
                        String Z10 = Z(optJSONObject28, "appKey");
                        this.H1 = Z10;
                        this.G1 = Z10 != null;
                        this.I1 = Z(optJSONObject28, "googleProjectId");
                    }
                    JSONObject optJSONObject29 = optJSONObject6.optJSONObject("cleverpush");
                    if (optJSONObject29 != null && optJSONObject29.optBoolean("active")) {
                        this.J1 = true;
                        this.K1 = Z(optJSONObject29, "channelId");
                        this.L1 = optJSONObject29.optBoolean("autoRegister", true);
                    }
                    JSONObject optJSONObject30 = optJSONObject6.optJSONObject("ibmpushAndroid");
                    optJSONObject30 = optJSONObject30 == null ? optJSONObject6.optJSONObject("ibmpush") : optJSONObject30;
                    if (optJSONObject30 != null && optJSONObject30.optBoolean("active")) {
                        this.M1 = true;
                        this.N1 = optJSONObject30;
                    }
                    JSONObject optJSONObject31 = optJSONObject6.optJSONObject("moxo");
                    if (optJSONObject31 != null && optJSONObject31.optBoolean("active")) {
                        this.O1 = true;
                        this.P1 = Z(optJSONObject31, "moxoDomain");
                    }
                    JSONObject optJSONObject32 = optJSONObject6.optJSONObject("facebook");
                    if (optJSONObject32 != null && optJSONObject32.optBoolean("active")) {
                        this.R1 = Z(optJSONObject32, "appId");
                        this.S1 = Z(optJSONObject32, "displayName");
                        this.Q1 = this.R1 != null;
                        this.T1 = optJSONObject32.optBoolean("autoLogging");
                    }
                    JSONObject optJSONObject33 = optJSONObject6.optJSONObject("socialLogin");
                    if (optJSONObject33 != null) {
                        JSONObject optJSONObject34 = optJSONObject33.optJSONObject("facebookLogin");
                        if (optJSONObject34 != null && optJSONObject34.optBoolean("active")) {
                            String str3 = this.R1;
                            if (str3 == null || str3.isEmpty()) {
                                this.R1 = optJSONObject34.optString("appId");
                            }
                            String str4 = this.S1;
                            if (str4 == null || str4.isEmpty()) {
                                this.S1 = optJSONObject34.optString("displayName");
                            }
                            this.U1 = this.R1 != null;
                        }
                        JSONObject optJSONObject35 = optJSONObject33.optJSONObject("googleSignIn");
                        if (optJSONObject35 != null && optJSONObject35.optBoolean("active")) {
                            String optString4 = optJSONObject35.optString("androidClientID");
                            if (!optString4.isEmpty()) {
                                this.V1 = true;
                                this.W1 = optString4;
                            }
                        }
                    }
                    JSONObject optJSONObject36 = optJSONObject6.optJSONObject("adjust");
                    if (optJSONObject36 != null && optJSONObject36.optBoolean("active")) {
                        this.X1 = true;
                        this.Y1 = Z(optJSONObject36, "appToken");
                        this.Z1 = Z(optJSONObject36, "environment");
                    }
                    JSONObject optJSONObject37 = optJSONObject6.optJSONObject("appsflyer");
                    if (optJSONObject37 != null && optJSONObject37.optBoolean("active")) {
                        this.f6780b2 = true;
                        String Z11 = Z(optJSONObject37, "androidDevKey");
                        this.f6776a2 = Z11;
                        if (Z11 == null) {
                            this.f6776a2 = Z(optJSONObject37, "devKey");
                        }
                    }
                    JSONObject optJSONObject38 = optJSONObject6.optJSONObject("identity");
                    if (optJSONObject38 != null && optJSONObject38.optBoolean("active")) {
                        LinkedList linkedList = new LinkedList();
                        this.f6784c2 = linkedList;
                        Object opt2 = optJSONObject38.opt("checkIdentityUrl");
                        if (opt2 != null && (opt2 instanceof String)) {
                            linkedList.add(Pattern.compile((String) opt2));
                        } else if (opt2 != null && (opt2 instanceof JSONArray)) {
                            JSONArray jSONArray = (JSONArray) opt2;
                            for (int i5 = 0; i5 < jSONArray.length(); i5++) {
                                String optString5 = jSONArray.optString(i5);
                                if (optString5 != null && !optString5.isEmpty()) {
                                    linkedList.add(Pattern.compile(optString5));
                                }
                            }
                        }
                        this.f6788d2 = Z(optJSONObject38, "identityEndpointUrl");
                    }
                    JSONObject optJSONObject39 = optJSONObject6.optJSONObject("registration");
                    if (optJSONObject39 != null && optJSONObject39.optBoolean("active")) {
                        this.f6792e2 = optJSONObject39.optJSONArray("endpoints");
                    }
                    JSONObject optJSONObject40 = optJSONObject6.optJSONObject("admob");
                    if (optJSONObject40 != null && optJSONObject40.optBoolean("active") && (optJSONObject12 = optJSONObject40.optJSONObject("admobAndroid")) != null && optJSONObject12.optBoolean("active") && (Z3 = Z(optJSONObject12, "applicationId")) != null && !Z3.isEmpty()) {
                        this.f6800g2 = true;
                        String Z12 = Z(optJSONObject12, "bannerAdUnitId");
                        this.f6804h2 = Z12;
                        if (Z12 != null && Z12.isEmpty()) {
                            this.f6804h2 = null;
                        }
                        String Z13 = Z(optJSONObject12, "interstitialAdUnitId");
                        this.f6808i2 = Z13;
                        if (Z13 != null && Z13.isEmpty()) {
                            this.f6808i2 = null;
                        }
                        this.f6812j2 = optJSONObject12.optBoolean("showBanner", true);
                    }
                    JSONObject optJSONObject41 = optJSONObject6.optJSONObject("cardIO");
                    if (optJSONObject41 != null && optJSONObject41.optBoolean("active")) {
                        this.f6816k2 = true;
                    }
                    JSONObject optJSONObject42 = optJSONObject6.optJSONObject("auth");
                    if (optJSONObject42 != null && optJSONObject42.optBoolean("active")) {
                        this.f6832o2 = true;
                        Object opt3 = optJSONObject42.opt("allowedUrls");
                        if (opt3 instanceof String) {
                            this.f6836p2.add(Pattern.compile((String) opt3));
                        } else if (opt3 instanceof JSONArray) {
                            JSONArray jSONArray2 = (JSONArray) opt3;
                            for (int i6 = 0; i6 < jSONArray2.length(); i6++) {
                                String optString6 = jSONArray2.optString(i6);
                                if (optString6 != null) {
                                    this.f6836p2.add(Pattern.compile(optString6));
                                }
                            }
                        }
                    }
                    JSONObject optJSONObject43 = optJSONObject6.optJSONObject("chromecast");
                    if (optJSONObject43 != null && optJSONObject43.optBoolean("active")) {
                        this.f6820l2 = true;
                        this.f6824m2 = Z(optJSONObject43, "receiverAppId");
                    }
                    if (this.f6820l2) {
                        this.f6828n2 = new ArrayList<>();
                        Object opt4 = optJSONObject43.opt("showCastButtonRegex");
                        if (opt4 instanceof String) {
                            this.f6828n2.add(Pattern.compile((String) opt4));
                        } else if (opt4 instanceof JSONArray) {
                            JSONArray jSONArray3 = (JSONArray) opt4;
                            for (int i7 = 0; i7 < jSONArray3.length(); i7++) {
                                String optString7 = jSONArray3.optString(i7);
                                if (optString7 != null) {
                                    this.f6828n2.add(Pattern.compile(optString7));
                                }
                            }
                        } else {
                            this.f6828n2.add(Pattern.compile(".*"));
                        }
                    }
                    JSONObject optJSONObject44 = optJSONObject6.optJSONObject("documentScanner");
                    if (optJSONObject44 != null && optJSONObject44.optBoolean("active")) {
                        this.f6840q2 = true;
                        String Z14 = Z(optJSONObject44, "androidAnylineLicenseKey");
                        this.f6844r2 = Z14;
                        if (Z14 == null) {
                            this.f6844r2 = Z(optJSONObject44, "anylineLicenseKey");
                        }
                    }
                    JSONObject optJSONObject45 = optJSONObject6.optJSONObject("scandit");
                    if (optJSONObject45 != null && optJSONObject45.optBoolean("active")) {
                        String Z15 = Z(optJSONObject45, "androidLicenseKey");
                        this.t2 = Z15;
                        if (Z15 == null) {
                            this.t2 = Z(optJSONObject45, "licenseKey");
                        }
                        if (this.t2 != null) {
                            this.s2 = true;
                        }
                    }
                    JSONObject optJSONObject46 = optJSONObject6.optJSONObject("barcode");
                    if (optJSONObject46 != null && optJSONObject46.optBoolean("active")) {
                        this.u2 = true;
                        this.v2 = Z(optJSONObject46, "prompt");
                    }
                    JSONObject optJSONObject47 = optJSONObject6.optJSONObject("iap");
                    if (optJSONObject47 != null && optJSONObject47.optBoolean("active") && (optJSONObject11 = optJSONObject47.optJSONObject("googleIAP")) != null) {
                        this.w2 = optJSONObject11.optBoolean("active");
                        this.x2 = Z(optJSONObject11, "productsUrl");
                        this.y2 = optJSONObject11.optBoolean("legacyMode", this.y2);
                    }
                    JSONObject optJSONObject48 = optJSONObject6.optJSONObject("couples");
                    if (optJSONObject48 != null && optJSONObject48.optBoolean("active")) {
                        this.z2 = true;
                        String Z16 = Z(optJSONObject48, "androidLicenseKey");
                        this.A2 = Z16;
                        if (Z16 == null) {
                            this.A2 = Z(optJSONObject48, "licenseKey");
                        }
                    }
                    JSONObject optJSONObject49 = optJSONObject6.optJSONObject("episerver");
                    if (optJSONObject49 != null && optJSONObject49.optBoolean("active")) {
                        this.B2 = true;
                        String Z17 = Z(optJSONObject49, "androidAuthToken");
                        this.C2 = Z17;
                        if (Z17 == null) {
                            this.C2 = Z(optJSONObject49, "authToken");
                        }
                    }
                    JSONObject optJSONObject50 = optJSONObject6.optJSONObject("rootDetect");
                    if (optJSONObject50 != null && optJSONObject50.optBoolean("active")) {
                        this.D2 = true;
                    }
                    JSONObject optJSONObject51 = optJSONObject6.optJSONObject("twilio");
                    if (optJSONObject51 != null && optJSONObject51.optBoolean("active")) {
                        this.E2 = true;
                    }
                    JSONObject optJSONObject52 = optJSONObject6.optJSONObject("beacon");
                    if (optJSONObject52 != null && optJSONObject52.optBoolean("active")) {
                        this.F2 = true;
                    }
                    JSONObject optJSONObject53 = optJSONObject6.optJSONObject("mobilepush");
                    if (optJSONObject53 != null && optJSONObject53.optBoolean("active")) {
                        this.G2 = true;
                        this.H2 = optJSONObject53.optBoolean("requiresUserPrivacyConsent");
                        this.I2 = optJSONObject53.optString("appID");
                        this.J2 = optJSONObject53.optString("accessToken");
                        this.K2 = optJSONObject53.optString("appEndpoint");
                        this.L2 = optJSONObject53.optString("mid");
                        this.M2 = optJSONObject53.optBoolean("delayRegistrationUntilContactKeyIsSet", true);
                    }
                    JSONObject optJSONObject54 = optJSONObject6.optJSONObject("kaltura");
                    if (optJSONObject54 != null && optJSONObject54.optBoolean("active")) {
                        this.N2 = true;
                        this.O2 = optJSONObject54.optInt("partnerId");
                        this.P2 = optJSONObject54.optString("castReceiverAppId");
                        this.Q2 = optJSONObject54.optString("serverUrl");
                    }
                    JSONObject optJSONObject55 = optJSONObject6.optJSONObject("localSettings");
                    if (optJSONObject55 != null && optJSONObject55.optBoolean("active")) {
                        this.j3 = true;
                        this.k3 = optJSONObject55.optBoolean("androidBackup");
                    }
                    JSONObject optJSONObject56 = optJSONObject6.optJSONObject("firebaseAnalytics");
                    if (optJSONObject56 != null && optJSONObject56.optBoolean("active")) {
                        this.n3 = true;
                    }
                    JSONObject optJSONObject57 = optJSONObject6.optJSONObject("opentok");
                    if (optJSONObject57 != null && optJSONObject57.optBoolean("active")) {
                        this.l3 = true;
                    }
                    if (optJSONObject57 != null && optJSONObject57.optBoolean("blockOtherCalls")) {
                        this.m3 = true;
                    }
                    JSONObject optJSONObject58 = optJSONObject6.optJSONObject("enterprisePlugin");
                    if (optJSONObject58 != null && optJSONObject58.optBoolean("active")) {
                        this.E3 = true;
                        JSONObject optJSONObject59 = optJSONObject58.optJSONObject("blockCopyPaste");
                        if (optJSONObject59 != null) {
                            this.F3 = optJSONObject59.optBoolean("active", false);
                        }
                        JSONObject optJSONObject60 = optJSONObject58.optJSONObject("blockScreenCapture");
                        if (optJSONObject60 != null) {
                            this.G3 = optJSONObject60.optBoolean("active", false);
                        }
                        JSONObject optJSONObject61 = optJSONObject58.optJSONObject("maskBackgroundedAppImage");
                        if (optJSONObject61 != null) {
                            this.H3 = optJSONObject61.optBoolean("active", false);
                        }
                    }
                    JSONObject optJSONObject62 = optJSONObject6.optJSONObject("nfc");
                    if (optJSONObject62 != null && optJSONObject62.optBoolean("active")) {
                        this.I3 = true;
                    }
                    JSONObject optJSONObject63 = optJSONObject6.optJSONObject("plaid");
                    if (optJSONObject63 != null && optJSONObject63.optBoolean("active")) {
                        this.J3 = true;
                    }
                    JSONObject optJSONObject64 = optJSONObject6.optJSONObject("geckoView");
                    if (optJSONObject64 != null && optJSONObject64.optBoolean("active")) {
                        this.K3 = true;
                    }
                    JSONObject optJSONObject65 = optJSONObject6.optJSONObject("moengage");
                    if (optJSONObject65 != null && optJSONObject65.optBoolean("active")) {
                        this.L3 = true;
                        this.M3 = optJSONObject65.optBoolean("autoRegister", true);
                        this.N3 = optJSONObject65.optString("appId", "");
                        this.O3 = optJSONObject65.optInt("dataCenter", 0);
                    }
                    JSONObject optJSONObject66 = optJSONObject6.optJSONObject("auth0");
                    if (optJSONObject66 != null && optJSONObject66.optBoolean("active")) {
                        this.P3 = true;
                        this.Q3 = optJSONObject66.optString("clientId");
                        this.R3 = optJSONObject66.optString("domain");
                        this.S3 = optJSONObject66.optString("scheme");
                    }
                    JSONObject optJSONObject67 = optJSONObject6.optJSONObject("sendbird");
                    if (optJSONObject67 != null && optJSONObject67.optBoolean("active")) {
                        this.T3 = true;
                        this.U3 = optJSONObject67.optString("appId");
                        this.V3 = optJSONObject67.optBoolean("autoRegister", this.V3);
                    }
                    JSONObject optJSONObject68 = optJSONObject6.optJSONObject("firebaseCrashlytics");
                    if (optJSONObject68 != null && optJSONObject68.optBoolean("active", true)) {
                        this.W3 = true;
                        this.X3 = optJSONObject68.optBoolean("webviewErrorsEnabled");
                        this.Y3 = optJSONObject68.optBoolean("toastErrorsEnabled");
                        this.Z3 = optJSONObject68.optBoolean("requestOptIn");
                    }
                }
                optJSONObject7 = this.f6777b.optJSONObject("performance");
                if (optJSONObject7 != null) {
                    y(optJSONObject7.optJSONArray("webviewPools"));
                }
                this.o3 = this.f6777b.optBoolean("allowZoom", true);
                x2 = x("splashpage.json");
                if (x2 != null && x2.has("splashPageUrl")) {
                    HashMap<String, String> hashMap2 = new HashMap<>();
                    this.W = hashMap2;
                    hashMap2.put("*", x2.getString("splashPageUrl"));
                }
                optJSONObject8 = this.f6777b.optJSONObject("security");
                if (optJSONObject8 != null && (optJSONObject10 = optJSONObject8.optJSONObject("network")) != null) {
                    this.r3 = optJSONObject10.optString("androidConfigXML");
                }
                optJSONObject9 = this.f6777b.optJSONObject("developmentTools");
                if (optJSONObject9 != null && optJSONObject9.optBoolean("enableWebConsoleLogs")) {
                    this.D3 = true;
                }
            } catch (Exception e8) {
                exc = e8;
                inputStream = null;
            }
            k.a(null);
            k.a(inputStream);
            c();
        } catch (Throwable th3) {
            th = th3;
            r9 = 0;
            k.a(null);
            k.a(r9);
            throw th;
        }
    }

    private void D(JSONObject jSONObject) {
        if (jSONObject == null) {
            return;
        }
        this.f6778b0 = new ArrayList<>();
        JSONArray optJSONArray = jSONObject.optJSONArray("items");
        for (int i3 = 0; i3 < optJSONArray.length(); i3++) {
            JSONObject optJSONObject = optJSONArray.optJSONObject(i3);
            if (optJSONObject != null) {
                this.f6778b0.add(optJSONObject);
            }
        }
        g0.a.b(this.f6773a).d(new Intent("io.gonative.android.AppConfig.processedSegmentedControl"));
    }

    private void G(JSONObject jSONObject) {
        int i3;
        String Z;
        String str;
        if (jSONObject == null) {
            return;
        }
        this.I = new HashMap<>();
        this.O = new ArrayList<>();
        this.P = new ArrayList<>();
        JSONArray optJSONArray = jSONObject.optJSONArray("menus");
        if (optJSONArray != null) {
            i3 = 0;
            for (int i4 = 0; i4 < optJSONArray.length(); i4++) {
                JSONObject optJSONObject = optJSONArray.optJSONObject(i4);
                if (optJSONObject != null && optJSONObject.optBoolean("active", false)) {
                    i3++;
                    String Z2 = Z(optJSONObject, "name");
                    JSONArray optJSONArray2 = optJSONObject.optJSONArray("items");
                    if (Z2 != null && optJSONArray2 != null) {
                        this.I.put(Z2, optJSONArray2);
                        if (Z2.equals("default")) {
                            this.J = true;
                        }
                    }
                }
            }
        } else {
            i3 = 0;
        }
        g0.a.b(this.f6773a).d(new Intent("io.gonative.android.AppConfig.processedMenu"));
        this.M = Z(jSONObject, "userIdRegex");
        JSONObject optJSONObject2 = jSONObject.optJSONObject("menuSelectionConfig");
        if ((i3 > 1 || this.f6827n1) && optJSONObject2 != null) {
            this.N = Z(optJSONObject2, "testURL");
            JSONArray optJSONArray3 = optJSONObject2.optJSONArray("redirectLocations");
            if (optJSONArray3 != null) {
                for (int i5 = 0; i5 < optJSONArray3.length(); i5++) {
                    JSONObject optJSONObject3 = optJSONArray3.optJSONObject(i5);
                    if (optJSONObject3 != null && (Z = Z(optJSONObject3, "regex")) != null) {
                        this.O.add(Pattern.compile(Z));
                        this.P.add(optJSONObject3);
                    }
                }
            }
        }
        this.K = new ArrayList();
        this.L = new ArrayList();
        Object opt = jSONObject.opt("sidebarEnabledRegex");
        if (opt != null) {
            if (opt instanceof String) {
                try {
                    this.K.add(Pattern.compile((String) opt));
                    this.L.add(Boolean.TRUE);
                } catch (PatternSyntaxException e3) {
                    g.a().c("co.median.median_core.AppConfig", "Invalid regex for sidebarEnabledRegex", e3);
                }
            } else if (opt instanceof JSONArray) {
                JSONArray jSONArray = (JSONArray) opt;
                for (int i6 = 0; i6 < jSONArray.length(); i6++) {
                    Object opt2 = jSONArray.opt(i6);
                    if (opt2 != null) {
                        Boolean bool = Boolean.TRUE;
                        if (opt2 instanceof String) {
                            str = (String) opt2;
                        } else if (opt2 instanceof JSONObject) {
                            JSONObject jSONObject2 = (JSONObject) opt2;
                            String Z3 = Z(jSONObject2, "regex");
                            bool = Boolean.valueOf(jSONObject2.optBoolean("value", true));
                            str = Z3;
                        } else {
                            str = null;
                        }
                        if (str != null) {
                            try {
                                this.K.add(Pattern.compile(str));
                                this.L.add(bool);
                            } catch (PatternSyntaxException e4) {
                                g.a().c("co.median.median_core.AppConfig", "Invalid regex in sidebarEnabledRegex", e4);
                            }
                        }
                    }
                }
            }
        }
    }

    private void I(JSONObject jSONObject) {
        if (jSONObject == null) {
            return;
        }
        this.f6782c0 = new HashMap<>();
        this.f6790e0 = new ArrayList<>();
        this.f6786d0 = new ArrayList<>();
        if (jSONObject.optBoolean("active")) {
            JSONArray optJSONArray = jSONObject.optJSONArray("tabMenus");
            if (optJSONArray != null) {
                for (int i3 = 0; i3 < optJSONArray.length(); i3++) {
                    JSONObject optJSONObject = optJSONArray.optJSONObject(i3);
                    if (optJSONObject != null) {
                        String Z = Z(optJSONObject, "id");
                        JSONArray optJSONArray2 = optJSONObject.optJSONArray("items");
                        if (Z != null && optJSONArray2 != null) {
                            this.f6782c0.put(Z, optJSONArray2);
                        }
                    }
                }
            }
            JSONArray optJSONArray3 = jSONObject.optJSONArray("tabSelectionConfig");
            if (optJSONArray3 != null) {
                for (int i4 = 0; i4 < optJSONArray3.length(); i4++) {
                    JSONObject optJSONObject2 = optJSONArray3.optJSONObject(i4);
                    if (optJSONObject2 != null) {
                        String Z2 = Z(optJSONObject2, "regex");
                        String Z3 = Z(optJSONObject2, "id");
                        if (Z2 != null && Z3 != null) {
                            try {
                                this.f6786d0.add(Pattern.compile(Z2));
                                this.f6790e0.add(Z3);
                            } catch (PatternSyntaxException e3) {
                                Log.w("co.median.median_core.AppConfig", "Problem with tabSelectionConfig pattern. " + e3.getMessage());
                            }
                        }
                    }
                }
            }
            g0.a.b(this.f6773a).d(new Intent("io.gonative.android.AppConfig.processedTabNavigation"));
        }
    }

    public static synchronized a M(Context context) {
        a aVar;
        synchronized (a.class) {
            if (a4 == null) {
                a4 = new a(context.getApplicationContext());
            }
            aVar = a4;
        }
        return aVar;
    }

    static HashMap T(a aVar) {
        aVar.getClass();
        HashMap hashMap = new HashMap();
        hashMap.put("platform", "android");
        String str = aVar.f6801h;
        if (str != null) {
            hashMap.put("publicKey", str);
        }
        String packageName = aVar.f6773a.getPackageName();
        hashMap.put("appId", packageName);
        PackageManager packageManager = aVar.f6773a.getPackageManager();
        try {
            PackageInfo packageInfo = packageManager.getPackageInfo(aVar.f6773a.getPackageName(), 0);
            hashMap.put("appVersion", packageInfo.versionName);
            hashMap.put("appVersionCode", Integer.valueOf(packageInfo.versionCode));
        } catch (PackageManager.NameNotFoundException unused) {
        }
        hashMap.put("coreVersion", "2.0.0");
        hashMap.put("isDebuggable", Boolean.valueOf((aVar.f6773a.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", aVar.f6785d);
        JSONObject optJSONObject = aVar.f6777b.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(aVar.A1));
        hashMap.put("isLicensed", Boolean.valueOf(aVar.t3));
        HashMap hashMap2 = new HashMap();
        hashMap2.put("onesignal", Boolean.valueOf(aVar.A1));
        hashMap2.put("xtremepush", Boolean.valueOf(aVar.G1));
        hashMap2.put("cleverpush", Boolean.valueOf(aVar.J1));
        hashMap2.put("facebook", Boolean.valueOf(aVar.Q1));
        hashMap2.put("adjust", Boolean.valueOf(aVar.X1));
        hashMap2.put("admob", Boolean.valueOf(aVar.f6800g2));
        hashMap2.put("cardIO", Boolean.valueOf(aVar.f6816k2));
        hashMap2.put("chromecast", Boolean.valueOf(aVar.f6820l2));
        hashMap2.put("auth", Boolean.valueOf(aVar.f6832o2));
        hashMap2.put("documentScanner", Boolean.valueOf(aVar.f6840q2));
        hashMap2.put("scandit", Boolean.valueOf(aVar.s2));
        hashMap2.put("googleIAP", Boolean.valueOf(aVar.w2));
        hashMap2.put("iap", Boolean.valueOf(aVar.w2));
        hashMap2.put("couples", Boolean.valueOf(aVar.z2));
        hashMap2.put("episerver", Boolean.valueOf(aVar.B2));
        hashMap2.put("rootDetect", Boolean.valueOf(aVar.D2));
        hashMap2.put("twilio", Boolean.valueOf(aVar.E2));
        hashMap2.put("beacon", Boolean.valueOf(aVar.F2));
        hashMap2.put("mobilepush", Boolean.valueOf(aVar.G2));
        hashMap2.put("kaltura", Boolean.valueOf(aVar.N2));
        hashMap2.put("localSettings", Boolean.valueOf(aVar.j3));
        hashMap2.put("firebaseAnalytics", Boolean.valueOf(aVar.n3));
        hashMap.put("activeServices", hashMap2);
        HashMap hashMap3 = new HashMap();
        hashMap3.put("io.gonative.android.CardScanner", Boolean.valueOf(n("io.gonative.android.CardScanner")));
        hashMap3.put("io.gonative.android.CastManager", Boolean.valueOf(n("io.gonative.android.CastManager")));
        hashMap3.put("io.gonative.android.Authentication", Boolean.valueOf(n("io.gonative.android.Authentication")));
        hashMap3.put("io.gonative.android.ScanditBarcodeScannerActivity", Boolean.valueOf(n("io.gonative.android.ScanditBarcodeScannerActivity")));
        hashMap3.put("io.gonative.android.downloadmanager.DownloadsActivity", Boolean.valueOf(n("io.gonative.android.downloadmanager.DownloadsActivity")));
        hashMap3.put("io.gonative.android.documentscanner.ScanDocumentActivity", Boolean.valueOf(n("io.gonative.android.documentscanner.ScanDocumentActivity")));
        hashMap3.put("io.gonative.android.SharingUtils", Boolean.valueOf(n("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;
    }

    static void V(a aVar) {
        aVar.o("splashpage.json").delete();
    }

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

    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 i3 = 0; i3 < jSONArray.length(); i3++) {
                try {
                    Object obj2 = jSONArray.get(i3);
                    if (obj2 instanceof String) {
                        arrayList.add(Pattern.compile((String) obj2));
                    }
                } catch (Exception unused2) {
                }
            }
        }
        return arrayList;
    }

    private void c() {
        if (!this.t3 || this.s3 <= 0 || SystemClock.elapsedRealtime() - this.s3 >= 1800000) {
            if (this.t3 || this.s3 <= 0 || SystemClock.elapsedRealtime() - this.s3 >= 60000) {
                new c(this, 0).execute(new Void[0]);
            }
        }
    }

    public void d(JSONArray jSONArray) {
        if (jSONArray != null) {
            this.U.clear();
            this.V.clear();
            for (int i3 = 0; i3 < jSONArray.length(); i3++) {
                JSONObject optJSONObject = jSONArray.optJSONObject(i3);
                if (optJSONObject != null && optJSONObject.has("regex") && optJSONObject.has("internal")) {
                    String Z = Z(optJSONObject, "regex");
                    boolean optBoolean = optJSONObject.optBoolean("internal", true);
                    if (Z != null) {
                        this.U.add(Pattern.compile(Z));
                        this.V.add(Boolean.valueOf(optBoolean));
                    }
                }
            }
            JSONObject x2 = x("splashpage.json");
            if (x2 != null && x2.has("splashPageRegex")) {
                try {
                    this.U.add(0, Pattern.compile(x2.getString("splashPageRegex")));
                    this.V.add(0, Boolean.TRUE);
                } catch (JSONException e3) {
                    e3.printStackTrace();
                }
            }
            try {
                JSONObject jSONObject = new JSONObject();
                jSONObject.put("rules", jSONArray);
                f(jSONObject, "regexintext.json");
            } catch (JSONException e4) {
                e4.printStackTrace();
            }
        }
    }

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

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

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

    private File o(String str) {
        File file = new File(this.f6773a.getFilesDir(), "gonative-config");
        file.mkdirs();
        return new File(file, str);
    }

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

    private void r(JSONArray jSONArray) {
        if (jSONArray == null) {
            return;
        }
        this.f6821m = new ArrayList<>(jSONArray.length());
        this.f6825n = new ArrayList<>(jSONArray.length());
        for (int i3 = 0; i3 < jSONArray.length(); i3++) {
            JSONObject optJSONObject = jSONArray.optJSONObject(i3);
            if (optJSONObject != null) {
                String Z = Z(optJSONObject, "regex");
                String Z2 = Z(optJSONObject, "userAgent");
                if (Z != null && Z2 != null) {
                    try {
                        this.f6821m.add(Pattern.compile(Z));
                        this.f6825n.add(Z2);
                        this.p3 = true;
                    } catch (PatternSyntaxException e3) {
                        g.a().c("co.median.median_core.AppConfig", "Syntax error with user agent regex", e3);
                    }
                }
            }
        }
    }

    private void s(JSONObject jSONObject) {
        this.R = null;
        this.Q = null;
        if (jSONObject != null && jSONObject.optBoolean("active")) {
            this.Q = new ArrayList<>();
            this.R = new ArrayList<>();
            JSONArray optJSONArray = jSONObject.optJSONArray("levels");
            if (optJSONArray != null) {
                for (int i3 = 0; i3 < optJSONArray.length(); i3++) {
                    JSONObject optJSONObject = optJSONArray.optJSONObject(i3);
                    if (optJSONObject != null) {
                        String Z = Z(optJSONObject, "regex");
                        int optInt = optJSONObject.optInt("level", -1);
                        if (Z != null && optInt != -1) {
                            this.Q.add(Pattern.compile(Z));
                            this.R.add(Integer.valueOf(optInt));
                        }
                    }
                }
            }
        }
        g0.a.b(this.f6773a).d(new Intent("io.gonative.android.AppConfig.processedNavigationLevels"));
    }

    public JSONObject x(String str) {
        try {
            FileInputStream fileInputStream = new FileInputStream(o(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 e3) {
            g.a().c("co.median.median_core.AppConfig", "Error reading ".concat(str), e3);
            o(str).delete();
            return null;
        }
    }

    private void y(JSONArray jSONArray) {
        if (jSONArray == null) {
            return;
        }
        this.f6796f2 = jSONArray;
        g0.a.b(this.f6773a).d(new Intent("io.gonative.android.AppConfig.processedWebViewPools"));
    }

    private void z(JSONObject jSONObject) {
        String Z;
        this.S = null;
        if (jSONObject != null && jSONObject.optBoolean("active")) {
            this.S = new ArrayList<>();
            JSONArray optJSONArray = jSONObject.optJSONArray("titles");
            if (optJSONArray != null) {
                for (int i3 = 0; i3 < optJSONArray.length(); i3++) {
                    JSONObject optJSONObject = optJSONArray.optJSONObject(i3);
                    if (optJSONObject != null && (Z = Z(optJSONObject, "regex")) != null) {
                        try {
                            HashMap<String, Object> hashMap = new HashMap<>();
                            hashMap.put("regex", Pattern.compile(Z));
                            String Z2 = Z(optJSONObject, "title");
                            boolean optBoolean = optJSONObject.optBoolean("showImage", false);
                            if (Z2 != null) {
                                hashMap.put("title", Z2);
                            }
                            hashMap.put("showImage", Boolean.valueOf(optBoolean));
                            this.S.add(hashMap);
                        } catch (PatternSyntaxException e3) {
                            g.a().c("co.median.median_core.AppConfig", e3.getMessage(), e3);
                        }
                    }
                }
            }
        }
        g0.a.b(this.f6773a).d(new Intent("io.gonative.android.AppConfig.processedNavigationTitles"));
    }

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

    public String L() {
        JSONObject x2;
        if (!this.w3 && (x2 = x("splashpage.json")) != null && x2.has("splashPageUrl")) {
            this.w3 = true;
            Timer timer = new Timer();
            timer.schedule(new b(timer), 2000L);
        }
        return this.f6785d;
    }

    public HashMap<String, Object> N(String str) {
        ArrayList<HashMap<String, Object>> arrayList;
        if (str != null && (arrayList = this.S) != null) {
            Iterator<HashMap<String, Object>> it = arrayList.iterator();
            while (it.hasNext()) {
                HashMap<String, Object> next = it.next();
                Pattern pattern = (Pattern) next.get("regex");
                if (pattern == null) {
                    return null;
                }
                if (pattern.matcher(str).matches()) {
                    return next;
                }
            }
        }
        return null;
    }

    public HashMap<String, String> O() {
        return this.W;
    }

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

    public boolean S() {
        return this.t3;
    }

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

    public void b0(boolean z2, int i3, boolean z3, boolean z4) {
        this.F = z2;
        this.G = i3;
        this.H = z3;
        if (z4) {
            try {
                JSONObject jSONObject = new JSONObject();
                jSONObject.put("enabled", z2);
                jSONObject.put("numWindows", i3);
                jSONObject.put("autoClose", z3);
                f(jSONObject, "maxwindows.json");
            } catch (JSONException e3) {
                e3.printStackTrace();
            }
        }
    }

    public void c0(JSONObject jSONObject, boolean z2) {
        if (jSONObject != null) {
            s(jSONObject);
            if (z2) {
                f(jSONObject, "navlevels.json");
                return;
            }
            return;
        }
        JSONObject optJSONObject = this.f6777b.optJSONObject("navigation");
        JSONObject optJSONObject2 = optJSONObject.optJSONObject("androidNaviationLevels");
        if (optJSONObject2 == null) {
            optJSONObject2 = optJSONObject.optJSONObject("navigationLevels");
        }
        s(optJSONObject2);
        if (z2) {
            o("navlevels.json").delete();
        }
    }

    public void d0(JSONObject jSONObject, boolean z2) {
        if (jSONObject != null) {
            z(jSONObject);
            if (z2) {
                f(jSONObject, "navtitles.json");
                return;
            }
            return;
        }
        JSONObject optJSONObject = this.f6777b.optJSONObject("navigation");
        z(optJSONObject != null ? optJSONObject.optJSONObject("navigationTitles") : null);
        if (z2) {
            o("navtitles.json").delete();
        }
    }

    public void e0(JSONArray jSONArray) {
        JSONObject optJSONObject;
        if (this.t3) {
            if (jSONArray == null || jSONArray.length() == 0) {
                JSONObject optJSONObject2 = this.f6777b.optJSONObject("navigation");
                if (optJSONObject2 == null || !optJSONObject2.has("regexInternalExternal") || (optJSONObject = optJSONObject2.optJSONObject("regexInternalExternal")) == null || !optJSONObject.has("rules")) {
                    return;
                }
                jSONArray = optJSONObject.optJSONArray("rules");
            }
            d(jSONArray);
        }
    }

    public void f0(Object obj) {
        if (obj == null) {
            return;
        }
        if (obj instanceof Boolean) {
            this.J = ((Boolean) obj).booleanValue();
        } else if (obj instanceof JSONArray) {
            ArrayList arrayList = new ArrayList(Arrays.asList("default", "loggedIn"));
            if (this.P != null) {
                for (int i3 = 0; i3 < this.P.size(); i3++) {
                    String Z = Z(this.P.get(i3), "status");
                    if (Z != null) {
                        arrayList.add(Z);
                    }
                }
            }
            this.I = new HashMap<>();
            for (int i4 = 0; i4 < arrayList.size(); i4++) {
                this.I.put((String) arrayList.get(i4), (JSONArray) obj);
            }
        }
        g0.a.b(this.f6773a).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) {
                f(jSONObject2, "sidebarnav.json");
            }
        } catch (JSONException e3) {
            e3.printStackTrace();
        }
        f0(obj);
    }

    public boolean h0(String str) {
        ArrayList<Pattern> arrayList;
        ArrayList<HashMap<String, Object>> arrayList2;
        c();
        if (str != null && (arrayList2 = this.S) != null) {
            Iterator<HashMap<String, Object>> it = arrayList2.iterator();
            while (true) {
                if (!it.hasNext()) {
                    break;
                }
                HashMap<String, Object> next = it.next();
                if (((Pattern) next.get("regex")).matcher(str).matches()) {
                    if (next.containsKey("showImage") && next.get("showImage") != null && ((Boolean) next.get("showImage")).booleanValue()) {
                        return true;
                    }
                }
            }
        }
        if (str == null || (arrayList = this.V0) == null) {
            return this.P0;
        }
        Iterator<Pattern> it2 = arrayList.iterator();
        while (it2.hasNext()) {
            if (it2.next().matcher(str).matches()) {
                return true;
            }
        }
        return false;
    }

    public boolean i0(String str) {
        List<Pattern> list = this.K;
        if (list == null || list.isEmpty()) {
            return true;
        }
        if (str == null) {
            str = "";
        }
        for (int i3 = 0; i3 < this.K.size(); i3++) {
            if (this.K.get(i3).matcher(str).matches()) {
                return this.L.get(i3).booleanValue();
            }
        }
        return false;
    }

    public String j0(String str) {
        if (str == null) {
            str = "";
        }
        if (this.f6821m != null) {
            for (int i3 = 0; i3 < this.f6821m.size(); i3++) {
                if (this.f6821m.get(i3).matcher(str).matches()) {
                    return this.f6825n.get(i3);
                }
            }
        }
        return this.f6813k;
    }
}