MD5 校验值:51aae3247d6bd20bca268c4c9a4dd21c
a.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。
package B1; import B1.m; import android.content.Context; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.net.Uri; import android.os.AsyncTask; import android.os.Build; import android.os.SystemClock; import android.util.Log; import android.widget.Toast; import com.google.android.gms.common.internal.ImagesContract; import com.google.android.gms.fido.fido2.api.common.DevicePublicKeyStringDef; 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 f747A4; public double f748A; public Integer f749A0; public int f750A1; public String f751A2; public boolean f752A3; public f f753B; public Integer f754B0; public int f755B1; public boolean f756B2; public boolean f757B3; public boolean f758C; public Integer f759C0; public boolean f760C1; public String f761C2; public boolean f762C3; public boolean f763D; public Integer f764D0; public boolean f765D1; public boolean f766D2; public boolean f767D3; public boolean f768E; public boolean f769E0; public String f771E2; public String f772E3; public boolean f773F; public boolean f774F0; public boolean f775F1; public boolean f776F2; public String f777F3; public boolean f778G; public boolean f779G0; public String f780G1; public boolean f781G2; public boolean f782G3; public boolean f783H; public boolean f784H0; public String f785H1; public String f786H2; public boolean f787H3; public int f788I; public double f789I0; public boolean f790I1; public boolean f791I2; public boolean f792I3; public boolean f793J; public boolean f794J0; public boolean f795J1; public String f796J2; public String f797J3; public HashMap f798K; public String f799K0; public boolean f800K1; public boolean f801K2; public String f802K3; public boolean f803L; public Integer f804L0; public C1.d f805L1; public boolean f806L2; public List f808M; public Integer f809M0; public boolean f810M1; public boolean f811M2; public List f813N; public boolean f814N0; public String f815N1; public String f816N2; public String f818O; public double f819O0; public String f820O1; public String f821O2; public String f823P; public String f824P0; public boolean f825P1; public boolean f826P2; public ArrayList f828Q; public boolean f829Q0; public String f830Q1; public boolean f831Q2; private HashMap f832Q3; public ArrayList f833R; public boolean f834R0; public boolean f835R1; public String f836R2; private List f837R3; public ArrayList f838S; public boolean f839S0; public boolean f840S1; public String f841S2; private HashMap f842S3; public ArrayList f843T; public boolean f844T0; public JSONObject f845T1; public String f846T2; private HashMap f847T3; public ArrayList f848U; public boolean f849U0; public boolean f850U1; public String f851U2; private boolean f852U3; public String f853V; public boolean f854V0; public String f855V1; public boolean f856V2; public boolean f857V3; public m f858W; public String f859W0; public boolean f860W1; public boolean f861W2; public boolean f862W3; private HashMap f863X; public C1.f f864X0; public String f865X1; public int f866X2; public boolean f867X3; public boolean f868Y; public ArrayList f869Y0; public String f870Y1; public String f871Y2; public boolean f872Y3; public boolean f873Z; public float f874Z0; public boolean f875Z1; public String f876Z2; public boolean f877Z3; private Context f878a; public boolean f879a0; public Integer f880a1; public boolean f881a2; public boolean f882a3; public boolean f883a4; private JSONObject f884b; public boolean f885b0; public Integer f886b1; public boolean f887b2; public boolean f888b3; public boolean f889b4; public Exception f890c; public ArrayList f891c0; public Integer f892c1; public String f893c2; public int f894c3; public boolean f895c4; private String f896d; public HashMap f897d0; public Integer f898d1; public boolean f899d2; public String f900d3; public boolean f901d4; public String f902e; public ArrayList f903e0; public Integer f904e1; public String f905e2; public boolean f906e3; public boolean f907e4; public String f908f; public ArrayList f909f0; public Integer f910f1; public String f911f2; public String f912f3; public String f913f4; public String f914g; public HashMap f915g0; public Integer f916g1; public String f917g2; public String f918g3; public int f919g4; public String f920h; public ArrayList f921h0; public Integer f922h1; public boolean f923h2; public boolean f924h3; public boolean f925h4; private String f926i; public ArrayList f927i0; public boolean f928i1; public List f929i2; public boolean f930i3; public String f931i4; public String f932j; public ArrayList f933j0; public double f934j1; public String f935j2; public String f936j3; public String f937j4; public String f938k; public ArrayList f939k0; public double f940k1; public JSONArray f941k2; public String f942k3; public String f943k4; public int f944l; public Integer f945l0; public boolean f946l1; public JSONArray f947l2; public boolean f948l3; public String f949l4; public ArrayList f950m; public Integer f951m0; public int f952m1; public boolean f953m2; public boolean f954m3; public boolean f955m4; public ArrayList f956n; public Integer f957n0; public String f958n1; public String f959n2; public String f960n3; public String f961n4; public boolean f962o; public Integer f963o0; public String f964o1; public String f965o2; public String f966o3; public boolean f967o4; public boolean f968p; public Integer f969p0; public JSONObject f970p1; public boolean f971p2; public String f972p3; public boolean f973p4; public boolean f974q; public Integer f975q0; public boolean f976q1; public boolean f977q2; public String f978q3; public boolean f979q4; public boolean f980r; public Integer f981r0; public String f982r1; public boolean f983r2; public String f984r3; public boolean f985r4; public boolean f986s; public Integer f987s0; public JSONObject f988s1; public boolean f989s2; public boolean f990s3; public boolean f991s4; public EnumC0009a f992t; public Integer f993t0; public C1.a f994t1; public String f995t2; public String f996t3; public boolean f997t4; public EnumC0009a f998u; public Integer f999u0; public boolean f1000u1; public ArrayList f1001u2; public String f1002u3; public String f1003u4; public EnumC0009a f1004v; public Integer f1005v0; public boolean f1006v1; public boolean f1007v2; public String f1008v3; public boolean f1009v4; public boolean f1010w; public Integer f1011w0; public boolean f1012w1; public String f1014w3; public String f1015w4; public boolean f1016x; public Integer f1017x0; public boolean f1018x1; public boolean f1019x2; public boolean f1020x3; public boolean f1021x4; public Map f1022y; public Integer f1023y0; public boolean f1024y1; public String f1025y2; public boolean f1026y3; public boolean f1027y4; public List f1028z; public Integer f1029z0; public boolean f1030z1; public boolean f1031z2; public boolean f1032z3; public C1.e f1033z4; private boolean f770E1 = false; public ArrayList f1013w2 = new ArrayList(); private long f807L3 = 0; private boolean f812M3 = true; private boolean f817N3 = true; private boolean f822O3 = true; private boolean f827P3 = false; public enum EnumC0009a { UNSPECIFIED, PORTRAIT, LANDSCAPE } final class b extends TimerTask { final Timer f1038g; b(Timer timer) { this.f1038g = timer; } @Override public final void run() { a aVar = a.this; aVar.f863X = aVar.f832Q3; this.f1038g.cancel(); } } public class c extends AsyncTask { private c() { } @Override protected final Object doInBackground(Object[] objArr) { ByteArrayOutputStream byteArrayOutputStream; a.this.f807L3 = SystemClock.elapsedRealtime(); try { JSONObject jSONObject = new JSONObject(a.this.H()); byte[] bArr = {-21, 41, 13, -62, 113, 29, -7, 48, 26, -97, 4, 125, -107, 4, -80, 115, 26, -127, 22, 50, -39, -33, 96, -105, 25, -46, 123, -62, -90, 109, -33, 58, 71, -100, -107, 56, -20, -16, -5, 116}; byte[] bArr2 = {-125, 93, 121, -78, 2, 39, -42, 31, 118, -10, 103, 24, -5, 119, -43, 93, 125, -18, 120, 83, -83, -74, 22, -14, 55, -69, 20, -19, -54, 4, -68, 95, 41, -17, -16, 91, -124, -107, -104, 31}; byte[] bArr3 = new byte[40]; for (int i5 = 0; i5 < 40; i5++) { bArr3[i5] = (byte) (bArr[i5] ^ bArr2[i5]); } HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(new String(bArr3, Charset.forName("US-ASCII"))).openConnection(); httpURLConnection.setRequestMethod("POST"); httpURLConnection.setRequestProperty("Content-Type", "application/json"); httpURLConnection.setDoOutput(true); OutputStreamWriter outputStreamWriter = new OutputStreamWriter(httpURLConnection.getOutputStream(), "UTF-8"); outputStreamWriter.write(jSONObject.toString()); outputStreamWriter.close(); httpURLConnection.connect(); if (httpURLConnection.getResponseCode() == 200) { if (httpURLConnection.getContentLength() > 0) { byteArrayOutputStream = new ByteArrayOutputStream(httpURLConnection.getContentLength()); } else { byteArrayOutputStream = new ByteArrayOutputStream(); } BufferedInputStream bufferedInputStream = new BufferedInputStream(httpURLConnection.getInputStream()); 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(Object obj) { JSONObject jSONObject = (JSONObject) obj; if (jSONObject == null) { return; } boolean optBoolean = jSONObject.optBoolean("isLicensed", true); JSONObject optJSONObject = jSONObject.optJSONObject("splashPageConfig"); if (optBoolean) { a aVar = a.this; if (optJSONObject == null) { JSONObject L5 = aVar.L("splashpage.json"); if (L5 != null && L5.has("splashPageUrl")) { a aVar2 = a.this; aVar2.f863X = aVar2.f832Q3; aVar2.G("splashpage.json").delete(); } } else { aVar.getClass(); String a02 = a.a0(optJSONObject, "splashPageUrl"); String a03 = a.a0(optJSONObject, "splashPageRegex"); if (a02 != null && !a02.isEmpty() && a03 != null && !a03.isEmpty()) { try { JSONObject jSONObject2 = new JSONObject(); jSONObject2.put("splashPageUrl", a02); jSONObject2.put("splashPageRegex", a03); aVar.E(jSONObject2, "splashpage.json"); } catch (JSONException e5) { e5.printStackTrace(); } } } } boolean optBoolean2 = jSONObject.optBoolean("isLicensedForPush", true); a.this.f822O3 = jSONObject.optBoolean("isPublished", false); String a04 = a.a0(jSONObject, "alert"); if (a04 != null && !a04.isEmpty()) { if (!optBoolean) { a aVar3 = a.this; if (aVar3.f822O3) { JSONObject L6 = aVar3.L("splashpage.json"); if (L6 != null) { } } } Toast.makeText(a.this.f878a, a04, 1).show(); } if (!optBoolean) { optBoolean2 = false; } if (!optBoolean) { a aVar4 = a.this; if (aVar4.f812M3) { aVar4.f812M3 = false; if (!aVar4.f822O3) { aVar4.G("splashpage.json").delete(); String c5 = n.c(jSONObject, "unlicensedUrl"); if (c5 == null) { c5 = "https://gonative.io/unlicensed"; } String c6 = n.c(jSONObject, "unlicensedLabel"); if (c6 == null) { c6 = "Disabled"; } a aVar5 = a.this; aVar5.f902e = aVar5.f896d; aVar5.f896d = c5; if (jSONObject.optBoolean("disableRedirects")) { a.this.f863X = null; } else { a.this.f863X = new HashMap(); a.this.f863X.put("*", c5); } a aVar6 = a.this; aVar6.f837R3 = aVar6.f858W.d(); a.this.f858W.b(); JSONArray optJSONArray = jSONObject.optJSONArray("regexInternalExternalRules"); if (optJSONArray != null) { a.this.C(optJSONArray); } else { a.this.f858W.a(new m.a("internal", Pattern.compile(".*"))); } a.this.f842S3 = new HashMap(a.this.f798K); for (String str : a.this.f798K.keySet()) { try { JSONObject jSONObject3 = new JSONObject(); jSONObject3.put(ImagesContract.URL, c5); jSONObject3.put("label", c6); JSONArray jSONArray = new JSONArray(); jSONArray.put(jSONObject3); a.this.f798K.put(str, jSONArray); } catch (JSONException unused) { } } a.this.f847T3 = new HashMap(a.this.f897d0); for (String str2 : a.this.f897d0.keySet()) { try { JSONObject jSONObject4 = new JSONObject(); jSONObject4.put(ImagesContract.URL, c5); jSONObject4.put("label", c6); jSONObject4.put("icon", "fa-ban"); JSONArray jSONArray2 = new JSONArray(); jSONArray2.put(jSONObject4); a.this.f897d0.put(str2, jSONArray2); } catch (JSONException unused2) { } } L0.a.b(a.this.f878a).d(new Intent("io.gonative.android.AppConfig.processedMenu")); L0.a.b(a.this.f878a).d(new Intent("io.gonative.android.AppConfig.processedTabNavigation")); } else if (optJSONObject != null) { String a05 = a.a0(optJSONObject, "splashPageUrl"); String a06 = a.a0(optJSONObject, "splashPageRegex"); if (a05 != null && !a05.isEmpty() && a06 != null && !a06.isEmpty()) { try { JSONObject jSONObject5 = new JSONObject(); jSONObject5.put("splashPageUrl", a05); jSONObject5.put("splashPageRegex", a06); aVar4.E(jSONObject5, "splashpage.json"); } catch (JSONException e6) { e6.printStackTrace(); } } } } } if (!optBoolean2) { a aVar7 = a.this; if (aVar7.f817N3) { aVar7.f817N3 = false; aVar7.f852U3 = aVar7.f775F1; aVar7.f775F1 = false; } } if (optBoolean) { a aVar8 = a.this; if (!aVar8.f812M3) { aVar8.f812M3 = true; aVar8.f896d = aVar8.f902e; aVar8.f863X = aVar8.f832Q3; aVar8.f858W.f(aVar8.f837R3); a aVar9 = a.this; aVar9.f798K = aVar9.f842S3; aVar9.f897d0 = aVar9.f847T3; L0.a.b(aVar9.f878a).d(new Intent("io.gonative.android.AppConfig.processedMenu")); L0.a.b(a.this.f878a).d(new Intent("io.gonative.android.AppConfig.processedTabNavigation")); } } if (optBoolean2) { a aVar10 = a.this; if (aVar10.f817N3) { return; } aVar10.f817N3 = true; aVar10.f775F1 = aVar10.f852U3; } } } private a(Context context) { Exception exc; InputStream inputStream; Throwable th; Exception exc2; BufferedInputStream bufferedInputStream; JSONObject optJSONObject; JSONObject optJSONObject2; JSONObject optJSONObject3; JSONObject optJSONObject4; Integer d5; JSONObject optJSONObject5; JSONObject optJSONObject6; JSONObject optJSONObject7; JSONObject optJSONObject8; JSONObject optJSONObject9; JSONObject L5; JSONObject optJSONObject10; JSONObject optJSONObject11; JSONObject optJSONObject12; JSONObject optJSONObject13; JSONObject optJSONObject14; String a02; double optDouble; boolean optBoolean; JSONObject L6; JSONArray optJSONArray; JSONArray optJSONArray2; Object opt; JSONObject optJSONObject15; JSONArray optJSONArray3; int i5; String optString; JSONArray optJSONArray4; String a03; String optString2; EnumC0009a enumC0009a; EnumC0009a enumC0009a2; EnumC0009a enumC0009a3; this.f974q = true; this.f748A = 10.0d; this.f753B = f.DEFAULT; this.f758C = true; this.f763D = true; this.f769E0 = false; this.f774F0 = false; this.f779G0 = false; this.f784H0 = false; this.f814N0 = true; this.f1000u1 = false; this.f1006v1 = false; this.f1012w1 = false; this.f1018x1 = false; this.f1024y1 = false; this.f1030z1 = false; this.f750A1 = Integer.MIN_VALUE; this.f755B1 = Integer.MIN_VALUE; this.f775F1 = false; this.f790I1 = false; this.f795J1 = true; this.f800K1 = true; this.f810M1 = false; this.f825P1 = false; this.f835R1 = true; this.f840S1 = false; this.f850U1 = false; this.f860W1 = false; this.f875Z1 = false; this.f887b2 = false; this.f899d2 = false; this.f923h2 = false; this.f953m2 = false; this.f971p2 = true; this.f977q2 = false; this.f983r2 = false; this.f989s2 = false; this.f1001u2 = new ArrayList(); this.f1007v2 = false; this.f1019x2 = false; this.f1025y2 = null; this.f1031z2 = false; this.f751A2 = null; this.f756B2 = false; this.f766D2 = false; this.f771E2 = null; this.f776F2 = false; this.f781G2 = false; this.f786H2 = null; this.f791I2 = false; this.f796J2 = null; this.f801K2 = false; this.f806L2 = false; this.f811M2 = false; this.f826P2 = false; this.f831Q2 = false; this.f836R2 = null; this.f841S2 = null; this.f846T2 = null; this.f851U2 = null; this.f856V2 = true; this.f861W2 = false; this.f882a3 = false; this.f888b3 = false; this.f894c3 = 0; this.f906e3 = false; this.f924h3 = false; this.f930i3 = false; this.f948l3 = false; this.f990s3 = false; this.f1020x3 = false; this.f1026y3 = false; this.f1032z3 = false; this.f752A3 = false; this.f757B3 = false; this.f762C3 = false; this.f767D3 = false; this.f782G3 = false; this.f787H3 = true; this.f792I3 = false; this.f857V3 = false; this.f862W3 = false; this.f867X3 = false; this.f872Y3 = false; this.f877Z3 = false; this.f883a4 = false; this.f889b4 = false; this.f895c4 = false; this.f901d4 = false; this.f925h4 = false; this.f955m4 = false; this.f967o4 = true; this.f973p4 = false; this.f979q4 = false; this.f985r4 = false; this.f991s4 = false; this.f997t4 = false; this.f1009v4 = true; this.f1021x4 = false; this.f1027y4 = false; this.f878a = context; try { try { if (T().exists()) { try { bufferedInputStream = new BufferedInputStream(new FileInputStream(T())); } catch (Exception e5) { exc2 = e5; bufferedInputStream = null; } try { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); k.b(bufferedInputStream, byteArrayOutputStream); byteArrayOutputStream.close(); this.f884b = new JSONObject(byteArrayOutputStream.toString("UTF-8")); } catch (Exception e6) { exc2 = e6; g.a().c("co.median.median_core.AppConfig", exc2.getMessage(), exc2); k.a(bufferedInputStream); if (this.f884b != null) { } this.f858W = new m(); optJSONObject = this.f884b.optJSONObject("general"); if (optJSONObject != null) { } optJSONObject2 = this.f884b.optJSONObject("forms"); if (optJSONObject2 != null) { } optJSONObject3 = this.f884b.optJSONObject("navigation"); if (optJSONObject3 != null) { } optJSONObject4 = this.f884b.optJSONObject("styling"); if (optJSONObject4 != null) { } this.f945l0 = n.d(a0(optJSONObject4, "androidActionBarBackgroundColor")); this.f951m0 = n.d(a0(optJSONObject4, "androidActionBarBackgroundColorDark")); this.f957n0 = n.d(a0(optJSONObject4, "androidSidebarBackgroundColor")); this.f963o0 = n.d(a0(optJSONObject4, "androidSidebarBackgroundColorDark")); this.f969p0 = n.d(a0(optJSONObject4, "androidSidebarForegroundColor")); this.f975q0 = n.d(a0(optJSONObject4, "androidSidebarForegroundColorDark")); this.f981r0 = n.d(a0(optJSONObject4, "androidSidebarHighlightColor")); this.f987s0 = n.d(a0(optJSONObject4, "androidSidebarHighlightColorDark")); this.f993t0 = n.d(a0(optJSONObject4, "androidTintColor")); this.f1011w0 = n.d(a0(optJSONObject4, "androidTabBarBackgroundColor")); this.f1017x0 = n.d(a0(optJSONObject4, "androidTabBarBackgroundColorDark")); this.f999u0 = n.d(a0(optJSONObject4, "androidTabBarTextColor")); this.f1005v0 = n.d(a0(optJSONObject4, "androidTabBarTextColorDark")); this.f1023y0 = n.d(a0(optJSONObject4, "androidTabBarIndicatorColor")); this.f1029z0 = n.d(a0(optJSONObject4, "androidTabBarIndicatorColorDark")); this.f749A0 = n.d(a0(optJSONObject4, "androidTabPressedBackgroundColor")); this.f754B0 = n.d(a0(optJSONObject4, "androidTabPressedBackgroundColorDark")); this.f819O0 = optJSONObject4.optDouble("transitionInteractiveDelayMax", Double.NaN); boolean optBoolean2 = optJSONObject4.optBoolean("androidHideTitleInActionBar", false); this.f829Q0 = optBoolean2; this.f834R0 = optJSONObject4.optBoolean("androidShowLogoInActionBar", optBoolean2); this.f839S0 = optJSONObject4.optBoolean("androidShowLogoInSideBar", true); this.f844T0 = optJSONObject4.optBoolean("androidShowAppNameInSideBar", true); this.f854V0 = optJSONObject4.optBoolean("androidEnableOverlayInStatusBar", false); this.f859W0 = a0(optJSONObject4, "androidStatusBarStyle"); this.f864X0 = new C1.f(optJSONObject4); d5 = n.d(a0(optJSONObject4, "androidActionBarForegroundColor")); this.f804L0 = d5; if (d5 == null) { } this.f809M0 = n.d(a0(optJSONObject4, "androidActionBarForegroundColorDark")); I(optJSONObject4.opt("navigationTitleImage")); this.f874Z0 = (float) optJSONObject4.optDouble("hideWebviewAlpha", 0.0d); this.f880a1 = n.d(a0(optJSONObject4, "androidPullToRefreshColor")); this.f886b1 = n.d(a0(optJSONObject4, "androidPullToRefreshColorDark")); this.f892c1 = n.d(a0(optJSONObject4, "androidSwipeNavigationBackgroundColor")); this.f898d1 = n.d(a0(optJSONObject4, "androidSwipeNavigationBackgroundColorDark")); this.f904e1 = n.d(a0(optJSONObject4, "androidSwipeNavigationActiveColor")); this.f910f1 = n.d(a0(optJSONObject4, "androidSwipeNavigationActiveColorDark")); this.f916g1 = n.d(a0(optJSONObject4, "androidSwipeNavigationInactiveColor")); this.f922h1 = n.d(a0(optJSONObject4, "androidSwipeNavigationInactiveColorDark")); this.f928i1 = optJSONObject4.optBoolean("androidShowSplash", false); this.f934j1 = optJSONObject4.optDouble("androidShowSplashMaxTime", 1.5d); this.f940k1 = optJSONObject4.optDouble("androidShowSplashForceTime", Double.NaN); this.f759C0 = n.d(a0(optJSONObject4, "androidSplashBackgroundColor")); this.f764D0 = n.d(a0(optJSONObject4, "androidSplashBackgroundColorDark")); this.f946l1 = optJSONObject4.optBoolean("disableAnimations", false); this.f952m1 = optJSONObject4.optInt("androidWebviewTextZoom", -1); optJSONObject5 = this.f884b.optJSONObject("script"); if (optJSONObject5 != null) { } optJSONObject6 = this.f884b.optJSONObject("permissions"); if (optJSONObject6 != null) { } optJSONObject7 = this.f884b.optJSONObject("contextMenu"); if (optJSONObject7 == null) { } optJSONObject8 = this.f884b.optJSONObject("services"); if (optJSONObject8 != null) { } optJSONObject9 = this.f884b.optJSONObject("performance"); if (optJSONObject9 != null) { } this.f787H3 = this.f884b.optBoolean("allowZoom", true); L5 = L("splashpage.json"); if (L5 != null) { HashMap hashMap = new HashMap(); this.f863X = hashMap; hashMap.put("*", L5.getString("splashPageUrl")); } optJSONObject10 = this.f884b.optJSONObject("security"); if (optJSONObject10 != null) { this.f802K3 = optJSONObject12.optString("androidConfigXML"); } optJSONObject11 = this.f884b.optJSONObject("developmentTools"); if (optJSONObject11 != null) { this.f857V3 = true; } k.a(null); k.a(inputStream); B(); } } if (this.f884b != null) { inputStream = context.getAssets().open("appConfig.json"); try { try { ByteArrayOutputStream byteArrayOutputStream2 = new ByteArrayOutputStream(); k.b(inputStream, byteArrayOutputStream2); k.a(byteArrayOutputStream2); this.f884b = new JSONObject(byteArrayOutputStream2.toString("UTF-8")); } catch (Exception e7) { exc = e7; g.a().c("co.median.median_core.AppConfig", exc.getMessage(), exc); this.f890c = exc; k.a(null); k.a(inputStream); B(); } } catch (Throwable th2) { th = th2; k.a(null); k.a(inputStream); throw th; } } else { inputStream = null; } this.f858W = new m(); optJSONObject = this.f884b.optJSONObject("general"); if (optJSONObject != null) { JSONObject L7 = L("initurl.json"); if (L7 == null || !L7.has("initialUrl")) { a03 = a0(optJSONObject, "initialUrl"); this.f902e = a03; } else { a03 = L7.getString("initialUrl"); this.f902e = a03; } this.f896d = a03; String host = Uri.parse(this.f896d).getHost(); this.f908f = host; if (host.startsWith("www.")) { this.f908f = this.f908f.substring(4); } this.f914g = a0(optJSONObject, "appName"); String a04 = a0(optJSONObject, "androidForceUserAgent"); this.f926i = a04; if (a04 == null || a04.isEmpty()) { this.f926i = a0(optJSONObject, "forceUserAgent"); } String str = this.f926i; if (str == null || str.isEmpty()) { String a05 = a0(optJSONObject, "androidUserAgentAdd"); this.f932j = a05; if (a05 == null || a05.isEmpty()) { this.f932j = a0(optJSONObject, "userAgentAdd"); } if (this.f932j == null) { this.f932j = "gonative"; } if (this.f932j.equals("gonative")) { this.f932j = "GoNativeAndroid/1.0 gonative"; } } else { this.f938k = this.f926i; } this.f920h = a0(optJSONObject, "publicKey"); int optInt = optJSONObject.optInt("forceSessionCookieExpiry", 0); this.f944l = optInt; if (optInt > 0) { this.f792I3 = true; } J(optJSONObject.optJSONArray("userAgentRegexes")); this.f962o = optJSONObject.optBoolean("disableConfigUpdater", false); this.f968p = optJSONObject.optBoolean("disableEventRecorder", false); this.f974q = optJSONObject.optBoolean("androidDirectCameraUploads", true); this.f980r = optJSONObject.optBoolean("androidClearCache", false); this.f986s = optJSONObject.optBoolean("enableWindowOpen", false); String a06 = a0(optJSONObject, "forceScreenOrientation"); if (a06 != null) { if (a06.equalsIgnoreCase("portrait")) { enumC0009a3 = EnumC0009a.PORTRAIT; } else { enumC0009a3 = a06.equalsIgnoreCase("landscape") ? EnumC0009a.LANDSCAPE : enumC0009a3; } this.f992t = enumC0009a3; } JSONObject optJSONObject16 = optJSONObject.optJSONObject("screenOrientation"); if (optJSONObject16 != null) { String optString3 = optJSONObject16.optString("androidPhone", ""); if ("portrait".equalsIgnoreCase(optString3)) { enumC0009a2 = EnumC0009a.PORTRAIT; } else { enumC0009a2 = "landscape".equalsIgnoreCase(optString3) ? EnumC0009a.LANDSCAPE : enumC0009a2; optString2 = optJSONObject16.optString("androidTablet", ""); if ("portrait".equalsIgnoreCase(optString2)) { enumC0009a = "landscape".equalsIgnoreCase(optString2) ? EnumC0009a.LANDSCAPE : enumC0009a; } else { enumC0009a = EnumC0009a.PORTRAIT; } this.f1004v = enumC0009a; } this.f998u = enumC0009a2; optString2 = optJSONObject16.optString("androidTablet", ""); if ("portrait".equalsIgnoreCase(optString2)) { } this.f1004v = enumC0009a; } this.f1010w = optJSONObject.optBoolean("keepScreenOn", false); this.f1016x = optJSONObject.optBoolean("androidFullScreen", false); JSONObject optJSONObject17 = optJSONObject.optJSONObject("androidCustomHeaders"); optJSONObject17 = optJSONObject17 == null ? optJSONObject.optJSONObject("customHeaders") : optJSONObject17; if (optJSONObject17 != null) { this.f1022y = new HashMap(); Iterator<String> keys = optJSONObject17.keys(); while (keys.hasNext()) { String next = keys.next(); String a07 = a0(optJSONObject17, next); if (next != null && a07 != null && !next.isEmpty() && !a07.isEmpty()) { this.f1022y.put(next, a07); } } } this.f797J3 = a0(optJSONObject, "postLoadJavascript"); this.f1028z = A(optJSONObject.opt("nativeBridgeUrls")); this.f753B = f.c(optJSONObject.optString("androidCacheMode", "default")); this.f758C = optJSONObject.optBoolean("sslToastErrorsEnabled", true); this.f763D = optJSONObject.optBoolean("injectMedianJS", this.f763D); } optJSONObject2 = this.f884b.optJSONObject("forms"); if (optJSONObject2 != null) { JSONObject optJSONObject18 = optJSONObject2.optJSONObject("search"); if (optJSONObject18 != null && optJSONObject18.optBoolean("active", false)) { this.f958n1 = a0(optJSONObject18, "searchTemplateURL"); } JSONObject optJSONObject19 = optJSONObject2.optJSONObject("loginConfig"); if (optJSONObject19 != null && optJSONObject19.optBoolean("active", false)) { this.f970p1 = optJSONObject19; this.f964o1 = a0(optJSONObject19, "interceptUrl"); this.f976q1 = optJSONObject19.optBoolean("loginIsFirstPage", false); } JSONObject optJSONObject20 = optJSONObject2.optJSONObject("signupConfig"); if (optJSONObject20 != null && optJSONObject20.optBoolean("active", false)) { this.f988s1 = optJSONObject20; this.f982r1 = a0(optJSONObject20, "interceptUrl"); } } optJSONObject3 = this.f884b.optJSONObject("navigation"); if (optJSONObject3 != null) { this.f768E = optJSONObject3.optBoolean("androidPullToRefresh"); this.f773F = optJSONObject3.optBoolean("swipeGestures"); this.f778G = optJSONObject3.optBoolean("swipeGesturesEdge"); JSONObject L8 = L("maxwindows.json"); if (L8 != null) { this.f783H = L8.optBoolean("enabled", false); this.f788I = L8.optInt("numWindows", 100); optBoolean = L8.optBoolean("autoClose", false); } else { JSONObject optJSONObject21 = optJSONObject3.optJSONObject("maxWindows"); if (optJSONObject21 != null && optJSONObject21.optBoolean("enabled")) { this.f783H = true; this.f788I = optJSONObject21.optInt("numWindows", 100); optBoolean = optJSONObject21.optBoolean("autoClose", false); } JSONObject L9 = L("sidebarnav.json"); R((L9 == null && L9.has("menus")) ? L9 : optJSONObject3.optJSONObject("sidebarNavigation")); JSONObject L10 = L("navlevels.json"); L10 = L10 == null ? optJSONObject3.optJSONObject("androidNavigationLevels") : L10; K(L10 == null ? optJSONObject3.optJSONObject("navigationLevels") : L10); JSONObject L11 = L("navtitles.json"); N(L11 == null ? optJSONObject3.optJSONObject("navigationTitles") : L11); this.f853V = a0(optJSONObject3, "profilePickerJS"); L6 = L("regexintext.json"); if (L6 == null && L6.has("rules")) { optJSONArray4 = L6.getJSONArray("rules"); } else { JSONObject optJSONObject22 = optJSONObject3.optJSONObject("regexInternalExternal"); optJSONArray4 = (optJSONObject22 != null && optJSONObject22.optBoolean("active")) ? optJSONObject22.optJSONArray("rules") : optJSONArray4; S(optJSONObject3.optJSONObject("tabNavigation")); D(optJSONObject3.optJSONObject("actionConfig")); this.f849U0 = optJSONObject3.optBoolean("androidShowRefreshButton", true); optJSONArray = optJSONObject3.optJSONArray("ignorePageFinishedRegexes"); this.f933j0 = new ArrayList(); if (optJSONArray != null) { for (int i6 = 0; i6 < optJSONArray.length(); i6++) { if (!optJSONArray.isNull(i6) && (optString = optJSONArray.optString(i6)) != null) { try { this.f933j0.add(Pattern.compile(optString)); } catch (PatternSyntaxException e8) { g.a().c("co.median.median_core.AppConfig", "Error parsing regex " + optString, e8); } } } } optJSONArray2 = optJSONObject3.optJSONArray("redirects"); if (optJSONArray2 != null) { this.f863X = new HashMap(optJSONArray2.length()); for (int i7 = 0; i7 < optJSONArray2.length(); i7++) { String c5 = n.c(optJSONArray2.optJSONObject(i7), "from"); String c6 = n.c(optJSONArray2.optJSONObject(i7), "to"); if (c5 != null && c6 != null) { this.f863X.put(c5, c6); } } } else { this.f863X = null; } this.f832Q3 = this.f863X; P(optJSONObject3.optJSONObject("segmentedControl")); this.f873Z = optJSONObject3.optBoolean("androidShowOfflinePage", true); this.f879a0 = optJSONObject3.optBoolean("androidShakeToClearCache", false); this.f885b0 = optJSONObject3.optBoolean("androidDisableBackButton", false); opt = optJSONObject3.opt("androidConnectionOfflineTime"); if (opt != null) { if (!(opt instanceof Boolean) || ((Boolean) opt).booleanValue()) { this.f748A = optJSONObject3.optDouble("androidConnectionOfflineTime", this.f748A); } else { this.f748A = Double.NaN; } } optJSONObject15 = optJSONObject3.optJSONObject("deepLinkDomains"); if (optJSONObject15 != null && (optJSONArray3 = optJSONObject15.optJSONArray("domains")) != null) { this.f939k0 = new ArrayList(); for (i5 = 0; i5 < optJSONArray3.length(); i5++) { try { this.f939k0.add(optJSONArray3.getString(i5)); } catch (JSONException unused) { } } } } C(optJSONArray4); S(optJSONObject3.optJSONObject("tabNavigation")); D(optJSONObject3.optJSONObject("actionConfig")); this.f849U0 = optJSONObject3.optBoolean("androidShowRefreshButton", true); optJSONArray = optJSONObject3.optJSONArray("ignorePageFinishedRegexes"); this.f933j0 = new ArrayList(); if (optJSONArray != null) { } optJSONArray2 = optJSONObject3.optJSONArray("redirects"); if (optJSONArray2 != null) { } this.f832Q3 = this.f863X; P(optJSONObject3.optJSONObject("segmentedControl")); this.f873Z = optJSONObject3.optBoolean("androidShowOfflinePage", true); this.f879a0 = optJSONObject3.optBoolean("androidShakeToClearCache", false); this.f885b0 = optJSONObject3.optBoolean("androidDisableBackButton", false); opt = optJSONObject3.opt("androidConnectionOfflineTime"); if (opt != null) { } optJSONObject15 = optJSONObject3.optJSONObject("deepLinkDomains"); if (optJSONObject15 != null) { this.f939k0 = new ArrayList(); while (i5 < optJSONArray3.length()) { } } } this.f793J = optBoolean; JSONObject L92 = L("sidebarnav.json"); R((L92 == null && L92.has("menus")) ? L92 : optJSONObject3.optJSONObject("sidebarNavigation")); JSONObject L102 = L("navlevels.json"); if (L102 == null) { } K(L102 == null ? optJSONObject3.optJSONObject("navigationLevels") : L102); JSONObject L112 = L("navtitles.json"); N(L112 == null ? optJSONObject3.optJSONObject("navigationTitles") : L112); this.f853V = a0(optJSONObject3, "profilePickerJS"); L6 = L("regexintext.json"); if (L6 == null) { } JSONObject optJSONObject222 = optJSONObject3.optJSONObject("regexInternalExternal"); if (optJSONObject222 != null) { C(optJSONArray4); } S(optJSONObject3.optJSONObject("tabNavigation")); D(optJSONObject3.optJSONObject("actionConfig")); this.f849U0 = optJSONObject3.optBoolean("androidShowRefreshButton", true); optJSONArray = optJSONObject3.optJSONArray("ignorePageFinishedRegexes"); this.f933j0 = new ArrayList(); if (optJSONArray != null) { } optJSONArray2 = optJSONObject3.optJSONArray("redirects"); if (optJSONArray2 != null) { } this.f832Q3 = this.f863X; P(optJSONObject3.optJSONObject("segmentedControl")); this.f873Z = optJSONObject3.optBoolean("androidShowOfflinePage", true); this.f879a0 = optJSONObject3.optBoolean("androidShakeToClearCache", false); this.f885b0 = optJSONObject3.optBoolean("androidDisableBackButton", false); opt = optJSONObject3.opt("androidConnectionOfflineTime"); if (opt != null) { } optJSONObject15 = optJSONObject3.optJSONObject("deepLinkDomains"); if (optJSONObject15 != null) { } } optJSONObject4 = this.f884b.optJSONObject("styling"); if (optJSONObject4 != null) { if (a0(optJSONObject4, "customCSS") != null) { if (!a0(optJSONObject4, "customCSS").isEmpty()) { } this.f769E0 = true; if (a0(optJSONObject4, "androidCustomCSS") != null) { if (!a0(optJSONObject4, "androidCustomCSS").isEmpty()) { } this.f774F0 = true; optDouble = optJSONObject4.optDouble("forceViewportWidth", Double.NaN); this.f789I0 = optDouble; if (!Double.isNaN(optDouble)) { this.f792I3 = true; } this.f794J0 = optJSONObject4.optBoolean("zoomableForceViewport", false); this.f814N0 = optJSONObject4.optBoolean("showActionBar", true); this.f799K0 = a0(optJSONObject4, "androidTheme"); } if (a0(optJSONObject4, "androidCustomCSSUrl") != null && !a0(optJSONObject4, "androidCustomCSSUrl").isEmpty()) { this.f774F0 = true; } optDouble = optJSONObject4.optDouble("forceViewportWidth", Double.NaN); this.f789I0 = optDouble; if (!Double.isNaN(optDouble)) { } this.f794J0 = optJSONObject4.optBoolean("zoomableForceViewport", false); this.f814N0 = optJSONObject4.optBoolean("showActionBar", true); this.f799K0 = a0(optJSONObject4, "androidTheme"); } if (a0(optJSONObject4, "customCSSUrl") != null && !a0(optJSONObject4, "customCSSUrl").isEmpty()) { this.f769E0 = true; } if (a0(optJSONObject4, "androidCustomCSS") != null) { } if (a0(optJSONObject4, "androidCustomCSSUrl") != null) { this.f774F0 = true; } optDouble = optJSONObject4.optDouble("forceViewportWidth", Double.NaN); this.f789I0 = optDouble; if (!Double.isNaN(optDouble)) { } this.f794J0 = optJSONObject4.optBoolean("zoomableForceViewport", false); this.f814N0 = optJSONObject4.optBoolean("showActionBar", true); this.f799K0 = a0(optJSONObject4, "androidTheme"); } this.f945l0 = n.d(a0(optJSONObject4, "androidActionBarBackgroundColor")); this.f951m0 = n.d(a0(optJSONObject4, "androidActionBarBackgroundColorDark")); this.f957n0 = n.d(a0(optJSONObject4, "androidSidebarBackgroundColor")); this.f963o0 = n.d(a0(optJSONObject4, "androidSidebarBackgroundColorDark")); this.f969p0 = n.d(a0(optJSONObject4, "androidSidebarForegroundColor")); this.f975q0 = n.d(a0(optJSONObject4, "androidSidebarForegroundColorDark")); this.f981r0 = n.d(a0(optJSONObject4, "androidSidebarHighlightColor")); this.f987s0 = n.d(a0(optJSONObject4, "androidSidebarHighlightColorDark")); this.f993t0 = n.d(a0(optJSONObject4, "androidTintColor")); this.f1011w0 = n.d(a0(optJSONObject4, "androidTabBarBackgroundColor")); this.f1017x0 = n.d(a0(optJSONObject4, "androidTabBarBackgroundColorDark")); this.f999u0 = n.d(a0(optJSONObject4, "androidTabBarTextColor")); this.f1005v0 = n.d(a0(optJSONObject4, "androidTabBarTextColorDark")); this.f1023y0 = n.d(a0(optJSONObject4, "androidTabBarIndicatorColor")); this.f1029z0 = n.d(a0(optJSONObject4, "androidTabBarIndicatorColorDark")); this.f749A0 = n.d(a0(optJSONObject4, "androidTabPressedBackgroundColor")); this.f754B0 = n.d(a0(optJSONObject4, "androidTabPressedBackgroundColorDark")); this.f819O0 = optJSONObject4.optDouble("transitionInteractiveDelayMax", Double.NaN); boolean optBoolean22 = optJSONObject4.optBoolean("androidHideTitleInActionBar", false); this.f829Q0 = optBoolean22; this.f834R0 = optJSONObject4.optBoolean("androidShowLogoInActionBar", optBoolean22); this.f839S0 = optJSONObject4.optBoolean("androidShowLogoInSideBar", true); this.f844T0 = optJSONObject4.optBoolean("androidShowAppNameInSideBar", true); this.f854V0 = optJSONObject4.optBoolean("androidEnableOverlayInStatusBar", false); this.f859W0 = a0(optJSONObject4, "androidStatusBarStyle"); this.f864X0 = new C1.f(optJSONObject4); d5 = n.d(a0(optJSONObject4, "androidActionBarForegroundColor")); this.f804L0 = d5; if (d5 == null) { String str2 = this.f799K0; this.f804L0 = str2 == null ? -1 : str2.equalsIgnoreCase("light") ? -16777216 : -1; } this.f809M0 = n.d(a0(optJSONObject4, "androidActionBarForegroundColorDark")); I(optJSONObject4.opt("navigationTitleImage")); this.f874Z0 = (float) optJSONObject4.optDouble("hideWebviewAlpha", 0.0d); this.f880a1 = n.d(a0(optJSONObject4, "androidPullToRefreshColor")); this.f886b1 = n.d(a0(optJSONObject4, "androidPullToRefreshColorDark")); this.f892c1 = n.d(a0(optJSONObject4, "androidSwipeNavigationBackgroundColor")); this.f898d1 = n.d(a0(optJSONObject4, "androidSwipeNavigationBackgroundColorDark")); this.f904e1 = n.d(a0(optJSONObject4, "androidSwipeNavigationActiveColor")); this.f910f1 = n.d(a0(optJSONObject4, "androidSwipeNavigationActiveColorDark")); this.f916g1 = n.d(a0(optJSONObject4, "androidSwipeNavigationInactiveColor")); this.f922h1 = n.d(a0(optJSONObject4, "androidSwipeNavigationInactiveColorDark")); this.f928i1 = optJSONObject4.optBoolean("androidShowSplash", false); this.f934j1 = optJSONObject4.optDouble("androidShowSplashMaxTime", 1.5d); this.f940k1 = optJSONObject4.optDouble("androidShowSplashForceTime", Double.NaN); this.f759C0 = n.d(a0(optJSONObject4, "androidSplashBackgroundColor")); this.f764D0 = n.d(a0(optJSONObject4, "androidSplashBackgroundColorDark")); this.f946l1 = optJSONObject4.optBoolean("disableAnimations", false); this.f952m1 = optJSONObject4.optInt("androidWebviewTextZoom", -1); optJSONObject5 = this.f884b.optJSONObject("script"); if (optJSONObject5 != null) { if (a0(optJSONObject5, "customJS") != null) { if (!a0(optJSONObject5, "customJS").isEmpty()) { } this.f779G0 = true; if (a0(optJSONObject5, "androidCustomJS") != null) { if (!a0(optJSONObject5, "androidCustomJS").isEmpty()) { } this.f784H0 = true; } if (a0(optJSONObject5, "androidCustomJSUrl") != null && !a0(optJSONObject5, "androidCustomJSUrl").isEmpty()) { this.f784H0 = true; } } if (a0(optJSONObject5, "customJSUrl") != null && !a0(optJSONObject5, "customJSUrl").isEmpty()) { this.f779G0 = true; } if (a0(optJSONObject5, "androidCustomJS") != null) { } if (a0(optJSONObject5, "androidCustomJSUrl") != null) { this.f784H0 = true; } } optJSONObject6 = this.f884b.optJSONObject("permissions"); if (optJSONObject6 != null) { this.f1000u1 = optJSONObject6.optBoolean("usesGeolocation", false); this.f1006v1 = optJSONObject6.optBoolean("androidDownloadToPublicStorage", false); this.f1012w1 = optJSONObject6.optBoolean("enableWebRTCBluetoothAudio", false); this.f1018x1 = optJSONObject6.optBoolean("enableWebRTCCamera", false); this.f1024y1 = optJSONObject6.optBoolean("enableWebRTCMicrophone", false); } optJSONObject7 = this.f884b.optJSONObject("contextMenu"); if (optJSONObject7 == null) { this.f994t1 = new C1.a(optJSONObject7); } else { this.f994t1 = new C1.a(false, new C1.c(new ArrayList())); } optJSONObject8 = this.f884b.optJSONObject("services"); if (optJSONObject8 != null) { JSONObject optJSONObject23 = optJSONObject8.optJSONObject("backgroundLocation"); if (optJSONObject23 != null) { this.f760C1 = optJSONObject23.optBoolean("active"); this.f765D1 = optJSONObject23.optBoolean("foregroundOnly"); } JSONObject optJSONObject24 = optJSONObject8.optJSONObject("autorefresh"); if (optJSONObject24 != null) { this.f882a3 = optJSONObject24.optBoolean("active", false); this.f888b3 = optJSONObject24.optBoolean("enabled", false); this.f894c3 = optJSONObject24.optInt("interval", 0); this.f900d3 = a0(optJSONObject24, ImagesContract.URL); } JSONObject optJSONObject25 = optJSONObject8.optJSONObject("cordial"); if (optJSONObject25 != null) { this.f906e3 = optJSONObject25.optBoolean("active"); this.f912f3 = optJSONObject25.optString("accountKey"); this.f918g3 = optJSONObject25.optString("channelKey"); this.f924h3 = optJSONObject25.optJSONObject("pushNotifications").optBoolean("active"); } JSONObject optJSONObject26 = optJSONObject8.optJSONObject("intercom"); if (optJSONObject26 != null) { this.f930i3 = optJSONObject26.optBoolean("active", false); this.f936j3 = a0(optJSONObject26, "androidApiKey"); this.f942k3 = a0(optJSONObject26, "androidAppId"); } JSONObject optJSONObject27 = optJSONObject8.optJSONObject("braze"); if (optJSONObject27 != null) { this.f948l3 = optJSONObject27.optBoolean("active", false); this.f954m3 = optJSONObject27.optBoolean("autoRegister", false); this.f960n3 = optJSONObject27.optString("androidApiKey"); this.f966o3 = optJSONObject27.optString("androidEndpointKey"); this.f972p3 = optJSONObject27.optString("firebaseSenderId"); this.f978q3 = optJSONObject27.optString("androidNotificationChannelName"); this.f984r3 = optJSONObject27.optString("androidNotificationDescription"); } JSONObject optJSONObject28 = optJSONObject8.optJSONObject("analytics"); if (optJSONObject28 != null && optJSONObject28.optBoolean("active", false)) { this.f750A1 = optJSONObject28.optInt("idsite_test", Integer.MIN_VALUE); int optInt2 = optJSONObject28.optInt("idsite_prod", Integer.MIN_VALUE); this.f755B1 = optInt2; if (this.f750A1 != Integer.MIN_VALUE && optInt2 != Integer.MIN_VALUE) { this.f1030z1 = true; } Log.w("co.median.median_core.AppConfig", "Analytics requires idsite_test and idsite_prod"); this.f1030z1 = false; } JSONObject optJSONObject29 = optJSONObject8.optJSONObject("oneSignal"); if (optJSONObject29 != null && optJSONObject29.optBoolean("active")) { String a08 = a0(optJSONObject29, "applicationId"); this.f780G1 = a08; this.f775F1 = a08 != null; this.f785H1 = a0(optJSONObject29, "tagsJsonUrl"); this.f790I1 = optJSONObject29.optBoolean("requiresUserPrivacyConsent"); this.f795J1 = optJSONObject29.optBoolean("autoRegister", true); this.f800K1 = optJSONObject29.optBoolean("showForegroundNotifications", true); } JSONObject optJSONObject30 = optJSONObject8.optJSONObject("oneSignalV5"); if (optJSONObject30 != null) { this.f805L1 = new C1.d(optJSONObject30); } JSONObject optJSONObject31 = optJSONObject8.optJSONObject("xtremepushAndroid"); optJSONObject31 = optJSONObject31 == null ? optJSONObject8.optJSONObject("xtremepush") : optJSONObject31; if (optJSONObject31 != null && optJSONObject31.optBoolean("active")) { String a09 = a0(optJSONObject31, "appKey"); this.f815N1 = a09; this.f810M1 = a09 != null; this.f820O1 = a0(optJSONObject31, "googleProjectId"); } JSONObject optJSONObject32 = optJSONObject8.optJSONObject("cleverpush"); if (optJSONObject32 != null && optJSONObject32.optBoolean("active")) { this.f825P1 = true; this.f830Q1 = a0(optJSONObject32, "channelId"); this.f835R1 = optJSONObject32.optBoolean("autoRegister", true); } JSONObject optJSONObject33 = optJSONObject8.optJSONObject("ibmpushAndroid"); optJSONObject33 = optJSONObject33 == null ? optJSONObject8.optJSONObject("ibmpush") : optJSONObject33; if (optJSONObject33 != null && optJSONObject33.optBoolean("active")) { this.f840S1 = true; this.f845T1 = optJSONObject33; } JSONObject optJSONObject34 = optJSONObject8.optJSONObject("moxo"); if (optJSONObject34 != null && optJSONObject34.optBoolean("active")) { this.f850U1 = true; this.f855V1 = a0(optJSONObject34, "moxoDomain"); } JSONObject optJSONObject35 = optJSONObject8.optJSONObject("facebook"); if (optJSONObject35 != null && optJSONObject35.optBoolean("active")) { this.f865X1 = a0(optJSONObject35, "appId"); this.f870Y1 = a0(optJSONObject35, "displayName"); this.f860W1 = this.f865X1 != null; this.f875Z1 = optJSONObject35.optBoolean("autoLogging"); } JSONObject optJSONObject36 = optJSONObject8.optJSONObject("socialLogin"); if (optJSONObject36 != null) { JSONObject optJSONObject37 = optJSONObject36.optJSONObject("facebookLogin"); if (optJSONObject37 != null && optJSONObject37.optBoolean("active")) { String str3 = this.f865X1; if (str3 == null || str3.isEmpty()) { this.f865X1 = optJSONObject37.optString("appId"); } String str4 = this.f870Y1; if (str4 == null || str4.isEmpty()) { this.f870Y1 = optJSONObject37.optString("displayName"); } this.f881a2 = this.f865X1 != null; } JSONObject optJSONObject38 = optJSONObject36.optJSONObject("googleSignIn"); if (optJSONObject38 != null && optJSONObject38.optBoolean("active")) { String optString4 = optJSONObject38.optString("androidClientID"); if (!optString4.isEmpty()) { this.f887b2 = true; this.f893c2 = optString4; } } } JSONObject optJSONObject39 = optJSONObject8.optJSONObject("adjust"); if (optJSONObject39 != null && optJSONObject39.optBoolean("active")) { this.f899d2 = true; this.f905e2 = a0(optJSONObject39, "appToken"); this.f911f2 = a0(optJSONObject39, "environment"); } JSONObject optJSONObject40 = optJSONObject8.optJSONObject("appsflyer"); if (optJSONObject40 != null && optJSONObject40.optBoolean("active")) { this.f923h2 = true; String a010 = a0(optJSONObject40, "androidDevKey"); this.f917g2 = a010; if (a010 == null) { this.f917g2 = a0(optJSONObject40, "devKey"); } } JSONObject optJSONObject41 = optJSONObject8.optJSONObject("identity"); if (optJSONObject41 != null && optJSONObject41.optBoolean("active")) { LinkedList linkedList = new LinkedList(); this.f929i2 = linkedList; Object opt2 = optJSONObject41.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 i8 = 0; i8 < jSONArray.length(); i8++) { String optString5 = jSONArray.optString(i8); if (optString5 != null && !optString5.isEmpty()) { linkedList.add(Pattern.compile(optString5)); } } } this.f935j2 = a0(optJSONObject41, "identityEndpointUrl"); } JSONObject optJSONObject42 = optJSONObject8.optJSONObject("registration"); if (optJSONObject42 != null && optJSONObject42.optBoolean("active")) { this.f941k2 = optJSONObject42.optJSONArray("endpoints"); } JSONObject optJSONObject43 = optJSONObject8.optJSONObject("admob"); if (optJSONObject43 != null && optJSONObject43.optBoolean("active") && (optJSONObject14 = optJSONObject43.optJSONObject("admobAndroid")) != null && optJSONObject14.optBoolean("active") && (a02 = a0(optJSONObject14, "applicationId")) != null && !a02.isEmpty()) { this.f953m2 = true; String a011 = a0(optJSONObject14, "bannerAdUnitId"); this.f959n2 = a011; if (a011 != null && a011.isEmpty()) { this.f959n2 = null; } String a012 = a0(optJSONObject14, "interstitialAdUnitId"); this.f965o2 = a012; if (a012 != null && a012.isEmpty()) { this.f965o2 = null; } this.f971p2 = optJSONObject14.optBoolean("showBanner", true); this.f977q2 = optJSONObject14.optBoolean("autoConsentPrompt", this.f977q2); } JSONObject optJSONObject44 = optJSONObject8.optJSONObject("cardIO"); if (optJSONObject44 != null && optJSONObject44.optBoolean("active")) { this.f983r2 = true; } JSONObject optJSONObject45 = optJSONObject8.optJSONObject("auth"); if (optJSONObject45 != null && optJSONObject45.optBoolean("active")) { this.f1007v2 = true; Object opt3 = optJSONObject45.opt("allowedUrls"); if (opt3 instanceof String) { this.f1013w2.add(Pattern.compile((String) opt3)); } else if (opt3 instanceof JSONArray) { JSONArray jSONArray2 = (JSONArray) opt3; for (int i9 = 0; i9 < jSONArray2.length(); i9++) { String optString6 = jSONArray2.optString(i9); if (optString6 != null) { this.f1013w2.add(Pattern.compile(optString6)); } } } } JSONObject optJSONObject46 = optJSONObject8.optJSONObject("chromecast"); if (optJSONObject46 != null && optJSONObject46.optBoolean("active")) { this.f989s2 = true; this.f995t2 = a0(optJSONObject46, "receiverAppId"); } if (this.f989s2) { this.f1001u2 = new ArrayList(); Object opt4 = optJSONObject46.opt("showCastButtonRegex"); if (opt4 instanceof String) { this.f1001u2.add(Pattern.compile((String) opt4)); } else if (opt4 instanceof JSONArray) { JSONArray jSONArray3 = (JSONArray) opt4; for (int i10 = 0; i10 < jSONArray3.length(); i10++) { String optString7 = jSONArray3.optString(i10); if (optString7 != null) { this.f1001u2.add(Pattern.compile(optString7)); } } } else { this.f1001u2.add(Pattern.compile(".*")); } } JSONObject optJSONObject47 = optJSONObject8.optJSONObject("documentScanner"); if (optJSONObject47 != null && optJSONObject47.optBoolean("active")) { this.f1019x2 = true; String a013 = a0(optJSONObject47, "androidAnylineLicenseKey"); this.f1025y2 = a013; if (a013 == null) { this.f1025y2 = a0(optJSONObject47, "anylineLicenseKey"); } } JSONObject optJSONObject48 = optJSONObject8.optJSONObject("scandit"); if (optJSONObject48 != null && optJSONObject48.optBoolean("active")) { String a014 = a0(optJSONObject48, "androidLicenseKey"); this.f751A2 = a014; if (a014 == null) { this.f751A2 = a0(optJSONObject48, "licenseKey"); } if (this.f751A2 != null) { this.f1031z2 = true; } } JSONObject optJSONObject49 = optJSONObject8.optJSONObject("barcode"); if (optJSONObject49 != null && optJSONObject49.optBoolean("active")) { this.f756B2 = true; this.f761C2 = a0(optJSONObject49, "prompt"); } JSONObject optJSONObject50 = optJSONObject8.optJSONObject("iap"); if (optJSONObject50 != null && optJSONObject50.optBoolean("active") && (optJSONObject13 = optJSONObject50.optJSONObject("googleIAP")) != null) { this.f766D2 = optJSONObject13.optBoolean("active"); this.f771E2 = a0(optJSONObject13, "productsUrl"); this.f776F2 = optJSONObject13.optBoolean("legacyMode", false); } JSONObject optJSONObject51 = optJSONObject8.optJSONObject("couples"); if (optJSONObject51 != null && optJSONObject51.optBoolean("active")) { this.f781G2 = true; String a015 = a0(optJSONObject51, "androidLicenseKey"); this.f786H2 = a015; if (a015 == null) { this.f786H2 = a0(optJSONObject51, "licenseKey"); } } JSONObject optJSONObject52 = optJSONObject8.optJSONObject("episerver"); if (optJSONObject52 != null && optJSONObject52.optBoolean("active")) { this.f791I2 = true; String a016 = a0(optJSONObject52, "androidAuthToken"); this.f796J2 = a016; if (a016 == null) { this.f796J2 = a0(optJSONObject52, "authToken"); } } JSONObject optJSONObject53 = optJSONObject8.optJSONObject("rootDetect"); if (optJSONObject53 != null && optJSONObject53.optBoolean("active")) { this.f801K2 = true; } JSONObject optJSONObject54 = optJSONObject8.optJSONObject("twilio"); if (optJSONObject54 != null && optJSONObject54.optBoolean("active")) { this.f806L2 = true; } JSONObject optJSONObject55 = optJSONObject8.optJSONObject("beacon"); if (optJSONObject55 != null && optJSONObject55.optBoolean("active")) { this.f811M2 = true; this.f816N2 = optJSONObject55.optString("beaconsJsonUrl"); this.f821O2 = optJSONObject55.optString("updateFrequency"); } JSONObject optJSONObject56 = optJSONObject8.optJSONObject("mobilepush"); if (optJSONObject56 != null && optJSONObject56.optBoolean("active")) { this.f826P2 = true; this.f831Q2 = optJSONObject56.optBoolean("requiresUserPrivacyConsent"); this.f836R2 = optJSONObject56.optString("appID"); this.f841S2 = optJSONObject56.optString("accessToken"); this.f846T2 = optJSONObject56.optString("appEndpoint"); this.f851U2 = optJSONObject56.optString("mid"); this.f856V2 = optJSONObject56.optBoolean("delayRegistrationUntilContactKeyIsSet", true); } JSONObject optJSONObject57 = optJSONObject8.optJSONObject("kaltura"); if (optJSONObject57 != null && optJSONObject57.optBoolean("active")) { this.f861W2 = true; this.f866X2 = optJSONObject57.optInt("partnerId"); this.f871Y2 = optJSONObject57.optString("castReceiverAppId"); this.f876Z2 = optJSONObject57.optString("serverUrl"); } JSONObject optJSONObject58 = optJSONObject8.optJSONObject("localSettings"); if (optJSONObject58 != null && optJSONObject58.optBoolean("active")) { this.f1020x3 = true; this.f1026y3 = optJSONObject58.optBoolean("androidBackup"); } JSONObject optJSONObject59 = optJSONObject8.optJSONObject("firebaseAnalytics"); if (optJSONObject59 != null && optJSONObject59.optBoolean("active")) { this.f757B3 = true; } JSONObject optJSONObject60 = optJSONObject8.optJSONObject("opentok"); if (optJSONObject60 != null && optJSONObject60.optBoolean("active")) { this.f1032z3 = true; } if (optJSONObject60 != null && optJSONObject60.optBoolean("blockOtherCalls")) { this.f752A3 = true; } JSONObject optJSONObject61 = optJSONObject8.optJSONObject("enterprisePlugin"); if (optJSONObject61 != null && optJSONObject61.optBoolean("active")) { this.f862W3 = true; JSONObject optJSONObject62 = optJSONObject61.optJSONObject("blockCopyPaste"); if (optJSONObject62 != null) { this.f867X3 = optJSONObject62.optBoolean("active", false); } JSONObject optJSONObject63 = optJSONObject61.optJSONObject("blockScreenCapture"); if (optJSONObject63 != null) { this.f872Y3 = optJSONObject63.optBoolean("active", false); } JSONObject optJSONObject64 = optJSONObject61.optJSONObject("maskBackgroundedAppImage"); if (optJSONObject64 != null) { this.f877Z3 = optJSONObject64.optBoolean("active", false); } } JSONObject optJSONObject65 = optJSONObject8.optJSONObject("nfc"); if (optJSONObject65 != null && optJSONObject65.optBoolean("active")) { this.f883a4 = true; } JSONObject optJSONObject66 = optJSONObject8.optJSONObject("plaid"); if (optJSONObject66 != null && optJSONObject66.optBoolean("active")) { this.f889b4 = true; } JSONObject optJSONObject67 = optJSONObject8.optJSONObject("geckoView"); if (optJSONObject67 != null && optJSONObject67.optBoolean("active")) { this.f895c4 = true; } JSONObject optJSONObject68 = optJSONObject8.optJSONObject("moengage"); if (optJSONObject68 != null && optJSONObject68.optBoolean("active")) { this.f901d4 = true; this.f907e4 = optJSONObject68.optBoolean("autoRegister", true); this.f913f4 = optJSONObject68.optString("appId", ""); this.f919g4 = optJSONObject68.optInt("dataCenter", 0); } JSONObject optJSONObject69 = optJSONObject8.optJSONObject("auth0"); if (optJSONObject69 != null && optJSONObject69.optBoolean("active")) { this.f925h4 = true; this.f931i4 = optJSONObject69.optString("clientId"); this.f937j4 = optJSONObject69.optString("domain"); this.f943k4 = optJSONObject69.optString("scheme"); this.f949l4 = optJSONObject69.optString("audience"); } JSONObject optJSONObject70 = optJSONObject8.optJSONObject("sendbird"); if (optJSONObject70 != null && optJSONObject70.optBoolean("active")) { this.f955m4 = true; this.f961n4 = optJSONObject70.optString("appId"); this.f967o4 = optJSONObject70.optBoolean("autoRegister", this.f967o4); } JSONObject optJSONObject71 = optJSONObject8.optJSONObject("firebaseCrashlytics"); if (optJSONObject71 != null && optJSONObject71.optBoolean("active", true)) { this.f973p4 = true; this.f979q4 = optJSONObject71.optBoolean("webviewErrorsEnabled"); this.f985r4 = optJSONObject71.optBoolean("toastErrorsEnabled"); this.f991s4 = optJSONObject71.optBoolean("requestOptIn"); } JSONObject optJSONObject72 = optJSONObject8.optJSONObject("msdynamics"); if (optJSONObject72 != null && optJSONObject72.optBoolean("active")) { this.f990s3 = true; this.f996t3 = optJSONObject72.optString("organizationId"); this.f1002u3 = optJSONObject72.optString("publicEndpoint"); this.f1008v3 = optJSONObject72.optString("mobileAppId"); this.f1014w3 = optJSONObject72.optString("apiAccessToken"); } JSONObject optJSONObject73 = optJSONObject8.optJSONObject("revenueCat"); if (optJSONObject73 != null && optJSONObject73.optBoolean("active")) { this.f762C3 = true; } JSONObject optJSONObject74 = optJSONObject8.optJSONObject("iterable"); if (optJSONObject74 != null && optJSONObject74.optBoolean("active")) { this.f997t4 = true; this.f1003u4 = optJSONObject74.optString("apiKey"); this.f1009v4 = optJSONObject74.optBoolean("autoRegister", this.f1009v4); this.f1015w4 = optJSONObject74.optString("dataRegion"); } JSONObject optJSONObject75 = optJSONObject8.optJSONObject("branch"); if (optJSONObject75 != null && optJSONObject75.optBoolean("active")) { this.f767D3 = true; this.f772E3 = optJSONObject75.optString("liveKey"); this.f777F3 = optJSONObject75.optString("testKey"); this.f782G3 = optJSONObject75.optBoolean("enableTestMode"); } JSONObject optJSONObject76 = optJSONObject8.optJSONObject("zoom"); if (optJSONObject76 != null && optJSONObject76.optBoolean("active")) { this.f1021x4 = true; } JSONObject optJSONObject77 = optJSONObject8.optJSONObject("webScreenshot"); if (optJSONObject77 != null && optJSONObject77.optBoolean("active")) { this.f1027y4 = true; } JSONObject optJSONObject78 = optJSONObject8.optJSONObject("socialShare"); if (optJSONObject78 != null) { this.f1033z4 = new C1.e(optJSONObject78); } } optJSONObject9 = this.f884b.optJSONObject("performance"); if (optJSONObject9 != null) { M(optJSONObject9.optJSONArray("webviewPools")); } this.f787H3 = this.f884b.optBoolean("allowZoom", true); L5 = L("splashpage.json"); if (L5 != null && L5.has("splashPageUrl")) { HashMap hashMap2 = new HashMap(); this.f863X = hashMap2; hashMap2.put("*", L5.getString("splashPageUrl")); } optJSONObject10 = this.f884b.optJSONObject("security"); if (optJSONObject10 != null && (optJSONObject12 = optJSONObject10.optJSONObject("network")) != null) { this.f802K3 = optJSONObject12.optString("androidConfigXML"); } optJSONObject11 = this.f884b.optJSONObject("developmentTools"); if (optJSONObject11 != null && optJSONObject11.optBoolean("enableWebConsoleLogs")) { this.f857V3 = true; } } catch (Throwable th3) { th = th3; inputStream = null; k.a(null); k.a(inputStream); throw th; } } catch (Exception e9) { exc = e9; inputStream = null; } k.a(null); k.a(inputStream); B(); } private static ArrayList A(Object obj) { ArrayList arrayList = new ArrayList(); if (obj instanceof String) { try { arrayList.add(Pattern.compile((String) obj)); } catch (Exception unused) { } } else if (obj instanceof JSONArray) { JSONArray jSONArray = (JSONArray) obj; for (int i5 = 0; i5 < jSONArray.length(); i5++) { try { Object obj2 = jSONArray.get(i5); if (obj2 instanceof String) { arrayList.add(Pattern.compile((String) obj2)); } } catch (Exception unused2) { } } } return arrayList; } private void B() { if (this.f812M3 && this.f807L3 > 0 && SystemClock.elapsedRealtime() - this.f807L3 < 1800000) { return; } if (!this.f812M3 && this.f807L3 > 0 && SystemClock.elapsedRealtime() - this.f807L3 < 60000) { return; } new c().execute(new Void[0]); } public void C(JSONArray jSONArray) { if (jSONArray != null) { ArrayList arrayList = new ArrayList(); int i5 = 0; while (true) { String str = "internal"; if (i5 < jSONArray.length()) { JSONObject optJSONObject = jSONArray.optJSONObject(i5); if (optJSONObject != null && optJSONObject.has("regex")) { String a02 = a0(optJSONObject, "regex"); if (a02 == null) { return; } if (optJSONObject.has("mode")) { str = a0(optJSONObject, "mode"); } else if (optJSONObject.has("internal") && !optJSONObject.optBoolean("internal", true)) { str = "external"; } arrayList.add(new m.a(str, Pattern.compile(a02))); } i5++; } else { JSONObject L5 = L("splashpage.json"); if (L5 != null && L5.has("splashPageRegex")) { try { arrayList.add(0, new m.a("internal", Pattern.compile(L5.getString("splashPageRegex")))); } catch (JSONException e5) { e5.printStackTrace(); } } this.f858W.f(arrayList); try { JSONObject jSONObject = new JSONObject(); jSONObject.put("rules", jSONArray); E(jSONObject, "regexintext.json"); return; } catch (JSONException e6) { e6.printStackTrace(); return; } } } } } private void D(JSONObject jSONObject) { if (jSONObject == null) { return; } this.f915g0 = new HashMap(); this.f927i0 = new ArrayList(); this.f921h0 = new ArrayList(); if (!jSONObject.optBoolean("active")) { return; } JSONArray optJSONArray = jSONObject.optJSONArray("actions"); if (optJSONArray != null) { for (int i5 = 0; i5 < optJSONArray.length(); i5++) { JSONObject optJSONObject = optJSONArray.optJSONObject(i5); if (optJSONObject != null) { String a02 = a0(optJSONObject, "id"); JSONArray optJSONArray2 = optJSONObject.optJSONArray("items"); if (a02 != null && optJSONArray2 != null) { this.f915g0.put(a02, optJSONArray2); } } } } JSONArray optJSONArray3 = jSONObject.optJSONArray("actionSelection"); if (optJSONArray3 != null) { for (int i6 = 0; i6 < optJSONArray3.length(); i6++) { JSONObject optJSONObject2 = optJSONArray3.optJSONObject(i6); if (optJSONObject2 != null) { String a03 = a0(optJSONObject2, "regex"); String a04 = a0(optJSONObject2, "id"); if (a03 != null && a04 != null) { try { this.f921h0.add(Pattern.compile(a03)); this.f927i0.add(a04); } catch (PatternSyntaxException e5) { Log.w("co.median.median_core.AppConfig", "Problem with actionSelection pattern. " + e5.getMessage()); } } } } } } public void E(JSONObject jSONObject, String str) { try { BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(G(str))); bufferedWriter.write(jSONObject.toString(4)); bufferedWriter.close(); } catch (Exception e5) { g.a().c("co.median.median_core.AppConfig", "Error writing to file ".concat(str), e5); G(str).delete(); } } private static boolean F(String str) { try { Class.forName(str); return true; } catch (ClassNotFoundException unused) { return false; } } public File G(String str) { File file = new File(this.f878a.getFilesDir(), "gonative-config"); file.mkdirs(); return new File(file, str); } public HashMap H() { HashMap hashMap = new HashMap(); hashMap.put("platform", "android"); String str = this.f920h; if (str != null) { hashMap.put("publicKey", str); } String packageName = this.f878a.getPackageName(); hashMap.put("appId", packageName); PackageManager packageManager = this.f878a.getPackageManager(); try { PackageInfo packageInfo = packageManager.getPackageInfo(this.f878a.getPackageName(), 0); hashMap.put("appVersion", packageInfo.versionName); hashMap.put("appVersionCode", Integer.valueOf(packageInfo.versionCode)); } catch (PackageManager.NameNotFoundException unused) { } hashMap.put("coreVersion", "2.4.7"); hashMap.put("isDebuggable", Boolean.valueOf((this.f878a.getApplicationInfo().flags & 2) != 0)); String installerPackageName = packageManager.getInstallerPackageName(packageName); if (installerPackageName == null) { installerPackageName = DevicePublicKeyStringDef.NONE; } hashMap.put("installer", installerPackageName); hashMap.put("language", Locale.getDefault().getLanguage()); hashMap.put("os", "Android"); hashMap.put("osVersion", Build.VERSION.RELEASE); hashMap.put("model", Build.MANUFACTURER + " " + Build.MODEL); hashMap.put("hardware", Build.FINGERPRINT); hashMap.put("timeZone", TimeZone.getDefault().getID()); hashMap.put("initialUrl", this.f896d); JSONObject optJSONObject = this.f884b.optJSONObject("styling"); hashMap.put("splashBackgroundColor", a0(optJSONObject, "androidSplashBackgroundColor")); hashMap.put("splashBackgroundColorDark", a0(optJSONObject, "androidSplashBackgroundColorDark")); hashMap.put("appIcon", a0(optJSONObject, a0(optJSONObject, "androidIcon") == null ? "icon" : "androidIcon")); hashMap.put("oneSignalEnabled", Boolean.valueOf(this.f775F1)); hashMap.put("isLicensed", Boolean.valueOf(this.f812M3)); JSONObject optJSONObject2 = this.f884b.optJSONObject("services"); HashMap hashMap2 = new HashMap(); if (optJSONObject2 != null) { Iterator<String> keys = optJSONObject2.keys(); while (keys.hasNext()) { String next = keys.next(); JSONObject optJSONObject3 = optJSONObject2.optJSONObject(next); if (optJSONObject3 != null && optJSONObject3.optBoolean("active", false)) { hashMap2.put(next, Boolean.TRUE); } } } hashMap.put("activeServices", hashMap2); HashMap hashMap3 = new HashMap(); hashMap3.put("io.gonative.android.CardScanner", Boolean.valueOf(F("io.gonative.android.CardScanner"))); hashMap3.put("io.gonative.android.CastManager", Boolean.valueOf(F("io.gonative.android.CastManager"))); hashMap3.put("io.gonative.android.Authentication", Boolean.valueOf(F("io.gonative.android.Authentication"))); hashMap3.put("io.gonative.android.ScanditBarcodeScannerActivity", Boolean.valueOf(F("io.gonative.android.ScanditBarcodeScannerActivity"))); hashMap3.put("io.gonative.android.downloadmanager.DownloadsActivity", Boolean.valueOf(F("io.gonative.android.downloadmanager.DownloadsActivity"))); hashMap3.put("io.gonative.android.documentscanner.ScanDocumentActivity", Boolean.valueOf(F("io.gonative.android.documentscanner.ScanDocumentActivity"))); hashMap3.put("io.gonative.android.SharingUtils", Boolean.valueOf(F("io.gonative.android.SharingUtils"))); hashMap.put("gonativeClasses", hashMap3); try { Class<? super Object> superclass = Class.forName("io.gonative.android.LeanWebView").getSuperclass(); if (superclass != null) { hashMap.put("webviewParentClass", superclass.getName()); } } catch (ClassNotFoundException unused2) { } return hashMap; } private void I(Object obj) { if (obj == null || (obj instanceof Boolean)) { return; } this.f869Y0 = new ArrayList(); if (obj instanceof JSONArray) { JSONArray jSONArray = (JSONArray) obj; for (int i5 = 0; i5 < jSONArray.length(); i5++) { String optString = jSONArray.optString(i5); if (optString != null) { try { this.f869Y0.add(Pattern.compile(optString)); } catch (PatternSyntaxException e5) { g.a().c("co.median.median_core.AppConfig", "Problem with navigation title image regex: " + e5.getMessage(), e5); } } } } } private void J(JSONArray jSONArray) { if (jSONArray == null) { return; } this.f950m = new ArrayList(jSONArray.length()); this.f956n = new ArrayList(jSONArray.length()); for (int i5 = 0; i5 < jSONArray.length(); i5++) { JSONObject optJSONObject = jSONArray.optJSONObject(i5); if (optJSONObject != null) { String a02 = a0(optJSONObject, "regex"); String a03 = a0(optJSONObject, "userAgent"); if (a02 != null && a03 != null) { try { this.f950m.add(Pattern.compile(a02)); this.f956n.add(a03); this.f792I3 = true; } catch (PatternSyntaxException e5) { g.a().c("co.median.median_core.AppConfig", "Syntax error with user agent regex", e5); } } } } } private void K(JSONObject jSONObject) { this.f843T = null; this.f838S = null; if (jSONObject != null && jSONObject.optBoolean("active")) { this.f838S = new ArrayList(); this.f843T = new ArrayList(); JSONArray optJSONArray = jSONObject.optJSONArray("levels"); if (optJSONArray != null) { for (int i5 = 0; i5 < optJSONArray.length(); i5++) { JSONObject optJSONObject = optJSONArray.optJSONObject(i5); if (optJSONObject != null) { String a02 = a0(optJSONObject, "regex"); int optInt = optJSONObject.optInt("level", -1); if (a02 != null && optInt != -1) { this.f838S.add(Pattern.compile(a02)); this.f843T.add(Integer.valueOf(optInt)); } } } } } L0.a.b(this.f878a).d(new Intent("io.gonative.android.AppConfig.processedNavigationLevels")); } public JSONObject L(String str) { try { FileInputStream fileInputStream = new FileInputStream(G(str)); byte[] bArr = new byte[fileInputStream.available()]; fileInputStream.read(bArr); fileInputStream.close(); return new JSONObject(new String(bArr, "UTF-8")); } catch (FileNotFoundException unused) { return null; } catch (Exception e5) { g.a().c("co.median.median_core.AppConfig", "Error reading ".concat(str), e5); G(str).delete(); return null; } } private void M(JSONArray jSONArray) { if (jSONArray == null) { return; } this.f947l2 = jSONArray; L0.a.b(this.f878a).d(new Intent("io.gonative.android.AppConfig.processedWebViewPools")); } private void N(JSONObject jSONObject) { String a02; this.f848U = null; if (jSONObject != null && jSONObject.optBoolean("active")) { this.f848U = new ArrayList(); JSONArray optJSONArray = jSONObject.optJSONArray("titles"); if (optJSONArray != null) { for (int i5 = 0; i5 < optJSONArray.length(); i5++) { JSONObject optJSONObject = optJSONArray.optJSONObject(i5); if (optJSONObject != null && (a02 = a0(optJSONObject, "regex")) != null) { try { HashMap hashMap = new HashMap(); hashMap.put("regex", Pattern.compile(a02)); String a03 = a0(optJSONObject, "title"); boolean optBoolean = optJSONObject.optBoolean("showImage", false); if (a03 != null) { hashMap.put("title", a03); } hashMap.put("showImage", Boolean.valueOf(optBoolean)); this.f848U.add(hashMap); } catch (PatternSyntaxException e5) { g.a().c("co.median.median_core.AppConfig", e5.getMessage(), e5); } } } } } L0.a.b(this.f878a).d(new Intent("io.gonative.android.AppConfig.processedNavigationTitles")); } private void P(JSONObject jSONObject) { if (jSONObject == null) { return; } this.f891c0 = new ArrayList(); JSONArray optJSONArray = jSONObject.optJSONArray("items"); for (int i5 = 0; i5 < optJSONArray.length(); i5++) { JSONObject optJSONObject = optJSONArray.optJSONObject(i5); if (optJSONObject != null) { this.f891c0.add(optJSONObject); } } L0.a.b(this.f878a).d(new Intent("io.gonative.android.AppConfig.processedSegmentedControl")); } private void R(JSONObject jSONObject) { int i5; String a02; String str; if (jSONObject == null) { return; } this.f798K = new HashMap(); this.f828Q = new ArrayList(); this.f833R = new ArrayList(); JSONArray optJSONArray = jSONObject.optJSONArray("menus"); if (optJSONArray != null) { i5 = 0; for (int i6 = 0; i6 < optJSONArray.length(); i6++) { JSONObject optJSONObject = optJSONArray.optJSONObject(i6); if (optJSONObject != null && optJSONObject.optBoolean("active", false)) { i5++; String a03 = a0(optJSONObject, "name"); JSONArray optJSONArray2 = optJSONObject.optJSONArray("items"); if (a03 != null && optJSONArray2 != null) { this.f798K.put(a03, optJSONArray2); if (a03.equals("default")) { this.f803L = true; } } } } } else { i5 = 0; } L0.a.b(this.f878a).d(new Intent("io.gonative.android.AppConfig.processedMenu")); this.f818O = a0(jSONObject, "userIdRegex"); JSONObject optJSONObject2 = jSONObject.optJSONObject("menuSelectionConfig"); if ((i5 > 1 || this.f976q1) && optJSONObject2 != null) { this.f823P = a0(optJSONObject2, "testURL"); JSONArray optJSONArray3 = optJSONObject2.optJSONArray("redirectLocations"); if (optJSONArray3 != null) { for (int i7 = 0; i7 < optJSONArray3.length(); i7++) { JSONObject optJSONObject3 = optJSONArray3.optJSONObject(i7); if (optJSONObject3 != null && (a02 = a0(optJSONObject3, "regex")) != null) { this.f828Q.add(Pattern.compile(a02)); this.f833R.add(optJSONObject3); } } } } this.f808M = new ArrayList(); this.f813N = new ArrayList(); Object opt = jSONObject.opt("sidebarEnabledRegex"); if (opt != null) { if (opt instanceof String) { try { this.f808M.add(Pattern.compile((String) opt)); this.f813N.add(Boolean.TRUE); return; } catch (PatternSyntaxException e5) { g.a().c("co.median.median_core.AppConfig", "Invalid regex for sidebarEnabledRegex", e5); return; } } if (opt instanceof JSONArray) { JSONArray jSONArray = (JSONArray) opt; for (int i8 = 0; i8 < jSONArray.length(); i8++) { Object opt2 = jSONArray.opt(i8); if (opt2 != null) { Boolean bool = Boolean.TRUE; if (opt2 instanceof String) { str = (String) opt2; } else if (opt2 instanceof JSONObject) { JSONObject jSONObject2 = (JSONObject) opt2; String a04 = a0(jSONObject2, "regex"); bool = Boolean.valueOf(jSONObject2.optBoolean("value", true)); str = a04; } else { str = null; } if (str != null) { try { this.f808M.add(Pattern.compile(str)); this.f813N.add(bool); } catch (PatternSyntaxException e6) { g.a().c("co.median.median_core.AppConfig", "Invalid regex in sidebarEnabledRegex", e6); } } } } } } } private void S(JSONObject jSONObject) { if (jSONObject == null) { return; } this.f897d0 = new HashMap(); this.f909f0 = new ArrayList(); this.f903e0 = new ArrayList(); if (!jSONObject.optBoolean("active")) { return; } JSONArray optJSONArray = jSONObject.optJSONArray("tabMenus"); if (optJSONArray != null) { for (int i5 = 0; i5 < optJSONArray.length(); i5++) { JSONObject optJSONObject = optJSONArray.optJSONObject(i5); if (optJSONObject != null) { String a02 = a0(optJSONObject, "id"); JSONArray optJSONArray2 = optJSONObject.optJSONArray("items"); if (a02 != null && optJSONArray2 != null) { this.f897d0.put(a02, optJSONArray2); } } } } JSONArray optJSONArray3 = jSONObject.optJSONArray("tabSelectionConfig"); if (optJSONArray3 != null) { for (int i6 = 0; i6 < optJSONArray3.length(); i6++) { JSONObject optJSONObject2 = optJSONArray3.optJSONObject(i6); if (optJSONObject2 != null) { String a03 = a0(optJSONObject2, "regex"); String a04 = a0(optJSONObject2, "id"); if (a03 != null && a04 != null) { try { this.f903e0.add(Pattern.compile(a03)); this.f909f0.add(a04); } catch (PatternSyntaxException e5) { Log.w("co.median.median_core.AppConfig", "Problem with tabSelectionConfig pattern. " + e5.getMessage()); } } } } } L0.a.b(this.f878a).d(new Intent("io.gonative.android.AppConfig.processedTabNavigation")); } public static synchronized a V(Context context) { a aVar; synchronized (a.class) { try { if (f747A4 == null) { f747A4 = new a(context.getApplicationContext()); } aVar = f747A4; } catch (Throwable th) { throw th; } } return aVar; } public static String a0(JSONObject jSONObject, String str) { if (jSONObject.isNull(str)) { return null; } return jSONObject.optString(str, null); } public boolean O() { if (!this.f770E1) { this.f770E1 = true; return true; } return false; } public void Q() { G("regexintext.json").delete(); } public File T() { return new File(this.f878a.getFilesDir(), "appConfig.json"); } public String U() { JSONObject L5; if (!this.f827P3 && (L5 = L("splashpage.json")) != null && L5.has("splashPageUrl")) { this.f827P3 = true; Timer timer = new Timer(); timer.schedule(new b(timer), 2000L); } return this.f896d; } public HashMap W(String str) { ArrayList arrayList; if (str != null && (arrayList = this.f848U) != null) { Iterator it = arrayList.iterator(); while (it.hasNext()) { HashMap hashMap = (HashMap) it.next(); Pattern pattern = (Pattern) hashMap.get("regex"); if (pattern == null) { return null; } if (pattern.matcher(str).matches()) { return hashMap; } } } return null; } public HashMap X() { return this.f863X; } public JSONObject Y() { try { return new JSONObject(this.f798K); } catch (Exception unused) { return null; } } public boolean Z() { return this.f812M3; } public void b0(String str, boolean z5) { if (str != null && str.length() != 0) { if (!str.contains("://")) { str = "http://".concat(str); } this.f896d = str; if (z5) { try { JSONObject jSONObject = new JSONObject(); jSONObject.put("initialUrl", this.f896d); E(jSONObject, "initurl.json"); } catch (JSONException e5) { e5.printStackTrace(); } } } } public void c0(boolean z5, int i5, boolean z6, boolean z7) { this.f783H = z5; this.f788I = i5; this.f793J = z6; if (z7) { try { JSONObject jSONObject = new JSONObject(); jSONObject.put("enabled", z5); jSONObject.put("numWindows", i5); jSONObject.put("autoClose", z6); E(jSONObject, "maxwindows.json"); } catch (JSONException e5) { e5.printStackTrace(); } } } public void d0(JSONObject jSONObject, boolean z5) { if (jSONObject != null) { K(jSONObject); if (z5) { E(jSONObject, "navlevels.json"); return; } return; } JSONObject optJSONObject = this.f884b.optJSONObject("navigation"); JSONObject optJSONObject2 = optJSONObject.optJSONObject("androidNaviationLevels"); if (optJSONObject2 == null) { optJSONObject2 = optJSONObject.optJSONObject("navigationLevels"); } K(optJSONObject2); if (z5) { G("navlevels.json").delete(); } } public void e0(JSONObject jSONObject, boolean z5) { JSONObject jSONObject2; if (jSONObject != null) { N(jSONObject); if (z5) { E(jSONObject, "navtitles.json"); return; } return; } JSONObject optJSONObject = this.f884b.optJSONObject("navigation"); if (optJSONObject != null) { jSONObject2 = optJSONObject.optJSONObject("navigationTitles"); } else { jSONObject2 = null; } N(jSONObject2); if (z5) { G("navtitles.json").delete(); } } public void f0(JSONArray jSONArray) { JSONObject optJSONObject; if (!this.f812M3) { return; } if (jSONArray == null || jSONArray.length() == 0) { JSONObject optJSONObject2 = this.f884b.optJSONObject("navigation"); if (optJSONObject2 != null && optJSONObject2.has("regexInternalExternal") && (optJSONObject = optJSONObject2.optJSONObject("regexInternalExternal")) != null && optJSONObject.has("rules")) { jSONArray = optJSONObject.optJSONArray("rules"); } else { return; } } C(jSONArray); } public void g0(Object obj) { if (obj == null) { return; } if (obj instanceof Boolean) { this.f803L = ((Boolean) obj).booleanValue(); } else if (obj instanceof JSONArray) { ArrayList arrayList = new ArrayList(Arrays.asList("default", "loggedIn")); if (this.f833R != null) { for (int i5 = 0; i5 < this.f833R.size(); i5++) { String a02 = a0((JSONObject) this.f833R.get(i5), "status"); if (a02 != null) { arrayList.add(a02); } } } this.f798K = new HashMap(); for (int i6 = 0; i6 < arrayList.size(); i6++) { this.f798K.put((String) arrayList.get(i6), (JSONArray) obj); } } L0.a.b(this.f878a).d(new Intent("io.gonative.android.AppConfig.processedMenu")); } public void h0(Object obj, boolean z5, boolean z6) { try { JSONObject jSONObject = new JSONObject(); jSONObject.put("items", obj); jSONObject.put("name", "default"); jSONObject.put("active", z5); JSONArray jSONArray = new JSONArray(); jSONArray.put(jSONObject); JSONObject jSONObject2 = new JSONObject(); jSONObject2.put("menus", jSONArray); if (z6) { E(jSONObject2, "sidebarnav.json"); } } catch (JSONException e5) { e5.printStackTrace(); } g0(obj); } public boolean i0(String str) { ArrayList arrayList; ArrayList arrayList2; B(); if (str != null && (arrayList2 = this.f848U) != null) { Iterator it = arrayList2.iterator(); while (true) { if (!it.hasNext()) { break; } HashMap hashMap = (HashMap) it.next(); if (((Pattern) hashMap.get("regex")).matcher(str).matches()) { if (hashMap.containsKey("showImage") && hashMap.get("showImage") != null && ((Boolean) hashMap.get("showImage")).booleanValue()) { return true; } } } } if (str != null && (arrayList = this.f869Y0) != null) { Iterator it2 = arrayList.iterator(); while (it2.hasNext()) { if (((Pattern) it2.next()).matcher(str).matches()) { return true; } } return false; } return this.f834R0; } public boolean j0(String str) { List list = this.f808M; if (list != null && !list.isEmpty()) { if (str == null) { str = ""; } for (int i5 = 0; i5 < this.f808M.size(); i5++) { if (((Pattern) this.f808M.get(i5)).matcher(str).matches()) { return ((Boolean) this.f813N.get(i5)).booleanValue(); } } return false; } return true; } public String k0(String str) { if (str == null) { str = ""; } if (this.f950m != null) { for (int i5 = 0; i5 < this.f950m.size(); i5++) { if (((Pattern) this.f950m.get(i5)).matcher(str).matches()) { return (String) this.f956n.get(i5); } } } return this.f938k; } }