xiaodi8 v1.0.0版本的 MD5 值为:6b857c57f508176c5ba1afb422bbb5a9
以下内容为反编译后的 MainActivity.java 源代码,内容仅作参考
package com.bslyun.app.activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.database.ContentObserver;
import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TabHost;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.Fragment;
import com.bslyun.app.MainApplication;
import com.bslyun.app.browser.JavaScriptUtils;
import com.bslyun.app.browser.WebViewUtils;
import com.bslyun.app.browser.listeners.ChangeBottomMenuListener;
import com.bslyun.app.browser.listeners.NetChangeListeners;
import com.bslyun.app.browser.listeners.PermissionListener;
import com.bslyun.app.browser.local.LocalBrowserChromeClient;
import com.bslyun.app.browser.local.WBH5FaceVerifySDK;
import com.bslyun.app.browser.x5.X5WBH5FaceVerifySDK;
import com.bslyun.app.component.LoginListener;
import com.bslyun.app.component.WeiboComponent;
import com.bslyun.app.component.linkpage.LinkpageComponent;
import com.bslyun.app.component.live.ZBCommponent;
import com.bslyun.app.component.qq.TencentComponent;
import com.bslyun.app.component.qrcode.QRCodeComponent;
import com.bslyun.app.component.quicklogin.QuickLoginComponent;
import com.bslyun.app.component.umeng.u_link.ULinkCommponent;
import com.bslyun.app.eventbus.MainActivityHook;
import com.bslyun.app.fragment.WebFragment;
import com.bslyun.app.modes.AddContact;
import com.bslyun.app.modes.AdveMode;
import com.bslyun.app.modes.BottomMenuItemModel;
import com.bslyun.app.modes.FloatMenuItem;
import com.bslyun.app.modes.RecordModel;
import com.bslyun.app.modes.SHARE_MEDIA;
import com.bslyun.app.modes.SendLiveData;
import com.bslyun.app.modes.Threeparty;
import com.bslyun.app.service.VideoDownloadService;
import com.bslyun.app.uiconfig.LayoutItem;
import com.bslyun.app.utils.b0;
import com.bslyun.app.utils.c0;
import com.bslyun.app.utils.e0;
import com.bslyun.app.utils.f0;
import com.bslyun.app.utils.h0;
import com.bslyun.app.utils.i0;
import com.bslyun.app.utils.l0;
import com.bslyun.app.utils.m0;
import com.bslyun.app.utils.w;
import com.bslyun.app.utils.y;
import com.bslyun.app.views.MyDrawerLayout;
import com.bslyun.app.views.MyFragmentTabHost;
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.kseuay.kziwmts.R;
import com.luck.picture.lib.basic.PictureSelector;
import com.luck.picture.lib.config.PictureMimeType;
import com.luck.picture.lib.config.SelectMimeType;
import com.luck.picture.lib.entity.LocalMedia;
import com.luck.picture.lib.permissions.PermissionConfig;
import com.tencent.smtt.sdk.TbsVideoCacheTask;
import com.tencent.smtt.sdk.WebView;
import io.github.inflationx.calligraphy3.BuildConfig;
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.InvocationTargetException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
public class MainActivity extends BaseActivity implements TabHost.OnTabChangeListener, LocalBrowserChromeClient.VideoFullScreenCallback, ChangeBottomMenuListener, PermissionListener, NetChangeListeners, com.bslyun.app.views.c, LoginListener {
public static final String MY_ACTION = "com.bslyun.app.activity.MainActivity.MY";
public static final String PAY_ACTION = "com.bslyun.app.activity.MainActivity.PAY";
public static String jsCallbackMethod;
public View barHeight;
public ContentObserver contentObserver;
public TextView copyright;
public String dynamicLeftNavigation;
public String dynamicRightNavigation;
private String f4147e;
private String f4148f;
private l0 f4149g;
private com.bslyun.app.f.d f4150h;
private com.bslyun.app.views.a i;
public boolean jsNavCallGone;
public boolean jsTabCallGone;
private com.bslyun.app.utils.c k;
private com.bslyun.app.views.d l;
private com.bslyun.app.views.b m;
public MyDrawerLayout mDrawerLayout;
public ImageView mLeftMenu;
public RelativeLayout mNavigateLayout;
public MyFragmentTabHost mTabHost;
private MainActivityHook n;
public View navLine;
private ImageButton o;
private ImageButton p;
private MainApplication q;
private com.bslyun.app.f.c s;
public ImageView share;
public boolean startScreenshort;
private int t;
public int tabHostHeight;
public TextView title;
public boolean touchHide;
private long u;
private com.bslyun.app.f.d v;
public com.bslyun.app.f.a widowAd;
public boolean isBarHeightVisiable = true;
private s j = new s();
public boolean isClearFragment = false;
public class a implements Runnable {
a() {
}
@Override
public void run() {
MainActivity mainActivity = MainActivity.this;
y.g(mainActivity, mainActivity.f4132a.T);
}
}
public class b implements Runnable {
b() {
}
@Override
public void run() {
MainActivity.this.mDrawerLayout.openDrawer(3);
}
}
class c implements Runnable {
c() {
}
@Override
public void run() {
MainActivity.this.mDrawerLayout.closeDrawers();
}
}
class d implements Runnable {
final String f4154a;
final boolean f4155b;
d(String str, boolean z) {
this.f4154a = str;
this.f4155b = z;
}
@Override
public void run() {
if (!TextUtils.isEmpty(this.f4154a)) {
if (this.f4154a.equals("0")) {
if (MainActivity.this.mTabHost.getHeight() > 0) {
MainActivity.this.mTabHost.setVisibility(8);
return;
}
return;
} else {
ViewGroup.LayoutParams layoutParams = MainActivity.this.mTabHost.getLayoutParams();
MainActivity mainActivity = MainActivity.this;
layoutParams.height = mainActivity.tabHostHeight;
mainActivity.mTabHost.requestLayout();
MainActivity.this.mTabHost.setVisibility(0);
return;
}
}
if (MainActivity.this.mTabHost.getVisibility() == 8) {
if (!this.f4155b) {
ViewGroup.LayoutParams layoutParams2 = MainActivity.this.mTabHost.getLayoutParams();
MainActivity mainActivity2 = MainActivity.this;
layoutParams2.height = mainActivity2.tabHostHeight;
mainActivity2.mTabHost.requestLayout();
MainActivity.this.mTabHost.setVisibility(0);
return;
}
com.bslyun.app.utils.b.b(MainActivity.this.mTabHost, r0.tabHostHeight);
return;
}
MainActivity mainActivity3 = MainActivity.this;
com.bslyun.app.utils.b.a(mainActivity3.mTabHost, mainActivity3.getWebFragment().getRootView(), MainActivity.this.tabHostHeight);
}
}
public class e implements Runnable {
final String f4157a;
final Fragment f4158b;
e(String str, Fragment fragment) {
this.f4157a = str;
this.f4158b = fragment;
}
@Override
public void run() {
androidx.lifecycle.h m;
String replace = this.f4157a.replace("tab", BuildConfig.FLAVOR);
LayoutItem layoutItem = MainActivity.this.f4132a.e0.a().e().get(Integer.parseInt(replace));
if (!layoutItem.a().equals("2") && !MainActivity.this.isClearFragment) {
m = ((com.bslyun.app.fragment.d) this.f4158b).k();
} else {
if (this.f4158b.getChildFragmentManager().o0() > 0) {
this.f4158b.getChildFragmentManager().a1(null, 1);
}
m = ((com.bslyun.app.fragment.d) this.f4158b).m();
MainActivity mainActivity = MainActivity.this;
if (mainActivity.isClearFragment) {
mainActivity.isClearFragment = false;
}
}
if (TextUtils.isEmpty(layoutItem.c()) || layoutItem.c().equals("\"\"")) {
((com.bslyun.app.fragment.m) m).onTabReselect(layoutItem, Integer.parseInt(replace), false);
MainActivity.this.refreshConfig();
}
}
}
public class f implements Runnable {
final String f4160a;
f(String str) {
this.f4160a = str;
}
@Override
public void run() {
MainActivity.this.getWebFragment().getLocalBrowser().postJs("javascript:" + MainActivity.jsCallbackMethod + "('" + this.f4160a + "')");
MainActivity.jsCallbackMethod = null;
}
}
public class g implements Runnable {
final String f4162a;
g(String str) {
this.f4162a = str;
}
@Override
public void run() {
MainActivity.this.getWebFragment().getX5Browser().postJs("javascript:" + MainActivity.jsCallbackMethod + "('" + this.f4162a + "')");
MainActivity.jsCallbackMethod = null;
}
}
public class h implements androidx.lifecycle.n<SendLiveData.JsMessage> {
h() {
}
@Override
public void a(SendLiveData.JsMessage jsMessage) {
if (MainActivity.this.getWebFragment() != null) {
MainActivity.this.getWebFragment().postJS("javascript:" + jsMessage.callback + "('" + jsMessage.json + "')");
}
}
}
public class i implements View.OnClickListener {
i() {
}
@Override
public void onClick(View view) {
Intent intent = new Intent(MainActivity.this, (Class<?>) WebActivity.class);
intent.putExtra("titleText", com.bslyun.app.e.a.p.getTitle());
intent.putExtra(TbsVideoCacheTask.KEY_VIDEO_CACHE_PARAM_URL, com.bslyun.app.e.a.p.getUrl());
MainActivity.this.startActivity(intent);
new com.bslyun.app.utils.m(MainActivity.this, false);
}
}
public class j implements DrawerLayout.d {
j() {
}
@Override
public void a(int i) {
}
@Override
public void b(View view, float f2) {
View childAt = MainActivity.this.mDrawerLayout.getChildAt(0);
float f3 = 1.0f - f2;
float f4 = (0.2f * f3) + 0.8f;
if (MainActivity.this.f4132a.j.equals("0")) {
if (view.getTag().equals("LEFT")) {
if (MainActivity.this.isWebFragment()) {
MainActivity.this.getWebFragment().setBrowserLayerType(1);
}
float f5 = 1.0f - (0.3f * f3);
b.a.a.a.f(view, f5);
b.a.a.a.g(view, f5);
b.a.a.a.f(childAt, f4);
b.a.a.a.g(childAt, f4);
float f6 = 1.0f - f3;
b.a.a.a.a(view, (0.4f * f6) + 0.6f);
b.a.a.a.h(childAt, view.getMeasuredWidth() * f6);
b.a.a.a.b(childAt, 0.0f);
b.a.a.a.c(childAt, childAt.getMeasuredHeight() / 2);
childAt.postInvalidate();
return;
}
return;
}
if (MainActivity.this.f4132a.j.equals("1")) {
float f7 = 1.0f - f3;
b.a.a.a.a(view, (0.4f * f7) + 0.6f);
b.a.a.a.h(childAt, view.getMeasuredWidth() * f7);
b.a.a.a.b(childAt, 0.0f);
b.a.a.a.c(childAt, childAt.getMeasuredHeight() / 2);
childAt.invalidate();
return;
}
MainActivity.this.f4132a.j.equals("2");
}
@Override
public void c(View view) {
}
@Override
public void d(View view) {
if (MainActivity.this.isWebFragment()) {
MainActivity.this.getWebFragment().setBrowserLayerType(0);
}
}
}
public class k implements TabHost.TabContentFactory {
k() {
}
@Override
public View createTabContent(String str) {
return new View(MainActivity.this);
}
}
class l implements Runnable {
final BottomMenuItemModel f4168a;
l(BottomMenuItemModel bottomMenuItemModel) {
this.f4168a = bottomMenuItemModel;
}
@Override
public void run() {
View childTabViewAt = MainActivity.this.mTabHost.getTabWidget().getChildTabViewAt(this.f4168a.getItemId());
ImageView imageView = (ImageView) childTabViewAt.findViewById(R.id.ivTabIcon);
TextView textView = (TextView) childTabViewAt.findViewById(R.id.tab_title);
char c2 = '\n';
if (!TextUtils.isEmpty(this.f4168a.getImageDefault()) && !TextUtils.isEmpty(this.f4168a.getImageSelect())) {
imageView.setLayoutParams(new LinearLayout.LayoutParams((MainActivity.this.mTabHost.getHeight() / 2) - 10, (MainActivity.this.mTabHost.getHeight() / 2) - 10));
imageView.setImageDrawable(f0.d(MainActivity.this, this.f4168a.getImageDefault(), this.f4168a.getImageSelect()));
}
if (!TextUtils.isEmpty(this.f4168a.getTitle())) {
textView.setText(this.f4168a.getTitle());
}
if (this.f4168a.getFontSize() != -1) {
textView.setTextSize(this.f4168a.getFontSize());
}
if (!TextUtils.isEmpty(this.f4168a.getColorDefault()) && !TextUtils.isEmpty(this.f4168a.getColorSelect())) {
textView.setTextColor(f0.a(Color.parseColor(this.f4168a.getColorDefault()), Color.parseColor(this.f4168a.getColorSelect())));
}
if (!TextUtils.isEmpty(this.f4168a.getStyle())) {
if (this.f4168a.getStyle().equals("1")) {
imageView.setVisibility(0);
textView.setVisibility(0);
} else if (this.f4168a.getStyle().equals("2")) {
imageView.setVisibility(0);
textView.setVisibility(8);
} else if (this.f4168a.getStyle().equals("3")) {
imageView.setVisibility(8);
textView.setVisibility(0);
}
}
if (!TextUtils.isEmpty(this.f4168a.getName())) {
MainActivity.this.f4132a.e0.a().e().get(this.f4168a.getItemId()).U(this.f4168a.getName());
}
if (!TextUtils.isEmpty(this.f4168a.getUrl())) {
MainActivity.this.f4132a.e0.a().e().get(this.f4168a.getItemId()).V(this.f4168a.getUrl());
} else if (!TextUtils.isEmpty(this.f4168a.getFunction())) {
MainActivity.this.f4132a.e0.a().e().get(this.f4168a.getItemId()).V(BuildConfig.FLAVOR);
MainActivity.this.f4132a.e0.a().e().get(this.f4168a.getItemId()).F(this.f4168a.getFunction());
}
if (!TextUtils.isEmpty(this.f4168a.getClickEvent())) {
MainActivity.this.f4132a.e0.a().e().get(this.f4168a.getItemId()).E(this.f4168a.getClickEvent());
}
if (this.f4168a.getSelectId() <= -1 || this.f4168a.getSelectId() >= MainActivity.this.f4132a.e0.a().e().size()) {
return;
}
if (!TextUtils.isEmpty(MainActivity.this.f4132a.e0.a().e().get(this.f4168a.getSelectId()).c())) {
LayoutItem layoutItem = MainActivity.this.f4132a.e0.a().e().get(this.f4168a.getSelectId());
if (layoutItem.c().equals("11")) {
MainActivity.this.u(layoutItem.c(), MainActivity.this.f4132a.e0.a().e().get(this.f4168a.getSelectId()).getUrl());
} else {
String c3 = layoutItem.c();
c3.hashCode();
switch (c3.hashCode()) {
case 48:
if (c3.equals("0")) {
c2 = 0;
break;
}
c2 = 65535;
break;
case 49:
if (c3.equals("1")) {
c2 = 1;
break;
}
c2 = 65535;
break;
case 50:
if (c3.equals("2")) {
c2 = 2;
break;
}
c2 = 65535;
break;
case 51:
if (c3.equals("3")) {
c2 = 3;
break;
}
c2 = 65535;
break;
case 52:
if (c3.equals("4")) {
c2 = 4;
break;
}
c2 = 65535;
break;
case 53:
if (c3.equals("5")) {
c2 = 5;
break;
}
c2 = 65535;
break;
case 54:
if (c3.equals("6")) {
c2 = 6;
break;
}
c2 = 65535;
break;
case 55:
if (c3.equals("7")) {
c2 = 7;
break;
}
c2 = 65535;
break;
case 56:
if (c3.equals("8")) {
c2 = '\b';
break;
}
c2 = 65535;
break;
case 57:
if (c3.equals("9")) {
c2 = '\t';
break;
}
c2 = 65535;
break;
case 1567:
break;
default:
c2 = 65535;
break;
}
switch (c2) {
case 0:
org.greenrobot.eventbus.c.c().l("share");
return;
case 1:
MainActivity.this.n.setFunction(((com.bslyun.app.fragment.d) MainActivity.this.getCurrentFragment()).k(), "1");
return;
case 2:
MainActivity.this.startActivity(new Intent(MainActivity.this, (Class<?>) AboutActivity.class));
return;
case 3:
org.greenrobot.eventbus.c.c().l("clearCache");
return;
case 4:
MainActivity.this.openBrowser();
return;
case 5:
org.greenrobot.eventbus.c.c().l("goForward");
return;
case 6:
org.greenrobot.eventbus.c.c().l("goBack");
return;
case 7:
org.greenrobot.eventbus.c.c().l("reload");
return;
case '\b':
MainActivity.this.quit();
return;
case '\t':
MainActivity.this.openLeftMenu();
return;
case '\n':
View childTabViewAt2 = MainActivity.this.mTabHost.getTabWidget().getChildTabViewAt(this.f4168a.getSelectId());
if (layoutItem.b() == null || layoutItem.b().size() <= 0) {
return;
}
MainActivity.this.w(childTabViewAt2, layoutItem);
return;
}
}
}
if (MainActivity.this.f4132a.e0.a().e().get(this.f4168a.getSelectId()).y() != 0) {
MainActivity.this.mTabHost.setCurrentTab(this.f4168a.getSelectId());
return;
}
if (TextUtils.isEmpty(MainActivity.this.f4132a.e0.a().e().get(this.f4168a.getSelectId()).getUrl())) {
return;
}
MainActivity.this.mTabHost.setCurrentTab(this.f4168a.getSelectId());
androidx.lifecycle.h currentFragment = MainActivity.this.getCurrentFragment();
if (currentFragment == null || !(currentFragment instanceof com.bslyun.app.fragment.m)) {
return;
}
((com.bslyun.app.fragment.m) currentFragment).onTabReselect(MainActivity.this.f4132a.e0.a().e().get(this.f4168a.getSelectId()), this.f4168a.getSelectId(), true);
}
}
class m implements Runnable {
final String f4170a;
m(String str) {
this.f4170a = str;
}
@Override
public void run() {
MainActivity.this.getWebFragment().getLocalBrowser().loadUrl("javascript:" + this.f4170a + "('" + m0.z(MainActivity.this) + "')");
}
}
class n implements Runnable {
final String f4172a;
n(String str) {
this.f4172a = str;
}
@Override
public void run() {
MainActivity.this.getWebFragment().getX5Browser().loadUrl("javascript:" + this.f4172a + "('" + m0.z(MainActivity.this) + "')");
}
}
public class o implements View.OnClickListener {
o() {
}
@Override
public void onClick(View view) {
MainActivity.this.exitApp();
}
}
public class p implements View.OnClickListener {
p() {
}
@Override
public void onClick(View view) {
MainActivity.this.v.hide();
}
}
class q extends BroadcastReceiver {
q() {
}
@Override
public void onReceive(Context context, Intent intent) {
String stringExtra;
if ("android.intent.action.CLOSE_SYSTEM_DIALOGS".equals(intent.getAction()) && (stringExtra = intent.getStringExtra("reason")) != null && MainActivity.this.isWebFragment() && WebFragment.webLoadOk) {
if (stringExtra.equals("homekey")) {
MainActivity.this.getWebFragment().postJS("javascript:onHome();");
} else if (stringExtra.equals("recentapps")) {
MainActivity.this.getWebFragment().postJS("javascript:onTask();");
}
}
}
}
public class r implements View.OnTouchListener {
private int f4177a;
private LayoutItem f4178b;
r(MainActivity mainActivity, int i, LayoutItem layoutItem, h hVar) {
this(i, layoutItem);
}
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
if (motionEvent.getAction() == 0) {
if (!TextUtils.isEmpty(this.f4178b.c()) && Pattern.matches("\\d+", this.f4178b.c())) {
if (this.f4178b.c().equals("11")) {
MainActivity.this.u(this.f4178b.c(), this.f4178b.getUrl());
return true;
}
String c2 = this.f4178b.c();
c2.hashCode();
char c3 = 65535;
switch (c2.hashCode()) {
case 48:
if (c2.equals("0")) {
c3 = 0;
break;
}
break;
case 49:
if (c2.equals("1")) {
c3 = 1;
break;
}
break;
case 50:
if (c2.equals("2")) {
c3 = 2;
break;
}
break;
case 51:
if (c2.equals("3")) {
c3 = 3;
break;
}
break;
case 52:
if (c2.equals("4")) {
c3 = 4;
break;
}
break;
case 53:
if (c2.equals("5")) {
c3 = 5;
break;
}
break;
case 54:
if (c2.equals("6")) {
c3 = 6;
break;
}
break;
case 55:
if (c2.equals("7")) {
c3 = 7;
break;
}
break;
case 56:
if (c2.equals("8")) {
c3 = '\b';
break;
}
break;
case 57:
if (c2.equals("9")) {
c3 = '\t';
break;
}
break;
case 1567:
if (c2.equals("10")) {
c3 = '\n';
break;
}
break;
}
switch (c3) {
case 0:
org.greenrobot.eventbus.c.c().l("share");
return true;
case 1:
MainActivity.this.n.setFunction(((com.bslyun.app.fragment.d) MainActivity.this.getCurrentFragment()).k(), "1");
return true;
case 2:
MainActivity.this.startActivity(new Intent(MainActivity.this, (Class<?>) AboutActivity.class));
return true;
case 3:
org.greenrobot.eventbus.c.c().l("clearCache");
return true;
case 4:
MainActivity.this.openBrowser();
return true;
case 5:
org.greenrobot.eventbus.c.c().l("goForward");
return true;
case 6:
org.greenrobot.eventbus.c.c().l("goBack");
return true;
case 7:
org.greenrobot.eventbus.c.c().l("reload");
return true;
case '\b':
MainActivity.this.quit();
return true;
case '\t':
MainActivity.this.openLeftMenu();
return true;
case '\n':
if (this.f4178b.b() != null && this.f4178b.b().size() > 0) {
MainActivity.this.w(view, this.f4178b);
}
return true;
}
}
if (!TextUtils.isEmpty(this.f4178b.getUrl()) && view.equals(MainActivity.this.mTabHost.getCurrentTabView())) {
MainActivity.this.onTabChanged("tab" + this.f4177a);
}
}
return false;
}
private r(int i, LayoutItem layoutItem) {
this.f4177a = i;
this.f4178b = layoutItem;
}
}
class s extends BroadcastReceiver {
s() {
}
@Override
public void onReceive(Context context, Intent intent) {
if (MainActivity.this.s != null) {
MainActivity.this.s.dismiss();
}
if (MainActivity.PAY_ACTION.equals(intent.getAction())) {
String stringExtra = intent.getStringExtra("code");
if (m0.Z(context)) {
MainActivity.this.v(stringExtra + BuildConfig.FLAVOR);
return;
}
MainActivity.this.v(stringExtra + BuildConfig.FLAVOR);
return;
}
if (MainActivity.MY_ACTION.equals(intent.getAction())) {
String stringExtra2 = intent.getStringExtra("result");
if (TextUtils.isEmpty(stringExtra2) || TextUtils.isEmpty(MainActivity.jsCallbackMethod)) {
return;
}
MainActivity mainActivity = MainActivity.this;
QuickLoginComponent.getLoginPhone(mainActivity, stringExtra2, mainActivity.getWebFragment().getBrowser(), MainActivity.jsCallbackMethod);
}
}
}
private void l(String str) {
if (isWebFragment() && str.startsWith("http")) {
if (m0.Z(this)) {
getWebFragment().getLocalBrowser().loadUrl(str);
return;
} else {
getWebFragment().getX5Browser().loadUrl(str);
return;
}
}
com.bslyun.app.f.d dVar = new com.bslyun.app.f.d(this, str, getResources().getString(R.string.qrcode_cancel), getResources().getString(R.string.qrcode_sure), null, new p());
this.v = dVar;
dVar.show();
}
private void m() {
if (System.currentTimeMillis() - this.u > 2000) {
this.u = System.currentTimeMillis();
if (isWebFragment() && getWebFragment().canGoback()) {
getWebFragment().goBack();
return;
} else {
if ("1".equals(this.f4132a.Y)) {
if (!TextUtils.isEmpty(getResources().getString(R.string.quit_hint2))) {
m0.u0(this, getResources().getString(R.string.quit_hint2));
return;
} else {
m0.u0(this, "再按一次退出应用");
return;
}
}
return;
}
}
quit();
}
private void n() {
MyFragmentTabHost myFragmentTabHost = (MyFragmentTabHost) findViewById(android.R.id.tabhost);
this.mTabHost = myFragmentTabHost;
myFragmentTabHost.setOnTabChangedListener(this);
this.mTabHost.f(this, getSupportFragmentManager(), R.id.realtabcontent);
if (Build.VERSION.SDK_INT > 10) {
this.mTabHost.getTabWidget().setShowDividers(0);
}
t();
if (this.f4132a.e0.a() != null) {
this.mTabHost.setCurrentTab(this.f4132a.e0.a().a());
} else {
this.mTabHost.setCurrentTab(0);
}
try {
findViewById(R.id.divide).setBackgroundColor(Color.parseColor(this.f4132a.z));
} catch (Exception e2) {
e2.printStackTrace();
}
if (this.f4132a.l) {
return;
}
this.mTabHost.setVisibility(8);
findViewById(R.id.divide).setVisibility(8);
}
private void o() {
com.bslyun.app.d.a aVar = this.f4132a;
if (aVar.H0 && aVar.r1 == 0) {
this.copyright = (TextView) findViewById(R.id.copyright);
if (m0.T(this.f4132a.q)) {
this.copyright.getBackground().setAlpha(Integer.parseInt(this.f4132a.q));
}
this.copyright.setVisibility(0);
this.copyright.setText(com.bslyun.app.e.a.p.getTitle());
this.copyright.setOnClickListener(new i());
}
}
private void p() {
this.mDrawerLayout.addDrawerListener(new j());
}
private void q() {
com.bslyun.app.d.a aVar = this.f4132a;
if (!aVar.n1 || aVar.e0.b() == null || this.f4132a.e0.b().size() <= 0) {
return;
}
if (this.f4132a.o1.equals("1")) {
ImageButton imageButton = (ImageButton) findViewById(R.id.suspension_left_bt);
this.o = imageButton;
imageButton.setVisibility(0);
this.o.setOnClickListener(this);
return;
}
if (this.f4132a.o1.equals("2")) {
ImageButton imageButton2 = (ImageButton) findViewById(R.id.suspension_right_bt);
this.p = imageButton2;
imageButton2.setVisibility(0);
this.p.setOnClickListener(this);
}
}
private void r() {
MyDrawerLayout myDrawerLayout = (MyDrawerLayout) findViewById(R.id.id_drawerlayout);
this.mDrawerLayout = myDrawerLayout;
myDrawerLayout.setScrimColor(0);
if (this.f4132a.S0.equals("2")) {
this.mDrawerLayout.setDrawerLockMode(0);
} else {
this.mDrawerLayout.setDrawerLockMode(1);
}
if (this.f4132a.i) {
androidx.fragment.app.r n2 = getSupportFragmentManager().n();
n2.b(R.id.left_menu_content, new com.bslyun.app.fragment.g());
n2.i();
int i2 = this.f4132a.K;
if (i2 > 0) {
this.mDrawerLayout.setBackgroundResource(i2);
}
if (this.f4132a.S0.equals("2")) {
this.mDrawerLayout.setDrawerLockMode(0);
} else {
this.mDrawerLayout.setDrawerLockMode(1);
}
p();
}
}
private void s() {
this.navLine = findViewById(R.id.navLine);
TextView textView = (TextView) findViewById(R.id.navTitle);
this.title = textView;
textView.setTextColor(this.f4132a.w);
this.title.setTextSize(Float.parseFloat(this.f4132a.f4257h));
if (!this.f4132a.r) {
findViewById(R.id.navLayout).setVisibility(8);
this.navLine.setVisibility(8);
}
try {
this.navLine.setBackgroundColor(Color.parseColor(this.f4132a.x));
if (Float.parseFloat(this.f4132a.n) < 1.0f) {
this.navLine.setVisibility(8);
}
} catch (Exception e2) {
e2.printStackTrace();
}
if (this.f4132a.O.equals("0")) {
findViewById(R.id.navLayout).setVisibility(8);
}
RelativeLayout relativeLayout = (RelativeLayout) findViewById(R.id.navLayout);
this.mNavigateLayout = relativeLayout;
com.bslyun.app.d.a aVar = this.f4132a;
if (aVar.L1 == 0) {
relativeLayout.setBackgroundColor(aVar.u);
} else {
relativeLayout.setBackgroundResource(b0.b(this, aVar.M1));
}
if (m0.T(this.f4132a.o)) {
this.mNavigateLayout.getBackground().setAlpha(Integer.parseInt(this.f4132a.o));
}
this.f4148f = this.f4132a.y;
ImageView imageView = (ImageView) findViewById(R.id.share);
this.share = imageView;
imageView.setOnClickListener(this);
if (!TextUtils.isEmpty(this.f4148f) && "-1".equals(this.f4148f)) {
this.share.setVisibility(8);
} else if (!TextUtils.isEmpty(this.f4148f)) {
this.share.setVisibility(0);
com.bumptech.glide.c.v(this).s(Integer.valueOf(b0.b(this, this.f4132a.M))).D0(this.share);
}
this.f4147e = this.f4132a.N;
ImageView imageView2 = (ImageView) findViewById(R.id.ivOpenLeft);
this.mLeftMenu = imageView2;
imageView2.setOnClickListener(this);
if (!TextUtils.isEmpty(this.f4147e) && "-1".equals(this.f4147e)) {
this.mLeftMenu.setVisibility(8);
} else {
if (TextUtils.isEmpty(this.f4147e)) {
return;
}
com.bumptech.glide.c.v(this).s(Integer.valueOf(b0.b(this, this.f4132a.L))).D0(this.mLeftMenu);
this.mLeftMenu.setVisibility(0);
}
}
private void t() {
boolean z;
int i2;
boolean z2;
Iterator<LayoutItem> it;
boolean z3;
String url;
String str;
int l2;
com.bslyun.app.d.a aVar = this.f4132a;
int i3 = 1;
if (aVar.l) {
int i4 = 0;
int i5 = 0;
for (LayoutItem layoutItem : aVar.e0.a().e()) {
if (layoutItem.A() == 3) {
i4++;
}
if (layoutItem.A() == 2) {
i5++;
}
}
z = i4 == this.f4132a.e0.a().e().size() || i5 == this.f4132a.e0.a().e().size();
this.t = this.f4132a.e0.a().e().size();
try {
l2 = m0.k0(this, Integer.parseInt(this.f4132a.e0.a().h()));
if (l2 <= 0) {
l2 = m0.l(this, 45.0f);
}
} catch (NumberFormatException e2) {
e2.printStackTrace();
l2 = m0.l(this, 45.0f);
}
ViewGroup.LayoutParams layoutParams = this.mTabHost.getLayoutParams();
layoutParams.height = l2;
this.tabHostHeight = l2;
this.mTabHost.setLayoutParams(layoutParams);
this.mTabHost.requestLayout();
} else {
z = false;
}
int i6 = -1;
try {
i2 = Color.parseColor(this.f4132a.e0.a().b());
try {
i6 = Color.parseColor(this.f4132a.e0.a().c());
} catch (Exception e3) {
e = e3;
e.printStackTrace();
String d2 = this.f4132a.e0.a().d();
if (m0.b0(this) == 0) {
}
if (!this.f4132a.Y0) {
}
z2 = true;
it = this.f4132a.e0.a().e().iterator();
int i7 = 0;
while (it.hasNext()) {
}
}
} catch (Exception e4) {
e = e4;
i2 = -1;
}
String d22 = this.f4132a.e0.a().d();
if (m0.b0(this) == 0) {
com.bslyun.app.d.a aVar2 = this.f4132a;
if (aVar2.G1) {
}
}
if (!this.f4132a.Y0) {
z2 = false;
it = this.f4132a.e0.a().e().iterator();
int i72 = 0;
while (it.hasNext()) {
LayoutItem next = it.next();
TabHost.TabSpec newTabSpec = this.mTabHost.newTabSpec("tab" + i72);
View inflate = LayoutInflater.from(this).inflate(R.layout.tab_indicator, (ViewGroup) null);
if (this.f4132a.l) {
inflate.setBackground(f0.c(i2, i6));
if (m0.T(this.f4132a.q)) {
inflate.getBackground().setAlpha(Integer.parseInt(this.f4132a.q));
}
TextView textView = (TextView) inflate.findViewById(R.id.tab_title);
ImageView imageView = (ImageView) inflate.findViewById(R.id.ivTabIcon);
if (!TextUtils.isEmpty(d22)) {
textView.setTextSize(Integer.parseInt(d22));
}
if (next.A() == i3) {
}
if (z) {
imageView.setVisibility(8);
}
textView.setTextColor(f0.a(Color.parseColor(this.f4132a.e0.a().f()), Color.parseColor(this.f4132a.e0.a().g())));
textView.setText(next.x());
int i8 = next.A() != 1 ? 2 : 2;
z3 = z;
imageView.setLayoutParams(new LinearLayout.LayoutParams((this.mTabHost.getHeight() / i8) - 10, (this.mTabHost.getHeight() / i8) - 10));
if (b0.b(this, next.k()) > 0 && b0.b(this, next.m()) > 0) {
imageView.setImageDrawable(f0.d(this, next.k(), next.m()));
}
if (next.A() == 2) {
textView.setVisibility(8);
}
if (next.A() == 2) {
imageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
}
newTabSpec.setIndicator(inflate);
newTabSpec.setContent(new k());
Bundle bundle = new Bundle();
bundle.putBoolean("isFirstLoad", (i72 == this.f4132a.e0.a().a() && this.f4132a.l) ? false : true);
bundle.putString("titleText", next.D());
if (i72 != this.f4132a.e0.a().a()) {
if (!TextUtils.isEmpty(next.getUrl()) && next.getUrl().startsWith("http")) {
url = next.getUrl();
} else {
url = next.w();
}
} else {
url = next.getUrl();
}
str = url;
if (z2 && !TextUtils.isEmpty(com.bslyun.app.e.a.m.get(str))) {
try {
if (getAssets().open(com.bslyun.app.e.a.m.get(str)) == null) {
str = "file:///android_asset/" + com.bslyun.app.e.a.m.get(str);
this.f4132a.e0.a().e().get(i72).V(str);
}
} catch (IOException e5) {
e5.printStackTrace();
}
}
bundle.putString(TbsVideoCacheTask.KEY_VIDEO_CACHE_PARAM_URL, str);
bundle.putInt("tab_index", i72);
bundle.putBoolean("is_tab", true);
bundle.putBoolean("newFragment", false);
next.N(m0.D(this, str));
bundle.putInt("page_type", next.y());
this.mTabHost.a(newTabSpec, com.bslyun.app.fragment.d.r().getClass(), bundle);
this.mTabHost.getTabWidget().getChildAt(i72).setOnTouchListener(new r(this, i72, next, null));
i72++;
z = z3;
i3 = 1;
}
z3 = z;
newTabSpec.setIndicator(inflate);
newTabSpec.setContent(new k());
Bundle bundle2 = new Bundle();
bundle2.putBoolean("isFirstLoad", (i72 == this.f4132a.e0.a().a() && this.f4132a.l) ? false : true);
bundle2.putString("titleText", next.D());
if (i72 != this.f4132a.e0.a().a()) {
}
str = url;
if (z2) {
if (getAssets().open(com.bslyun.app.e.a.m.get(str)) == null) {
}
}
bundle2.putString(TbsVideoCacheTask.KEY_VIDEO_CACHE_PARAM_URL, str);
bundle2.putInt("tab_index", i72);
bundle2.putBoolean("is_tab", true);
bundle2.putBoolean("newFragment", false);
next.N(m0.D(this, str));
bundle2.putInt("page_type", next.y());
this.mTabHost.a(newTabSpec, com.bslyun.app.fragment.d.r().getClass(), bundle2);
this.mTabHost.getTabWidget().getChildAt(i72).setOnTouchListener(new r(this, i72, next, null));
i72++;
z = z3;
i3 = 1;
}
}
z2 = true;
it = this.f4132a.e0.a().e().iterator();
int i722 = 0;
while (it.hasNext()) {
}
}
public void u(String str, String str2) {
if (TextUtils.isEmpty(str) || !Pattern.matches("\\d+", str)) {
return;
}
if (str.equals("11")) {
if (TextUtils.isEmpty(str2)) {
return;
}
if (!str2.startsWith(WebView.SCHEME_TEL) && !str2.startsWith("sms") && !str2.startsWith("Mailto:")) {
if (str2.startsWith("BSL.")) {
getWebFragment().postJS("javascript:(!function(){" + str2 + "}())");
return;
}
if (str2.startsWith("javascript:")) {
getWebFragment().postJS("javascript:(!function(){" + str2 + "}())");
return;
}
getWebFragment().postJS(str2);
return;
}
getWebFragment().postJS("window.location.href = '" + str2 + "'");
return;
}
getWebFragment().getFunction(str);
}
public void v(String str) {
if (TextUtils.isEmpty(jsCallbackMethod)) {
return;
}
if (m0.Z(this)) {
getWebFragment().getLocalBrowser().post(new f(str));
} else {
getWebFragment().getX5Browser().post(new g(str));
}
}
public void w(View view, LayoutItem layoutItem) {
com.bslyun.app.views.a aVar = new com.bslyun.app.views.a(this, layoutItem.b(), this.t);
this.i = aVar;
if (aVar != null) {
aVar.showAsDropDown(view, 0, 5);
}
}
private void x(String str, String str2) {
String geneciCallbackFunction = JavaScriptUtils.geneciCallbackFunction(str, str2);
if (m0.Z(this)) {
JavaScriptUtils.postJsInWebView(this, getWebFragment().getLocalBrowser(), geneciCallbackFunction);
} else {
JavaScriptUtils.postJsInWebView(this, getWebFragment().getX5Browser(), geneciCallbackFunction);
}
}
public void adClickReport(Threeparty threeparty) {
if (threeparty.getCli_call() == null || threeparty.getCli_call().size() <= 0) {
return;
}
Iterator<String> it = threeparty.getCli_call().iterator();
while (it.hasNext()) {
new h0(this).a(it.next());
}
}
@Override
public void attachBaseContext(Context context) {
super.attachBaseContext(context);
if (com.bslyun.app.d.a.f(this).z0) {
try {
Class.forName("com.bun.miitmdid.core.JLibrary").getMethod("InitEntry", Context.class).invoke(null, context);
} catch (ClassNotFoundException e2) {
e2.printStackTrace();
} catch (IllegalAccessException e3) {
e3.printStackTrace();
} catch (NoSuchMethodException e4) {
e4.printStackTrace();
} catch (InvocationTargetException e5) {
e5.printStackTrace();
}
}
}
@Override
public void changeBottomMenu(BottomMenuItemModel bottomMenuItemModel) {
if (bottomMenuItemModel.getItemId() > this.f4132a.e0.a().e().size() - 1) {
return;
}
runOnUiThread(new l(bottomMenuItemModel));
}
public void checkUpdate(boolean z) {
if (this.f4132a.X.equals("1")) {
WebViewUtils.removeExpiredX5Cookies();
} else {
WebViewUtils.removeExpiredCookies();
}
if (Build.VERSION.SDK_INT >= 21) {
int systemUiVisibility = getWindow().getDecorView().getSystemUiVisibility();
int i2 = this.f4132a.T1;
if (i2 == 0) {
getWindow().getDecorView().setSystemUiVisibility(systemUiVisibility | 16);
} else if (i2 == 1) {
getWindow().getDecorView().setSystemUiVisibility(systemUiVisibility & (-17));
}
}
com.bslyun.app.d.a aVar = this.f4132a;
if (aVar.r1 == 0 && !aVar.H0 && com.bslyun.app.e.a.p != null && this.widowAd == null) {
com.bslyun.app.f.a aVar2 = new com.bslyun.app.f.a(this, com.bslyun.app.e.a.p.getWtype(), com.bslyun.app.e.a.p.getWscurl(), com.bslyun.app.e.a.p.getWurl());
this.widowAd = aVar2;
aVar2.show();
}
if (this.f4132a.J1 && !com.bslyun.app.e.a.s && WebFragment.webLoadOk) {
openAppNumber();
}
this.f4149g.m(this.f4132a.f4251b);
}
public void closeLeftMenu() {
if (this.f4132a.i && this.mDrawerLayout.isDrawerOpen(8388611)) {
this.mDrawerLayout.post(new c());
}
}
public void controlBottomTabLayout(boolean z, String str, boolean z2) {
if (this.tabHostHeight == 0) {
this.tabHostHeight = m0.l(this, 58.0f);
}
if (this.touchHide) {
return;
}
if (z2) {
this.jsTabCallGone = z;
}
this.mTabHost.post(new d(str, z));
}
public void downloadAd() {
try {
String str = (String) c0.a(this, "advObject", BuildConfig.FLAVOR);
if (TextUtils.isEmpty(str)) {
return;
}
AdveMode adveMode = (AdveMode) w.b(str);
String old_name = adveMode.getDatas().getOld_name();
if (!TextUtils.isEmpty(old_name)) {
File file = new File(getExternalCacheDir().getAbsolutePath() + File.separator + old_name);
if (file.exists()) {
file.delete();
}
}
if (adveMode.getDatas().getIs_video() == 1) {
VideoDownloadService.d(this, adveMode.getDatas().getAd_pic(), BuildConfig.FLAVOR);
return;
}
String absolutePath = getExternalCacheDir() == null ? null : getExternalCacheDir().getAbsolutePath();
if (absolutePath == null) {
absolutePath = getCacheDir().getAbsolutePath();
if (TextUtils.isEmpty(absolutePath)) {
return;
}
}
com.bslyun.app.utils.f.c(this, adveMode.getDatas().getAd_pic(), adveMode.getDatas().getAd_name() + PictureMimeType.PNG, absolutePath);
} catch (IOException e2) {
e2.printStackTrace();
}
}
public void error(String str, Object obj) {
}
public void exitApp() {
c0.e(this, "js_orientation");
com.bslyun.app.g.d.f().d();
System.exit(0);
}
public Fragment getCurrentFragment() {
MyFragmentTabHost myFragmentTabHost = this.mTabHost;
if (myFragmentTabHost == null || TextUtils.isEmpty(myFragmentTabHost.getCurrentTabTag())) {
return null;
}
return getSupportFragmentManager().k0(this.mTabHost.getCurrentTabTag());
}
public WebFragment getWebFragment() {
if (getCurrentFragment() != null) {
return (WebFragment) ((com.bslyun.app.fragment.d) getCurrentFragment()).k();
}
return null;
}
@Override
public void initView() {
if (this.f4132a.r1 == 0) {
new com.bslyun.app.utils.m(this, true);
}
MainActivityHook mainActivityHook = new MainActivityHook();
this.n = mainActivityHook;
mainActivityHook.onCreateActivity(this);
new com.bslyun.app.fragment.n().show(getFragmentManager(), "splashFragment");
this.n.openPrivacyDialog();
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(PAY_ACTION);
intentFilter.addAction(MY_ACTION);
a.g.a.a.b(this).c(this.j, intentFilter);
if (m0.T(this.f4132a.o) && !m0.T(this.f4132a.q)) {
setContentView(R.layout.activity_main_nav_alpha);
} else if (!m0.T(this.f4132a.o) && m0.T(this.f4132a.q)) {
setContentView(R.layout.activity_main_tab_alpha);
} else if (m0.T(this.f4132a.q) && m0.T(this.f4132a.o)) {
setContentView(R.layout.activity_main_full);
} else {
setContentView(R.layout.activity_main);
}
s();
if (Build.VERSION.SDK_INT >= 19) {
this.barHeight = findViewById(R.id.bar_height);
com.flyco.systembar.a.b(this, 0.0f);
if (Float.parseFloat(this.f4132a.n) < 1.0f && Float.parseFloat(this.f4132a.p) < 1.0f) {
View findViewById = findViewById(R.id.bar_height2);
ViewGroup.LayoutParams layoutParams = findViewById.getLayoutParams();
layoutParams.height = com.flyco.systembar.a.a(this) * 2;
findViewById.setLayoutParams(layoutParams);
findViewById.setVisibility(0);
}
this.barHeight.setVisibility(0);
ViewGroup.LayoutParams layoutParams2 = this.barHeight.getLayoutParams();
layoutParams2.height = com.flyco.systembar.a.a(this);
this.barHeight.setLayoutParams(layoutParams2);
this.barHeight.setBackgroundColor(this.f4132a.G);
com.bslyun.app.d.a aVar = this.f4132a;
if (aVar.r) {
this.barHeight.setBackgroundColor(m0.f(aVar.F, Integer.parseInt(aVar.o)));
}
com.flyco.systembar.a.e(this, this.barHeight);
if (this.f4132a.H == 1) {
m0.r0(getWindow(), true);
} else {
m0.r0(getWindow(), false);
}
} else {
findViewById(R.id.bar_height).setVisibility(8);
}
q();
o();
n();
r();
this.f4149g = new l0(this.f4134c);
MainApplication mainApplication = (MainApplication) getApplication();
this.q = mainApplication;
mainApplication.init();
SendLiveData.liveData.e(this, new h());
}
public boolean isWebFragment() {
return ((com.bslyun.app.fragment.d) getCurrentFragment()).k() instanceof WebFragment;
}
@Override
public void loginError(String str) {
com.bslyun.app.f.c cVar = this.s;
if (cVar != null) {
cVar.dismiss();
}
}
@Override
public void loginSuccess(int i2, String str, String str2, SHARE_MEDIA share_media, String str3, Map<String, Object> map) {
com.bslyun.app.f.c cVar = this.s;
if (cVar != null) {
cVar.dismiss();
}
if (str3.equals("uni")) {
JavaScriptUtils.postJsInWebView(this, getWebFragment().getBrowser(), JavaScriptUtils.dogeneciCallbackFunction(str2, true, this.f4135d.toJson(map)));
return;
}
try {
if (!TextUtils.isEmpty(str)) {
StringBuilder sb = new StringBuilder(str);
if (!str.contains("?")) {
sb.append("?");
} else if (str.trim().charAt(str.length() - 1) != '&') {
sb.append("&");
}
sb.append("platform");
sb.append("=");
sb.append(share_media.toString());
sb.append("&");
sb.append("openid");
sb.append("=");
sb.append(str3);
sb.append("&");
for (Map.Entry<String, Object> entry : map.entrySet()) {
sb.append(entry.getKey());
sb.append("=");
sb.append(URLEncoder.encode(entry.getValue().toString(), "UTF-8"));
sb.append("&");
}
if (m0.Z(this)) {
getWebFragment().getLocalBrowser().loadUrl(sb.toString());
return;
} else {
getWebFragment().getX5Browser().loadUrl(sb.toString());
return;
}
}
if (TextUtils.isEmpty(str2)) {
return;
}
map.put("platform", share_media.toString());
map.put("openid", str3.toString());
JavaScriptUtils.postJsInWebView(this, getWebFragment().getBrowser(), JavaScriptUtils.geneciCallbackFunction(str2, new Gson().toJson(map)));
} catch (UnsupportedEncodingException e2) {
e2.printStackTrace();
}
}
@Override
public void menuItemClick(LayoutItem layoutItem) {
com.bslyun.app.views.d dVar = this.l;
if (dVar != null) {
dVar.dismiss();
}
u(layoutItem.g(), layoutItem.getUrl());
}
@Override
public void onActivityResult(int i2, int i3, Intent intent) {
super.onActivityResult(i2, i3, intent);
if (i2 == 17) {
com.bslyun.app.d.a aVar = this.f4132a;
if (aVar.Z) {
if ("1".equals(aVar.X)) {
if (X5WBH5FaceVerifySDK.getInstance().receiveH5FaceVerifyResult(i2, i3, intent)) {
return;
}
} else if (WBH5FaceVerifySDK.getInstance().receiveH5FaceVerifyResult(i2, i3, intent)) {
return;
}
}
}
if (i2 == 10103 || i2 == 10104 || i2 == 11101) {
TencentComponent.handleShareResult(this, i2, i3, intent);
}
if (intent != null && intent.getExtras() != null && !TextUtils.isEmpty(intent.getExtras().getString("pay_result"))) {
JavaScriptUtils.postJsInWebView(this, getWebFragment().getBrowser(), "javascript:" + com.bslyun.app.e.a.f4268e + "('" + intent.getExtras().getString("pay_result") + "')");
}
if (i2 == 10124) {
if (intent == null || isWebFragment()) {
return;
}
com.bslyun.app.utils.c cVar = new com.bslyun.app.utils.c(this);
this.k = cVar;
JavaScriptUtils.postJsInWebView(this, getWebFragment().getBrowser(), JavaScriptUtils.geneciCallbackFunction(com.bslyun.app.e.a.f4270g, this.f4135d.toJson(cVar.d(intent))));
}
if (i2 == 10139) {
QRCodeComponent.scanResult(intent, this.f4132a.T);
}
if (i2 == 10128) {
if (intent == null) {
return;
}
ArrayList<LocalMedia> obtainSelectorList = PictureSelector.obtainSelectorList(intent);
if (obtainSelectorList != null && obtainSelectorList.size() > 0) {
QRCodeComponent.image(this, Uri.parse(obtainSelectorList.get(0).getPath()), this.f4132a.T);
}
}
if (i2 == 10130) {
com.bslyun.app.g.e.k();
}
if (onActivityResutlForPermission(i2)) {
return;
}
MainActivityHook mainActivityHook = this.n;
if (mainActivityHook == null || intent == null || !mainActivityHook.onActivityResult(i2, i3, intent)) {
if (i2 == 1000 && intent != null) {
String stringExtra = intent.getStringExtra("callback");
String stringExtra2 = intent.getStringExtra("data");
if (com.bslyun.app.e.a.f4265b == 1) {
if (isWebFragment() && this.f4132a.S.equals("0")) {
JavaScriptUtils.postJsInWebView(this, getWebFragment().getBrowser(), "javascript:qrResult('" + stringExtra2 + "')");
return;
}
l(stringExtra2);
return;
}
if (isWebFragment() && com.bslyun.app.e.a.f4266c.equals("0")) {
JavaScriptUtils.postJsInWebView(this, getWebFragment().getBrowser(), "javascript:" + stringExtra + "('" + stringExtra2 + "')");
} else {
l(stringExtra2);
}
com.bslyun.app.e.a.f4265b = 1;
return;
}
if (isWebFragment() && getWebFragment() != null) {
getWebFragment().onActivityResult(i2, i3, intent);
}
WeiboComponent.setLoginResult(i2, i3, intent);
if (i2 == 2000) {
com.bslyun.app.e.a.f4267d = null;
}
}
}
public boolean onActivityResutlForPermission(int i2) {
if (i2 != 1100) {
if (i2 != 1200) {
if (i2 == 1400 && androidx.core.content.a.a(this, "android.permission.READ_PHONE_STATE") == 0) {
JavaScriptUtils.postJsInWebView(this, getWebFragment().getBrowser(), "javascript:" + this.f4132a.c() + "('" + m0.z(this) + "')");
return true;
}
} else if (androidx.core.content.a.a(this, PermissionConfig.WRITE_EXTERNAL_STORAGE) == 0) {
this.f4149g.r();
return true;
}
} else if (androidx.core.content.a.a(this, "android.permission.CAMERA") == 0) {
i0.a().post(new a());
return true;
}
return false;
}
@Override
public void onBackPressed() {
if (getCurrentFragment().getChildFragmentManager().o0() > 0) {
if (isWebFragment()) {
if (getWebFragment().canGoback()) {
getWebFragment().goBack();
return;
}
WebViewUtils.fpe = WebViewUtils.FragmentPopEvent.BACK_GESTURE;
getCurrentFragment().getChildFragmentManager().b1();
refreshConfig();
return;
}
getCurrentFragment().getChildFragmentManager().b1();
refreshConfig();
return;
}
if (isWebFragment() && this.f4132a.i1) {
getWebFragment().postJS("javascript:onBack();");
}
com.bslyun.app.d.a aVar = this.f4132a;
if (aVar.A0) {
if (aVar.B0.equals("2")) {
if (isWebFragment() && getWebFragment().canGoback()) {
getWebFragment().goBack();
return;
}
return;
}
if (this.f4132a.B0.equals("0")) {
if (m0.b0(this) != 0) {
if (isWebFragment() && getWebFragment().canGoback()) {
if (m0.Z(this)) {
getWebFragment().getLocalBrowser().goBack();
return;
} else {
getWebFragment().getX5Browser().goBack();
return;
}
}
m();
return;
}
m();
return;
}
m();
}
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.ivOpenLeft:
if (TextUtils.isEmpty(this.dynamicLeftNavigation)) {
if (TextUtils.isEmpty(this.f4132a.N)) {
return;
} else {
this.dynamicLeftNavigation = this.f4132a.N;
}
}
if (this.dynamicLeftNavigation.equals("12")) {
if (this.f4132a.e0.d() == null || this.f4132a.e0.d().c() == null || this.f4132a.e0.d().c().size() <= 0) {
return;
}
com.bslyun.app.views.d dVar = new com.bslyun.app.views.d(this, this.f4132a.e0.d(), null);
this.l = dVar;
dVar.showAsDropDown(view, 0, 5);
return;
}
this.n.setFunction(((com.bslyun.app.fragment.d) getCurrentFragment()).k(), this.dynamicLeftNavigation);
return;
case R.id.share:
if (TextUtils.isEmpty(this.dynamicRightNavigation)) {
if (TextUtils.isEmpty(this.f4132a.y)) {
return;
} else {
this.dynamicRightNavigation = this.f4132a.y;
}
}
if (this.dynamicRightNavigation.equals("12")) {
if (this.f4132a.e0.e() == null || this.f4132a.e0.e().c() == null || this.f4132a.e0.e().c().size() <= 0) {
return;
}
com.bslyun.app.views.d dVar2 = new com.bslyun.app.views.d(this, null, this.f4132a.e0.e());
this.l = dVar2;
dVar2.showAsDropDown(view, 0, 5);
return;
}
this.n.setFunction(((com.bslyun.app.fragment.d) getCurrentFragment()).k(), this.dynamicRightNavigation);
return;
case R.id.suspension_left_bt:
case R.id.suspension_right_bt:
com.bslyun.app.views.b bVar = new com.bslyun.app.views.b(this, this.f4132a.e0.b());
this.m = bVar;
bVar.showAtLocation(getWindow().getDecorView(), 17, 0, 0);
return;
default:
return;
}
}
@Override
public void onConfigurationChanged(Configuration configuration) {
int i2 = Build.VERSION.SDK_INT;
com.bslyun.app.f.d dVar = this.f4150h;
if (dVar != null && dVar.isShowing()) {
this.f4150h.b();
}
int i3 = configuration.orientation;
if (i3 == 2) {
getWindow().addFlags(1024);
if (i2 > 19) {
ViewGroup.LayoutParams layoutParams = this.barHeight.getLayoutParams();
layoutParams.height = com.flyco.systembar.a.a(this);
this.barHeight.setLayoutParams(layoutParams);
}
if (i2 <= 19) {
this.isBarHeightVisiable = false;
ViewGroup.LayoutParams layoutParams2 = this.barHeight.getLayoutParams();
layoutParams2.height = com.flyco.systembar.a.a(this);
this.barHeight.setLayoutParams(layoutParams2);
}
} else if (i3 == 1) {
getWebFragment().setConfig(getWebFragment().getUrl());
getWindow().clearFlags(1024);
if (i2 > 19) {
ViewGroup.LayoutParams layoutParams3 = this.barHeight.getLayoutParams();
layoutParams3.height = com.flyco.systembar.a.a(this) * 2;
this.barHeight.setLayoutParams(layoutParams3);
}
if (i2 <= 19 && !this.isBarHeightVisiable) {
this.isBarHeightVisiable = true;
ViewGroup.LayoutParams layoutParams4 = this.barHeight.getLayoutParams();
layoutParams4.height += com.flyco.systembar.a.a(this);
this.barHeight.setLayoutParams(layoutParams4);
}
}
super.onConfigurationChanged(configuration);
}
@Override
protected void onCreate(Bundle bundle) {
setTheme(R.style.AppTheme);
super.onCreate(bundle);
if (this.f4132a.i1) {
registerReceiver(new q(), new IntentFilter("android.intent.action.CLOSE_SYSTEM_DIALOGS"));
}
com.bslyun.app.d.a aVar = this.f4132a;
if (aVar.g2 && aVar.i2) {
ZBCommponent.automaticLogin();
}
}
@Override
public void onDenied(List<String> list, int i2) {
if (i2 == 110) {
com.bslyun.app.utils.s.a(this, getString(R.string.permission_CAMERA), 1100);
return;
}
if (i2 != 140) {
if (i2 != 10125) {
if (i2 != 10127) {
if (i2 == 10133) {
com.bslyun.app.utils.s.a(this, getString(R.string.permission_WRITE_EXTERNAL_STORAGE), 1100);
return;
}
if (i2 != 10206) {
if (i2 == 10208) {
com.bslyun.app.utils.s.a(this, getString(R.string.permission_READ_PHONE_STATE), -1);
return;
}
if (i2 != 10121 && i2 != 10122) {
switch (i2) {
case 10201:
com.bslyun.app.utils.s.a(this, getString(R.string.permission_RECORD_AUDIO), -1);
return;
case 10202:
com.bslyun.app.utils.s.a(this, getString(R.string.permission_CAMERA), -1);
return;
case 10203:
com.bslyun.app.utils.s.a(this, getString(R.string.permission_ACCESS_FINE_LOCATION), -1);
return;
case 10204:
break;
default:
return;
}
}
}
}
com.bslyun.app.utils.s.a(this, getString(R.string.permission_WRITE_EXTERNAL_STORAGE), -1);
return;
}
com.bslyun.app.utils.s.a(this, getString(R.string.permission_READ_CONTACTS), -1);
return;
}
com.bslyun.app.utils.s.a(this, getString(R.string.permission_READ_PHONE_STATE), 1400);
}
@Override
protected void onDestroy() {
this.n.onDestory();
super.onDestroy();
l0 l0Var = this.f4149g;
if (l0Var != null) {
l0Var.o();
}
com.bslyun.app.f.d dVar = this.f4150h;
if (dVar != null) {
dVar.dismiss();
this.f4150h = null;
}
com.bslyun.app.views.d dVar2 = this.l;
if (dVar2 != null) {
dVar2.dismiss();
this.l = null;
}
a.g.a.a.b(this).e(this.j);
if (!this.startScreenshort || this.contentObserver == null) {
return;
}
e0.k(getContentResolver(), this.contentObserver);
this.contentObserver = null;
}
@Override
public void onGranted(int i2) {
if (i2 == 110) {
y.g(this, this.f4132a.T);
return;
}
if (i2 == 140) {
String c2 = this.f4132a.c();
if (m0.Z(this)) {
getWebFragment().getLocalBrowser().post(new m(c2));
return;
} else {
getWebFragment().getX5Browser().post(new n(c2));
return;
}
}
if (i2 == 10125) {
if (TextUtils.isEmpty(com.bslyun.app.e.a.i) || TextUtils.isEmpty(com.bslyun.app.e.a.j)) {
return;
}
new AddContact();
try {
if (new com.bslyun.app.utils.c(this).a((AddContact) this.f4135d.fromJson(com.bslyun.app.e.a.i, AddContact.class))) {
x(com.bslyun.app.e.a.j, "1");
return;
} else {
x(com.bslyun.app.e.a.j, "0");
return;
}
} catch (JsonSyntaxException e2) {
e2.printStackTrace();
m0.u0(this, "联系人信息有误");
return;
}
}
if (i2 == 10127) {
PictureSelector.create((AppCompatActivity) this).openGallery(SelectMimeType.ofImage()).setImageEngine(com.bslyun.app.utils.k.a()).setMaxSelectNum(1).isDisplayCamera(false).forResult(10128);
return;
}
if (i2 == 10133) {
QRCodeComponent.open(this);
return;
}
if (i2 == 10141) {
getWebFragment().setPermissionRequest();
return;
}
if (i2 == 10203) {
if (!this.f4132a.v3 || androidx.core.content.a.a(this, "android.permission.ACCESS_BACKGROUND_LOCATION") == 0) {
return;
}
new com.bslyun.app.utils.s().c(this, new String[]{"android.permission.ACCESS_BACKGROUND_LOCATION"}, this, 91, null, null, null, null);
return;
}
if (i2 == 10121) {
startActivityForResult(new Intent("android.intent.action.PICK", ContactsContract.Contacts.CONTENT_URI), 10124);
return;
}
if (i2 != 10122) {
return;
}
try {
x(com.bslyun.app.e.a.f4271h, this.f4135d.toJson(new com.bslyun.app.utils.c(this).c()));
} catch (Exception e3) {
e3.printStackTrace();
m0.u0(this, "读取联系人失败");
}
}
@Override
public void onHideFull() {
if (this.f4132a.r) {
this.mNavigateLayout.setVisibility(0);
}
}
@Override
public void onHideState(String str) {
}
@Override
public void onJsTitleName(String str, String str2) {
}
@Override
public boolean onKeyDown(int i2, KeyEvent keyEvent) {
if (i2 == 82 && isWebFragment() && this.f4132a.i1) {
getWebFragment().postJS("javascript:onTask();");
}
return super.onKeyDown(i2, keyEvent);
}
@Override
public void onNetType(String str) {
if (com.bslyun.app.e.a.n.equals(BuildConfig.FLAVOR)) {
return;
}
String geneciCallbackFunction = JavaScriptUtils.geneciCallbackFunction(com.bslyun.app.e.a.n, str);
if (m0.Z(this)) {
JavaScriptUtils.postJsInWebView(this, getWebFragment().getLocalBrowser(), geneciCallbackFunction);
} else {
JavaScriptUtils.postJsInWebView(this, getWebFragment().getX5Browser(), geneciCallbackFunction);
}
}
@Override
public void onNewIntent(Intent intent) {
super.onNewIntent(intent);
WeiboComponent.handleWeiboResponse(this, intent);
Uri data = intent.getData();
if (!com.bslyun.app.d.a.f(this).p3 || data == null) {
return;
}
ULinkCommponent.handleUMLinkURI(this, data);
}
@Override
public void onPause() {
super.onPause();
com.bslyun.app.utils.p.c("momo", "MainActivity onPause()");
}
@Override
public void onRequestPermissionsResult(int i2, String[] strArr, int[] iArr) {
super.onRequestPermissionsResult(i2, strArr, iArr);
if (this.n.onActivityResutlForPermission(i2, strArr, iArr)) {
return;
}
new com.bslyun.app.utils.s().b(i2, strArr, iArr, this);
if (i2 != 120) {
if (i2 == 131 && iArr.length > 0 && iArr[0] == 0) {
if (this.f4132a.v3 && androidx.core.content.a.a(this, "android.permission.ACCESS_BACKGROUND_LOCATION") != 0) {
new com.bslyun.app.utils.s().c(this, new String[]{"android.permission.ACCESS_BACKGROUND_LOCATION"}, this, 91, null, null, null, null);
}
if (m0.Z(this)) {
getWebFragment().getLocalBrowser().getLocalBrowserChromeClient().setGeoPermissionsCallback();
return;
} else {
getWebFragment().getX5Browser().getX5BrowserChromeClient().setGeoPermissionsCallback();
return;
}
}
return;
}
if (iArr.length <= 0 || iArr[0] != 0) {
return;
}
this.f4149g.r();
}
@Override
public void onResume() {
super.onResume();
com.bslyun.app.f.c cVar = this.s;
if (cVar != null) {
cVar.dismiss();
}
if (this.f4132a.k2) {
LinkpageComponent.setImmediate();
}
}
@Override
public void onSetStateBarColor(String str, String str2, boolean z) {
this.barHeight.setBackgroundColor(Color.parseColor(str));
}
@Override
public void onShowFull() {
if (this.f4132a.r) {
this.mNavigateLayout.setVisibility(8);
}
}
@Override
public void onStop() {
super.onStop();
}
@Override
public void onTabChanged(String str) {
Fragment currentFragment = getCurrentFragment();
if (currentFragment != null) {
i0.a().post(new e(str, currentFragment));
}
}
@Override
public void onTopResumedActivityChanged(boolean z) {
super.onTopResumedActivityChanged(z);
if (getWebFragment() != null) {
if (z) {
getWebFragment().postJS("javascript:onBackToBSLApp();");
} else {
getWebFragment().postJS("javascript:onLeaveBSLApp();");
}
}
}
@Override
public void onWindowFocusChanged(boolean z) {
super.onWindowFocusChanged(z);
this.tabHostHeight = this.mTabHost.getHeight();
}
public void openAppNumber() {
int i2 = 1;
com.bslyun.app.e.a.s = true;
RecordModel recordModel = (RecordModel) c0.b(this, "openAppNumber");
if (recordModel != null) {
int number = recordModel.getNumber();
Date date = new Date();
int i3 = this.f4132a.K1;
if (number >= i3 && i3 != 0) {
return;
}
if (m0.h(date, recordModel.getDate()) == 0) {
int i4 = number + 1;
recordModel.setNumber(i4);
i2 = i4;
} else {
recordModel.setNumber(1);
recordModel.setDate(date);
}
} else {
recordModel = new RecordModel();
recordModel.setDate(new Date());
recordModel.setNumber(1);
}
int i5 = this.f4132a.K1;
if (i2 <= i5 || i5 == 0) {
c0.d(this, "openAppNumber", recordModel);
String str = "javascript:todayOpenAppNumber(" + i2 + ");";
if (isWebFragment()) {
getWebFragment().postJS(str);
}
}
}
public void openBrowser() {
this.n.setFunction(((com.bslyun.app.fragment.d) getCurrentFragment()).k(), "4");
}
public void openLeftMenu() {
if (this.f4132a.i) {
this.mDrawerLayout.post(new b());
}
}
public void permission() {
try {
PackageInfo packageInfo = getPackageManager().getPackageInfo(getPackageName(), 4096);
String[] strArr = packageInfo != null ? packageInfo.requestedPermissions : null;
if (strArr == null || strArr.length <= 0) {
return;
}
List asList = Arrays.asList(strArr);
ArrayList arrayList = new ArrayList();
arrayList.addAll(asList);
String str = BuildConfig.FLAVOR + arrayList;
} catch (PackageManager.NameNotFoundException e2) {
e2.printStackTrace();
}
}
public void quit() {
if ("0".equals(this.f4132a.Y)) {
if (this.f4150h == null) {
this.f4150h = new com.bslyun.app.f.d(this.f4134c, getResources().getString(R.string.quit_hint1), getResources().getString(R.string.quit_cancel), getResources().getString(R.string.quit_sure), null, new o());
}
this.f4150h.show();
return;
}
exitApp();
}
public void refreshConfig() {
if (isWebFragment() || m0.o()) {
return;
}
((com.bslyun.app.fragment.l) ((com.bslyun.app.fragment.d) getCurrentFragment()).k()).i();
}
public void showLoginDialog() {
com.bslyun.app.f.c cVar = this.s;
if (cVar == null || !cVar.isShowing()) {
com.bslyun.app.f.c cVar2 = new com.bslyun.app.f.c(this);
this.s = cVar2;
cVar2.show();
}
}
@Override
public void menuItemClick(FloatMenuItem floatMenuItem) {
com.bslyun.app.views.b bVar = this.m;
if (bVar != null) {
bVar.dismiss();
}
u(floatMenuItem.getBtnFunction(), floatMenuItem.getBtnJs());
}
}