百度手机卫士 v8.4.5版本的 MD5 值为:c65ef854a40bb6200c4d8c4603c58403

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


package com.dianxinos.optimizer.web;

import android.annotation.TargetApi;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.IContentProvider;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.Process;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.inputmethod.InputMethodManager;
import android.webkit.WebView;
import android.widget.AutoCompleteTextView;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import cn.opda.a.phonoalbumshoushou.R;
import com.dianxinos.optimizer.ui.DxTitleBar;
import com.dianxinos.optimizer.utils.HttpUtils;
import dxoptimizer.aei;
import dxoptimizer.afv;
import dxoptimizer.ayi;
import dxoptimizer.ayj;
import dxoptimizer.gbs;
import dxoptimizer.gbw;
import dxoptimizer.hfl;
import dxoptimizer.hkn;
import dxoptimizer.hmr;
import dxoptimizer.hqo;
import dxoptimizer.hrf;
import dxoptimizer.hsm;
import dxoptimizer.hsx;
import dxoptimizer.hsy;
import dxoptimizer.htc;
import dxoptimizer.htd;
import dxoptimizer.hte;
import dxoptimizer.htg;
import dxoptimizer.hth;
import dxoptimizer.hti;
import dxoptimizer.htj;
import dxoptimizer.htm;
import dxoptimizer.htt;
import dxoptimizer.hzm;
import dxoptimizer.iaf;
import dxoptimizer.iii;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;

