万能钥匙.apk(点击下载) / h.java


package com.linksure.browser.webcore;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.Parcel;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.view.View;
import android.webkit.URLUtil;
import android.webkit.WebView;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.appara.feed.constant.Constants;
import com.appara.feed.constant.TTParam;
import com.appara.feed.ui.componets.OpenHelper;
import com.lantern.core.manager.WkSecretFactory;
import com.lantern.taichi.TCConstants;
import com.lantern.taichi.TaiChiApi;
import com.lantern.webviewsdk.webview_compats.IWebView;
import com.linksure.api.utils.f;
import com.linksure.api.utils.l;
import com.linksure.api.utils.m;
import com.linksure.browser.BrowserApp;
import com.linksure.browser.activity.a.a;
import com.linksure.browser.activity.fragment.TabListFragment;
import com.linksure.browser.activity.fragment.TabListLikeQFragment;
import com.linksure.browser.activity.fragment.WebFragment;
import com.linksure.browser.activity.home.BaseHomeFragment;
import com.linksure.browser.activity.home.EasyHomeFragment;
import com.linksure.browser.activity.home.FeedsListFragment;
import com.linksure.browser.activity.home.MinHomeFragment;
import com.linksure.browser.activity.home.MineHomeFragment;
import com.linksure.browser.activity.home.VideoListFragment;
import com.linksure.browser.activity.home.WifiConnectFragment;
import com.linksure.browser.activity.search.SearchActivity;
import com.linksure.browser.activity.tab.TabManager;
import com.linksure.browser.analytics.b;
import com.linksure.browser.bean.HotWordItem;
import com.linksure.browser.bean.SpiderItem;
import com.linksure.browser.config.d;
import com.linksure.browser.config.e;
import com.linksure.browser.constant.EventConstants;
import com.linksure.browser.preference.LocalCacheManager;
import com.linksure.browser.service.AssistService;
import com.linksure.browser.update.a.a;
import com.linksure.browser.utils.CommonUtils;
import com.linksure.browser.utils.g;
import com.linksure.browser.utils.r;
import com.linksure.browser.utils.w;
import com.linksure.browser.view.dialog.RecoveryLastPagePop;
import com.linksure.browser.webcore.a.a;
import com.linksure.browser.webcore.a.b;
import com.linksure.browser.webcore.a.c;
import com.linksure.framework.a.n;
import com.wifi.link.wfys.R;
import java.io.File;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;

/* compiled from: PhoneUIManager */
public final class h extends a {
    public WebFragment d;
    Fragment e = null;
    private BaseHomeFragment f;
    private TabListLikeQFragment g;
    private TabListFragment h;
    private FeedsListFragment i;
    private VideoListFragment j;
    private WifiConnectFragment k;

    /* renamed from: l  reason: collision with root package name */
    private MineHomeFragment f7500l;
    private List<Fragment> m = new ArrayList();
    private long n = 0;
    private boolean o = false;
    private a p = null;
    private RecoveryLastPagePop q = null;

    public h(FragmentActivity fragmentActivity) {
        super(fragmentActivity);
        if (o()) {
            this.f = new EasyHomeFragment();
        } else {
            this.f = new MinHomeFragment();
            b.a("lsbr_simplehome_expo");
        }
        if (!this.m.contains(this.f)) {
            this.m.add(this.f);
        }
        this.f7442b.a().a(R.id.fragment_home_container, this.f).g();
    }

