手机管家 v6.0.0版本的 MD5 值为:bf0bca2cb03f766137fe9ecf7383a634

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


package com.tencent.qqpimsecure.h5;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.net.Uri;
import android.net.http.SslError;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.telephony.TelephonyManager;
import android.text.ClipboardManager;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.webkit.DownloadListener;
import android.webkit.JsResult;
import android.webkit.SslErrorHandler;
import android.webkit.URLUtil;
import android.webkit.ValueCallback;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import com.meri.service.s;
import com.tencent.kingkong.database.SQLiteDatabase;
import com.tencent.map.lbsapi.api.SOSOMapLBSApiResult;
import com.tencent.qqpimsecure.account.AccountInfo;
import com.tencent.qqpimsecure.account.MainAccountInfo;
import com.tencent.qqpimsecure.dao.r;
import com.tencent.server.base.QQSecureApplication;
import com.tencent.server.fore.SafeDownloadActivity;
import com.tencent.server.task.g;
import com.tencent.tmassistantsdk.common.TMAssistantDownloadSDKErrorCode;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import meri.pluginsdk.d;
import meri.util.AccessHelper;
import meri.util.BaseReceiver;
import oicq.wlogin_sdk.tools.util;
import org.json.JSONException;
import org.json.JSONObject;
import tcs.aaf;
import tcs.abn;
import tcs.aif;
import tcs.aig;
import tcs.ajg;
import tcs.ajk;
import tcs.ajy;
import tcs.akn;
import tcs.aow;
import tcs.ap;
import tcs.aqh;
import tcs.aqz;
import tcs.arc;
import tcs.azr;
import tcs.ber;
import tcs.bju;
import tcs.bxk;
import tcs.hv;
import tcs.jb;
import tcs.pz;
import tcs.qa;
import tcs.qf;
import tcs.rv;
import tcs.sd;
import tcs.tw;
import tcs.uc;
import tcs.uf;
import tcs.vb;
import tcs.ys;
import tcs.yz;
import tcs.za;
import tcs.zb;
import tmsdk.common.TMSDKContext;
import tmsdk.common.internal.utils.i;
import tmsdk.common.internal.utils.z;
import tmsdk.common.tcc.TccCryptor;
import uilib.components.QLinearLayout;
import uilib.components.QTextView;
import uilib.frame.BaseActivity;

public class f extends uilib.frame.a {
    private static String eUE = "https";
    private static int eVn = 0;
    private static final String eVo = "WVSession_" + System.currentTimeMillis();
    private Handler bvp;
    private HandlerThread cDY;
    private Handler clZ;
    private QLinearLayout eUF;
    private ViewGroup eUG;
    private WebView eUH;
    private View eUI;
    private ProgressBar eUJ;
    private com.tencent.qqpimsecure.h5.e eUK;
    private QTextView eUL;
    private com.tencent.qqpimsecure.h5.b eUM;
    private boolean eUN;
    private boolean eUO;
    private String eUP;
    private String eUQ;
    private zb eUR;
    private a eUS;
    private com.tencent.server.task.g eUT;
    private boolean eUU;
    private boolean eUV;
    private boolean eUW;
    private int eUX;
    private int eUY;
    private ValueCallback<Uri> eUZ;
    private int eVa;
    private String eVb;
    private String eVc;
    private boolean eVd;
    private boolean eVe;
    private boolean eVf;
    private boolean eVg;
    private String eVh;
    private StringBuilder eVi;
    private StringBuilder eVj;
    DownloadListener eVk;
    private Map<String, g.a> eVl;
    private Map<String, Boolean> eVm;
    private Context mContext;

    public interface b {
        void lY(int i);
    }

    static boolean Po() {
        return Pk();
    }

    static int Pp() {
        return Pm();
    }

    public f(Context context) {
        super(context);
        this.eUN = false;
        this.eUO = false;
        this.eUP = null;
        this.eUQ = null;
        this.eUR = null;
        this.bvp = null;
        this.clZ = new Handler(Looper.getMainLooper());
        this.cDY = null;
        this.eUS = null;
        this.eUT = null;
        this.eUU = false;
        this.eUV = true;
        this.eUW = false;
        this.eUX = 16;
        this.eUY = 16;
        this.eVa = -1;
        this.eVd = false;
        this.eVe = false;
        this.eVf = false;
        this.eVg = false;
        this.eVi = new StringBuilder();
        this.eVj = new StringBuilder();
        this.eVk = new DownloadListener() {
            @Override
            public void onDownloadStart(String str, String str2, String str3, String str4, long j) {
                try {
                    f.this.eUQ = str;
                    yz.c(ber.nV().kH(), 260412, 4);
                    if (f.this.eUH != null) {
                        f.this.eUP = f.this.eUH.getUrl();
                    }
                    if (str.endsWith(".apk")) {
                        Uri parse = Uri.parse(str);
                        Intent intent = new Intent(f.this.mContext, (Class<?>) SafeDownloadActivity.class);
                        intent.setData(parse);
                        intent.putExtra("from_webview", true);
                        f.this.mContext.startActivity(intent);
                        Intent intent2 = new Intent(za.eqM);
                        intent2.putExtra(za.a.egA, str);
                        f.this.mContext.sendBroadcast(intent2, d.s.dvj);
                        return;
                    }
                    Intent intent3 = new Intent("android.intent.action.VIEW", Uri.parse(str));
                    intent3.addFlags(SQLiteDatabase.CREATE_IF_NECESSARY);
                    f.this.mContext.startActivity(intent3);
                } catch (Exception e2) {
                }
            }
        };
        this.eVl = new HashMap();
        this.eVm = new HashMap();
        this.mContext = context;
        this.eUT = new com.tencent.server.task.g(context);
    }