public class WebBrowserActivity extends afv implements View.OnClickListener, View.OnFocusChangeListener, TextView.OnEditorActionListener, aei, ayj {
    private String D;
    private boolean H;
    private DxTitleBar q;
    private ImageButton r;
    private AutoCompleteTextView s;
    private ImageView t;
    private ImageView u;
    private ImageView v;
    private LinearLayout w;
    private LinearLayout x;
    private ProgressBar y;
    private Handler z;
    private boolean p = false;
    private List A = new ArrayList();
    private String B = null;
    private String C = null;
    private boolean E = false;
    private boolean F = false;
    private boolean G = false;
    private boolean I = false;

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.jadx_deobf_0x00000a43);
        this.z = new ayi(this);
        q();
        r();
    }

    private void q() {
        Intent intent = getIntent();
        this.H = htm.a(intent, "extra_box_enable", false);
        if (this.H) {
            this.x = (LinearLayout) findViewById(R.id.jadx_deobf_0x00001c08);
            this.x.setVisibility(0);
            this.t = (ImageView) findViewById(R.id.jadx_deobf_0x00001c0c);
            this.t.setOnClickListener(this);
            this.s = (AutoCompleteTextView) findViewById(R.id.jadx_deobf_0x00001c0b);
            this.s.setOnClickListener(this);
            this.s.setOnFocusChangeListener(this);
            this.s.setOnEditorActionListener(this);
            this.u = (ImageButton) findViewById(R.id.jadx_deobf_0x00001c0e);
            this.u.setOnClickListener(this);
            this.v = (ImageView) findViewById(R.id.jadx_deobf_0x00001c09);
            this.v.setOnClickListener(this);
            hfl.a(this).a("msgbox", "wb_b", 1, false);
        } else {
            this.q = (DxTitleBar) findViewById(R.id.jadx_deobf_0x0000100c);
            this.q.setVisibility(0);
            this.q.a((aei) this);
            String b = htm.b(intent, "extra_title");
            this.F = htm.a(intent, "extra_webtitle", false);
            this.E = htm.a(intent, "extra_share", false);
            this.B = htm.b(intent, "extra_share_info");
            if (b != null) {
                this.q.a(b);
            }
        }
        this.w = (LinearLayout) findViewById(R.id.jadx_deobf_0x00001c10);
        this.y = (ProgressBar) findViewById(R.id.jadx_deobf_0x00001c0f);
        this.C = htm.b(intent, "extra_url");
        if (this.C == null) {
            this.C = iii.a();
        }
    }

    private void r() {
        a(6);
        hkn.a().b(new htg(this));
    }

    private void s() {
        a(new hsy(this), new htd(this), new htc(this), new hte(this), new hsx(this));
        View i = i();
        if (i != null) {
            ViewGroup.LayoutParams layoutParams = i.getLayoutParams();
            if (layoutParams == null) {
                layoutParams = new LinearLayout.LayoutParams(-1, -1, 1.0f);
            }
            layoutParams.width = -1;
            layoutParams.height = -1;
            i.setLayoutParams(layoutParams);
        }
        this.w.addView(i);
    }

    private void t() {
        if (TextUtils.isEmpty(this.D)) {
            htt.b(this, R.string.jadx_deobf_0x00002763, 0);
            return;
        }
        if (hrf.g(this, "com.baidu.searchbox") && hrf.h(this, "com.baidu.searchbox")) {
            e("com.baidu.searchbox");
            hfl.a(this).a("msgbox", "wb_ub", 1, false);
        } else if (hrf.g(this, "com.android.browser") && hrf.h(this, "com.android.browser")) {
            e("com.android.browser");
            hfl.a(this).a("msgbox", "wb_us", 1, false);
        } else if (!hsm.a(this, "http://m.baidu.com/s?from=1009596a&word=" + this.D).booleanValue()) {
            htt.b(this, R.string.jadx_deobf_0x00002761, 0);
        }
    }

    private void e(String str) {
        try {
            Intent intent = new Intent("android.intent.action.VIEW", Uri.parse("https://sjws-rts.baidu.com/rts/rd?" + HttpUtils.a("url", "http://m.baidu.com/s?from=1009596a&word=" + this.D)));
            intent.putExtra("com.android.browser.application_id", getPackageName());
            intent.setPackage(str);
            intent.addFlags(268435456);
            startActivity(intent);
        } catch (ActivityNotFoundException e) {
        }
    }

    private void f(String str) {
        iaf a = iaf.a(this.s, "y", 0.0f, -100.0f);
        a.b(200L);
        a.a((hzm) new hth(this, str));
        a.a();
    }

    private void u() {
        hkn.a().b(new hti(this));
    }

    public ArrayList v() {
        String a = htj.a(this);
        ArrayList arrayList = new ArrayList();
        if (a != null) {
            try {
                JSONArray jSONArray = new JSONArray(a);
                for (int i = 0; i < jSONArray.length(); i++) {
                    arrayList.add(jSONArray.getJSONObject(i).getString("keyword"));
                }
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
        return arrayList;
    }

    @Override
    protected void onStart() {
        super.onStart();
        if (!this.p) {
            k();
            this.p = true;
        }
    }

    @TargetApi(IContentProvider.CALL_TRANSACTION)
    protected void k() {
        if (Build.VERSION.SDK_INT >= 21) {
            if (d(hmr.a((Context) this))) {
                Window window = getWindow();
                window.getDecorView().setSystemUiVisibility(1280);
                window.addFlags(Integer.MIN_VALUE);
                window.setStatusBarColor(0);
                return;
            }
            e(getResources().getColor(R.color.jadx_deobf_0x00000e5d));
        }
    }

    protected boolean d(int i) {
        ViewGroup viewGroup = (ViewGroup) findViewById(R.id.jadx_deobf_0x0000131b);
        if (viewGroup == null || i <= 0) {
            return false;
        }
        ((ViewGroup) viewGroup.getParent()).setPadding(0, i, 0, 0);
        return true;
    }

    @TargetApi(IContentProvider.CALL_TRANSACTION)
    protected void e(int i) {
        if (Build.VERSION.SDK_INT >= 21) {
            Window window = getWindow();
            window.addFlags(Integer.MIN_VALUE);
            window.setStatusBarColor(i);
        }
    }

    @Override
    public void onResume() {
        super.onResume();
        boolean a = gbs.a();
        if (!this.H) {
            if (a && this.E && this.B != null) {
                this.q.a(true);
                this.q.a(R.drawable.jadx_deobf_0x00000389, this);
                this.q.a((View.OnClickListener) this);
                this.r = this.q.getSettingButton();
                return;
            }
            this.q.a(false);
        }
    }

    @Override
    public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
        if (i != 3) {
            return false;
        }
        ((InputMethodManager) getSystemService("input_method")).hideSoftInputFromWindow(this.s.getWindowToken(), 0);
        this.u.performClick();
        return true;
    }

    @Override
    public void a(String str) {
        if (!this.H) {
            if (this.F && this.q == null && str != null) {
                this.F = false;
                return;
            }
            this.q.a();
            if (this.F && !TextUtils.isEmpty(str) && !g(str)) {
                this.q.a(str);
            }
        }
    }

    @Override
    public void a(WebView webView, int i) {
        this.y.setProgress(i);
    }

    private boolean g(String str) {
        return h(h()).equals(h(str));
    }

    private String h(String str) {
        return str.replaceAll("(^[^:]*:(\\/\\/)?)|(\\?.*)", "");
    }

    @Override
    public void b(String str) {
        this.y.setVisibility(0);
    }

    @Override
    public void c(String str) {
        this.y.setVisibility(8);
        if (this.H && this.A.size() <= 0) {
            u();
        }
    }

    @Override
    public void b(int i) {
    }

    @Override
    public void l_() {
        finish();
    }

    @Override
    public void finish() {
        super.finish();
        overridePendingTransition(R.anim.dx_enter_anim, R.anim.dx_exit_anim);
        Process.killProcess(Process.myPid());
    }

    @Override
    public void onFocusChange(View view, boolean z) {
        if (view == this.s) {
            if (z) {
                this.s.setTextColor(getResources().getColor(R.color.jadx_deobf_0x00000e5f));
                this.t.setVisibility(0);
                this.G = true;
                return;
            } else {
                this.s.setTextColor(getResources().getColor(R.color.jadx_deobf_0x00000e5c));
                this.t.setVisibility(4);
                this.G = false;
                return;
            }
        }
        this.G = false;
    }

    @Override
    public void onClick(View view) {
        if (view == this.u) {
            this.D = this.s.getText().toString().trim();
            hfl.a(this).a("msgbox", "wb_c", 1, false);
            t();
        } else if (view == this.t) {
            this.s.setText("");
            this.D = "";
        } else if (this.r != null && view == this.r) {
            gbw.a(this, null, null, this.B, false);
            hfl.a(this).a("msgbox", "wb_s", 1, false);
        } else if (view == this.v) {
            finish();
        }
    }

    @Override
    public void handleMessage(Message message) {
        int i;
        switch (message.what) {
            case 0:
                JSONArray jSONArray = (JSONArray) message.obj;
                if (jSONArray == null) {
                    try {
                        jSONArray = new JSONArray("[{\"url\":\"https://sjws.dianxinos.com:8443/*\",\"perm\":\"all\"},{\"url\":\"https://sjws.dianxinos.com/*\",\"perm\":\"all\"},{\"url\":\"https://shoujiweishi.baidu.com/*\",\"perm\":\"all\"},{\"url\":\"file:///android_asset/www/*\",\"perm\":\"all\"} ]");
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                }
                if (jSONArray != null) {
                    a(jSONArray);
                }
                s();
                d(this.C);
                return;
            case 1:
                List list = (List) message.obj;
                if (list.size() == 0) {
                    if (hqo.c(this) && !this.I) {
                        u();
                        this.I = true;
                        return;
                    }
                    return;
                }
                this.A.clear();
                this.A.addAll(list);
                this.z.obtainMessage(2, 0).sendToTarget();
                return;
            case 2:
                if (!this.G) {
                    int intValue = ((Integer) message.obj).intValue();
                    int i2 = intValue + 1;
                    if (intValue <= this.A.size() - 1) {
                        f((String) this.A.get(intValue));
                        i = i2;
                    } else {
                        i = 0;
                    }
                    Message message2 = new Message();
                    message2.what = 2;
                    message2.obj = Integer.valueOf(i);
                    this.z.sendMessageDelayed(message2, 5000L);
                    return;
                }
                return;
            default:
                return;
        }
    }
}