    /* access modifiers changed from: protected */
    /* JADX WARNING: Removed duplicated region for block: B:14:0x007d  */
    /* JADX WARNING: Removed duplicated region for block: B:15:0x007f  */
    /* JADX WARNING: Removed duplicated region for block: B:23:0x00d7  */
    /* JADX WARNING: Removed duplicated region for block: B:26:0x00e4  */
    /* JADX WARNING: Removed duplicated region for block: B:32:0x0108  */
    /* JADX WARNING: Removed duplicated region for block: B:38:0x011a  */
    @Override // com.linksure.browser.webcore.a
    public final void a() {
        CommonUtils.Country country;
        super.a();
        if (System.currentTimeMillis() - com.linksure.browser.preference.a.a().f7265a.getLong("key_upgrade_ignore_time", 0) > 86400000) {
            this.p = new a(this.f7441a);
            this.p.a(false, (com.bluefay.b.a) null);
        }
        Intent intent = new Intent(this.f7441a, AssistService.class);
        intent.putExtra("status", AssistService.AssistStatus.DEFAULT);
        AssistService.a(this.f7441a, intent);
        String simOperator = ((TelephonyManager) com.linksure.api.a.a().f5950a.getSystemService("phone")).getSimOperator();
        if (!TextUtils.isEmpty(simOperator)) {
            if (simOperator.startsWith("460")) {
                country = CommonUtils.Country.CN;
            } else if (simOperator.startsWith("510")) {
                country = CommonUtils.Country.IN;
            }
            b.a("lsbr_simcard_country", "country", String.valueOf(country != CommonUtils.Country.CN ? 0 : 1));
            d a2 = d.a();
            TCConstants.URL_EXP = "https://taichi.51y5.net/alps/fcompb.pgs";
            Context context = com.linksure.api.a.a().f5950a;
            String str = WkSecretFactory.getDefaultConfig().mAppId;
            String str2 = WkSecretFactory.TAICHI_AES_KEY;
            String str3 = WkSecretFactory.TAICHI_AES_IV;
            String dhid = BrowserApp.j().getDHID();
            String channelID = BrowserApp.j().getChannelID();
            StringBuilder sb = new StringBuilder();
            sb.append(BrowserApp.l());
            TaiChiApi.init(context, str, str2, str3, dhid, channelID, sb.toString(), 
            /*  JADX ERROR: Method code generation error
                jadx.core.utils.exceptions.CodegenException: Error generate insn: 0x00c7: INVOKE  
                  (r7v0 'context' android.content.Context)
                  (r8v0 'str' java.lang.String)
                  (r9v0 'str2' java.lang.String)
                  (r10v0 'str3' java.lang.String)
                  (r11v0 'dhid' java.lang.String)
                  (r12v0 'channelID' java.lang.String)
                  (wrap: java.lang.String : 0x00bb: INVOKE  (r13v0 java.lang.String) = (r2v13 'sb' java.lang.StringBuilder) type: VIRTUAL call: java.lang.StringBuilder.toString():java.lang.String)
                  (wrap: com.linksure.browser.config.d$1 : 0x00c1: CONSTRUCTOR  (r14v0 com.linksure.browser.config.d$1) = (r0v5 'a2' com.linksure.browser.config.d) call: com.linksure.browser.config.d.1.<init>(com.linksure.browser.config.d):void type: CONSTRUCTOR)
                  (null com.lantern.taichi.network.ITaiChiOptinsParams)
                  (null com.lantern.taichi.log.TaiChiLogCallback)
                 type: STATIC call: com.lantern.taichi.TaiChiApi.init(android.content.Context, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, com.lantern.taichi.listener.ConfigChangeListener, com.lantern.taichi.network.ITaiChiOptinsParams, com.lantern.taichi.log.TaiChiLogCallback):void in method: com.linksure.browser.webcore.h.a():void, file: classes.dex
                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:255)
                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:217)
                	at jadx.core.codegen.RegionGen.makeSimpleBlock(RegionGen.java:110)
                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:56)
                	at jadx.core.codegen.RegionGen.makeSimpleRegion(RegionGen.java:93)
                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:59)
                	at jadx.core.codegen.RegionGen.makeRegionIndent(RegionGen.java:99)
                	at jadx.core.codegen.RegionGen.makeIf(RegionGen.java:143)
                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:63)
                	at jadx.core.codegen.RegionGen.makeSimpleRegion(RegionGen.java:93)
                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:59)
                	at jadx.core.codegen.MethodGen.addRegionInsns(MethodGen.java:244)
                	at jadx.core.codegen.MethodGen.addInstructions(MethodGen.java:237)
                	at jadx.core.codegen.ClassGen.addMethodCode(ClassGen.java:342)
                	at jadx.core.codegen.ClassGen.addMethod(ClassGen.java:295)
                	at jadx.core.codegen.ClassGen.lambda$addInnerClsAndMethods$2(ClassGen.java:264)
                	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
                	at java.util.ArrayList.forEach(ArrayList.java:1259)
                	at java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:390)
                	at java.util.stream.Sink$ChainedReference.end(Sink.java:258)
                Caused by: jadx.core.utils.exceptions.CodegenException: Error generate insn: 0x00c1: CONSTRUCTOR  (r14v0 com.linksure.browser.config.d$1) = (r0v5 'a2' com.linksure.browser.config.d) call: com.linksure.browser.config.d.1.<init>(com.linksure.browser.config.d):void type: CONSTRUCTOR in method: com.linksure.browser.webcore.h.a():void, file: classes.dex
                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:255)
                	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:119)
                	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:103)
                	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:806)
                	at jadx.core.codegen.InsnGen.makeInvoke(InsnGen.java:746)
                	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:367)
                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:249)
                	... 19 more
                Caused by: jadx.core.utils.exceptions.JadxRuntimeException: Expected class to be processed at this point, class: com.linksure.browser.config.d, state: GENERATED_AND_UNLOADED
                	at jadx.core.dex.nodes.ClassNode.ensureProcessed(ClassNode.java:215)
                	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:630)
                	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:363)
                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:230)
                	... 25 more
                */
            /* JADX WARNING: Removed duplicated region for block: B:14:0x007d  */
            /* JADX WARNING: Removed duplicated region for block: B:15:0x007f  */
            /* JADX WARNING: Removed duplicated region for block: B:23:0x00d7  */
            /* JADX WARNING: Removed duplicated region for block: B:26:0x00e4  */
            /* JADX WARNING: Removed duplicated region for block: B:32:0x0108  */
            /* JADX WARNING: Removed duplicated region for block: B:38:0x011a  */
            /*
            // Method dump skipped, instructions count: 288
            */
            throw new UnsupportedOperationException("Method not decompiled: com.linksure.browser.webcore.h.a():void");
        }

        @Override // com.linksure.browser.webcore.a, com.linksure.browser.c.a
        public final void channel_CN() {
            super.channel_CN();
        }

        public final void b() {
            if (this.d == null || this.f7442b == null || !this.f7442b.f().contains(this.d)) {
                BrowserApp.e().post(new Runnable() {
                    /* class com.linksure.browser.webcore.$$Lambda$h$Ic3Bgs_lgBvlcvz2UHdDtNseicM */

                    public final void run() {
                        h.this.r();
                    }
                });
                BrowserApp.e().postDelayed(new Runnable() {
                    /* class com.linksure.browser.webcore.$$Lambda$h$0yiwFl9Tza8FU5n8eZa7TWfswo */

                    public final void run() {
                        h.this.q();
                    }
                }, 200);
                if (com.linksure.browser.preference.a.a().F()) {
                    Intent intent = new Intent(this.f7441a, com.linksure.browser.service.d.class);
                    intent.putExtra("from", 4);
                    this.f7441a.startService(intent);
                }
                l.a("key_vpn_auto_connect_tips", Boolean.FALSE);
            }
        }

        /* access modifiers changed from: private */
        public /* synthetic */ void r() {
            if (this.g == null) {
                this.g = new TabListLikeQFragment();
            }
            this.f7442b.a().b(R.id.fragment_tab_container, this.g).b(this.g).g();
            if (this.d == null) {
                this.d = new WebFragment();
            }
            this.f7442b.a().b(R.id.fragment_web_container, this.d).b(this.d).g();
            if (this.h == null) {
                this.h = new TabListFragment();
            }
            this.f7442b.a().b(R.id.fragment_tab_list_container, this.h).b(this.h).g();
        }

        /* access modifiers changed from: private */
        public /* synthetic */ void q() {
            if (com.linksure.browser.preference.a.a().m() && l.b("tab_count") > 0) {
                LocalCacheManager localCacheManager = LocalCacheManager.f7263a;
                if (!LocalCacheManager.c("open_recovery_tips")) {
                    this.q = new RecoveryLastPagePop(this.f7441a);
                    this.q.show();
                } else if (this.c != null) {
                    this.c.a();
                }
            }
            if (!(this.c.b() == null || this.c.b().f6891b == null || !TextUtils.isEmpty(this.c.b().f6891b.getUrl()))) {
                g.a(2001, null, null, null);
            }
            if (this.c.c() == 0) {
                this.c.a("file:///android_asset/page/home.html");
            }
        }

        public final void c() {
            if (o()) {
                if (!(this.f instanceof EasyHomeFragment)) {
                    n();
                    this.f = new EasyHomeFragment();
                    this.f7442b.a().b(R.id.fragment_home_container, this.f).g();
                    this.m.add(this.f);
                }
            } else if (!(this.f instanceof MinHomeFragment)) {
                n();
                this.f = new MinHomeFragment();
                this.f7442b.a().b(R.id.fragment_home_container, this.f).g();
                this.m.add(this.f);
            }
            this.c.e = TabManager.HomeState.DEFAULT;
            BrowserApp.e().postDelayed(new Runnable() {
                /* class com.linksure.browser.webcore.h.AnonymousClass1 */

                public final void run() {
                    g.a(EventConstants.EVT_FUNCTION_TAB_SWITCH, null, null, null);
                }
            }, 100);
        }

        private void n() {
            this.f = null;
            this.j = null;
            this.i = null;
            this.k = null;
            this.f7500l = null;
            List<Fragment> list = this.m;
            list.removeAll(list);
        }

        private static boolean o() {
            return !e.a() && com.linksure.browser.preference.a.a().D() == 0 && f.a();
        }

        public final void a(TabManager.HomeState homeState) {
            Fragment fragment;
            this.c.e = homeState;
            android.support.v4.app.g a2 = this.f7442b.a();
            switch (homeState) {
                case DEFAULT:
                    fragment = this.f;
                    this.e = fragment;
                    break;
                case VIDEO:
                    if (this.j == null) {
                        List<Fragment> list = this.m;
                        VideoListFragment videoListFragment = new VideoListFragment();
                        this.j = videoListFragment;
                        list.add(videoListFragment);
                    }
                    fragment = this.j;
                    this.e = fragment;
                    break;
                case FEEDS:
                    if (this.i == null) {
                        List<Fragment> list2 = this.m;
                        FeedsListFragment feedsListFragment = new FeedsListFragment();
                        this.i = feedsListFragment;
                        list2.add(feedsListFragment);
                    }
                    fragment = this.i;
                    this.e = fragment;
                    break;
                case WIFI:
                    if (this.k == null) {
                        List<Fragment> list3 = this.m;
                        WifiConnectFragment wifiConnectFragment = new WifiConnectFragment();
                        this.k = wifiConnectFragment;
                        list3.add(wifiConnectFragment);
                    }
                    fragment = this.k;
                    break;
                case MINE:
                    if (this.f7500l == null) {
                        List<Fragment> list4 = this.m;
                        MineHomeFragment mineHomeFragment = new MineHomeFragment();
                        this.f7500l = mineHomeFragment;
                        list4.add(mineHomeFragment);
                    }
                    fragment = this.f7500l;
                    break;
                default:
                    fragment = this.f;
                    this.e = fragment;
                    break;
            }
            if (fragment != null) {
                for (Fragment fragment2 : this.m) {
                    if (fragment != fragment2) {
                        a2.b(fragment2);
                    } else if (fragment2.isAdded()) {
                        a2.c(fragment2);
                    } else {
                        a2.a(R.id.fragment_home_container, fragment2);
                    }
                }
                a2.g();
            }
        }

        public final void d() {
            if (this.e == null) {
                this.e = this.f;
            }
            this.f7442b.a().c(this.e).c(this.k).g();
            View view = this.k.getView();
            if (view != null) {
                ObjectAnimator duration = ObjectAnimator.ofFloat(view, "translationY", 0.0f, (float) m.b()).setDuration(400L);
                duration.addListener(new AnimatorListenerAdapter() {
                    /* class com.linksure.browser.webcore.h.AnonymousClass2 */

                    public final void onAnimationEnd(Animator animator) {
                        super.onAnimationEnd(animator);
                        if (h.this.e instanceof VideoListFragment) {
                            g.a(EventConstants.EVT_HOME_SHOW_VIDEO, null, null, null);
                        } else {
                            g.a(EventConstants.EVT_HOME_SHOW_HOME, null, null, null);
                        }
                    }
                });
                duration.start();
            }
        }

        public final void a(Intent intent) {
            if (intent != null && this.f7441a != null) {
                String action = intent.getAction();
                Uri data = intent.getData();
                final Bundle extras = intent.getExtras();
                String str = "";
                if (extras != null) {
                    str = extras.getString("needgoto");
                }
                if (action != null && action.equals("android.intent.action.WEB_SEARCH")) {
                    g.a(1001, URLUtil.composeSearchUrl(intent.getStringExtra(TTParam.SOURCE_query), r.a(), "%s"), null, null);
                } else if (action == null || !action.equals("schema_action_push_feed")) {
                    if (Objects.equals(action, "schema_action_quick_search_weather") || Objects.equals(action, "schema_action_quick_search_search")) {
                        BrowserApp.e().postDelayed(new Runnable() {
                            /* class com.linksure.browser.webcore.h.AnonymousClass3 */

                            public final void run() {
                                Bundle bundle = extras;
                                if (bundle != null && bundle.getSerializable("info") != null) {
                                    Serializable serializable = extras.getSerializable("info");
                                    if (serializable instanceof HotWordItem) {
                                        HotWordItem hotWordItem = (HotWordItem) serializable;
                                        h.this.f7441a.startActivity(new Intent(h.this.f7441a, SearchActivity.class).putExtra(TTParam.KEY_item, hotWordItem));
                                        b.a("lsbr_notification_searchbar", "news", hotWordItem.getTitle());
                                    }
                                    b.a("lsbr_app_open", "openstyle", TTParam.hb_invite_h5_frompage_id_mine_tab_hbdialog);
                                }
                            }
                        }, 200);
                    } else if (Objects.equals(action, "schema_action_local_spider")) {
                        Serializable serializable = extras.getSerializable("info");
                        if (serializable instanceof SpiderItem) {
                            SpiderItem spiderItem = (SpiderItem) serializable;
                            if (!TextUtils.isEmpty(spiderItem.getUrl())) {
                                g.a(1001, spiderItem.getUrl());
                                a.C0240a aVar = com.linksure.browser.webcore.a.a.f7443a;
                                a.C0240a.a();
                                com.linksure.browser.webcore.a.a.b("web_crawler_weibo_cache", spiderItem.getUrl());
                                b.a("lsbr_hottopic_click");
                                b.a("lsbr_app_open", "openstyle", TTParam.hb_invite_h5_frompage_id_mine_tab_hbdialog);
                            }
                        }
                    } else if (Objects.equals(action, "schema_action_default_spider")) {
                        Serializable serializable2 = extras.getSerializable("info");
                        if (serializable2 instanceof SpiderItem) {
                            SpiderItem spiderItem2 = (SpiderItem) serializable2;
                            if (!TextUtils.isEmpty(spiderItem2.getUrl())) {
                                g.a(1001, spiderItem2.getUrl());
                            }
                        }
                    } else if (Objects.equals(action, "schema_action_wifi_connect")) {
                        g.a(2005);
                        b.a("lsbr_notification_nearwifi");
                    } else if (Objects.equals(action, "schema_action_shortcut")) {
                        BrowserApp.e().postDelayed(new Runnable(intent) {
                            /* class com.linksure.browser.webcore.$$Lambda$h$4XnFNygV74ZsrJ0d8O7_J8YpzAc */
                            private final /* synthetic */ Intent f$1;

                            {
                                this.f$1 = r2;
                            }

                            public final void run() {
                                h.this.b(this.f$1);
                            }
                        }, 200);
                    } else if (Objects.equals(action, "schema_action_load_url")) {
                        String uri = data.toString();
                        if (!TextUtils.isEmpty(uri)) {
                            g.a(1001, uri);
                        }
                    } else if (data != null) {
                        String uri2 = data.toString();
                        if (!TextUtils.isEmpty(uri2) && uri2.contains("set_default_browser")) {
                            if (com.linksure.browser.activity.settings.a.a(BrowserApp.f())) {
                                n.a(this.f7441a, (int) R.string.set_default_browser_success);
                                com.linksure.browser.preference.a.a();
                                com.linksure.browser.preference.a.P();
                                b.a("lsbr_defaultbro_success");
                                return;
                            }
                            n.a(this.f7441a, (int) R.string.set_default_browser_failed);
                            b.a("lsbr_defaultbro_fail");
                        }
                        g.a(1001, uri2);
                    } else if (!TextUtils.isEmpty(str)) {
                        g.a(1001, str);
                    } else if (e.b()) {
                        com.linksure.browser.config.a.a();
                        if (com.linksure.browser.config.a.n()) {
                            g.a(2005);
                            b.a("lsbr_tabbar_wifi", "style", "0");
                        }
                    }
                } else if (data != null) {
                    try {
                        HashMap hashMap = new HashMap();
                        hashMap.put("url", data.toString());
                        b.b("lsbr_push_click", hashMap);
                        b.a("lsbr_app_open", "openstyle", "5");
                        OpenHelper.openUrl(BrowserApp.f(), data.toString(), false);
                    } catch (Exception e2) {
                        HashMap hashMap2 = new HashMap();
                        hashMap2.put("error", e2.toString());
                        b.b("lsbr_push_error", hashMap2);
                        com.linksure.api.utils.e.a();
                    }
                }
            }
        }

        /* access modifiers changed from: private */
        public /* synthetic */ void b(Intent intent) {
            if (com.linksure.api.utils.n.a((Context) this.f7441a)) {
                String stringExtra = intent.getStringExtra(Constants.FEED_SCENE_SHORTCUT);
                if (Objects.equals(stringExtra, "search")) {
                    this.f7441a.startActivity(new Intent(this.f7441a, SearchActivity.class));
                    b.a("lsbr_desktop_search");
                    b.a("lsbr_app_open", "openstyle", TTParam.hb_invite_h5_frompage_id_search_banner);
                } else if (Objects.equals(stringExtra, "wifi")) {
                    g.a(2005);
                    b.a("lsbr_desktop_wifi");
                    b.a("lsbr_app_open", "openstyle", TTParam.hb_invite_h5_frompage_id_search_banner);
                    b.a("lsbr_tabbar_wifi", "style", "2");
                }
            }
        }

        public final void e() {
            BaseHomeFragment baseHomeFragment = this.f;
            if (baseHomeFragment == null || !baseHomeFragment.onBackPressed()) {
                MineHomeFragment mineHomeFragment = this.f7500l;
                if (mineHomeFragment == null || !mineHomeFragment.onBackPressed()) {
                    VideoListFragment videoListFragment = this.j;
                    if (videoListFragment == null || !videoListFragment.onBackPressed()) {
                        FeedsListFragment feedsListFragment = this.i;
                        if (feedsListFragment == null || !feedsListFragment.onBackPressed()) {
                            TabListLikeQFragment tabListLikeQFragment = this.g;
                            if (tabListLikeQFragment == null || !tabListLikeQFragment.onBackPressed()) {
                                TabListFragment tabListFragment = this.h;
                                if (tabListFragment == null || !tabListFragment.onBackPressed()) {
                                    WebFragment webFragment = this.d;
                                    if (webFragment == null || !webFragment.onBackPressed()) {
                                        WifiConnectFragment wifiConnectFragment = this.k;
                                        if (wifiConnectFragment != null && wifiConnectFragment.onBackPressed()) {
                                            return;
                                        }
                                        if (System.currentTimeMillis() - this.n > 2000) {
                                            this.n = System.currentTimeMillis();
                                            n.a(this.f7441a, (int) R.string.msg_exit_browser);
                                            return;
                                        }
                                        b.a("lsbr_back_closeapp");
                                        com.linksure.browser.config.a.a();
                                        int i2 = com.linksure.browser.config.a.i();
                                        com.linksure.browser.config.a.a();
                                        boolean h2 = com.linksure.browser.config.a.h();
                                        boolean z = false;
                                        if (!l.a("exit_open_switch_style", false)) {
                                            LocalCacheManager localCacheManager = LocalCacheManager.f7263a;
                                            if (!LocalCacheManager.b("exit_open_switch_style", (long) i2, LocalCacheManager.State.NUM) && com.linksure.api.utils.a.d()) {
                                                z = true;
                                            }
                                        }
                                        BaseHomeFragment baseHomeFragment2 = this.f;
                                        if (!(baseHomeFragment2 instanceof EasyHomeFragment) || !z || !h2) {
                                            this.f7441a.finish();
                                        } else {
                                            baseHomeFragment2.b();
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        public final void f() {
            RecoveryLastPagePop recoveryLastPagePop = this.q;
            if (recoveryLastPagePop != null) {
                recoveryLastPagePop.dismiss();
                this.q = null;
            }
            if (com.linksure.browser.preference.a.a().f7265a.getBoolean("clearExit", false)) {
                MixedWebView mixedWebView = TabManager.a(this.f7441a).b().f6891b;
                w.d(mixedWebView);
                w.a(mixedWebView);
                w.c(mixedWebView);
                w.a();
                w.b(mixedWebView);
            }
            TabManager.a(this.f7441a).f();
            a.C0221a aVar = com.linksure.browser.activity.a.a.f5999b;
            com.linksure.browser.activity.a.a a2 = a.C0221a.a();
            if (!a2.f6000a.isEmpty()) {
                a2.f6000a.clear();
            }
            TabManager.f6887a = null;
            if (!com.linksure.browser.preference.a.a().m()) {
                TabManager.g();
            }
            com.linksure.framework.a.g.a("destroy...", new Object[0]);
            e.d();
            com.linksure.d.d.a();
            com.linksure.d.d.b();
            com.linksure.api.utils.g a3 = com.linksure.api.utils.g.a();
            if ((ActivityCompat.a(a3.f5967b, "android.permission.ACCESS_FINE_LOCATION") == 0 || ActivityCompat.a(a3.f5967b, "android.permission.ACCESS_COARSE_LOCATION") == 0) && a3.f5966a != null) {
                a3.f5966a.removeUpdates(a3);
            }
            b.a aVar2 = com.linksure.browser.webcore.a.b.f7447b;
            com.linksure.browser.webcore.a.b a4 = b.a.a();
            Iterator<c> it = a4.f7448a.iterator();
            while (it.hasNext()) {
                c next = it.next();
                if (next != null) {
                    next.c = false;
                    next.d = null;
                    WebView webView = next.e;
                    if (webView != null) {
                        webView.destroy();
                    }
                    next.e = null;
                    next.f = null;
                }
            }
            if (a4.f7448a != null) {
                a4.f7448a.clear();
            }
            com.linksure.browser.update.a.a aVar3 = this.p;
            if (aVar3 != null) {
                aVar3.a();
            }
        }

        public final void g() {
            this.o = true;
            TabManager.g();
            this.f7441a.finish();
        }

        public final void h() {
            TabManager tabManager = this.c;
            if (tabManager.c != null && tabManager.c.size() > 0) {
                for (com.linksure.browser.activity.tab.a aVar : tabManager.c) {
                    if (aVar != null) {
                        if (aVar.f6891b != null) {
                            aVar.f6891b.b();
                        }
                        aVar.h();
                    }
                }
            }
        }

        public final void i() {
            if (!this.o && this.c != null) {
                TabManager tabManager = this.c;
                if (com.linksure.browser.preference.a.a().m() && tabManager.c.size() != 0 && !e.a()) {
                    try {
                        ArrayList arrayList = new ArrayList();
                        for (com.linksure.browser.activity.tab.a aVar : tabManager.c) {
                            Bundle bundle = null;
                            if (aVar.f6891b != null) {
                                MixedWebView mixedWebView = aVar.f6891b;
                                if (mixedWebView.c != null) {
                                    IWebView iWebView = mixedWebView.c;
                                    bundle = new Bundle();
                                    iWebView.saveState(bundle);
                                }
                            }
                            if (bundle != null) {
                                bundle.putBoolean("cache", aVar.e());
                                bundle.putString("title", aVar.f());
                                arrayList.add(bundle);
                            }
                        }
                        ArrayList arrayList2 = new ArrayList();
                        for (int i2 = 0; i2 < arrayList.size(); i2++) {
                            if (((Bundle) arrayList.get(i2)).getBoolean("cache")) {
                                arrayList2.add(arrayList.get(i2));
                            }
                        }
                        int i3 = 0;
                        int i4 = 0;
                        for (int i5 = 0; i5 < arrayList2.size(); i5++) {
                            Bundle bundle2 = (Bundle) arrayList2.get(i5);
                            if (bundle2 != null && bundle2.getBoolean("cache")) {
                                i4++;
                                if (tabManager.b() != null && tabManager.b().f().equals(bundle2.getString("title"))) {
                                    i3 = i4 - 1;
                                }
                                if (!TabManager.d.exists()) {
                                    TabManager.d.mkdirs();
                                }
                                File a2 = com.linksure.api.utils.d.a(TabManager.d, String.valueOf(i5));
                                if (!a2.exists() || bundle2.size() != 0) {
                                    Parcel obtain = Parcel.obtain();
                                    obtain.writeParcelable(bundle2, 0);
                                    com.linksure.api.utils.d.a(a2, obtain.marshall());
                                    obtain.recycle();
                                }
                            }
                        }
                        l.a("tab_index", Integer.valueOf(i3));
                        l.a("tab_count", Integer.valueOf(i4));
                        JSONArray jSONArray = new JSONArray();
                        for (com.linksure.browser.activity.tab.a aVar2 : tabManager.c) {
                            if (aVar2.e()) {
                                jSONArray.add(aVar2.f());
                            }
                        }
                        l.a("tab_title", jSONArray.toJSONString());
                        LocalCacheManager localCacheManager = LocalCacheManager.f7263a;
                        LocalCacheManager.a("open_recovery_tips");
                        com.linksure.framework.a.g.a("Tab SaveState...", new Object[0]);
                    } catch (Exception e2) {
                        com.linksure.framework.a.g.a(e2);
                        TabManager.g();
                    }
                }
            }
        }

        public final void j() {
            for (com.linksure.browser.activity.tab.a aVar : this.c.c) {
                if (!(aVar == null || aVar.f6891b == null)) {
                    aVar.h();
                }
            }
        }

        public final void k() {
            for (com.linksure.browser.activity.tab.a aVar : this.c.c) {
                if (!(aVar == null || aVar.f6891b == null)) {
                    aVar.i();
                }
            }
        }

        public final boolean l() {
            if (this.d.isHidden()) {
                return false;
            }
            BaseHomeFragment baseHomeFragment = this.f;
            return !(baseHomeFragment instanceof EasyHomeFragment) || !baseHomeFragment.a();
        }

        public final boolean m() {
            WebFragment webFragment = this.d;
            if (webFragment != null && webFragment.a() && (!this.f.isHidden() || !this.d.isHidden())) {
                return true;
            }
            return false;
        }

        /* access modifiers changed from: private */
        public static /* synthetic */ void p() {
            try {
                ArrayList<PackageInfo> arrayList = new ArrayList();
                List<PackageInfo> installedPackages = com.linksure.api.a.a().f5950a.getPackageManager().getInstalledPackages(0);
                for (int i2 = 0; i2 < installedPackages.size(); i2++) {
                    PackageInfo packageInfo = installedPackages.get(i2);
                    int i3 = packageInfo.applicationInfo.flags;
                    ApplicationInfo applicationInfo = packageInfo.applicationInfo;
                    if ((i3 & 1) <= 0) {
                        arrayList.add(packageInfo);
                    }
                }
                PackageManager packageManager = com.linksure.api.a.a().f5950a.getPackageManager();
                JSONArray jSONArray = new JSONArray();
                for (PackageInfo packageInfo2 : arrayList) {
                    JSONObject jSONObject = new JSONObject();
                    jSONObject.put(TTParam.KEY_name, (Object) packageManager.getApplicationLabel(packageInfo2.applicationInfo).toString());
                    jSONObject.put("package", (Object) packageInfo2.packageName);
                    jSONArray.add(jSONObject);
                }
                com.linksure.browser.analytics.b.a("lsbr_user_applist", "applist", jSONArray.toJSONString());
                com.linksure.framework.a.g.a("install app list===" + jSONArray.toJSONString());
                l.a("first_report_app_list", Boolean.TRUE);
            } catch (Exception e2) {
                e2.printStackTrace();
            }
        }
    }