    @Override
    public View Zm() {
        QLinearLayout qLinearLayout = new QLinearLayout(this.mContext);
        qLinearLayout.setOrientation(1);
        this.eUF = new QLinearLayout(this.mContext);
        this.eUF.setBackgroundResource(bju.c.webview_blue_bg);
        int a2 = arc.a(this.mContext, 55.0f) + BaseActivity.eux;
        if (this.eUK != null) {
            a2 = (int) this.eUK.ain();
        }
        qLinearLayout.addView(this.eUF, new LinearLayout.LayoutParams(-1, a2));
        qLinearLayout.addView((QLinearLayout) Zr().getLayoutInflater().inflate(bju.g.layout_web_ui, (ViewGroup) null), new LinearLayout.LayoutParams(-1, -1));
        return qLinearLayout;
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        View contentView = getContentView();
        this.eUG = (ViewGroup) contentView.findViewById(bju.f.container);
        this.eUH = (WebView) contentView.findViewById(bju.f.webview);
        this.eUJ = (ProgressBar) contentView.findViewById(bju.f.progress);
        this.eUI = contentView.findViewById(bju.f.layout_failmsg);
        this.eUL = (QTextView) this.eUI.findViewById(bju.f.page_err);
        this.eUI.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (f.this.eUH != null) {
                    if (f.this.eUI != null && f.this.eUI.isShown()) {
                        f.this.eUH.clearView();
                        f.this.eUI.setVisibility(4);
                    }
                    f.this.eUH.reload();
                    f.this.Pi();
                }
            }
        });
        if (this.eUH == null) {
            Zr().finish();
        } else {
            Pd();
            Pc();
        }
    }

    private void Pc() {
        try {
            String stringExtra = Zr().getIntent().getStringExtra("bF6efA");
            if (stringExtra != null && this.eUF != null) {
                this.eUF.setBackgroundColor(Color.parseColor(stringExtra));
            }
        } catch (Exception e2) {
        }
    }

    private void Pd() {
        Intent intent = Zr().getIntent();
        try {
            String stringExtra = intent.getStringExtra(meri.pluginsdk.d.egj);
            if (!TextUtils.isEmpty(stringExtra)) {
                JSONObject jSONObject = new JSONObject(stringExtra);
                String optString = jSONObject.optString(za.c.blp);
                String optString2 = jSONObject.optString(za.c.EXTRA_TITLE);
                boolean optBoolean = jSONObject.optBoolean(za.c.egE);
                int optInt = jSONObject.optInt(za.c.egF, 65535);
                String optString3 = jSONObject.optString(za.c.egG);
                String optString4 = jSONObject.optString(za.c.egH);
                String optString5 = jSONObject.optString(za.c.egI);
                if (!TextUtils.isEmpty(optString)) {
                    intent.putExtra("lxKcgA", optString);
                }
                if (!TextUtils.isEmpty(optString2)) {
                    intent.putExtra("HMt1KQ", optString2);
                }
                if (!TextUtils.isEmpty(optString3)) {
                    intent.putExtra("I1dDIA", optString3);
                }
                if (!TextUtils.isEmpty(optString4)) {
                    intent.putExtra("bF6efA", optString4);
                }
                if (!TextUtils.isEmpty(optString5)) {
                    intent.putExtra("p8idlQ", optString5);
                }
                intent.putExtra("xCI79Q", optInt);
                intent.putExtra("XF0wBA", optBoolean);
            }
        } catch (Exception e2) {
        }
        Zr().setIntent(intent);
    }

    private void vr() {
        yz.c(ber.nV().kH(), 260403, 4);
        if (Zr().getIntent().getBooleanExtra(vb.aQS, false)) {
            yz.c(ber.nV().kH(), 260288, 4);
        }
        this.eVa = Zr().getIntent().getIntExtra(za.a.ehQ, -1);
        this.eVb = Zr().getIntent().getStringExtra(za.a.eqR);
        this.eVc = Zr().getIntent().getStringExtra(za.a.eqS);
        String stringExtra = Zr().getIntent().getStringExtra("lxKcgA");
        if (stringExtra != null && stringExtra.equals("file:///sdcard/demo.html") && !new File("/sdcard/demo.html").exists()) {
            stringExtra = "file:///android_asset/demo.html";
        }
        if (stringExtra != null && this.eUH != null) {
            this.eUH.loadUrl(stringExtra);
        } else {
            Zr().finish();
        }
    }

    public void N(int i, boolean z) {
        if (z) {
            this.eUX |= i;
        } else {
            this.eUX &= i ^ (-1);
        }
    }

    @Override
    public void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        Pd();
        Pc();
        vr();
    }

    @Override
    public void WP() {
        super.WP();
        this.eVh = Zr().getIntent().getStringExtra(za.a.evB);
        if (!TextUtils.isEmpty(this.eVh)) {
            this.eVi.append("0-").append(this.eVh);
        }
        if (!TextUtils.isEmpty(this.eVh)) {
            this.eVi.append(",").append("1-").append(String.valueOf(System.currentTimeMillis()));
        }
        Pe();
    }

    @SuppressLint({"SetJavaScriptEnabled"})
    private void Pe() {
        try {
            this.cDY = new HandlerThread("webview-work", -2);
            this.cDY.start();
            this.bvp = new Handler(this.cDY.getLooper());
            this.eUH.setDownloadListener(this.eVk);
            this.eUH.setWebViewClient(new d());
            this.eUH.setWebChromeClient(new c());
            this.eUH.getSettings().setJavaScriptEnabled(true);
            this.eUH.getSettings().setDatabaseEnabled(true);
            this.eUH.getSettings().setDomStorageEnabled(true);
            this.eUH.getSettings().setCacheMode(2);
            if (!Pj()) {
                this.eUH.getSettings().setSupportZoom(true);
                this.eUH.getSettings().setBuiltInZoomControls(true);
            }
            this.eUR = new zb(Zr());
            this.eUS = new a();
            this.eUS.vr();
        } catch (Throwable th) {
        }
        try {
            if (11 <= uc.KF()) {
                this.eUH.getClass().getDeclaredMethod("removeJavascriptInterface", String.class).invoke(this.eUH, "searchBoxJavaBridge_");
            }
        } catch (Throwable th2) {
        }
        vr();
    }

    @Override
    public void onDestroy() {
        try {
            if (this.eUH != null) {
                this.eUH.setVisibility(8);
                this.eUH.stopLoading();
                this.eUH.clearCache(true);
                this.eUG.removeView(this.eUH);
                this.eUH.removeAllViews();
                this.eUH.destroy();
                this.eUH = null;
            }
        } catch (Exception e2) {
        }
        try {
            if (this.eUS != null) {
                this.eUS.destroy();
                this.eUS = null;
            }
            if (this.cDY != null) {
                this.cDY.quit();
            }
        } catch (Exception e3) {
        }
        super.onDestroy();
    }

    public boolean Pf() {
        if (this.eVa != 1) {
            return false;
        }
        Bundle bundle = new Bundle();
        bundle.putInt(za.a.ehQ, this.eVa);
        com.meri.util.f.b(this.mContext, "qqsecure_webview", 0, bundle);
        uilib.components.g.e(QQSecureApplication.getContext(), bju.h.spash_wording);
        this.clZ.postDelayed(new Runnable() {
            @Override
            public void run() {
                f.this.Zr().finish();
            }
        }, 2000L);
        return true;
    }

    @Override
    public boolean onKeyDown(int i, KeyEvent keyEvent) {
        if (i == 4) {
            if (Pf()) {
                return true;
            }
            if (this.eUW) {
                Zr().finish();
                return true;
            }
            if (this.eUH != null && this.eUH.canGoBack()) {
                if (this.eUI != null && this.eUI.isShown()) {
                    this.eUH.clearView();
                    this.eUI.setVisibility(4);
                }
                this.eUH.goBack();
                return true;
            }
            Pl();
        }
        return super.onKeyDown(i, keyEvent);
    }

    @Override
    public void onActivityResult(int i, int i2, Intent intent) {
        super.onActivityResult(i, i2, intent);
        if (i == 100 && this.eUZ != null) {
            this.eUZ.onReceiveValue((intent == null || i2 != -1) ? null : intent.getData());
            this.eUZ = null;
        }
    }

    public class d extends WebViewClient {
        private d() {
        }

        @Override
        public boolean shouldOverrideUrlLoading(WebView webView, String str) {
            if (URLUtil.isNetworkUrl(str)) {
                webView.loadUrl(str);
            } else {
                try {
                    if (!str.startsWith("tel:")) {
                        f.this.eUW = true;
                        Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
                        intent.addFlags(SQLiteDatabase.CREATE_IF_NECESSARY);
                        f.this.mContext.startActivity(intent);
                    } else {
                        f.this.Zr().startActivity(new Intent("android.intent.action.DIAL", Uri.parse(str)));
                    }
                } catch (Exception e) {
                }
            }
            return true;
        }

        @Override
        public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
            super.onPageStarted(webView, str, bitmap);
            f.this.eUV = true;
            f.this.eUP = str;
            f.this.eUU = false;
            if (!f.this.eVg && !TextUtils.isEmpty(f.this.eVh)) {
                f.this.eVg = true;
                f.this.eVj.append(",").append("2-").append(String.valueOf(System.currentTimeMillis()));
            }
        }

        @Override
        public void onPageFinished(WebView webView, String str) {
            try {
                super.onPageFinished(webView, str);
            } catch (Exception e) {
            }
            if (f.this.eUQ == null || !f.this.eUQ.equals(str)) {
                if (webView != null && !f.this.eUU) {
                    String title = webView.getTitle();
                    if (title == null) {
                        title = SQLiteDatabase.KeyEmpty;
                    }
                    f.this.eUK.nK(title);
                }
                f.this.eUX = f.this.eUY;
                new Thread(new Runnable() {
                    @Override
                    public void run() {
                        f.this.Pg();
                    }
                }).start();
            }
            if (f.this.eUO && f.this.eUH.canGoBack()) {
                f.this.eUK.lW(0);
            }
            if (!f.this.eVd && !TextUtils.isEmpty(f.this.eVh)) {
                f.this.eVd = true;
                f.this.eVj.append(",").append("5-").append(String.valueOf(System.currentTimeMillis()));
            }
        }

        @Override
        public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
            f.this.eUV = false;
            super.onReceivedSslError(webView, sslErrorHandler, sslError);
        }

        @Override
        public void onReceivedError(WebView webView, int i, String str, String str2) {
            super.onReceivedError(webView, i, str, str2);
            f.this.eUU = true;
            if (f.this.eUI != null) {
                f.this.eUI.setVisibility(0);
            }
            if (f.this.eUL != null && !TextUtils.isEmpty(f.this.eVc)) {
                f.this.eUL.setText(f.this.eVc);
            }
            try {
                if (!TextUtils.isEmpty(f.this.eVb)) {
                    f.this.eUK.nK(f.this.eVb);
                } else {
                    f.this.eUK.nK(f.this.mContext.getResources().getString(bju.h.wv_webpage_err));
                }
            } catch (Exception e) {
            }
            if (!f.this.eVe && !TextUtils.isEmpty(f.this.eVh)) {
                f.this.eVe = true;
                f.this.eVj.append(",").append("4-").append(String.valueOf(System.currentTimeMillis()));
            }
        }
    }

    public void Pg() {
        byte[] decrypt;
        if (this.eUH != null) {
            try {
                byte[] a2 = i.a(this.mContext, "jsapi.js");
                if (a2 != null && a2.length > 0 && (decrypt = TccCryptor.decrypt(this.mContext, a2, null)) != null && decrypt.length > 0) {
                    final String str = new String(decrypt, "utf-8");
                    this.clZ.post(new Runnable() {
                        @Override
                        public void run() {
                            if (f.this.eUH != null) {
                                f.this.eUH.loadUrl("javascript:" + str);
                                JSONObject jSONObject = new JSONObject();
                                try {
                                    jSONObject.put("logType", tw.kG() ? "alert" : "console");
                                    jSONObject.put("sessionId", "WebSession_" + System.currentTimeMillis());
                                } catch (JSONException e2) {
                                }
                                f.this.eUH.loadUrl(String.format("javascript:handleMessageFromTcs('sys:init', '%s')", jSONObject.toString()));
                            }
                        }
                    });
                }
            } catch (Throwable th) {
            }
        }
    }

    public class c extends WebChromeClient {
        private c() {
        }

        @Override
        public void onProgressChanged(WebView webView, int i) {
            if (!f.this.eVf && i > 0) {
                f.this.eVf = true;
                if (!TextUtils.isEmpty(f.this.eVh)) {
                    f.this.eVj.append(",").append("3-").append(String.valueOf(System.currentTimeMillis()));
                }
            }
            if (i < 100) {
                f.this.eUJ.setVisibility(0);
            } else {
                f.this.eUJ.setVisibility(8);
            }
            f.this.eUJ.setProgress(i);
        }

        @Override
        public void onReceivedTitle(WebView webView, String str) {
            super.onReceivedTitle(webView, str);
            if (!f.this.eUU) {
                if (str == null) {
                    str = SQLiteDatabase.KeyEmpty;
                }
                f.this.eUK.nK(str);
            }
        }

        @Override
        public boolean onJsConfirm(WebView webView, String str, String str2, JsResult jsResult) {
            if (str2 == null) {
                return super.onJsConfirm(webView, str, str2, jsResult);
            }
            if (str2.startsWith("#js_invoke#")) {
                final String substring = str2.substring("#js_invoke#".length());
                if (f.this.bvp != null) {
                    f.this.bvp.post(new Runnable() {
                        @Override
                        public void run() {
                            String str3;
                            String str4;
                            String str5 = null;
                            int i = 0;
                            try {
                                JSONObject jSONObject = new JSONObject(substring);
                                str4 = jSONObject.getString("sessionId");
                                try {
                                    i = jSONObject.getInt("callbackId");
                                    str3 = jSONObject.getString("funcName");
                                    try {
                                        str5 = jSONObject.getString("paramStr");
                                    } catch (JSONException e) {
                                    }
                                } catch (JSONException e2) {
                                    str3 = null;
                                }
                            } catch (JSONException e3) {
                                str3 = null;
                                str4 = null;
                            }
                            if (f.this.eUS != null) {
                                f.this.eUS.invoke(str4, i, str3, str5);
                            }
                        }
                    });
                }
                if (jsResult == null) {
                    return true;
                }
                jsResult.confirm();
                return true;
            }
            if (str2.startsWith("#js_on#")) {
                final String substring2 = str2.substring("#js_on#".length());
                if (f.this.bvp != null) {
                    f.this.bvp.post(new Runnable() {
                        @Override
                        public void run() {
                            String str3;
                            String str4 = null;
                            try {
                                JSONObject jSONObject = new JSONObject(substring2);
                                str3 = jSONObject.getString("sessionId");
                                try {
                                    str4 = jSONObject.getString("eventName");
                                } catch (JSONException e) {
                                }
                            } catch (JSONException e2) {
                                str3 = null;
                            }
                            if (f.this.eUS != null) {
                                f.this.eUS.on(str3, str4);
                            }
                        }
                    });
                }
                if (jsResult == null) {
                    return true;
                }
                jsResult.confirm();
                return true;
            }
            return super.onJsConfirm(webView, str, str2, jsResult);
        }

        public void openFileChooser(ValueCallback<Uri> valueCallback, String str, String str2) {
            f.this.eUZ = valueCallback;
            Intent intent = new Intent("android.intent.action.GET_CONTENT");
            intent.addCategory("android.intent.category.OPENABLE");
            if (TextUtils.isEmpty(str)) {
                intent.setType("image/*");
            } else {
                intent.setType(str);
            }
            ((Activity) f.this.mContext).startActivityForResult(Intent.createChooser(intent, f.this.mContext.getResources().getString(bju.h.wv_file_chooser)), 100);
        }

        public void openFileChooser(ValueCallback<Uri> valueCallback, String str) {
            openFileChooser(valueCallback, str, SQLiteDatabase.KeyEmpty);
        }

        public void openFileChooser(ValueCallback<Uri> valueCallback) {
            openFileChooser(valueCallback, SQLiteDatabase.KeyEmpty, SQLiteDatabase.KeyEmpty);
        }
    }

    public class a implements IApiForJS {
        private C0013a eVC;
        private List<C0015f> eVD;
        private Map<String, Integer> eVE;

        private a() {
            this.eVC = null;
            this.eVD = null;
            this.eVE = null;
        }

        public class C0013a extends BaseReceiver {
            private C0013a() {
            }

            @Override
            public void p(Context context, Intent intent) {
                Boolean bool;
                g.a aVar;
                if (intent != null && intent.getAction() != null) {
                    String action = intent.getAction();
                    if (zb.cZv.equals(action)) {
                        String stringExtra = intent.getStringExtra(zb.cZH);
                        int intExtra = intent.getIntExtra(zb.cZJ, 0);
                        switch (intExtra) {
                            case -5:
                                uilib.components.g.d(context, bju.h.wv_share_not_support);
                                break;
                            case -4:
                            case -3:
                            case -1:
                                uilib.components.g.d(context, bju.h.wv_share_else);
                                break;
                            case 0:
                                uilib.components.g.d(context, bju.h.wv_share_success);
                                if (stringExtra != null) {
                                    synchronized (f.this.eVm) {
                                        bool = (Boolean) f.this.eVm.remove(stringExtra);
                                    }
                                    if (bool != null) {
                                        if (bool.booleanValue()) {
                                            yz.c(ber.nV().kH(), 261130, 4);
                                            break;
                                        } else {
                                            yz.c(ber.nV().kH(), 261131, 4);
                                            break;
                                        }
                                    }
                                }
                                break;
                        }
                        if (stringExtra != null) {
                            synchronized (f.this.eVl) {
                                aVar = (g.a) f.this.eVl.remove(stringExtra);
                            }
                            if (aVar != null) {
                                if (intExtra == 0) {
                                    aVar.onSuccess();
                                    return;
                                } else {
                                    aVar.onError(intExtra);
                                    return;
                                }
                            }
                            return;
                        }
                        return;
                    }
                    if (azr.eiV.equals(action)) {
                        a.this.C(intent);
                        return;
                    }
                    if ("p.c.f.updated".equals(action)) {
                        if (f.this.bvp != null) {
                            f.this.bvp.post(new Runnable() {
                                @Override
                                public void run() {
                                    synchronized (a.this) {
                                        a.this.eVD = a.this.Pr();
                                    }
                                }
                            });
                            return;
                        }
                        return;
                    }
                    if (za.egz.equals(action)) {
                        a.this.B(intent);
                        return;
                    }
                    if (za.eqN.equals(action)) {
                        float floatExtra = intent.getFloatExtra(za.a.eqP, 0.0f);
                        int intExtra2 = intent.getIntExtra(za.a.eqQ, -1);
                        JSONObject jSONObject = new JSONObject();
                        try {
                            jSONObject.put("eventName", "downloadChange");
                            jSONObject.put("state", SQLiteDatabase.KeyEmpty + intExtra2);
                            jSONObject.put("progress", SQLiteDatabase.KeyEmpty + floatExtra);
                            a.this.g(jSONObject);
                        } catch (JSONException e) {
                            e.printStackTrace();
                        }
                    }
                }
            }
        }

        public void vr() {
            if (this.eVC == null) {
                this.eVC = new C0013a();
                IntentFilter intentFilter = new IntentFilter();
                intentFilter.addAction(zb.cZv);
                intentFilter.addAction(azr.eiV);
                intentFilter.addAction("p.c.f.updated");
                intentFilter.addAction(za.egz);
                intentFilter.addAction(za.eqN);
                try {
                    f.this.Zr().registerReceiver(this.eVC, intentFilter, d.s.dvj, null);
                } catch (Exception e) {
                }
            }
        }

        public void destroy() {
            if (this.eVC != null) {
                try {
                    f.this.Zr().unregisterReceiver(this.eVC);
                    this.eVC = null;
                } catch (Exception e) {
                }
            }
        }

        @Override
        public void on(String str, String str2) {
            if (str2 != null && u(str2, false) == 1) {
                f.this.bvp.post(new Runnable() {
                    @Override
                    public void run() {
                    }
                });
            }
        }

        @Override
        public void invoke(final String str, final int i, final String str2, final String str3) {
            if (str2 == null) {
                a(str, i, "check_arg:funcName is null");
                return;
            }
            if ("isTcsWebview".equals(str2)) {
                a(str, i, (Object) true);
                return;
            }
            if ("checkPermission".equals(str2)) {
                a(str, i, Integer.valueOf(u(null, true)));
                yz.c(ber.nV().kH(), 260415, 4);
                return;
            }
            int u = u(str2, true);
            if (u == 2) {
                a(str, i, "access_control:not_allow");
                return;
            }
            if (u == 3) {
                a(str, i, "system:function_not_exist");
                return;
            }
            if ("appKey".equals(str2)) {
                a(str, i, "com.tencent.qqpimsecure");
                f.this.kP(String.valueOf(this.eVE.get("appKey")));
                return;
            }
            if (TMSDKContext.CON_PLATFORM.equals(str2)) {
                a(str, i, "android");
                f.this.kP(String.valueOf(this.eVE.get(TMSDKContext.CON_PLATFORM)));
                return;
            }
            if ("apiVersion".equals(str2)) {
                a(str, i, "20150901");
                f.this.kP(String.valueOf(this.eVE.get("apiVersion")));
                return;
            }
            if ("isQQSecureInstalled".equals(str2)) {
                f.this.bvp.post(new Runnable() {
                    @Override
                    public void run() {
                        a.this.a(str, i, (Object) true);
                        f.this.kP(String.valueOf(a.this.eVE.get("isQQSecureInstalled")));
                    }
                });
                return;
            }
            if ("isQQSecureOfficial".equals(str2)) {
                f.this.bvp.post(new Runnable() {
                    @Override
                    public void run() {
                        a.this.a(str, i, Boolean.valueOf(a.this.Ps()));
                        f.this.kP(String.valueOf(a.this.eVE.get("isQQSecureOfficial")));
                    }
                });
                return;
            }
            if ("getQQSecureVersionCode".equals(str2)) {
                f.this.bvp.post(new Runnable() {
                    @Override
                    public void run() {
                        a.this.a(str, i, Integer.valueOf(com.tencent.server.base.b.bL()));
                        f.this.kP(String.valueOf(a.this.eVE.get("getQQSecureVersionCode")));
                    }
                });
                return;
            }
            if ("getQQSecureVersionName".equals(str2)) {
                f.this.bvp.post(new Runnable() {
                    @Override
                    public void run() {
                        a.this.a(str, i, (Object) TMSDKContext.getStrFromEnvMap(TMSDKContext.CON_SOFTVERSION));
                        f.this.kP(String.valueOf(a.this.eVE.get("getQQSecureVersionName")));
                    }
                });
                return;
            }
            if ("getQQSecureBuildNo".equals(str2)) {
                f.this.bvp.post(new Runnable() {
                    @Override
                    public void run() {
                        a.this.a(str, i, Integer.valueOf(TMSDKContext.getIntFromEnvMap(TMSDKContext.CON_BUILD)));
                        f.this.kP(String.valueOf(a.this.eVE.get("getQQSecureBuildNo")));
                    }
                });
                return;
            }
            if ("shareTimeline".equals(str2) || "sendAppMessage".equals(str2)) {
                final boolean equals = "shareTimeline".equals(str2);
                f.this.bvp.post(new Runnable() {
                    @Override
                    public void run() {
                        if (equals) {
                            f.this.kP(String.valueOf(a.this.eVE.get("shareTimeline")));
                        } else {
                            f.this.kP(String.valueOf(a.this.eVE.get("sendAppMessage")));
                        }
                        if (str3 == null) {
                            a.this.a(str, i, "check_arg:params is null");
                            return;
                        }
                        String str4 = SQLiteDatabase.KeyEmpty;
                        String str5 = SQLiteDatabase.KeyEmpty;
                        try {
                            JSONObject jSONObject = new JSONObject(str3);
                            String string = jSONObject.getString("title");
                            String string2 = jSONObject.getString(azr.b.ejV);
                            try {
                                str4 = jSONObject.getString("link");
                            } catch (JSONException e) {
                            }
                            try {
                                str5 = jSONObject.getString("img_url");
                            } catch (JSONException e2) {
                            }
                            if (string == null) {
                                string = SQLiteDatabase.KeyEmpty;
                            }
                            if (string2 == null) {
                                string2 = SQLiteDatabase.KeyEmpty;
                            }
                            String str6 = str5 == null ? SQLiteDatabase.KeyEmpty : str5;
                            if (za.ff(str4)) {
                                str4 = f.this.eUP == null ? SQLiteDatabase.KeyEmpty : f.this.eUP;
                            }
                            f.this.a(string, string2, str4, str6, (Bitmap) null, equals, new g.a() {
                                @Override
                                public void onSuccess() {
                                    a.this.a(str, i, (Object) 0);
                                }

                                @Override
                                public void onError(int i2) {
                                    a.this.a(str, i, Integer.valueOf(i2));
                                }
                            });
                        } catch (JSONException e3) {
                            a.this.a(str, i, "invoke " + str2 + ", parse arguments exception: " + e3.getMessage());
                        }
                    }
                });
                return;
            }
            if ("gotoQQSecure".equals(str2)) {
                f.this.bvp.post(new AnonymousClass32(str3, str, i, str2));
                return;
            }
            if ("isPkgInstalled".equals(str2)) {
                f.this.bvp.post(new Runnable() {
                    @Override
                    public void run() {
                        String a = a.this.a(str, i, str2, str3, "pkgName", false);
                        if (!za.ff(a)) {
                            a.this.a(str, i, Boolean.valueOf(f.this.kK(a)));
                        }
                        f.this.kP(String.valueOf(a.this.eVE.get("isPkgInstalled")));
                    }
                });
                return;
            }
            if ("getPkgVersionCode".equals(str2)) {
                f.this.bvp.post(new Runnable() {
                    @Override
                    public void run() {
                        String a = a.this.a(str, i, str2, str3, "pkgName", false);
                        if (!za.ff(a)) {
                            a.this.a(str, i, Integer.valueOf(f.this.kL(a)));
                        }
                        f.this.kP(String.valueOf(a.this.eVE.get("getPkgVersionCode")));
                    }
                });
                return;
            }
            if ("getPkgVersionName".equals(str2)) {
                f.this.bvp.post(new Runnable() {
                    @Override
                    public void run() {
                        String a = a.this.a(str, i, str2, str3, "pkgName", false);
                        if (!za.ff(a)) {
                            a.this.a(str, i, (Object) f.this.kM(a));
                        }
                        f.this.kP(String.valueOf(a.this.eVE.get("getPkgVersionName")));
                    }
                });
                return;
            }
            if ("isPkgOfficial".equals(str2)) {
                f.this.bvp.post(new Runnable() {
                    @Override
                    public void run() {
                        if (str3 == null) {
                            a.this.a(str, i, "check_arg:params is null");
                            return;
                        }
                        try {
                            JSONObject jSONObject = new JSONObject(str3);
                            String string = jSONObject.getString("pkgName");
                            String string2 = jSONObject.getString("certMd5");
                            if (za.ff(string) || za.ff(string2)) {
                                a.this.a(str, i, "pkgName and certMd5 must not be null or empty");
                            } else {
                                a.this.a(str, i, Boolean.valueOf(f.this.az(string, string2)));
                            }
                            f.this.kP(String.valueOf(a.this.eVE.get("isPkgOfficial")));
                        } catch (JSONException e) {
                            a.this.a(str, i, "invoke " + str2 + ", parse arguments exception: " + e.getMessage());
                        }
                    }
                });
                return;
            }
            if ("setTitle".equals(str2)) {
                f.this.bvp.post(new Runnable() {
                    @Override
                    public void run() {
                        f.this.kP(String.valueOf(a.this.eVE.get("setTitle")));
                        String a = a.this.a(str, i, str2, str3, "title", true);
                        if (a != null) {
                            a.this.a(str, i, Integer.valueOf(a.this.kS(a)));
                            a.this.kR("titleChange");
                        }
                    }
                });
                return;
            }
            if ("setRightTopBtnShowable".equals(str2)) {
                f.this.bvp.post(new Runnable() {
                    @Override
                    public void run() {
                        if (str3 == null) {
                            a.this.a(str, i, "check_arg:params is null");
                            return;
                        }
                        try {
                            boolean z = new JSONObject(str3).getBoolean("showable");
                            a.this.a(str, i, Integer.valueOf(a.this.bb(z)));
                            if (z) {
                                f.this.kP(String.valueOf(a.this.eVE.get("setRightTopBtnShowable")) + "_show");
                            } else {
                                f.this.kP(String.valueOf(a.this.eVE.get("setRightTopBtnShowable")) + "_hide");
                            }
                        } catch (JSONException e) {
                            a.this.a(str, i, "invoke " + str2 + ", parse arguments exception: " + e.getMessage());
                        }
                    }
                });
                return;
            }
            if ("setMenuItemsShowable".equals(str2)) {
                f.this.bvp.post(new Runnable() {
                    @Override
                    public void run() {
                        int i2 = 0;
                        if (str3 == null) {
                            a.this.a(str, i, "check_arg:params is null");
                            return;
                        }
                        int i3 = -1;
                        try {
                            JSONObject jSONObject = new JSONObject(str3);
                            try {
                                f.this.N(32, jSONObject.getBoolean("share"));
                                i3 = 0;
                            } catch (JSONException e) {
                            }
                            try {
                                f.this.N(1, jSONObject.getBoolean("shareTimeline"));
                                i3 = 0;
                            } catch (JSONException e2) {
                            }
                            try {
                                f.this.N(2, jSONObject.getBoolean("shareFriends"));
                                i3 = 0;
                            } catch (JSONException e3) {
                            }
                            try {
                                f.this.N(4, jSONObject.getBoolean("copyLink"));
                                i3 = 0;
                            } catch (JSONException e4) {
                            }
                            try {
                                f.this.N(8, jSONObject.getBoolean("browser"));
                                i3 = 0;
                            } catch (JSONException e5) {
                            }
                            try {
                                f.this.N(16, jSONObject.getBoolean("refresh"));
                            } catch (JSONException e6) {
                                i2 = i3;
                            }
                            a.this.a(str, i, Integer.valueOf(i2));
                            f.this.kP(String.valueOf(a.this.eVE.get("setMenuItemsShowable")));
                        } catch (JSONException e7) {
                            a.this.a(str, i, "invoke " + str2 + ", parse arguments exception: " + e7.getMessage());
                        }
                    }
                });
                return;
            }
            if ("setThemeColor".equals(str2)) {
                e(str, i, str2, str3);
                return;
            }
            if ("getLocation".equals(str2)) {
                a(f.this.mContext, str, i, str2);
                return;
            }
            if ("share2App".equals(str2)) {
                f(str, i, str2, str3);
                return;
            }
            if ("getQQLoginState".equals(str2)) {
                i(str, i, str2, str3);
                return;
            }
            if ("getQQLoginKey".equals(str2)) {
                l(str, i, str2, str3);
                return;
            }
            if ("loginQQ".equals(str2)) {
                n(str, i, str2, str3);
                return;
            }
            if ("logoutQQ".equals(str2)) {
                q(str, i, str2, str3);
                return;
            }
            if ("getWXLoginState".equals(str2)) {
                j(str, i, str2, str3);
                return;
            }
            if ("loginWX".equals(str2)) {
                o(str, i, str2, str3);
                return;
            }
            if ("getInfo".equals(str2)) {
                g(str, i, str2, str3);
                return;
            }
            if ("launch3rdApp".equals(str2)) {
                h(str, i, str2, str3);
                return;
            }
            if ("sendMessage".equals(str2)) {
                c(str, i, str2, str3);
                return;
            }
            if ("copy2Clipboard".equals(str2)) {
                d(str, i, str2, str3);
            } else if ("toggleSoftInput".equals(str2)) {
                b(str, i, str2, str3);
            } else {
                a(str, i, "system:function_not_exist");
            }
        }

        public class AnonymousClass32 implements Runnable {
            final String eVG;
            final int eVH;
            final String eVI;
            final String eVJ;

            AnonymousClass32(String str, String str2, int i, String str3) {
                this.eVJ = str;
                this.eVG = str2;
                this.eVH = i;
                this.eVI = str3;
            }

            @Override
            public void run() {
                int i;
                int i2;
                final boolean z;
                f.this.kP(String.valueOf(a.this.eVE.get("gotoQQSecure")));
                if (this.eVJ == null) {
                    a.this.a(this.eVG, this.eVH, "check_arg:params is null");
                    return;
                }
                String str = SQLiteDatabase.KeyEmpty;
                String str2 = SQLiteDatabase.KeyEmpty;
                try {
                    JSONObject jSONObject = new JSONObject(this.eVJ);
                    int i3 = jSONObject.getInt("viewId");
                    try {
                        str = jSONObject.getString("str1");
                    } catch (JSONException e) {
                    }
                    try {
                        str2 = jSONObject.getString("str2");
                    } catch (JSONException e2) {
                    }
                    try {
                        i = jSONObject.getInt("int1");
                    } catch (JSONException e3) {
                        i = 0;
                    }
                    try {
                        i2 = jSONObject.getInt("int2");
                    } catch (JSONException e4) {
                        i2 = 0;
                    }
                    try {
                        z = jSONObject.getBoolean("finishSelf");
                    } catch (JSONException e5) {
                        z = false;
                    }
                    a.this.a(this.eVG, this.eVH, Integer.valueOf(a.this.b(i3, str, str2, i, i2)), new b() {
                        @Override
                        public void lY(int i4) {
                            if (z) {
                                f.this.clZ.postDelayed(new Runnable() {
                                    @Override
                                    public void run() {
                                        f.this.Zr().finish();
                                    }
                                }, 2000L);
                            }
                        }
                    });
                } catch (JSONException e6) {
                    a.this.a(this.eVG, this.eVH, "invoke " + this.eVI + ", parse arguments exception: " + e6.getMessage());
                }
            }
        }

        private void b(String str, int i, String str2, String str3) {
            if (!za.ff(str3)) {
                f.this.clZ.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        ((InputMethodManager) f.this.Zr().getSystemService("input_method")).toggleSoftInput(0, 2);
                    }
                }, 500L);
            } else {
                a(str, i, "check_arg:params is null");
            }
        }

        private void c(final String str, final int i, final String str2, final String str3) {
            if (!za.ff(str3)) {
                f.this.bvp.post(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            String optString = new JSONObject(str3).optString(za.a.egC);
                            if (!f.this.eUV) {
                                f.this.kP(String.valueOf(a.this.eVE.get("sendMessage")) + "_" + optString + "_UnTrust");
                                a.this.a(str, i, "check_arg:info_type is null");
                                return;
                            }
                            if (TextUtils.isEmpty(optString)) {
                                a.this.a(str, i, "check_arg:info_type is null");
                                return;
                            }
                            if (!za.d.egK.equals(optString)) {
                                f.this.kP(String.valueOf(a.this.eVE.get("sendMessage")) + "_" + optString);
                            } else {
                                String scheme = Uri.parse(f.this.eUP).getScheme();
                                if (!f.eUE.equals(scheme)) {
                                    f.this.kP(String.valueOf(a.this.eVE.get("sendMessage")) + "_" + optString + "_" + scheme);
                                    a.this.a(str, i, "check_arg:params is null");
                                    return;
                                } else {
                                    ArrayList arrayList = new ArrayList();
                                    arrayList.add(String.valueOf(a.this.eVE.get("sendMessage")) + "_" + optString);
                                    yz.b(ber.nV().kH(), 261186, arrayList, 1);
                                }
                            }
                            String g = f.g("sendMessage", str, i);
                            Intent intent = new Intent(za.egy);
                            intent.putExtra(za.a.egA, str3);
                            intent.putExtra(za.a.egC, optString);
                            intent.putExtra(za.a.egD, g);
                            f.this.mContext.sendBroadcast(intent, d.s.dvj);
                        } catch (Exception e) {
                            a.this.a(str, i, "invoke " + str2 + "exception: " + e.getMessage());
                        }
                    }
                });
            } else {
                a(str, i, "check_arg:params is null");
            }
        }

        private void d(final String str, final int i, final String str2, final String str3) {
            if (!za.ff(str3)) {
                f.this.bvp.post(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            String optString = new JSONObject(str3).optString("info_value");
                            String str4 = optString == null ? SQLiteDatabase.KeyEmpty : optString;
                            ClipboardManager clipboardManager = (ClipboardManager) f.this.Zr().getSystemService("clipboard");
                            if (clipboardManager != null) {
                                clipboardManager.setText(str4);
                                uilib.components.g.B(f.this.Zr(), f.this.mContext.getResources().getString(bju.h.wv_copy_succ));
                            }
                            a.this.a(str, i, (Object) 1);
                            f.this.kP(String.valueOf(a.this.eVE.get("copy2Clipboard")) + "_" + str4);
                        } catch (Exception e) {
                            a.this.a(str, i, "invoke " + str2 + "exception: " + e.getMessage());
                        }
                    }
                });
            } else {
                a(str, i, "check_arg:params is null");
            }
        }

        private void e(final String str, final int i, final String str2, final String str3) {
            if (str3 == null) {
                a(str, i, "check_arg:params is null");
            } else if (f.Po()) {
                f.this.clZ.post(new Runnable() {
                    @Override
                    public void run() {
                        f.this.kP(String.valueOf(a.this.eVE.get("setThemeColor")));
                        int i2 = -1;
                        try {
                            try {
                                f.this.eUF.setBackgroundColor(Color.parseColor(new JSONObject(str3).getString("titleBar")));
                                i2 = 0;
                            } catch (JSONException e) {
                            } catch (Exception e2) {
                                i2 = -3;
                            }
                            a.this.a(str, i, Integer.valueOf(i2));
                        } catch (JSONException e3) {
                            a.this.a(str, i, "invoke " + str2 + ", parse arguments exception: " + e3.getMessage());
                        }
                    }
                });
            } else {
                a(str, i, "not_working_below_android4_4");
            }
        }

        private void f(final String str, final int i, final String str2, final String str3) {
            if (str3 != null) {
                f.this.bvp.post(new Runnable() {
                    @Override
                    public void run() {
                        f.this.kP(String.valueOf(a.this.eVE.get("share2App")));
                        try {
                            final String str4 = SQLiteDatabase.KeyEmpty;
                            final String str5 = SQLiteDatabase.KeyEmpty;
                            final String str6 = SQLiteDatabase.KeyEmpty;
                            final String str7 = SQLiteDatabase.KeyEmpty;
                            JSONObject jSONObject = new JSONObject(str3);
                            final String string = jSONObject.getString(azr.b.ejV);
                            try {
                                str4 = jSONObject.getString("title");
                            } catch (JSONException e) {
                            }
                            if (str4 == null) {
                                str4 = SQLiteDatabase.KeyEmpty;
                            }
                            try {
                                str7 = jSONObject.getString("pkg_name");
                            } catch (JSONException e2) {
                            }
                            try {
                                str5 = jSONObject.getString("img_url");
                            } catch (JSONException e3) {
                            }
                            try {
                                str6 = jSONObject.getString("link");
                            } catch (JSONException e4) {
                            }
                            if (za.ff(str6)) {
                                str6 = f.this.eUP;
                            }
                            final g.a aVar = new g.a() {
                                @Override
                                public void onSuccess() {
                                    a.this.a(str, i, (Object) 0);
                                }

                                @Override
                                public void onError(int i2) {
                                    if (i2 == -101) {
                                        uilib.components.g.d(f.this.mContext, bju.h.wv_no_app_to_share);
                                    } else if (i2 == -100 && !za.ff(str7)) {
                                        uilib.components.g.B(f.this.mContext, String.format(f.this.mContext.getResources().getString(bju.h.wv_share_app_not_installed), com.tencent.server.task.g.sG(str7)));
                                    }
                                    a.this.a(str, i, Integer.valueOf(i2));
                                }
                            };
                            if (za.ff(str7)) {
                                f.this.clZ.post(new Runnable() {
                                    @Override
                                    public void run() {
                                        f.this.a(false, str4, string, str6, str5, (Bitmap) null, aVar);
                                    }
                                });
                            } else {
                                if (str7.equals(aaf.b.dnj)) {
                                    f.this.a(str4, string, str6, str5, (Bitmap) null, false, aVar);
                                    return;
                                }
                                final String str8 = str5;
                                final String str9 = str4;
                                new Thread(new Runnable() {
                                    @Override
                                    public void run() {
                                        f.this.eUT.a(str7, str9, string, (Bitmap) null, !za.ff(str8) ? f.kN(str8) : null, aVar);
                                    }
                                }).start();
                            }
                        } catch (JSONException e5) {
                            a.this.a(str, i, "invoke " + str2 + ", parse arguments exception: " + e5.getMessage());
                        }
                    }
                });
            } else {
                a(str, i, "check_arg:params is null");
            }
        }

        private void a(Context context, String str, int i, String str2) {
            ((aig) s.kD(4)).d(new AnonymousClass14(str, i), "H5_getLocation").start();
        }

        public class AnonymousClass14 implements Runnable {
            final String eVG;
            final int eVH;

            AnonymousClass14(String str, int i) {
                this.eVG = str;
                this.eVH = i;
            }

            @Override
            public void run() {
                f.this.kP(String.valueOf(a.this.eVE.get("getLocation")));
                try {
                    Looper.prepare();
                    final Looper myLooper = Looper.myLooper();
                    tmsdk.common.module.antitheft.d dVar = new tmsdk.common.module.antitheft.d() {
                        boolean eVR = false;

                        @Override
                        public void a(final SOSOMapLBSApiResult sOSOMapLBSApiResult, boolean z) {
                            if (!this.eVR) {
                                this.eVR = true;
                                if (sOSOMapLBSApiResult.ErrorCode == 0 && f.this.eUH != null) {
                                    f.this.clZ.post(new Runnable() {
                                        @Override
                                        public void run() {
                                            JSONObject jSONObject = new JSONObject();
                                            try {
                                                jSONObject.put("sessionId", SQLiteDatabase.KeyEmpty + AnonymousClass14.this.eVG);
                                                jSONObject.put("callbackId", SQLiteDatabase.KeyEmpty + AnonymousClass14.this.eVH);
                                                jSONObject.put("err_msg", "ok");
                                                jSONObject.put("ret", "0");
                                                jSONObject.put("latitude", SQLiteDatabase.KeyEmpty + sOSOMapLBSApiResult.Latitude);
                                                jSONObject.put("longitude", SQLiteDatabase.KeyEmpty + sOSOMapLBSApiResult.Longitude);
                                                jSONObject.put("speed", SQLiteDatabase.KeyEmpty + sOSOMapLBSApiResult.Speed);
                                                jSONObject.put("accuracy", SQLiteDatabase.KeyEmpty + sOSOMapLBSApiResult.Accuracy);
                                            } catch (JSONException e) {
                                                e.printStackTrace();
                                            }
                                            if (f.this.eUH != null) {
                                                f.this.eUH.loadUrl(String.format("javascript:handleMessageFromTcs('onCallback', '%s')", jSONObject.toString()));
                                            }
                                        }
                                    });
                                }
                                Ac();
                            }
                        }

                        @Override
                        public void EB() {
                            if (!this.eVR) {
                                this.eVR = true;
                                a.this.a(AnonymousClass14.this.eVG, AnonymousClass14.this.eVH, (Object) (-2));
                                Ac();
                            }
                        }

                        @Override
                        public void fS() {
                            if (!this.eVR) {
                                this.eVR = true;
                                a.this.a(AnonymousClass14.this.eVG, AnonymousClass14.this.eVH, (Object) (-1));
                                Ac();
                            }
                        }

                        @Override
                        public void Ac() {
                            try {
                                myLooper.quit();
                            } catch (Exception e) {
                                e.printStackTrace();
                            }
                        }
                    };
                    tmsdk.common.module.antitheft.c cVar = (tmsdk.common.module.antitheft.c) qf.i(tmsdk.common.module.antitheft.c.class);
                    cVar.a(dVar);
                    cVar.GD();
                    Looper.loop();
                } catch (Exception e) {
                }
            }
        }

        private void g(final String str, final int i, final String str2, final String str3) {
            f.this.bvp.post(new Runnable() {
                @Override
                public void run() {
                    String string;
                    String str4;
                    String str5;
                    int i2;
                    if (!za.ff(str3)) {
                        try {
                            string = new JSONObject(str3).getString("key");
                        } catch (JSONException e) {
                        }
                        if (!za.ff(string)) {
                            a.this.a(str, i, "invoke " + str2 + ", argument key must be set");
                            return;
                        }
                        if (string.equals("imei")) {
                            try {
                                str5 = ((TelephonyManager) f.this.mContext.getSystemService("phone")).getDeviceId();
                                str4 = null;
                                i2 = 0;
                            } catch (Exception e2) {
                                str4 = e2.getMessage();
                                str5 = null;
                                i2 = 0;
                            }
                        } else if (string.equals(abn.dQx)) {
                            try {
                                str5 = r.afP().aj();
                                str4 = null;
                                i2 = 1;
                            } catch (Exception e3) {
                                str4 = e3.getMessage();
                                str5 = null;
                                i2 = 1;
                            }
                        } else if (string.equals("phone_number")) {
                            try {
                                str5 = ajy.j(f.this.mContext);
                                str4 = null;
                                i2 = 2;
                            } catch (Exception e4) {
                                str4 = e4.getMessage();
                                str5 = null;
                                i2 = 2;
                            }
                        } else if (string.equals(TMSDKContext.CON_LC)) {
                            try {
                                str5 = uf.eu(TMSDKContext.getStrFromEnvMap(TMSDKContext.CON_LC));
                                str4 = null;
                                i2 = 3;
                            } catch (Exception e5) {
                                str4 = e5.getMessage();
                                str5 = null;
                                i2 = 3;
                            }
                        } else if (string.equals("android_os_build_model")) {
                            try {
                                str5 = Build.MODEL;
                                str4 = null;
                                i2 = 4;
                            } catch (Exception e6) {
                                str4 = e6.getMessage();
                                str5 = null;
                                i2 = 4;
                            }
                        } else if (string.equals("android_os_build_version_release")) {
                            try {
                                str5 = Build.VERSION.RELEASE;
                                str4 = null;
                                i2 = 5;
                            } catch (Exception e7) {
                                str4 = e7.getMessage();
                                str5 = null;
                                i2 = 5;
                            }
                        } else {
                            str4 = "unsupported key: " + string;
                            str5 = null;
                            i2 = 99;
                        }
                        if (str4 != null) {
                            a.this.a(str, i, str4);
                        } else {
                            if (str5 == null) {
                                str5 = SQLiteDatabase.KeyEmpty;
                            }
                            a.this.a(str, i, (Object) str5);
                        }
                        new ArrayList().add(Integer.valueOf(i2));
                        ArrayList arrayList = new ArrayList();
                        arrayList.add(String.valueOf(a.this.eVE.get("getInfo")) + "_" + i2);
                        yz.b(ber.nV().kH(), 261186, arrayList, 22);
                        return;
                    }
                    string = null;
                    if (!za.ff(string)) {
                    }
                }
            });
        }

        private void h(final String str, final int i, final String str2, final String str3) {
            f.this.bvp.post(new Runnable() {
                @Override
                public void run() {
                    String str4;
                    String str5;
                    String str6;
                    String str7;
                    String str8;
                    String str9;
                    String str10;
                    Intent intent;
                    Intent intent2;
                    if (za.ff(str3)) {
                        a.this.a(str, i, "check_arg:params is null");
                        return;
                    }
                    try {
                        try {
                            JSONObject jSONObject = new JSONObject(str3);
                            try {
                                str4 = jSONObject.getString("pkgName");
                            } catch (JSONException e) {
                                str4 = null;
                            }
                            try {
                                str5 = jSONObject.getString("signature");
                            } catch (JSONException e2) {
                                str5 = null;
                            }
                            try {
                                str6 = jSONObject.getString("activity");
                            } catch (JSONException e3) {
                                str6 = null;
                            }
                            try {
                                str7 = jSONObject.getString("param");
                            } catch (JSONException e4) {
                                str7 = null;
                            }
                            try {
                                str8 = jSONObject.getString(ys.cxg);
                            } catch (JSONException e5) {
                                str8 = null;
                            }
                            try {
                                str9 = jSONObject.getString("url");
                            } catch (JSONException e6) {
                                str9 = null;
                            }
                            int optInt = jSONObject.optInt("tipType");
                            int optInt2 = jSONObject.optInt("tipTime");
                            String optString = jSONObject.optString("tipMsg");
                            if (str8 != null) {
                                str10 = "1300_action:" + str8;
                                if (!za.ff(str9)) {
                                    intent2 = new Intent(str8, Uri.parse(str9));
                                } else {
                                    intent2 = new Intent(str8);
                                }
                                if (!za.ff(str7)) {
                                    intent2.putExtra("param", str7);
                                }
                                intent2.addFlags(SQLiteDatabase.CREATE_IF_NECESSARY);
                                f.this.Zr().getApplicationContext().startActivity(intent2);
                            } else if (!za.ff(str4)) {
                                if (!f.this.kK(str4)) {
                                    a.this.a(str, i, "app not installed!");
                                    return;
                                }
                                if (!za.ff(str5) && !f.this.az(str4, str5)) {
                                    a.this.a(str, i, "signature not match!");
                                    return;
                                }
                                if (!za.ff(str6)) {
                                    Intent intent3 = new Intent();
                                    intent3.setClassName(str4, str6);
                                    str10 = "1300_" + str4 + "_" + str6;
                                    intent = intent3;
                                } else {
                                    String str11 = "1300_" + str4;
                                    Intent launchIntentForPackage = f.this.mContext.getPackageManager().getLaunchIntentForPackage(str4);
                                    if (launchIntentForPackage == null) {
                                        a.this.a(str, i, "app launch intent not found!");
                                        return;
                                    } else {
                                        str10 = str11;
                                        intent = launchIntentForPackage;
                                    }
                                }
                                if (!za.ff(str7)) {
                                    intent.putExtra("param", str7);
                                }
                                intent.addFlags(SQLiteDatabase.CREATE_IF_NECESSARY);
                                f.this.Zr().getApplicationContext().startActivity(intent);
                                if (!TextUtils.isEmpty(optString) && optInt != -1) {
                                    String str12 = str10 + "_" + optInt;
                                    switch (optInt) {
                                        case 1:
                                            uilib.components.g.F(f.this.Zr(), optString);
                                            str10 = str12;
                                            break;
                                        case 2:
                                            new AccessHelper.b().a(f.this.Zr(), optString, optInt2, -1, -1);
                                            str10 = str12;
                                            break;
                                        case 3:
                                            bxk bxkVar = new bxk();
                                            bxkVar.sA(optString);
                                            bxkVar.a(f.this.Zr(), optInt2, -1, -1);
                                        default:
                                            str10 = str12;
                                            break;
                                    }
                                }
                            } else {
                                a.this.a(str, i, "bad argument, action or pkgName must be set");
                                return;
                            }
                            a.this.a(str, i, (Object) 0);
                            if (str10 != null) {
                                ArrayList arrayList = new ArrayList();
                                arrayList.add(str10);
                                yz.b(ber.nV().kH(), 261186, arrayList, 22);
                            }
                        } catch (Throwable th) {
                            a.this.a(str, i, "invoke " + str2 + ", exception: " + th.getMessage());
                        }
                    } catch (JSONException e7) {
                        a.this.a(str, i, "invoke " + str2 + ", parse arguments exception: " + e7.getMessage());
                    }
                }
            });
        }

        private void i(String str, int i, String str2, String str3) {
            k(str, i, str2, str3);
        }

        private void j(String str, int i, String str2, String str3) {
            k(str, i, str2, str3);
        }

        private void k(final String str, final int i, final String str2, final String str3) {
            f.this.bvp.post(new Runnable() {
                @Override
                public void run() {
                    int i2;
                    boolean equals = "getQQLoginState".equals(str2);
                    if (equals) {
                        f.this.kP(String.valueOf(a.this.eVE.get("getQQLoginState")));
                    } else {
                        f.this.kP(String.valueOf(a.this.eVE.get("getWXLoginState")));
                    }
                    String str4 = null;
                    if (!za.ff(str3)) {
                        try {
                            str4 = new JSONObject(str3).getString(za.e.eqU);
                        } catch (JSONException e) {
                        }
                    }
                    Bundle bundle = new Bundle();
                    if (!za.ff(str4)) {
                        bundle.putInt(meri.pluginsdk.d.bss, azr.c.ekJ);
                        bundle.putInt(azr.b.KEY_ACCOUNT_TYPE, equals ? 1 : 2);
                        bundle.putString(azr.b.ekg, str4);
                    } else {
                        bundle.putInt(meri.pluginsdk.d.bss, azr.c.ekI);
                    }
                    Intent intent = new Intent(azr.eiT);
                    intent.putExtra(azr.eiY, f.g(equals ? "getQQLoginState" : "getWXLoginState", str, i));
                    intent.putExtra(azr.eiW, bundle);
                    try {
                        f.this.mContext.sendBroadcast(intent, d.s.dvj);
                        i2 = 0;
                    } catch (Exception e2) {
                        i2 = -1;
                    }
                    if (i2 != 0) {
                        a.this.a(str, i, Integer.valueOf(i2));
                    }
                }
            });
        }

        public int kQ(String str) {
            if (str.equals("sid")) {
                return 524288;
            }
            if (str.equals("skey")) {
                return 4096;
            }
            if (str.equals("vkey")) {
                return 131072;
            }
            if (str.equals("a2key")) {
                return 64;
            }
            if (str.equals("stwebkey")) {
                return 32;
            }
            if (str.equals("accesstoken")) {
                return 0;
            }
            throw new RuntimeException("unknow keyType: " + str);
        }

        private String lX(int i) {
            switch (i) {
                case 0:
                    return "accesstoken";
                case 32:
                    return "stwebkey";
                case 64:
                    return "a2key";
                case 4096:
                    return "skey";
                case 131072:
                    return "vkey";
                case 524288:
                    return "sid";
                default:
                    throw new RuntimeException("unknow keyType: " + i);
            }
        }

        private void l(String str, int i, String str2, String str3) {
            m(str, i, str2, str3);
        }

        private void m(final String str, final int i, final String str2, final String str3) {
            f.this.bvp.post(new Runnable() {
                @Override
                public void run() {
                    String str4;
                    int i2;
                    String str5 = null;
                    f.this.kP(String.valueOf(a.this.eVE.get("getQQLoginKey")));
                    try {
                        JSONObject jSONObject = new JSONObject(str3);
                        str4 = jSONObject.getString(za.e.eqU);
                        try {
                            str5 = jSONObject.getString("keytype");
                        } catch (JSONException e) {
                        }
                    } catch (JSONException e2) {
                        str4 = null;
                    }
                    if (za.ff(str4) || za.ff(str5)) {
                        a.this.a(str, i, "invoke " + str2 + ", argument uin and keytype must be set");
                        return;
                    }
                    try {
                        Bundle bundle = new Bundle();
                        bundle.putInt(meri.pluginsdk.d.bss, azr.c.ekF);
                        bundle.putInt(azr.b.KEY_ACCOUNT_TYPE, 1);
                        bundle.putString(azr.b.ekg, str4);
                        bundle.putInt(azr.b.ekk, a.this.kQ(str5));
                        Intent intent = new Intent(azr.eiU);
                        intent.putExtra(azr.eiY, f.g("getQQLoginKey", str, i));
                        intent.putExtra(azr.eiW, bundle);
                        f.this.mContext.sendBroadcast(intent, d.s.dvj);
                        i2 = 0;
                    } catch (Exception e3) {
                        i2 = -1;
                    }
                    if (i2 != 0) {
                        a.this.a(str, i, Integer.valueOf(i2));
                    }
                }
            });
        }

        private void n(String str, int i, String str2, String str3) {
            p(str, i, str2, str3);
        }

        private void o(String str, int i, String str2, String str3) {
            p(str, i, str2, str3);
        }

        private void p(final String str, final int i, final String str2, final String str3) {
            f.this.bvp.post(new Runnable() {
                @Override
                public void run() {
                    String str4;
                    boolean z;
                    int i2;
                    String str5 = null;
                    boolean equals = "loginQQ".equals(str2);
                    if (equals) {
                        f.this.kP(String.valueOf(a.this.eVE.get("loginQQ")));
                    } else {
                        f.this.kP(String.valueOf(a.this.eVE.get("loginWX")));
                    }
                    try {
                        JSONObject jSONObject = new JSONObject(str3);
                        z = jSONObject.getBoolean(za.e.eqT);
                        try {
                            str4 = jSONObject.optString(za.e.eqU);
                            try {
                                str5 = jSONObject.optString(za.e.eqV);
                            } catch (JSONException e) {
                            }
                        } catch (JSONException e2) {
                            str4 = null;
                        }
                    } catch (JSONException e3) {
                        str4 = null;
                        z = true;
                    }
                    Bundle bundle = new Bundle();
                    bundle.putInt(meri.pluginsdk.d.bss, azr.c.ekE);
                    if (TextUtils.isEmpty(str5)) {
                        str5 = "WebView";
                    }
                    bundle.putString("source", str5);
                    if (!za.ff(str4)) {
                        bundle.putString(azr.b.ekg, str4);
                    }
                    if (z) {
                        bundle.putInt(azr.b.eke, 1);
                    } else {
                        bundle.putInt(azr.b.eke, 2);
                    }
                    bundle.putInt(azr.b.ekf, equals ? 1 : 2);
                    Intent intent = new Intent(azr.eiU);
                    intent.putExtra(azr.eiY, f.g(equals ? "loginQQ" : "loginWX", str, i));
                    intent.putExtra(azr.eiW, bundle);
                    try {
                        f.this.mContext.sendBroadcast(intent, d.s.dvj);
                        i2 = 0;
                    } catch (Exception e4) {
                        i2 = -1;
                    }
                    if (i2 != 0) {
                        a.this.a(str, i, Integer.valueOf(i2));
                    }
                }
            });
        }

        private void q(String str, int i, String str2, String str3) {
            r(str, i, str2, str3);
        }

        private void r(final String str, final int i, final String str2, final String str3) {
            f.this.bvp.post(new Runnable() {
                @Override
                public void run() {
                    int i2;
                    f.this.kP(String.valueOf(a.this.eVE.get("logoutQQ")));
                    String str4 = null;
                    try {
                        str4 = new JSONObject(str3).getString(za.e.eqU);
                    } catch (JSONException e) {
                    }
                    if (za.ff(str4)) {
                        a.this.a(str, i, "invoke " + str2 + ", argument uin must be set");
                        return;
                    }
                    Bundle bundle = new Bundle();
                    bundle.putInt(meri.pluginsdk.d.bss, azr.c.ekE);
                    bundle.putInt(azr.b.eke, 3);
                    bundle.putInt(azr.b.ekf, 1);
                    bundle.putString(azr.b.ekg, str4);
                    Intent intent = new Intent(azr.eiU);
                    intent.putExtra(azr.eiY, f.g("logoutQQ", str, i));
                    intent.putExtra(azr.eiW, bundle);
                    try {
                        f.this.mContext.sendBroadcast(intent, d.s.dvj);
                        i2 = 0;
                    } catch (Exception e2) {
                        i2 = -1;
                    }
                    if (i2 != 0) {
                        a.this.a(str, i, Integer.valueOf(i2));
                    }
                }
            });
        }

        private boolean i(boolean z, int i) {
            return z ? i == 1 : i == 2;
        }

        public void B(Intent intent) {
            try {
                String stringExtra = intent.getStringExtra(za.a.egD);
                String stringExtra2 = intent.getStringExtra(za.a.egA);
                if (stringExtra2 == null) {
                    stringExtra2 = SQLiteDatabase.KeyEmpty;
                }
                if (stringExtra != null) {
                    String[] split = stringExtra.split("\\|");
                    if (split.length == 5) {
                        a(split[3], Integer.valueOf(split[4]).intValue(), (Object) stringExtra2);
                    }
                }
            } catch (Exception e) {
            }
        }

        public void C(Intent intent) {
            AccountInfo accountInfo;
            String str;
            String str2;
            AccountInfo accountInfo2;
            AccountInfo accountInfo3;
            String str3 = null;
            String stringExtra = intent.getStringExtra(azr.eiY);
            int intExtra = intent.getIntExtra("result_code", 0);
            Bundle bundleExtra = intent.getBundleExtra(azr.eiX);
            String[] split = stringExtra.split("\\|");
            if (split.length == 5) {
                String str4 = split[3];
                String str5 = split[4];
                if (intExtra != 0) {
                    a(str4, Integer.valueOf(str5).intValue(), Integer.valueOf(intExtra));
                    return;
                }
                if (bundleExtra == null) {
                    a(str4, Integer.valueOf(str5).intValue(), (Object) (-1));
                    return;
                }
                final JSONObject jSONObject = new JSONObject();
                try {
                    jSONObject.put("sessionId", str4);
                    jSONObject.put("callbackId", str5);
                    jSONObject.put("err_msg", "ok");
                    jSONObject.put("ret", intExtra);
                } catch (JSONException e) {
                    e.printStackTrace();
                }
                if ("getQQLoginState".equals(split[0]) || "getWXLoginState".equals(split[0])) {
                    boolean equals = "getQQLoginState".equals(split[0]);
                    MainAccountInfo mainAccountInfo = (MainAccountInfo) bundleExtra.getParcelable(azr.b.ekp);
                    if (mainAccountInfo != null) {
                        accountInfo = equals ? mainAccountInfo.dxY : mainAccountInfo.dxZ;
                    } else {
                        accountInfo = (AccountInfo) bundleExtra.getParcelable(azr.b.ekj);
                    }
                    if (accountInfo == null) {
                        str2 = "none";
                        str = null;
                    } else if (!i(equals, accountInfo.type)) {
                        str2 = "none";
                        str = null;
                    } else if (accountInfo.status == 0) {
                        str3 = accountInfo.dxQ;
                        str = accountInfo.name;
                        str2 = "online";
                    } else if (accountInfo.status == 1) {
                        str3 = accountInfo.dxQ;
                        str = accountInfo.name;
                        str2 = "offline";
                    } else if (accountInfo.status == 2) {
                        str3 = accountInfo.dxQ;
                        str = accountInfo.name;
                        str2 = "offline";
                    } else {
                        str = null;
                        str2 = null;
                    }
                    if (str2 != null) {
                        try {
                            jSONObject.put("state", str2);
                        } catch (JSONException e2) {
                            e2.printStackTrace();
                        }
                    }
                    if (str3 != null) {
                        jSONObject.put(za.e.eqU, str3);
                    }
                    if (str != null) {
                        jSONObject.put("name", str);
                    }
                } else if ("getQQLoginKey".equals(split[0])) {
                    int i = bundleExtra.getInt("result");
                    try {
                        jSONObject.put("ret", i);
                    } catch (JSONException e3) {
                        e3.printStackTrace();
                    }
                    if (i == 0) {
                        ArrayList parcelableArrayList = bundleExtra.getParcelableArrayList(azr.b.ekm);
                        String string = bundleExtra.getString(azr.b.ekg);
                        if (parcelableArrayList != null && parcelableArrayList.size() > 0) {
                            Bundle bundle = (Bundle) parcelableArrayList.get(0);
                            int i2 = bundle.getInt("token_type");
                            String string2 = bundle.getString(azr.a.ejg);
                            if (string2 != null) {
                                try {
                                    jSONObject.put("keytype", lX(i2));
                                    jSONObject.put("key", string2);
                                    if (string != null) {
                                        jSONObject.put(za.e.eqU, string);
                                    }
                                } catch (JSONException e4) {
                                } catch (Exception e5) {
                                }
                            }
                        }
                    }
                } else if ("loginQQ".equals(split[0]) || "loginWX".equals(split[0])) {
                    int i3 = bundleExtra.getInt("result");
                    try {
                        jSONObject.put("ret", i3);
                    } catch (JSONException e6) {
                        e6.printStackTrace();
                    }
                    if (i3 == 0 && (accountInfo2 = (AccountInfo) bundleExtra.getParcelable(azr.b.ekj)) != null) {
                        try {
                            jSONObject.put(za.e.eqU, accountInfo2.dxQ);
                            String str6 = accountInfo2.name;
                            if (str6 != null) {
                                jSONObject.put("name", str6);
                            }
                        } catch (JSONException e7) {
                            e7.printStackTrace();
                        }
                    }
                } else if ("logoutQQ".equals(split[0])) {
                    int i4 = bundleExtra.getInt("result");
                    try {
                        jSONObject.put("ret", i4);
                    } catch (JSONException e8) {
                        e8.printStackTrace();
                    }
                    if (i4 == 0 && (accountInfo3 = (AccountInfo) bundleExtra.getParcelable(azr.b.ekj)) != null) {
                        try {
                            jSONObject.put(za.e.eqU, accountInfo3.dxQ);
                        } catch (JSONException e9) {
                            e9.printStackTrace();
                        }
                    }
                }
                if (f.this.eUH != null) {
                    f.this.clZ.post(new Runnable() {
                        @Override
                        public void run() {
                            if (f.this.eUH != null) {
                                f.this.eUH.loadUrl(String.format("javascript:handleMessageFromTcs('onCallback', '%s')", jSONObject.toString()));
                            }
                        }
                    });
                }
            }
        }

        public String a(String str, int i, String str2, String str3, String str4, boolean z) {
            if (str3 == null) {
                a(str, i, "check_arg:params is null");
                return null;
            }
            try {
                String string = new JSONObject(str3).getString(str4);
                if (string == null) {
                    a(str, i, String.format("argument %s must not be null or empty", str4));
                    return null;
                }
                if (z || !SQLiteDatabase.KeyEmpty.equals(string)) {
                    return string;
                }
                a(str, i, String.format("argument %s must not be null or empty", str4));
                return SQLiteDatabase.KeyEmpty;
            } catch (JSONException e) {
                a(str, i, "invoke " + str2 + ", parse arguments exception: " + e.getMessage());
                return null;
            }
        }

        public void kR(String str) {
            JSONObject jSONObject = new JSONObject();
            try {
                jSONObject.put("eventName", SQLiteDatabase.KeyEmpty + str);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            g(jSONObject);
        }

        public void g(final JSONObject jSONObject) {
            if (f.this.eUH != null) {
                f.this.clZ.post(new Runnable() {
                    @Override
                    public void run() {
                        if (f.this.eUH != null) {
                            f.this.eUH.loadUrl(String.format("javascript:handleMessageFromTcs('event:broadcast', '%s')", jSONObject.toString()));
                        }
                    }
                });
            }
        }

        public void a(String str, int i, Object obj) {
            a(str, i, obj, (b) null);
        }

        public void a(final String str, final int i, final Object obj, final b bVar) {
            if (f.this.eUH != null) {
                f.this.clZ.post(new Runnable() {
                    @Override
                    public void run() {
                        JSONObject jSONObject = new JSONObject();
                        try {
                            jSONObject.put("sessionId", SQLiteDatabase.KeyEmpty + str);
                            jSONObject.put("callbackId", SQLiteDatabase.KeyEmpty + i);
                            jSONObject.put("err_msg", "ok");
                            jSONObject.put("ret", SQLiteDatabase.KeyEmpty + obj);
                        } catch (JSONException e) {
                            e.printStackTrace();
                        }
                        if (f.this.eUH != null) {
                            f.this.eUH.loadUrl(String.format("javascript:handleMessageFromTcs('onCallback', '%s')", jSONObject.toString()));
                        }
                        if (bVar != null) {
                            bVar.lY(0);
                        }
                    }
                });
            } else if (bVar != null) {
                bVar.lY(-1);
            }
        }

        public void a(final String str, final int i, final String str2) {
            if (f.this.eUH != null) {
                f.this.clZ.post(new Runnable() {
                    @Override
                    public void run() {
                        JSONObject jSONObject = new JSONObject();
                        try {
                            jSONObject.put("sessionId", SQLiteDatabase.KeyEmpty + str);
                            jSONObject.put("callbackId", SQLiteDatabase.KeyEmpty + i);
                            jSONObject.put("err_msg", SQLiteDatabase.KeyEmpty + str2);
                        } catch (JSONException e) {
                            e.printStackTrace();
                        }
                        if (f.this.eUH != null) {
                            f.this.eUH.loadUrl(String.format("javascript:handleMessageFromTcs('onCallback', '%s')", jSONObject.toString()));
                        }
                    }
                });
            }
        }

        private int u(String str, boolean z) {
            int i;
            String str2 = f.this.eUP;
            if (str2 == null || !URLUtil.isNetworkUrl(str2)) {
                return 2;
            }
            synchronized (this) {
                if (this.eVD == null) {
                    this.eVD = Pr();
                }
                if (this.eVE == null) {
                    this.eVE = Pq();
                }
            }
            try {
                String host = Uri.parse(str2).getHost();
                C0015f c0015f = null;
                synchronized (this) {
                    Iterator<C0015f> it = this.eVD.iterator();
                    while (true) {
                        if (!it.hasNext()) {
                            break;
                        }
                        C0015f next = it.next();
                        if (host.endsWith(next.eWq)) {
                            c0015f = next;
                            break;
                        }
                    }
                }
                if (c0015f == null) {
                    i = 2;
                } else if (!z || str == null) {
                    i = 1;
                } else {
                    synchronized (this) {
                        Integer num = this.eVE.get(str);
                        if (num == null) {
                            return 3;
                        }
                        int intValue = num.intValue();
                        if (c0015f.eWr.size() > 0) {
                            i = c0015f.eWr.contains(Integer.valueOf(intValue)) ? 1 : 2;
                        } else if (c0015f.eWs.size() > 0) {
                            i = c0015f.eWs.contains(Integer.valueOf(intValue)) ? 2 : 1;
                        } else {
                            i = 1;
                        }
                    }
                }
            } catch (Exception e) {
                com.tencent.server.base.b.k(e);
                i = 2;
            }
            return i;
        }

        private Map<String, Integer> Pq() {
            HashMap hashMap = new HashMap();
            hashMap.put("appKey", 3);
            hashMap.put(TMSDKContext.CON_PLATFORM, 4);
            hashMap.put("apiVersion", 5);
            hashMap.put("isTcsWebview", 6);
            hashMap.put("checkPermission", 7);
            hashMap.put("isQQSecureInstalled", 100);
            hashMap.put("isQQSecureOfficial", 101);
            hashMap.put("getQQSecureVersionCode", 102);
            hashMap.put("getQQSecureVersionName", 103);
            hashMap.put("getQQSecureBuildNo", 104);
            hashMap.put("shareTimeline", 300);
            hashMap.put("sendAppMessage", 301);
            hashMap.put("share2App", 302);
            hashMap.put("gotoQQSecure", Integer.valueOf(ap.fr));
            hashMap.put("setTitle", 500);
            hashMap.put("setRightTopBtnShowable", 501);
            hashMap.put("setMenuItemsShowable", 502);
            hashMap.put("setThemeColor", Integer.valueOf(rv.bIO));
            hashMap.put("getLocation", 600);
            hashMap.put("getQQLoginState", Integer.valueOf(TMAssistantDownloadSDKErrorCode.DownloadSDKErrorCode_URL_INVALID));
            hashMap.put("getQQLoginKey", 701);
            hashMap.put("loginQQ", 702);
            hashMap.put("logoutQQ", 703);
            hashMap.put("loginWX", 704);
            hashMap.put("getWXLoginState", 705);
            hashMap.put("isPkgInstalled", 800);
            hashMap.put("isPkgOfficial", 801);
            hashMap.put("getPkgVersionCode", 802);
            hashMap.put("getPkgVersionName", 803);
            hashMap.put("getInfo", Integer.valueOf(hv.FL));
            hashMap.put("launch3rdApp", Integer.valueOf(hv.RJ));
            hashMap.put("sendMessage", 1400);
            hashMap.put("copy2Clipboard", 1500);
            hashMap.put("toggleSoftInput", 1600);
            return hashMap;
        }

        public List<C0015f> Pr() {
            ArrayList<pz> arrayList;
            String[] split;
            String[] split2;
            String str = tmsdk.common.module.update.e.ecS;
            ArrayList arrayList2 = new ArrayList();
            qa qaVar = (qa) z.a(f.this.mContext, str, tmsdk.common.module.update.e.ms(jb.aid), new qa(), "UTF-8");
            if (qaVar != null && (arrayList = qaVar.ig) != null && arrayList.size() > 0) {
                Iterator<pz> it = arrayList.iterator();
                while (it.hasNext()) {
                    pz next = it.next();
                    if (next != null && next.ib != null) {
                        try {
                            C0015f c0015f = new C0015f();
                            c0015f.eWq = next.ib;
                            if (!TextUtils.isEmpty(next.ic) && (split2 = next.ic.split(",")) != null && split2.length > 0) {
                                for (String str2 : split2) {
                                    String trim = str2.trim();
                                    if (!TextUtils.isEmpty(trim)) {
                                        c0015f.eWr.add(Integer.valueOf(trim));
                                    }
                                }
                            }
                            if (!TextUtils.isEmpty(next.ie) && (split = next.ie.split(",")) != null && split.length > 0) {
                                for (String str3 : split) {
                                    String trim2 = str3.trim();
                                    if (!TextUtils.isEmpty(trim2)) {
                                        c0015f.eWs.add(Integer.valueOf(trim2));
                                    }
                                }
                            }
                            arrayList2.add(c0015f);
                        } catch (Exception e) {
                            com.tencent.server.base.b.k(e);
                        }
                    }
                }
            }
            if (arrayList2.isEmpty()) {
                C0015f c0015f2 = new C0015f();
                c0015f2.eWq = ".qq.com";
                arrayList2.add(c0015f2);
            }
            return arrayList2;
        }

        public boolean Ps() {
            sd e;
            aif aifVar = (aif) s.kD(12);
            if (aifVar == null || (e = aifVar.e("com.tencent.qqpimsecure", 16)) == null) {
                return false;
            }
            return "00B1208638DE0FCD3E920886D658DAF6".equalsIgnoreCase(e.sz());
        }

        public int b(int i, String str, String str2, int i2, int i3) {
            if (i != -1) {
                Bundle bundle = new Bundle();
                bundle.putString(za.f.eqW, str);
                bundle.putString(za.f.eqX, str2);
                bundle.putInt(za.f.eqY, i2);
                bundle.putInt(za.f.eqZ, i3);
                if (f.this.eVa == 1) {
                    bundle.putInt(za.a.ehQ, f.this.eVa);
                }
                com.meri.util.f.b(f.this.mContext, "qqsecure_webview", i, bundle);
            }
            return 0;
        }

        public int kS(final String str) {
            if (f.this.eUK == null) {
                return -1;
            }
            if (str != null) {
                f.this.clZ.post(new Runnable() {
                    @Override
                    public void run() {
                        f.this.eUK.nK(str);
                    }
                });
                return 0;
            }
            return -2;
        }

        public int bb(final boolean z) {
            if (f.this.eUK != null) {
                f.this.clZ.post(new Runnable() {
                    @Override
                    public void run() {
                        f.this.eUK.fd(z);
                    }
                });
                return 0;
            }
            return -1;
        }
    }

    public boolean kK(String str) {
        aif aifVar;
        if (str != null && (aifVar = (aif) s.kD(12)) != null) {
            return aifVar.df(str);
        }
        return false;
    }

    public boolean az(String str, String str2) {
        sd e2;
        if (str == null || str2 == null) {
            return false;
        }
        aif aifVar = (aif) s.kD(12);
        if (aifVar == null || (e2 = aifVar.e(str, 16)) == null) {
            return false;
        }
        return str2.equalsIgnoreCase(e2.sz());
    }

    public int kL(String str) {
        sd e2;
        if (str == null) {
            return 0;
        }
        aif aifVar = (aif) s.kD(12);
        if (aifVar == null || (e2 = aifVar.e(str, 8)) == null) {
            return 0;
        }
        return e2.bL();
    }

    public String kM(String str) {
        aif aifVar;
        sd e2;
        if (str != null && (aifVar = (aif) s.kD(12)) != null && (e2 = aifVar.e(str, 8)) != null) {
            return e2.getVersion();
        }
        return "0.0.0";
    }

    public boolean Ph() {
        String kM = kM(aaf.b.dnj);
        return kM == null || !kM.contains("6.0.2");
    }

    public void a(final String str, final String str2, final String str3, final String str4, final Bitmap bitmap, final boolean z, final g.a aVar) {
        if (!this.eUR.isWXAppInstalled()) {
            uilib.components.g.d(this.mContext, bju.h.wv_share_wx_not_installed);
            if (aVar != null) {
                aVar.onError(-1000);
                return;
            }
            return;
        }
        if (!this.eUR.isWXAppSupportAPI()) {
            uilib.components.g.d(this.mContext, bju.h.wv_share_not_support);
            if (aVar != null) {
                aVar.onError(util.E_PENDING);
                return;
            }
            return;
        }
        if (z && !this.eUR.rm()) {
            uilib.components.g.d(this.mContext, bju.h.wv_share_not_support);
            if (aVar != null) {
                aVar.onError(util.E_DECRYPT);
                return;
            }
            return;
        }
        new Thread(new Runnable() {
            @Override
            public void run() {
                File kN;
                String O = zb.O(zb.cZu, SQLiteDatabase.KeyEmpty + f.Pp());
                boolean Ph = f.this.Ph();
                if (aVar != null && Ph) {
                    synchronized (f.this.eVl) {
                        f.this.eVl.put(O, aVar);
                    }
                    synchronized (f.this.eVm) {
                        f.this.eVm.put(O, Boolean.valueOf(z));
                    }
                }
                try {
                    if (bitmap != null) {
                        f.this.eUR.a(str, str2, str3, bitmap, z, O);
                    } else {
                        Bitmap bitmap2 = null;
                        if (!za.ff(str4) && (kN = f.kN(str4)) != null && kN.exists()) {
                            bitmap2 = ajg.eg(kN.getAbsolutePath());
                        }
                        if (bitmap2 == null) {
                            bitmap2 = BitmapFactory.decodeResource(f.this.mContext.getResources(), bju.e.pic_empty);
                        }
                        f.this.eUR.a(str, str2, str3, bitmap2, z, O);
                    }
                    if (aVar != null && !Ph) {
                        aVar.onSuccess();
                    }
                } catch (Exception e2) {
                    synchronized (f.this.eVl) {
                        f.this.eVl.remove(O);
                        synchronized (f.this.eVm) {
                            f.this.eVm.remove(O);
                        }
                    }
                }
            }
        }).start();
    }

    public void a(final boolean z, final String str, final String str2, final String str3, final String str4, final Bitmap bitmap, final g.a aVar) {
        final uilib.components.e eVar = new uilib.components.e(Zr());
        eVar.setTitle(Zr().getResources().getString(bju.h.share_for_friend_sms));
        eVar.eK(false);
        ArrayList arrayList = new ArrayList();
        List<g.b> aLZ = this.eUT.aLZ();
        if (aLZ == null || aLZ.isEmpty()) {
            if (aVar != null) {
                aVar.onError(-101);
                return;
            }
            return;
        }
        Resources resources = Zr().getResources();
        for (g.b bVar : aLZ) {
            aqh aqhVar = new aqh(resources.getDrawable(bVar.gtb), bVar.bcc);
            aqhVar.mF(3);
            aqhVar.setTag(bVar);
            aqhVar.a(new uilib.components.item.b() {
                @Override
                public void a(aow aowVar, int i) {
                    if (eVar != null) {
                        eVar.dismiss();
                    }
                    if (aowVar != null) {
                        final g.b bVar2 = (g.b) aowVar.getTag();
                        if (bVar2.gta.activityInfo.packageName.equals(aaf.b.dnj)) {
                            boolean z2 = bVar2.gsZ == g.c.WeiXinTime;
                            if (z) {
                                if (z2) {
                                    yz.c(ber.nV().kH(), 260406, 4);
                                } else {
                                    yz.c(ber.nV().kH(), 260407, 4);
                                }
                            }
                            f.this.a(str, str2, str3, str4, bitmap, z2, aVar);
                            return;
                        }
                        new Thread(new Runnable() {
                            @Override
                            public void run() {
                                File file = null;
                                if (!za.ff(str4)) {
                                    file = f.kN(str4);
                                }
                                f.this.eUT.a(bVar2.gta, str, str2 + " 地址:" + str3, bitmap, file, aVar);
                            }
                        }).start();
                    }
                }
            });
            if (aqhVar != null) {
                arrayList.add(aqhVar);
            }
        }
        eVar.a(Zr().getResources().getString(bju.h.cancel), new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (eVar != null) {
                    eVar.dismiss();
                }
            }
        });
        eVar.G(arrayList);
        eVar.show();
    }

    public static File kN(String str) {
        InputStream inputStream;
        FileOutputStream fileOutputStream;
        InputStream inputStream2;
        FileOutputStream fileOutputStream2 = null;
        File file = new File(ajk.csT);
        int hashCode = str.hashCode();
        String str2 = hashCode >= 0 ? SQLiteDatabase.KeyEmpty + hashCode : SQLiteDatabase.KeyEmpty + hashCode + "_";
        File file2 = new File(file, str2 + ".temp");
        File file3 = new File(file, str2 + ".imgf");
        if (file3.exists()) {
            return file3;
        }
        if (URLUtil.isNetworkUrl(str) && "mounted".equals(Environment.getExternalStorageState())) {
            try {
                if (file2.exists()) {
                    file2.delete();
                }
                file2.getAbsoluteFile().getParentFile().mkdirs();
                file2.createNewFile();
                HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(str).openConnection();
                httpURLConnection.setConnectTimeout(5000);
                httpURLConnection.setRequestMethod("GET");
                httpURLConnection.setDoInput(true);
                if (httpURLConnection.getResponseCode() == 200) {
                    inputStream = httpURLConnection.getInputStream();
                    try {
                        fileOutputStream = new FileOutputStream(file2);
                    } catch (Exception e2) {
                        fileOutputStream = null;
                        inputStream2 = inputStream;
                        if (inputStream2 != null) {
                            try {
                                inputStream2.close();
                            } catch (IOException e3) {
                            }
                        }
                        if (fileOutputStream != null) {
                            try {
                                fileOutputStream.close();
                            } catch (IOException e4) {
                            }
                        }
                        if (file2.exists()) {
                        }
                        return null;
                    } catch (Throwable th) {
                        th = th;
                        if (inputStream != null) {
                            try {
                                inputStream.close();
                            } catch (IOException e5) {
                            }
                        }
                        if (fileOutputStream2 != null) {
                            throw th;
                        }
                        try {
                            fileOutputStream2.close();
                            throw th;
                        } catch (IOException e6) {
                            throw th;
                        }
                    }
                    try {
                        byte[] bArr = new byte[1024];
                        while (true) {
                            int read = inputStream.read(bArr);
                            if (read == -1) {
                                break;
                            }
                            fileOutputStream.write(bArr, 0, read);
                        }
                        fileOutputStream.flush();
                    } catch (Exception e7) {
                        inputStream2 = inputStream;
                        if (inputStream2 != null) {
                        }
                        if (fileOutputStream != null) {
                        }
                        if (file2.exists()) {
                        }
                        return null;
                    } catch (Throwable th2) {
                        fileOutputStream2 = fileOutputStream;
                        th = th2;
                        if (inputStream != null) {
                        }
                        if (fileOutputStream2 != null) {
                        }
                    }
                } else {
                    fileOutputStream = null;
                    inputStream = null;
                }
            } catch (Exception e8) {
                fileOutputStream = null;
                inputStream2 = null;
            } catch (Throwable th3) {
                th = th3;
                inputStream = null;
            }
            if (file2.renameTo(file3)) {
                file2.delete();
                if (inputStream != null) {
                    try {
                        inputStream.close();
                    } catch (IOException e9) {
                    }
                }
                if (fileOutputStream != null) {
                    try {
                        fileOutputStream.close();
                    } catch (IOException e10) {
                    }
                }
                return file3;
            }
            if (inputStream != null) {
                try {
                    inputStream.close();
                } catch (IOException e11) {
                }
            }
            if (fileOutputStream != null) {
                try {
                    fileOutputStream.close();
                } catch (IOException e12) {
                }
            }
            if (file2.exists()) {
                file2.delete();
            }
            return null;
        }
        return null;
    }

    @Override
    public uilib.frame.b Zl() {
        this.eUY = Zr().getIntent().getIntExtra("xCI79Q", 16);
        this.eUX = this.eUY;
        String stringExtra = Zr().getIntent().getStringExtra("HMt1KQ");
        if (stringExtra == null) {
            stringExtra = SQLiteDatabase.KeyEmpty;
        }
        this.eUK = new com.tencent.qqpimsecure.h5.e(this.mContext, stringExtra, true);
        this.eUK.kJ(aqz.dIm);
        this.eUN = Zr().getIntent().getBooleanExtra(za.a.ecd, false);
        boolean booleanExtra = Zr().getIntent().getBooleanExtra(za.a.eqO, false);
        try {
            if (this.eUX == 16) {
                this.eUK.p(Zr().getResources().getDrawable(bju.e.webview_menu_refresh_selector));
            } else {
                this.eUK.p(Zr().getResources().getDrawable(bju.e.webview_menu_btn_selector));
            }
            if (this.eUN) {
                this.eUO = booleanExtra;
            } else {
                this.eUK.q(Zr().getResources().getDrawable(bju.e.webview_lefttop_selector));
            }
        } catch (Exception e2) {
        }
        if (Zr().getIntent().getBooleanExtra("XF0wBA", false)) {
            this.eUK.fd(false);
        } else {
            this.eUK.fd(true);
        }
        this.eUM = new e();
        this.eUK.c(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (f.this.eUX == 16) {
                    if (f.this.eUH != null) {
                        if (f.this.eUI != null && f.this.eUI.isShown()) {
                            f.this.eUH.clearView();
                            f.this.eUI.setVisibility(4);
                        }
                        f.this.eUH.reload();
                        f.this.Pi();
                    }
                    yz.c(com.tencent.server.base.b.aKo(), 260410, 4);
                    return;
                }
                yz.c(com.tencent.server.base.b.aKo(), 260408, 4);
                f.this.eUM.onClick(view);
            }
        });
        this.eUK.b(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (!f.this.Pf()) {
                    if (f.this.eUN) {
                        if (f.this.eUH == null || !f.this.eUH.canGoBack()) {
                            f.this.Pl();
                            f.this.Zr().finish();
                            return;
                        }
                        if (f.this.eUI != null && f.this.eUI.isShown()) {
                            f.this.eUH.clearView();
                            f.this.eUI.setVisibility(4);
                        }
                        f.this.eUH.goBack();
                        return;
                    }
                    f.this.Pl();
                    f.this.Zr().finish();
                }
            }
        });
        this.eUK.d(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                f.this.Pl();
                f.this.Zr().finish();
            }
        });
        return this.eUK;
    }

    private class e extends com.tencent.qqpimsecure.h5.b {
        private e() {
        }

        public void Pt() {
            if (f.this.eUH != null) {
                final String title = f.this.eUH.getTitle();
                final String url = f.this.eUH.getUrl();
                if (title == null) {
                    title = SQLiteDatabase.KeyEmpty;
                }
                if (url == null) {
                    url = SQLiteDatabase.KeyEmpty;
                }
                final String format = String.format(f.this.mContext.getResources().getString(bju.h.wv_share_desc_format), title);
                f.this.bvp.post(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            yz.c(ber.nV().kH(), 260736, 4);
                            final Bitmap bitmap = null;
                            try {
                                WebView webView = f.this.eUH;
                                webView.setDrawingCacheEnabled(true);
                                webView.buildDrawingCache();
                                bitmap = webView.getDrawingCache().copy(Bitmap.Config.ARGB_8888, false);
                            } catch (Throwable th) {
                            }
                            if (bitmap == null) {
                                bitmap = BitmapFactory.decodeResource(f.this.mContext.getResources(), bju.e.pic_empty);
                            }
                            final g.a aVar = new g.a() {
                                @Override
                                public void onSuccess() {
                                }

                                @Override
                                public void onError(int i) {
                                }
                            };
                            f.this.clZ.post(new Runnable() {
                                @Override
                                public void run() {
                                    f.this.a(true, title, format, url, (String) null, bitmap, aVar);
                                }
                            });
                        } catch (Exception e) {
                        }
                    }
                });
            }
        }

        @Override
        public void OY() {
            List<g.b> aLZ;
            int i;
            super.OY();
            final com.tencent.qqpimsecure.h5.d OX = OX();
            OX.Pb();
            if (za.ff(f.this.eUP) || (!f.this.kO(f.this.eUP) && !URLUtil.isNetworkUrl(f.this.eUP))) {
                if ((f.this.eUX & 16) != 0) {
                    OX.a(0, f.this.mContext.getResources().getString(bju.h.wv_refresh), f.this.mContext.getResources().getDrawable(bju.e.icon_freshen), false, new View.OnClickListener() {
                        @Override
                        public void onClick(View view) {
                            OX.dismiss();
                            if (f.this.eUH != null) {
                                f.this.eUH.reload();
                                f.this.Pi();
                            }
                            yz.c(ber.nV().kH(), 260410, 4);
                        }
                    });
                    return;
                }
                return;
            }
            if (((f.this.eUX & 32) == 0 && (f.this.eUX & 1) == 0 && (f.this.eUX & 2) == 0) || (aLZ = f.this.eUT.aLZ()) == null || aLZ.isEmpty()) {
                i = 0;
            } else {
                OX.a(0, f.this.mContext.getResources().getString(bju.h.wv_share_for_friend), f.this.mContext.getResources().getDrawable(bju.e.icon_sharefriend), false, new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        OX.dismiss();
                        e.this.Pt();
                    }
                });
                i = 1;
            }
            if ((f.this.eUX & 4) != 0) {
                OX.a(i, f.this.mContext.getResources().getString(bju.h.wv_copy_link), f.this.mContext.getResources().getDrawable(bju.e.icon_copy), false, new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        ClipboardManager clipboardManager;
                        OX.dismiss();
                        if (f.this.eUH != null && (clipboardManager = (ClipboardManager) f.this.Zr().getSystemService("clipboard")) != null) {
                            String url = f.this.eUH.getUrl();
                            if (url == null) {
                                url = SQLiteDatabase.KeyEmpty;
                            }
                            clipboardManager.setText(url);
                            uilib.components.g.B(f.this.Zr(), f.this.mContext.getResources().getString(bju.h.wv_copy_link_succ));
                        }
                        yz.c(ber.nV().kH(), 260409, 4);
                    }
                });
                i++;
            }
            if ((f.this.eUX & 8) != 0) {
                OX.a(i, f.this.mContext.getResources().getString(bju.h.wv_open_in_browser), f.this.mContext.getResources().getDrawable(bju.e.icon_browser), false, new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        OX.dismiss();
                        if (f.this.eUH != null) {
                            try {
                                String url = f.this.eUH.getUrl();
                                if (url == null) {
                                    url = SQLiteDatabase.KeyEmpty;
                                }
                                akn.b(f.this.mContext, url, 0);
                            } catch (Exception e) {
                                uilib.components.g.e(f.this.mContext, bju.h.wv_open_sys_browser_fail);
                            }
                        }
                        yz.c(ber.nV().kH(), 260411, 4);
                    }
                });
                i++;
            }
            if ((f.this.eUX & 16) != 0) {
                OX.a(i, f.this.mContext.getResources().getString(bju.h.wv_refresh), f.this.mContext.getResources().getDrawable(bju.e.icon_freshen), false, new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        OX.dismiss();
                        if (f.this.eUH != null) {
                            if (f.this.eUI != null && f.this.eUI.isShown()) {
                                f.this.eUH.clearView();
                                f.this.eUI.setVisibility(4);
                            }
                            f.this.eUH.reload();
                            f.this.Pi();
                        }
                        yz.c(ber.nV().kH(), 260410, 4);
                    }
                });
            }
        }

        @Override
        protected com.tencent.qqpimsecure.h5.d OW() {
            return new com.tencent.qqpimsecure.h5.d(f.this.mContext, bju.e.bg_popup_menu_top);
        }
    }

    public void Pi() {
        this.eVd = false;
        this.eVe = false;
        this.eVg = false;
        this.eVf = false;
        this.eVj = new StringBuilder();
    }

    public boolean kO(String str) {
        if (str == null) {
            return false;
        }
        return str.equals("file:///android_asset/demo.html") || str.equals("file:///sdcard/demo.html");
    }

    public static boolean Pj() {
        return Build.MODEL.toLowerCase().startsWith("oms");
    }

    private static boolean Pk() {
        return uc.KF() >= 19 && !Build.MODEL.startsWith("MX");
    }

    public static String g(String str, String str2, int i) {
        return str + "|" + Pm() + "|" + eVo + "|" + str2 + "|" + i;
    }

    public void kP(String str) {
        ArrayList arrayList = new ArrayList();
        arrayList.add(str);
        yz.b(ber.nV().kH(), 261186, arrayList, 4);
    }

    public void Pl() {
        if (!TextUtils.isEmpty(this.eVh)) {
            this.eVj.append(",").append("6-").append(String.valueOf(System.currentTimeMillis()));
            ArrayList arrayList = new ArrayList();
            arrayList.add(this.eVi.toString() + this.eVj.toString());
            yz.b(ber.nV().kH(), 261696, arrayList, 4);
        }
    }

    private static int Pm() {
        int i;
        synchronized (WebView.class) {
            if (eVn + 1 == Integer.MAX_VALUE) {
                eVn = 0;
            }
            i = eVn + 1;
            eVn = i;
        }
        return i;
    }

    public class C0015f {
        private String eWq;
        private List<Integer> eWr;
        private List<Integer> eWs;

        private C0015f() {
            this.eWq = SQLiteDatabase.KeyEmpty;
            this.eWr = new ArrayList();
            this.eWs = new ArrayList();
        }
    }
}