Anybuypro - Free followers v1.0.0版本的 MD5 值为:ac97504c3229ff11289cc66f3291d928
以下内容为反编译后的 MainActivity.java 源代码,内容仅作参考
package co.median.android;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.PorterDuff;
import android.hardware.SensorManager;
import android.location.LocationManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.telephony.PhoneStateListener;
import android.telephony.SignalStrength;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Base64;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.WindowManager;
import android.webkit.CookieManager;
import android.webkit.JavascriptInterface;
import android.webkit.ValueCallback;
import android.webkit.WebChromeClient;
import android.widget.ExpandableListView;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.widget.Toolbar;
import androidx.drawerlayout.widget.DrawerLayout;
import co.median.android.MainActivity;
import co.median.android.MySwipeRefreshLayout;
import co.median.android.k;
import co.median.android.u;
import co.median.android.widget.GoNativeDrawerLayout;
import co.median.android.widget.SwipeHistoryNavigationLayout;
import co.median.android.widget.WebViewContainerView;
import co.median.android.widget.b;
import co.median.android.yrmwbd.R;
import com.aurelhubert.ahbottomnavigation.AHBottomNavigation;
import java.io.File;
import java.net.CookieHandler;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Observable;
import java.util.Observer;
import java.util.Stack;
import java.util.UUID;
import java.util.regex.Pattern;
import org.json.JSONException;
import org.json.JSONObject;
import r0.f1;
import r0.h0;
import r0.i0;
import r0.l0;
import r0.x0;
import t0.a;
import u1.a;
public class MainActivity extends androidx.appcompat.app.d implements Observer, t0.h, b.j, a.InterfaceC0089a, u.b {
private static final String I0 = "co.median.android.MainActivity";
private String A0;
private String B0;
private PhoneStateListener C0;
private WebViewContainerView D;
private SignalStrength D0;
private t0.j E;
private View F;
private androidx.activity.result.b<String> F0;
private String I;
private ValueCallback<Uri> K;
private ValueCallback<Uri[]> L;
private Uri M;
private GoNativeDrawerLayout N;
private View O;
private ExpandableListView P;
private ProgressBar Q;
private MySwipeRefreshLayout R;
private SwipeHistoryNavigationLayout S;
private RelativeLayout T;
private androidx.appcompat.app.b V;
private AHBottomNavigation W;
private v Z;
private co.median.android.a f3567a0;
private boolean f3568b0;
private Menu f3573g0;
private String f3574h0;
private co.median.android.d f3577k0;
private co.median.android.g f3578l0;
private co.median.android.o f3580n0;
private s f3581o0;
private m f3582p0;
private l0 f3583q0;
private BroadcastReceiver f3584r0;
private BroadcastReceiver f3585s0;
private BroadcastReceiver f3586t0;
protected String f3587u0;
protected String f3588v0;
private Stack<Bundle> f3589w0;
private n f3590x0;
private boolean C = false;
boolean G = false;
private Stack<String> H = new Stack<>();
private boolean J = true;
private co.median.android.m U = null;
private ConnectivityManager X = null;
private r Y = null;
private float f3569c0 = 0.0f;
private boolean f3570d0 = true;
private boolean f3571e0 = false;
private Handler f3572f0 = new Handler();
private Runnable f3575i0 = new a();
private u1.a f3576j0 = new u1.a(this);
private boolean f3579m0 = false;
private ArrayList<p> f3591y0 = new ArrayList<>();
private ArrayList<Intent> f3592z0 = new ArrayList<>();
private boolean E0 = false;
private String G0 = "";
private boolean H0 = false;
class a implements Runnable {
class RunnableC0048a implements Runnable {
RunnableC0048a() {
}
@Override
public void run() {
MainActivity.this.h1();
}
}
a() {
}
@Override
public void run() {
MainActivity.this.runOnUiThread(new RunnableC0048a());
MainActivity.this.f3572f0.postDelayed(MainActivity.this.f3575i0, 100L);
}
}
class b implements Runnable {
b() {
}
@Override
public void run() {
MainActivity.this.f2();
}
}
class c implements Runnable {
final String f3596d;
c(String str) {
this.f3596d = str;
}
@Override
public void run() {
MainActivity.this.e2(this.f3596d);
}
}
public static class d {
static final int[] f3598a;
static {
int[] iArr = new int[a.EnumC0086a.values().length];
f3598a = iArr;
try {
iArr[a.EnumC0086a.UNSPECIFIED.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
f3598a[a.EnumC0086a.PORTRAIT.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
f3598a[a.EnumC0086a.LANDSCAPE.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
}
}
class e implements SwipeHistoryNavigationLayout.a {
final t0.a f3599a;
e(t0.a aVar) {
this.f3599a = aVar;
}
@Override
public boolean a() {
if (MainActivity.this.E.getMaxHorizontalScroll() <= 0 || MainActivity.this.E.getScrollX() >= MainActivity.this.E.getMaxHorizontalScroll()) {
return MainActivity.this.d1();
}
return false;
}
@Override
public boolean b() {
if (this.f3599a.D && MainActivity.this.c1()) {
MainActivity.this.C1();
return true;
}
return false;
}
@Override
public boolean c() {
return this.f3599a.D;
}
@Override
public void d() {
}
@Override
public void e() {
}
@Override
public String f() {
return "";
}
@Override
public boolean g() {
if (this.f3599a.D && MainActivity.this.d1()) {
MainActivity.this.D1();
return true;
}
return false;
}
@Override
public boolean h() {
if (MainActivity.this.E.getMaxHorizontalScroll() <= 0 || MainActivity.this.E.getScrollX() <= 0) {
return MainActivity.this.c1();
}
return false;
}
}
class f extends BroadcastReceiver {
f() {
}
@Override
public void onReceive(Context context, Intent intent) {
String url;
if (!"io.gonative.android.AppConfig.processedNavigationTitles".equals(intent.getAction()) || (url = MainActivity.this.E.getUrl()) == null) {
return;
}
String A2 = MainActivity.this.A2(url);
if (A2 != null) {
MainActivity.this.setTitle(A2);
} else {
MainActivity.this.setTitle(R.string.app_name);
}
}
}
class g extends BroadcastReceiver {
g() {
}
@Override
public void onReceive(Context context, Intent intent) {
String url;
if (!"io.gonative.android.AppConfig.processedNavigationLevels".equals(intent.getAction()) || (url = MainActivity.this.E.getUrl()) == null) {
return;
}
MainActivity.this.n2(MainActivity.this.F2(url));
}
}
class h extends BroadcastReceiver {
h() {
}
@Override
public void onReceive(Context context, Intent intent) {
if ("io.gonative.android.MainActivity.Extra.BROADCAST_RECEIVER_ACTION_WEBVIEW_LIMIT_REACHED".equals(intent.getAction())) {
String stringExtra = intent.getStringExtra("excessWindowId");
if (TextUtils.isEmpty(stringExtra)) {
if (MainActivity.this.s1().g(MainActivity.this.f3574h0)) {
return;
}
MainActivity.this.finish();
} else if (stringExtra.equals(MainActivity.this.f3574h0)) {
MainActivity.this.finish();
}
}
}
}
public class i extends androidx.appcompat.app.b {
final t0.a f3604l;
i(Activity activity, DrawerLayout drawerLayout, int i3, int i4, t0.a aVar) {
super(activity, drawerLayout, i3, i4);
this.f3604l = aVar;
}
@Override
public void c(View view) {
MainActivity.this.invalidateOptionsMenu();
MainActivity.this.N.setDisableTouch(false);
}
@Override
public void d(View view) {
MainActivity.this.invalidateOptionsMenu();
MainActivity.this.N.setDisableTouch(this.f3604l.D && MainActivity.this.c1());
}
}
public class j implements Runnable {
j() {
}
@Override
public void run() {
MainActivity.this.t2();
}
}
public class k implements Runnable {
k() {
}
@Override
public void run() {
MainActivity.this.R.setRefreshing(false);
}
}
public class l extends PhoneStateListener {
l() {
}
@Override
public void onSignalStrengthsChanged(SignalStrength signalStrength) {
MainActivity.this.D0 = signalStrength;
MainActivity.this.f2();
if (MainActivity.this.A0 != null) {
MainActivity mainActivity = MainActivity.this;
mainActivity.e2(mainActivity.A0);
}
}
}
private class m extends BroadcastReceiver {
private m() {
}
m(MainActivity mainActivity, a aVar) {
this();
}
@Override
public void onReceive(Context context, Intent intent) {
MainActivity.this.d2();
if (MainActivity.this.A0 != null) {
MainActivity mainActivity = MainActivity.this;
mainActivity.e2(mainActivity.A0);
}
}
}
public interface n {
void a(boolean z2);
}
public interface o {
void a(String[] strArr, int[] iArr);
}
public class p {
String[] f3610a;
o f3611b;
p(String[] strArr, o oVar) {
this.f3610a = strArr;
this.f3611b = oVar;
}
}
public class q {
class a implements Runnable {
final String f3614d;
a(String str) {
this.f3614d = str;
}
@Override
public void run() {
MainActivity.this.i1(this.f3614d);
}
}
public q() {
}
@JavascriptInterface
public void onReadyState(String str) {
MainActivity.this.runOnUiThread(new a(str));
}
}
private void C2(boolean z2) {
co.median.android.m mVar;
String str;
if (this.U == null) {
o2();
}
try {
if (z2) {
mVar = this.U;
str = "loggedIn";
} else {
mVar = this.U;
str = "default";
}
mVar.m(str);
} catch (Exception e3) {
t0.g.a().c(I0, e3.getMessage(), e3);
}
}
public void D1() {
if (co.median.android.n.g()) {
F1();
}
this.E.goForward();
}
private boolean E2(String str, String str2) {
if (str == null || str2 == null) {
return false;
}
if (str.endsWith("/")) {
str = str.substring(0, str.length() - 1);
}
if (str2.endsWith("/")) {
str2 = str2.substring(0, str2.length() - 1);
}
if (str.startsWith("http://")) {
str = "https://" + str.substring(7);
}
return str.equals(str2);
}
private void G1() {
File file = new File(getCacheDir(), "webviewDatabase");
if (file.mkdirs()) {
String str = I0;
Log.v(str, "databasePath " + file.toString() + " exists");
}
x0.a().c(this);
new co.median.android.b(this).b();
this.f3581o0 = ((GoNativeApplication) getApplication()).e();
}
private void G2() {
}
private void H1() {
String str;
t0.a M = t0.a.M(this);
String str2 = M.C0;
if ((str2 == null || str2.isEmpty()) && ((str = M.D0) == null || str.isEmpty())) {
return;
}
try {
StringBuilder sb = new StringBuilder();
String str3 = M.C0;
if (str3 != null) {
sb.append(str3);
sb.append(" ");
}
String str4 = M.D0;
if (str4 != null) {
sb.append(str4);
}
String encodeToString = Base64.encodeToString(sb.toString().getBytes(StandardCharsets.UTF_8), 2);
U1("(function() {var parent = document.getElementsByTagName('head').item(0);var style = document.createElement('style');style.type = 'text/css';style.innerHTML = window.atob('" + encodeToString + "');parent.appendChild(style)})()");
} catch (Exception e3) {
t0.g.a().c(I0, "Error injecting customCSS via javascript", e3);
}
}
private void I1() {
String str;
t0.a M = t0.a.M(this);
String str2 = M.E0;
if ((str2 == null || str2.isEmpty()) && ((str = M.F0) == null || str.isEmpty())) {
return;
}
try {
StringBuilder sb = new StringBuilder();
String str3 = M.E0;
if (str3 != null) {
sb.append(str3);
sb.append(" ");
}
String str4 = M.F0;
if (str4 != null) {
sb.append(str4);
}
String encodeToString = Base64.encodeToString(sb.toString().getBytes(StandardCharsets.UTF_8), 2);
U1("javascript:(function() {var parent = document.getElementsByTagName('head').item(0);var script = document.createElement('script');script.type = 'text/javascript';script.innerHTML = window.atob('" + encodeToString + "');parent.appendChild(script)})()");
} catch (Exception e3) {
t0.g.a().c(I0, "Error injecting customJS via javascript", e3);
}
}
@SuppressLint({"DiscouragedApi"})
private boolean J1() {
if (Build.VERSION.SDK_INT < 29) {
return false;
}
try {
int identifier = getResources().getIdentifier("config_navBarInteractionMode", "integer", "android");
if (identifier > 0) {
return getResources().getInteger(identifier) == 2;
}
return false;
} catch (Resources.NotFoundException e3) {
t0.g.a().c(I0, "isAndroidGestureEnabled: ", e3);
return false;
}
}
private boolean L1() {
GoNativeDrawerLayout goNativeDrawerLayout = this.N;
return goNativeDrawerLayout != null && goNativeDrawerLayout.F(this.O);
}
private boolean M1() {
return androidx.core.content.a.a(this, "android.permission.ACCESS_FINE_LOCATION") == 0 && androidx.core.content.a.a(this, "android.permission.ACCESS_COARSE_LOCATION") == 0;
}
public static void P1(Boolean bool) {
String str = I0;
Log.d(str, "clearWebviewCookies: onReceiveValue callback: " + bool);
}
public boolean Q1() {
return this.E.getWebViewScrollY() > 0;
}
public void R1(Boolean bool) {
w(this.G0, false);
}
public void S1(String str, co.median.android.k kVar) {
this.E.loadUrl(str);
kVar.k(null);
}
public static void T1(boolean z2) {
String str = I0;
Log.d(str, "promptLocationService: " + z2);
}
private void V1() {
if (this.C0 != null) {
return;
}
this.C0 = new l();
try {
TelephonyManager telephonyManager = (TelephonyManager) getSystemService("phone");
if (telephonyManager == null) {
t0.g.a().b(I0, "Error getting system telephony manager");
} else {
telephonyManager.listen(this.C0, 256);
}
} catch (Exception e3) {
t0.g.a().c(I0, "Error listening for signal strength", e3);
}
}
private void a2() {
this.E.stopLoading();
p();
C2(false);
this.f3580n0.g();
this.E.loadUrl(t0.a.M(this).L());
}
public boolean d1() {
return this.E.canGoForward();
}
public void d2() {
if (this.E.getProgress() < 100) {
return;
}
String url = this.E.getUrl();
if ((url != null && !url.equals("file:///android_asset/offline.html")) || this.H.isEmpty() || K1()) {
return;
}
W1(this.H.pop());
}
public void e2(String str) {
int level;
NetworkInfo activeNetworkInfo = this.X.getActiveNetworkInfo();
boolean z2 = activeNetworkInfo != null && activeNetworkInfo.isConnected();
String typeName = activeNetworkInfo != null ? activeNetworkInfo.getTypeName() : "DISCONNECTED";
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("connected", z2);
jSONObject.put("type", typeName);
if (this.D0 != null) {
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("cdmaDbm", this.D0.getCdmaDbm());
jSONObject2.put("cdmaEcio", this.D0.getCdmaEcio());
jSONObject2.put("evdoDbm", this.D0.getEvdoDbm());
jSONObject2.put("evdoEcio", this.D0.getEvdoEcio());
jSONObject2.put("evdoSnr", this.D0.getEvdoSnr());
jSONObject2.put("gsmBitErrorRate", this.D0.getGsmBitErrorRate());
jSONObject2.put("gsmSignalStrength", this.D0.getGsmSignalStrength());
if (Build.VERSION.SDK_INT >= 23) {
level = this.D0.getLevel();
jSONObject2.put("level", level);
}
jSONObject.put("cellSignalStrength", jSONObject2);
}
U1(t0.l.b(str, jSONObject));
} catch (JSONException e3) {
t0.g.a().c(I0, "JSON error sending connectivity", e3);
}
}
public void f2() {
String str = this.B0;
if (str == null) {
return;
}
e2(str);
this.B0 = null;
}
@SuppressLint({"SourceLockedOrientationActivity"})
private void g2(a.EnumC0086a enumC0086a) {
int i3;
int i4 = d.f3598a[enumC0086a.ordinal()];
if (i4 == 1) {
i3 = -1;
} else if (i4 == 2) {
setRequestedOrientation(1);
return;
} else if (i4 != 3) {
return;
} else {
i3 = 6;
}
setRequestedOrientation(i3);
}
public void h1() {
this.E.a("if (gonative_status_checker && typeof gonative_status_checker.onReadyState === 'function') gonative_status_checker.onReadyState(document.readyState);");
}
public void i1(String str) {
double d3 = t0.a.M(this).M0;
if (str.equals("loading") || (Double.isNaN(d3) && str.equals("interactive"))) {
this.f3579m0 = true;
} else if ((Double.isNaN(d3) || !str.equals("interactive")) && !(this.f3579m0 && str.equals("complete"))) {
} else {
if (str.equals("interactive")) {
u2(d3);
} else {
t2();
}
}
}
private void i2(boolean z2) {
Toolbar toolbar;
if (this.f3568b0) {
t0.a M = t0.a.M(this);
if (M.J) {
GoNativeDrawerLayout goNativeDrawerLayout = this.N;
if (goNativeDrawerLayout != null) {
goNativeDrawerLayout.setDrawerLockMode(!z2 ? 1 : 0);
}
if ((this.J || M.L0) && z2 && (toolbar = (Toolbar) findViewById(R.id.toolbar)) != null) {
toolbar.setVisibility(0);
}
androidx.appcompat.app.a u02 = u0();
if (u02 != null) {
u02.v(z2);
}
}
}
}
private void l2() {
t0.a M = t0.a.M(this);
a.EnumC0086a enumC0086a = M.f6848t;
if (enumC0086a != null) {
g2(enumC0086a);
return;
}
if (getResources().getBoolean(R.bool.isTablet)) {
a.EnumC0086a enumC0086a2 = M.f6854v;
if (enumC0086a2 != null) {
g2(enumC0086a2);
return;
}
} else {
a.EnumC0086a enumC0086a3 = M.f6851u;
if (enumC0086a3 != null) {
g2(enumC0086a3);
return;
}
}
if (M.f6860x) {
return;
}
g2(a.EnumC0086a.UNSPECIFIED);
}
private void o2() {
co.median.android.m mVar = new co.median.android.m(this, this.P);
this.U = mVar;
try {
mVar.m("default");
this.P.setAdapter(this.U);
} catch (Exception e3) {
t0.g.a().c(I0, "Error setting up menu", e3);
}
this.P.setOnGroupClickListener(this.U);
this.P.setOnChildClickListener(this.U);
}
private void p2() {
this.Y = new r(this, (Spinner) findViewById(R.id.profile_picker));
new t(this, (Spinner) findViewById(R.id.segmented_control));
}
@SuppressLint({"RequiresFeature"})
private void q2(String str) {
if (!p0.d.a("FORCE_DARK")) {
Log.d(I0, "Dark mode feature is not supported");
} else if (this.E.getSettings() == null) {
} else {
if ("dark".equals(str)) {
p0.b.b(this.E.getSettings(), 2);
} else if ("light".equals(str)) {
p0.b.b(this.E.getSettings(), 0);
} else {
int i3 = getResources().getConfiguration().uiMode & 48;
if (i3 == 0 || i3 == 16) {
p0.b.b(this.E.getSettings(), 0);
} else if (i3 == 32) {
p0.b.b(this.E.getSettings(), 2);
}
if (p0.d.a("FORCE_DARK_STRATEGY")) {
p0.b.c(this.E.getSettings(), 1);
}
}
}
}
private void r2(boolean z2) {
t0.a M = t0.a.M(this);
this.N = (GoNativeDrawerLayout) findViewById(R.id.drawer_layout);
this.O = findViewById(R.id.left_drawer);
this.P = (ExpandableListView) findViewById(R.id.drawer_list);
if (!z2) {
this.N.setDrawerLockMode(1);
return;
}
this.N.setDrawerLockMode(0);
this.N.Y(R.drawable.drawer_shadow, 8388611);
i iVar = new i(this, this.N, R.string.drawer_open, R.string.drawer_close, M);
this.V = iVar;
iVar.j(true);
this.V.e().c(getResources().getColor(R.color.titleTextColor));
this.N.c(this.V);
o2();
if (M.N != null) {
this.f3580n0.addObserver(this);
}
}
private void u2(double d3) {
if (d3 > 0.0d) {
this.f3572f0.postDelayed(new j(), (int) (d3 * 1000.0d));
} else {
t2();
}
}
private void x2() {
this.f3572f0.removeCallbacks(this.f3575i0);
}
private void y2(boolean z2, int i3) {
if (z2 && t0.a.M(this).f6807i1) {
new Handler().postDelayed(new k(), i3);
} else {
this.R.setRefreshing(false);
}
}
private String z1(Intent intent) {
String str;
if (intent == null) {
return null;
}
String stringExtra = intent.getStringExtra("targetUrl");
if (stringExtra == null || stringExtra.isEmpty()) {
if ("android.intent.action.VIEW".equals(intent.getAction())) {
Uri data = intent.getData();
if (data == null || !(data.getScheme().endsWith(".http") || data.getScheme().endsWith(".https"))) {
return intent.getDataString();
}
Uri.Builder buildUpon = data.buildUpon();
if (!data.getScheme().endsWith(".https")) {
str = data.getScheme().endsWith(".http") ? "http" : "http";
return buildUpon.build().toString();
}
str = "https";
buildUpon.scheme(str);
return buildUpon.build().toString();
}
return null;
}
return stringExtra;
}
@Override
public void A() {
if (l0().g0("ShakeDialogFragment") != null) {
return;
}
new u().P1(l0(), "ShakeDialogFragment");
}
public int A1() {
return s1().d(this.f3574h0);
}
public String A2(String str) {
ArrayList<HashMap<String, Object>> arrayList = t0.a.M(this).S;
String str2 = null;
if (arrayList != null) {
Iterator<HashMap<String, Object>> it = arrayList.iterator();
while (it.hasNext()) {
HashMap<String, Object> next = it.next();
if (((Pattern) next.get("regex")).matcher(str).matches() && next.containsKey("title")) {
str2 = (String) next.get("title");
}
}
}
return str2;
}
@Override
public void B(JSONObject jSONObject) {
if (this.f3581o0 == null) {
return;
}
if (jSONObject != null) {
JSONObject optJSONObject = jSONObject.optJSONObject("customData");
if (optJSONObject == null) {
try {
optJSONObject = new JSONObject(jSONObject.optString("customData"));
} catch (JSONException e3) {
t0.g a3 = t0.g.a();
String str = I0;
a3.c(str, "GoNative Registration JSONException:- " + e3.getMessage(), e3);
}
}
if (optJSONObject != null) {
this.f3581o0.h(optJSONObject);
}
}
this.f3581o0.g();
}
public t0.j B1() {
return this.E;
}
public void B2() {
this.f3580n0.g();
}
public void C1() {
if (this.E == null) {
return;
}
if (co.median.android.n.g()) {
F1();
}
this.E.goBack();
}
@Override
public void D(boolean z2) {
int i3;
androidx.appcompat.app.a u02 = u0();
View decorView = getWindow().getDecorView();
int systemUiVisibility = decorView.getSystemUiVisibility();
int i4 = 519 | 6144;
if (z2) {
i3 = systemUiVisibility | i4;
if (u02 != null) {
u02.m();
}
} else {
i3 = systemUiVisibility & (~i4);
if (u02 != null && t0.a.M(this).L0) {
u02.E();
}
this.E.clearFocus();
}
decorView.setSystemUiVisibility(i3);
if (!z2 || t0.a.M(this).f6848t == a.EnumC0086a.LANDSCAPE) {
l2();
} else {
setRequestedOrientation(4);
}
}
public void D2() {
if (t0.a.M(this).X) {
setTitle(this.E.getTitle());
}
}
@Override
public void E(String str) {
if (TextUtils.isEmpty(str)) {
return;
}
t0.a M = t0.a.M(this);
if (!M.F || M.G <= 0 || s1().e() < M.G || !b2(str)) {
Intent intent = new Intent(this, MainActivity.class);
intent.putExtra("isRoot", false);
intent.putExtra("url", str);
intent.putExtra("ignoreInterceptMaxWindows", true);
startActivityForResult(intent, 400);
}
}
public void E1() {
this.W.setVisibility(8);
}
@Override
public void F() {
if (s1().g(this.f3574h0)) {
return;
}
finish();
}
public void F1() {
View view;
((GoNativeApplication) getApplication()).f3565j.r(this);
if (t0.a.M(this).f6807i1) {
return;
}
this.f3571e0 = true;
float f3 = 1.0f;
this.Q.setAlpha(1.0f);
this.Q.setVisibility(0);
if (this.f3570d0) {
view = this.F;
} else {
view = this.F;
f3 = 1.0f - this.f3569c0;
}
view.setAlpha(f3);
u2(10.0d);
}
public int F2(String str) {
ArrayList<Pattern> arrayList = t0.a.M(this).Q;
if (arrayList != null) {
for (int i3 = 0; i3 < arrayList.size(); i3++) {
if (arrayList.get(i3).matcher(str).matches()) {
return t0.a.M(this).R.get(i3).intValue();
}
}
return -1;
}
return -1;
}
@Override
public void H() {
x1(new n() {
@Override
public final void a(boolean z2) {
MainActivity.T1(z2);
}
});
}
@Override
public void I(boolean z2, int i3) {
if (z2) {
getWindow().addFlags(i3);
} else {
getWindow().clearFlags(i3);
}
}
@Override
public void K(boolean z2) {
this.E0 = z2;
}
public boolean K1() {
NetworkInfo activeNetworkInfo = this.X.getActiveNetworkInfo();
return activeNetworkInfo == null || !activeNetworkInfo.isConnected();
}
@Override
public void L(boolean z2) {
if (z2) {
r0.o.h(this);
} else {
r0.o.c(this);
}
}
@Override
public void M(String str) {
if (this.f3583q0 == null || TextUtils.isEmpty(str)) {
return;
}
U1(t0.l.b(str, this.f3583q0.c()));
}
@Override
public void N(Map<String, String> map) {
JSONObject b3 = i0.b(map);
String str = map.get("callback");
if (str == null || str.isEmpty()) {
return;
}
final String b4 = t0.l.b(str, b3);
new Handler(getMainLooper()).post(new Runnable() {
@Override
public final void run() {
MainActivity.this.U1(b4);
}
});
}
public boolean N1() {
return !this.f3568b0;
}
@Override
public void O(String str) {
this.A0 = str;
V1();
new Handler().postDelayed(new c(str), 500L);
}
public boolean O1() {
return this.E0;
}
@Override
public void P(String str) {
new r0.p(this).c(str);
this.H0 = true;
if ("light".equals(str)) {
androidx.appcompat.app.h.O(1);
} else {
androidx.appcompat.app.h.O("dark".equals(str) ? 2 : -1);
}
}
@Override
public void R(String str) {
if (str.isEmpty()) {
setTitle(R.string.app_name);
} else {
setTitle(str);
}
}
@Override
public void S() {
String url = this.E.getUrl();
if (url == null || !url.equals("file:///android_asset/offline.html")) {
this.f3587u0 = this.f3588v0;
this.E.loadUrl(url);
return;
}
if (this.E.canGoBack()) {
this.E.goBack();
} else {
String str = this.I;
if (str != null) {
this.E.loadUrl(str);
}
}
B2();
}
@Override
public void U(String str) {
if (str.isEmpty()) {
return;
}
((ClipboardManager) getSystemService("clipboard")).setPrimaryClip(ClipData.newPlainText("copy", str));
}
@Override
public void V(androidx.fragment.app.c cVar) {
W();
Toast.makeText(this, (int) R.string.cleared_cache, 0).show();
}
@Override
public void W() {
this.E.clearCache(true);
}
public void W1(String str) {
X1(str, false);
}
@Override
public void X() {
this.W.setCurrentItem(-1);
}
public void X1(String str, boolean z2) {
v vVar;
if (str == null) {
return;
}
this.f3587u0 = null;
this.f3588v0 = null;
if (str.equalsIgnoreCase("median_logout") || str.equalsIgnoreCase("gonative_logout")) {
a2();
} else {
this.E.loadUrl(str);
}
if (z2 || (vVar = this.Z) == null) {
return;
}
vVar.l(str, null);
}
public void Y1(String str, String str2) {
Z1(str, str2, false);
}
public void Z1(String str, String str2, boolean z2) {
v vVar;
String url = this.E.getUrl();
if (str == null || url == null || !str.equals(url)) {
this.f3587u0 = str2;
this.f3588v0 = str2;
this.E.loadUrl(str);
} else {
U1(str2);
this.f3588v0 = str2;
}
if (z2 || (vVar = this.Z) == null) {
return;
}
vVar.l(str, str2);
}
@Override
public void U1(String str) {
if (str == null) {
return;
}
this.E.a(str);
}
public void b1(String str) {
if (str == null) {
return;
}
if (this.H.isEmpty() || !this.H.peek().equals(str)) {
this.H.push(str);
}
f1(str);
u2(0.3d);
}
public boolean b2(final String str) {
t0.a M = t0.a.M(this);
final co.median.android.k s12 = s1();
if (!M.H || !t0.l.k(str, M.L())) {
String b3 = s12.b();
Intent intent = new Intent("io.gonative.android.MainActivity.Extra.BROADCAST_RECEIVER_ACTION_WEBVIEW_LIMIT_REACHED");
intent.putExtra("excessWindowId", b3);
g0.a.b(this).d(intent);
s12.h(b3);
return false;
}
this.f3568b0 = true;
s12.i(this.f3574h0);
s12.m(this.f3574h0, -1, -1);
G1();
if (M.L0 || M.J) {
p2();
}
r2(M.J);
co.median.android.a aVar = this.f3567a0;
if (aVar != null) {
aVar.C(this.f3568b0);
this.f3567a0.E(str);
}
androidx.appcompat.app.b bVar = this.V;
if (bVar != null && M.J) {
bVar.l();
}
s12.j(this.f3574h0, true);
Intent intent2 = new Intent("io.gonative.android.MainActivity.Extra.BROADCAST_RECEIVER_ACTION_WEBVIEW_LIMIT_REACHED");
intent2.putExtra("newRootUrl", str);
g0.a.b(this).d(intent2);
s12.k(new k.b() {
@Override
public final void a() {
MainActivity.this.S1(str, s12);
}
});
return true;
}
@Override
public void c(JSONObject jSONObject, int i3) {
v vVar = this.Z;
if (vVar == null) {
return;
}
vVar.p(jSONObject, i3);
}
public boolean c1() {
t0.j jVar = this.E;
if (jVar == null) {
return false;
}
return jVar.canGoBack();
}
public void c2() {
if (this.R != null) {
this.R.setEnabled(t0.a.M(this).C);
}
}
@Override
public void d(String str) {
l0 l0Var = this.f3583q0;
if (l0Var == null) {
return;
}
l0Var.e(str);
}
public void e1() {
ValueCallback<Uri> valueCallback = this.K;
if (valueCallback != null) {
valueCallback.onReceiveValue(null);
this.K = null;
}
ValueCallback<Uri[]> valueCallback2 = this.L;
if (valueCallback2 != null) {
valueCallback2.onReceiveValue(null);
this.L = null;
}
this.M = null;
}
@Override
public void f(boolean z2) {
this.J = z2;
i2(z2);
}
public void f1(String str) {
if (str.equals(this.f3577k0.i())) {
return;
}
v vVar = this.Z;
if (vVar != null) {
vVar.g(str);
}
co.median.android.a aVar = this.f3567a0;
if (aVar != null) {
aVar.m(str);
}
s sVar = this.f3581o0;
if (sVar != null) {
sVar.d(str);
}
co.median.android.m mVar = this.U;
if (mVar != null) {
mVar.b(str);
}
}
public void g1(String str) {
v vVar = this.Z;
if (vVar != null) {
vVar.f(str);
}
co.median.android.m mVar = this.U;
if (mVar != null) {
mVar.b(str);
}
co.median.android.a aVar = this.f3567a0;
if (aVar != null) {
aVar.n();
}
t0.a M = t0.a.M(this);
boolean z2 = false;
i2(M.i0(str) && this.J);
GoNativeDrawerLayout goNativeDrawerLayout = this.N;
if (goNativeDrawerLayout == null || goNativeDrawerLayout.s(8388611) == 1) {
return;
}
GoNativeDrawerLayout goNativeDrawerLayout2 = this.N;
if (M.D && c1()) {
z2 = true;
}
goNativeDrawerLayout2.setDisableTouch(z2);
}
public void h2(Uri uri) {
this.M = uri;
}
@Override
public void i(float f3) {
WindowManager.LayoutParams attributes = getWindow().getAttributes();
attributes.screenBrightness = f3;
getWindow().setAttributes(attributes);
}
@Override
public void j(String str) {
String str2;
if (TextUtils.isEmpty(str)) {
return;
}
HashMap hashMap = new HashMap();
ClipboardManager clipboardManager = (ClipboardManager) getSystemService("clipboard");
if (clipboardManager.hasPrimaryClip()) {
CharSequence text = clipboardManager.getPrimaryClip().getItemAt(0).getText();
if (text != null) {
hashMap.put("data", text.toString());
U1(t0.l.b(str, new JSONObject(hashMap)));
}
str2 = "Clipboard item is not a string.";
} else {
str2 = "No Clipboard item available.";
}
hashMap.put("error", str2);
U1(t0.l.b(str, new JSONObject(hashMap)));
}
public void j1() {
this.N.j();
}
public void j2(boolean z2) {
k2(z2, null);
}
@Override
public void k(String str) {
if (str == null) {
return;
}
this.B0 = str;
if (this.C0 != null) {
e2(str);
return;
}
V1();
new Handler().postDelayed(new b(), 500L);
}
public void k1() {
MySwipeRefreshLayout mySwipeRefreshLayout = this.R;
if (mySwipeRefreshLayout != null) {
mySwipeRefreshLayout.setEnabled(true);
}
}
public void k2(boolean z2, MenuItem menuItem) {
for (int i3 = 0; i3 < this.f3573g0.size(); i3++) {
MenuItem item = this.f3573g0.getItem(i3);
if (item != menuItem) {
item.setVisible(z2);
item.setEnabled(z2);
}
}
}
@Override
public void l(int i3) {
getWindow().setStatusBarColor(i3);
}
public co.median.android.a l1() {
return this.f3567a0;
}
@Override
public void m(String str, String str2, boolean z2, boolean z3) {
this.f3577k0.g(str, str2, z2, z3);
}
public String m1() {
return this.f3574h0;
}
public void m2(ValueCallback<Uri[]> valueCallback) {
this.L = valueCallback;
}
public GoNativeDrawerLayout n1() {
return this.N;
}
public void n2(int i3) {
s1().l(this.f3574h0, i3);
}
@Override
public void o(int i3) {
v vVar = this.Z;
if (vVar == null) {
return;
}
vVar.m(i3, false);
}
public androidx.appcompat.app.b o1() {
return this.V;
}
@Override
public void onActivityResult(int i3, int i4, Intent intent) {
String str;
boolean z2;
super.onActivityResult(i3, i4, intent);
((GoNativeApplication) getApplication()).f3565j.l(this, i3, i4, intent);
if (intent != null && intent.getBooleanExtra("exit", false)) {
finish();
}
if (intent != null) {
str = intent.getStringExtra("url");
z2 = intent.getBooleanExtra("success", false);
} else {
str = null;
z2 = false;
}
if (i3 == 300 && i4 == -1) {
if (str != null) {
W1(str);
} else {
this.E.setCheckLoginSignup(false);
this.E.loadUrl(t0.a.M(this).L());
}
if (t0.a.M(this).J) {
C2(z2);
}
}
if (i3 == 400 && i4 == -1 && str != null) {
int intExtra = intent.getIntExtra("urlLevel", -1);
int c3 = s1().c(this.f3574h0);
if (intExtra == -1 || c3 == -1 || intExtra > c3) {
this.f3587u0 = intent.getStringExtra("postLoadJavascript");
W1(str);
} else {
setResult(-1, intent);
finish();
}
}
if (i3 == 100) {
if (i4 != -1) {
e1();
} else if (intent != null && intent.getData() != null) {
ValueCallback<Uri> valueCallback = this.K;
if (valueCallback != null) {
valueCallback.onReceiveValue(intent.getData());
this.K = null;
}
ValueCallback<Uri[]> valueCallback2 = this.L;
if (valueCallback2 != null) {
valueCallback2.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(i4, intent));
this.L = null;
}
} else if (intent == null || intent.getClipData() == null) {
if (this.M == null) {
e1();
return;
}
Uri a3 = new s0.a().a(this, this.M);
ValueCallback<Uri> valueCallback3 = this.K;
if (valueCallback3 != null) {
valueCallback3.onReceiveValue(a3);
this.K = null;
}
ValueCallback<Uri[]> valueCallback4 = this.L;
if (valueCallback4 != null) {
valueCallback4.onReceiveValue(new Uri[]{a3});
this.L = null;
}
getContentResolver().delete(this.M, null, null);
this.M = null;
} else {
ClipData clipData = intent.getClipData();
ArrayList arrayList = new ArrayList(clipData.getItemCount());
for (int i5 = 0; i5 < clipData.getItemCount(); i5++) {
ClipData.Item itemAt = clipData.getItemAt(i5);
if (itemAt.getUri() != null) {
arrayList.add(itemAt.getUri());
}
}
if (this.K != null) {
if (arrayList.size() > 0) {
this.K.onReceiveValue((Uri) arrayList.get(0));
} else {
this.K.onReceiveValue(null);
}
this.K = null;
}
ValueCallback<Uri[]> valueCallback5 = this.L;
if (valueCallback5 != null) {
valueCallback5.onReceiveValue((Uri[]) arrayList.toArray(new Uri[arrayList.size()]));
this.L = null;
}
}
}
}
@Override
public void onConfigurationChanged(Configuration configuration) {
super.onConfigurationChanged(configuration);
this.f3567a0.D();
GoNativeApplication goNativeApplication = (GoNativeApplication) getApplication();
androidx.appcompat.app.b bVar = this.V;
if (bVar != null) {
bVar.g(configuration);
}
goNativeApplication.f3565j.q(this);
}
@Override
public void onCreate(Bundle bundle) {
boolean z2;
String str;
ImageView imageView;
RelativeLayout relativeLayout;
t0.a M = t0.a.M(this);
GoNativeApplication goNativeApplication = (GoNativeApplication) getApplication();
co.median.android.k h3 = goNativeApplication.h();
boolean z3 = true;
if (M.f6860x) {
D(true);
}
l2();
if (M.f6857w) {
getWindow().addFlags(128);
}
this.f3569c0 = M.W0;
r0.p pVar = new r0.p(this);
String a3 = pVar.a();
if (TextUtils.isEmpty(a3)) {
a3 = !TextUtils.isEmpty(M.I0) ? M.I0 : "light";
pVar.c(a3);
}
if (bundle != null ? bundle.getBoolean("ignoreThemeSetup", false) : false) {
Log.d("GNDebug", "onCreate: configuration change from setupAppTheme(), ignoring theme setup");
} else if ("light".equals(a3)) {
androidx.appcompat.app.h.O(1);
} else if ("dark".equals(a3)) {
androidx.appcompat.app.h.O(2);
} else if ("auto".equals(a3)) {
androidx.appcompat.app.h.O(-1);
} else {
androidx.appcompat.app.h.O(1);
pVar.c("light");
}
super.onCreate(bundle);
this.f3574h0 = UUID.randomUUID().toString();
this.f3568b0 = getIntent().getBooleanExtra("isRoot", true);
int intExtra = getIntent().getIntExtra("urlLevel", -1);
int intExtra2 = getIntent().getIntExtra("parentUrlLevel", -1);
if (bundle != null) {
this.f3574h0 = bundle.getString("activityId", this.f3574h0);
this.f3568b0 = bundle.getBoolean("isRoot", this.f3568b0);
intExtra = bundle.getInt("urlLevel", intExtra);
intExtra2 = bundle.getInt("parentUrlLevel", intExtra2);
}
goNativeApplication.f3565j.h(this, this.f3568b0);
h3.a(this.f3574h0, this.f3568b0);
h3.m(this.f3574h0, intExtra, intExtra2);
if (M.F) {
h3.j(this.f3574h0, getIntent().getBooleanExtra("ignoreInterceptMaxWindows", false));
}
if (this.f3568b0) {
G1();
}
this.f3580n0 = goNativeApplication.d();
this.f3578l0 = new co.median.android.g(this);
this.f3577k0 = new co.median.android.d(this);
goNativeApplication.f().q(this);
this.X = (ConnectivityManager) getSystemService("connectivity");
setContentView(R.layout.activity_gonative);
this.Q = (ProgressBar) findViewById(R.id.progress);
this.T = (RelativeLayout) findViewById(R.id.fullscreen);
MySwipeRefreshLayout mySwipeRefreshLayout = (MySwipeRefreshLayout) findViewById(R.id.swipe_refresh);
this.R = mySwipeRefreshLayout;
mySwipeRefreshLayout.setEnabled(M.C);
this.R.setOnRefreshListener(this);
this.R.setCanChildScrollUpCallback(new MySwipeRefreshLayout.a() {
@Override
public final boolean a() {
boolean Q1;
Q1 = MainActivity.this.Q1();
return Q1;
}
});
if (J1()) {
M.D = false;
}
SwipeHistoryNavigationLayout swipeHistoryNavigationLayout = (SwipeHistoryNavigationLayout) findViewById(R.id.swipe_history_nav);
this.S = swipeHistoryNavigationLayout;
swipeHistoryNavigationLayout.setEnabled(M.D);
this.S.setSwipeNavListener(new e(M));
this.R.setColorSchemeColors(getResources().getColor(R.color.pull_to_refresh_color));
this.S.setActiveColor(getResources().getColor(R.color.pull_to_refresh_color));
this.R.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.swipe_nav_background));
this.S.setBackgroundColor(getResources().getColor(R.color.swipe_nav_background));
this.F = findViewById(R.id.webviewOverlay);
WebViewContainerView webViewContainerView = (WebViewContainerView) findViewById(R.id.webviewContainer);
this.D = webViewContainerView;
this.E = webViewContainerView.getWebview();
this.D.b(this, this.f3568b0);
q2(a3);
if (bundle != null) {
Bundle bundle2 = bundle.getBundle("webViewState");
if (bundle2 != null) {
this.E.e(bundle2);
z2 = true;
} else {
z2 = false;
}
this.E.scrollTo(bundle.getInt("scrollX", 0), bundle.getInt("scrollY", 0));
} else {
z2 = false;
}
if (this.f3568b0 && (M.L0 || M.J)) {
p2();
}
CookieHandler.setDefault(new f1());
String stringExtra = getIntent().getStringExtra("postLoadJavascript");
this.f3587u0 = stringExtra;
this.f3588v0 = stringExtra;
this.f3589w0 = new Stack<>();
this.W = (AHBottomNavigation) findViewById(R.id.bottom_navigation);
this.Z = new v(this, this.W);
E1();
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
if (u0() == null) {
D0(toolbar);
}
if (!M.L0 && !M.J) {
u0().m();
}
if (!M.Q0 && !M.R0 && (relativeLayout = (RelativeLayout) findViewById(R.id.header_layout)) != null) {
relativeLayout.setVisibility(8);
}
if (!M.Q0 && (imageView = (ImageView) findViewById(R.id.app_logo)) != null) {
imageView.setVisibility(8);
}
TextView textView = (TextView) findViewById(R.id.app_name);
if (textView != null) {
if (M.R0) {
textView.setText(M.f6797g);
} else {
textView.setVisibility(4);
}
}
co.median.android.a aVar = new co.median.android.a(this);
this.f3567a0 = aVar;
aVar.C(this.f3568b0);
if (toolbar != null && toolbar.getOverflowIcon() != null) {
toolbar.getOverflowIcon().setColorFilter(getResources().getColor(R.color.titleTextColor), PorterDuff.Mode.SRC_ATOP);
}
if (z2) {
str = this.E.getUrl();
} else {
Intent intent = getIntent();
String z12 = z1(intent);
if (z12 == null && this.f3568b0) {
z12 = M.L();
}
if (z12 == null) {
z12 = intent.getStringExtra("url");
}
if (z12 != null) {
Map<String, String> b3 = goNativeApplication.f3565j.b(this, this.f3568b0);
if (b3 == null || b3.isEmpty()) {
str = z12;
} else {
Uri.Builder buildUpon = Uri.parse(z12).buildUpon();
for (Map.Entry<String, String> entry : b3.entrySet()) {
buildUpon.appendQueryParameter(entry.getKey(), entry.getValue());
}
str = buildUpon.build().toString();
}
this.I = str;
this.E.loadUrl(str);
} else {
if (!intent.getBooleanExtra("io.gonative.android.MainActivity.Extra.WEBVIEW_WINDOW_OPEN", false)) {
t0.g.a().b(I0, "No url specified for MainActivity");
}
str = z12;
}
}
r2((this.f3568b0 && M.J) ? false : false);
this.f3567a0.E(str);
v(M.T0);
y(M.U0);
this.f3583q0 = new l0(this, (ViewGroup) findViewById(16908290));
View view = this.O;
if (view != null) {
view.setBackgroundColor(getResources().getColor(R.color.sidebarBackground));
}
this.f3584r0 = new f();
g0.a.b(this).c(this.f3584r0, new IntentFilter("io.gonative.android.AppConfig.processedNavigationTitles"));
this.f3585s0 = new g();
g0.a.b(this).c(this.f3585s0, new IntentFilter("io.gonative.android.AppConfig.processedNavigationLevels"));
this.f3586t0 = new h();
g0.a.b(this).c(this.f3586t0, new IntentFilter("io.gonative.android.MainActivity.Extra.BROADCAST_RECEIVER_ACTION_WEBVIEW_LIMIT_REACHED"));
goNativeApplication.f3565j.w(this, h0.b(this), this.E.getUrl());
G2();
this.F0 = i0(new b.c(), new androidx.activity.result.a() {
@Override
public final void a(Object obj) {
MainActivity.this.R1((Boolean) obj);
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.topmenu, menu);
this.f3573g0 = menu;
co.median.android.a aVar = this.f3567a0;
if (aVar != null) {
aVar.h(menu);
return true;
}
return true;
}
@Override
protected void onDestroy() {
super.onDestroy();
GoNativeApplication goNativeApplication = (GoNativeApplication) getApplication();
goNativeApplication.f3565j.i(this);
goNativeApplication.h().h(this.f3574h0);
co.median.android.d dVar = this.f3577k0;
if (dVar != null) {
dVar.o();
}
t0.j jVar = this.E;
if (jVar != null) {
jVar.stopLoading();
ViewGroup viewGroup = (ViewGroup) this.E.getParent();
if (viewGroup != null) {
viewGroup.removeView((View) this.E);
}
if (!this.G) {
this.E.destroy();
}
}
this.f3580n0.deleteObserver(this);
if (this.f3584r0 != null) {
g0.a.b(this).e(this.f3584r0);
}
if (this.f3585s0 != null) {
g0.a.b(this).e(this.f3585s0);
}
if (this.f3586t0 != null) {
g0.a.b(this).e(this.f3586t0);
}
}
@Override
public boolean onKeyDown(int i3, KeyEvent keyEvent) {
if (i3 == 4) {
if (t0.a.M(this).f6774a0 || this.E.d()) {
return true;
}
if (L1()) {
this.N.j();
return true;
} else if (c1()) {
C1();
return true;
} else if (!this.f3589w0.isEmpty()) {
co.median.android.n nVar = new co.median.android.n(this);
nVar.e(this.f3589w0.pop());
z2(nVar, false, true);
return true;
}
}
if (((GoNativeApplication) getApplication()).f3565j.s(i3, keyEvent)) {
return true;
}
return super.onKeyDown(i3, keyEvent);
}
@Override
public void onNewIntent(Intent intent) {
super.onNewIntent(intent);
String z12 = z1(intent);
if (z12 == null || z12.isEmpty()) {
Log.w(I0, "Received intent without url");
((GoNativeApplication) getApplication()).f3565j.j(this, intent);
} else if (E2(z12, this.E.getUrl())) {
} else {
W1(z12);
}
}
@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
androidx.appcompat.app.b bVar = this.V;
if (bVar == null || !bVar.h(menuItem)) {
co.median.android.a aVar = this.f3567a0;
if (aVar == null || !aVar.y(menuItem)) {
if (menuItem.getItemId() == 16908332) {
if (!this.f3567a0.r()) {
finish();
return true;
}
this.f3567a0.o();
this.f3567a0.B(false);
return true;
}
return super.onOptionsItemSelected(menuItem);
}
return true;
}
return true;
}
@Override
public void onPause() {
super.onPause();
GoNativeApplication goNativeApplication = (GoNativeApplication) getApplication();
goNativeApplication.f3565j.k(this);
this.C = true;
x2();
if (goNativeApplication.f3565j.y()) {
this.E.onPause();
}
m mVar = this.f3582p0;
if (mVar != null) {
unregisterReceiver(mVar);
}
CookieManager.getInstance().flush();
this.f3576j0.d();
}
@Override
protected void onPostCreate(Bundle bundle) {
super.onPostCreate(bundle);
((GoNativeApplication) getApplication()).f3565j.u(this, bundle, this.f3568b0);
androidx.appcompat.app.b bVar = this.V;
if (bVar != null) {
bVar.l();
}
}
@Override
public void onRequestPermissionsResult(int i3, String[] strArr, int[] iArr) {
boolean z2;
super.onRequestPermissionsResult(i3, strArr, iArr);
((GoNativeApplication) getApplication()).f3565j.v(this, i3, strArr, iArr);
if (i3 == 102) {
n nVar = this.f3590x0;
if (nVar != null) {
if (iArr.length >= 2 && iArr[0] == 0 && iArr[1] == 0) {
nVar.a(true);
} else {
nVar.a(false);
}
this.f3590x0 = null;
}
} else if (i3 != 199) {
} else {
Iterator<p> it = this.f3591y0.iterator();
while (it.hasNext()) {
p next = it.next();
if (next.f3610a.length == strArr.length) {
int i4 = 0;
while (true) {
String[] strArr2 = next.f3610a;
if (i4 >= strArr2.length || i4 >= strArr.length) {
break;
} else if (!strArr2[i4].equals(strArr[i4])) {
z2 = true;
break;
} else {
i4++;
}
}
z2 = false;
if (!z2) {
o oVar = next.f3611b;
if (oVar != null) {
oVar.a(strArr, iArr);
}
it.remove();
}
}
}
if (this.f3591y0.size() != 0 || this.f3592z0.size() <= 0) {
return;
}
Iterator<Intent> it2 = this.f3592z0.iterator();
while (it2.hasNext()) {
startActivity(it2.next());
it2.remove();
}
}
}
@Override
public void onResume() {
super.onResume();
((GoNativeApplication) getApplication()).f3565j.m(this);
this.E.onResume();
if (this.C) {
this.C = false;
U1(t0.l.b("median_app_resumed", null));
U1(t0.l.b("gonative_app_resumed", null));
}
d2();
m mVar = new m(this, null);
this.f3582p0 = mVar;
registerReceiver(mVar, new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"));
this.f3580n0.g();
if (t0.a.M(this).Z) {
this.f3576j0.b(15);
this.f3576j0.c((SensorManager) getSystemService("sensor"));
}
}
@Override
public void onSaveInstanceState(Bundle bundle) {
Bundle bundle2 = new Bundle();
this.E.c(bundle2);
bundle.putBundle("webViewState", bundle2);
bundle.putString("activityId", this.f3574h0);
bundle.putBoolean("isRoot", s1().g(this.f3574h0));
bundle.putInt("urlLevel", s1().d(this.f3574h0));
bundle.putInt("parentUrlLevel", s1().c(this.f3574h0));
bundle.putInt("scrollX", this.E.getWebViewScrollX());
bundle.putInt("scrollY", this.E.getWebViewScrollY());
if (this.H0) {
bundle.putBoolean("ignoreThemeSetup", true);
}
super.onSaveInstanceState(bundle);
}
@Override
protected void onStart() {
super.onStart();
((GoNativeApplication) getApplication()).f3565j.n(this);
if (t0.a.M(this).f6847s1) {
r0.o.d(this);
}
}
@Override
protected void onStop() {
super.onStop();
((GoNativeApplication) getApplication()).f3565j.o(this);
if (this.f3568b0 && t0.a.M(this).f6841r) {
this.E.clearCache(true);
}
}
@Override
public void p() {
final CookieManager cookieManager = CookieManager.getInstance();
cookieManager.removeAllCookies(new ValueCallback() {
@Override
public final void onReceiveValue(Object obj) {
MainActivity.P1((Boolean) obj);
}
});
AsyncTask.THREAD_POOL_EXECUTOR.execute(new Runnable() {
@Override
public final void run() {
cookieManager.flush();
}
});
}
public co.median.android.d p1() {
return this.f3577k0;
}
public co.median.android.g q1() {
return this.f3578l0;
}
public RelativeLayout r1() {
return this.T;
}
@Override
public boolean s() {
boolean isLocationEnabled;
if (M1()) {
if (Build.VERSION.SDK_INT < 28) {
return Settings.Secure.getInt(getContentResolver(), "location_mode", 0) != 0;
}
isLocationEnabled = ((LocationManager) getSystemService(LocationManager.class)).isLocationEnabled();
return isLocationEnabled;
}
return false;
}
public co.median.android.k s1() {
return ((GoNativeApplication) getApplication()).h();
}
public void s2() {
this.W.setVisibility(0);
}
@Override
public void setTitle(CharSequence charSequence) {
super.setTitle(charSequence);
co.median.android.a aVar = this.f3567a0;
if (aVar != null) {
aVar.G(charSequence);
}
}
@Override
public void t() {
S();
y2(true, 1000);
}
public Object t1() {
return ((GoNativeApplication) getApplication()).f3565j.c();
}
public void t2() {
this.f3570d0 = false;
this.f3579m0 = false;
x2();
if (!this.f3571e0) {
this.Q.setVisibility(4);
return;
}
H1();
I1();
this.f3571e0 = false;
this.F.animate().alpha(0.0f).setDuration(300L).setStartDelay(150L);
this.Q.animate().alpha(0.0f).setDuration(60L);
}
public int u1() {
return s1().c(this.f3574h0);
}
@Override
public void update(Observable observable, Object obj) {
if (observable instanceof co.median.android.o) {
C2(((co.median.android.o) observable).h());
}
}
@Override
public void v(boolean z2) {
View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(z2 ? decorView.getSystemUiVisibility() | 1024 | 256 : decorView.getSystemUiVisibility() & (-1025) & (-257));
}
public void v1(String[] strArr, o oVar) {
boolean z2;
int length = strArr.length;
int i3 = 0;
while (true) {
if (i3 >= length) {
z2 = false;
break;
} else if (androidx.core.content.a.a(this, strArr[i3]) != 0) {
z2 = true;
break;
} else {
i3++;
}
}
if (z2) {
if (oVar != null) {
this.f3591y0.add(new p(strArr, oVar));
}
androidx.core.app.b.l(this, strArr, 199);
} else if (oVar != null) {
int length2 = strArr.length;
int[] iArr = new int[length2];
for (int i4 = 0; i4 < length2; i4++) {
iArr[i4] = 0;
}
oVar.a(strArr, iArr);
}
}
public void v2() {
this.f3570d0 = false;
this.f3571e0 = false;
this.f3579m0 = false;
x2();
this.F.setAlpha(0.0f);
this.Q.setVisibility(4);
H1();
I1();
}
@Override
public void w(String str, boolean z2) {
Boolean bool;
if (z2) {
this.G0 = str;
this.F0.a("android.permission.READ_PHONE_STATE");
return;
}
Map<String, Object> b3 = h0.b(this);
SharedPreferences defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
if (defaultSharedPreferences.getBoolean("hasLaunched", false)) {
bool = Boolean.FALSE;
} else {
defaultSharedPreferences.edit().putBoolean("hasLaunched", true).commit();
bool = Boolean.TRUE;
}
b3.put("isFirstLaunch", bool);
U1(t0.l.b(str, new JSONObject(b3)));
}
public r w1() {
return this.Y;
}
public void w2() {
this.f3575i0.run();
}
@Override
public void x() {
this.A0 = null;
}
public void x1(n nVar) {
if (M1()) {
nVar.a(true);
}
if (androidx.core.app.b.m(this, "android.permission.ACCESS_FINE_LOCATION") || androidx.core.app.b.m(this, "android.permission.ACCESS_COARSE_LOCATION")) {
Toast.makeText(this, (int) R.string.request_permission_explanation_geolocation, 0).show();
}
this.f3590x0 = nVar;
androidx.core.app.b.l(this, new String[]{"android.permission.ACCESS_FINE_LOCATION", "android.permission.ACCESS_COARSE_LOCATION"}, androidx.constraintlayout.widget.j.U0);
}
@Override
public void y(String str) {
View decorView;
int systemUiVisibility;
if (str == null || str.isEmpty() || Build.VERSION.SDK_INT < 23) {
return;
}
char c3 = 65535;
switch (str.hashCode()) {
case 3005871:
if (str.equals("auto")) {
c3 = 0;
break;
}
break;
case 3075958:
if (str.equals("dark")) {
c3 = 1;
break;
}
break;
case 102970646:
if (str.equals("light")) {
c3 = 2;
break;
}
break;
}
switch (c3) {
case 0:
int i3 = getResources().getConfiguration().uiMode & 48;
if (i3 != 32) {
if (i3 != 16) {
t0.g.a().b(I0, "updateStatusBarStyle: Current mode is undefined");
return;
}
decorView = getWindow().getDecorView();
systemUiVisibility = decorView.getSystemUiVisibility() | 8192;
break;
}
decorView = getWindow().getDecorView();
systemUiVisibility = decorView.getSystemUiVisibility() & (-8193);
break;
case 1:
decorView = getWindow().getDecorView();
systemUiVisibility = decorView.getSystemUiVisibility() & (-8193);
break;
case 2:
decorView = getWindow().getDecorView();
systemUiVisibility = decorView.getSystemUiVisibility() | 8192;
break;
default:
return;
}
decorView.setSystemUiVisibility(systemUiVisibility);
}
public q y1() {
return new q();
}
@Override
public void z(String str, String str2) {
String url = this.E.getUrl();
if (str == null || str.isEmpty()) {
str = url;
} else {
try {
URI uri = new URI(str);
if (!uri.isAbsolute()) {
str = new URI(url).resolve(uri).toString();
}
} catch (URISyntaxException unused) {
}
}
if (str == null || str.isEmpty()) {
return;
}
Intent intent = new Intent("android.intent.action.SEND");
intent.setType("text/plain");
intent.putExtra("android.intent.extra.TEXT", str);
if (str2 != null) {
intent.putExtra("android.intent.extra.SUBJECT", str2);
}
startActivity(Intent.createChooser(intent, getString(R.string.action_share)));
}
public void z2(t0.j jVar, boolean z2, boolean z3) {
this.D.b(this, this.f3568b0);
((View) jVar).scrollTo(0, 0);
View view = (View) this.E;
if (!z3) {
Bundle bundle = new Bundle();
this.E.c(bundle);
this.f3589w0.add(bundle);
}
if (jVar != view) {
ViewParent parent = jVar.getParent();
if (parent instanceof ViewGroup) {
((ViewGroup) parent).removeView((View) jVar);
}
ViewGroup viewGroup = (ViewGroup) view.getParent();
int indexOfChild = viewGroup.indexOfChild(view);
viewGroup.removeView(view);
View view2 = (View) jVar;
viewGroup.addView(view2, indexOfChild);
view2.setLayoutParams(view.getLayoutParams());
y.a((co.median.android.n) view);
if (!this.G) {
((t0.j) view).destroy();
}
}
this.G = z2;
this.E = jVar;
String str = this.f3587u0;
if (str != null) {
U1(str);
this.f3587u0 = null;
}
}
}