百度手机卫士 v8.1.5版本的 MD5 值为:15af71eae74e2f2b5b9f845fe77a4804

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


package com.dianxinos.optimizer.web;

import android.annotation.TargetApi;
import android.content.ActivityNotFoundException;
import android.content.Context;
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 com.baidu.location.h.e;
import com.baidu.sapi2.c.R;
import com.dianxinos.optimizer.ui.DxTitleBar;
import com.dianxinos.optimizer.utils.HttpUtils;
import dxoptimizer.acq;
import dxoptimizer.aed;
import dxoptimizer.bab;
import dxoptimizer.bac;
import dxoptimizer.fxi;
import dxoptimizer.fxm;
import dxoptimizer.gzf;
import dxoptimizer.heg;
import dxoptimizer.hgn;
import dxoptimizer.hki;
import dxoptimizer.hky;
import dxoptimizer.hmd;
import dxoptimizer.hmo;
import dxoptimizer.hmp;
import dxoptimizer.hmt;
import dxoptimizer.hmu;
import dxoptimizer.hmv;
import dxoptimizer.hmx;
import dxoptimizer.hmy;
import dxoptimizer.hmz;
import dxoptimizer.hna;
import dxoptimizer.hnd;
import dxoptimizer.hnk;
import dxoptimizer.htn;
import dxoptimizer.hug;
import dxoptimizer.ick;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;

public class WebBrowserActivity extends aed implements View.OnClickListener, View.OnFocusChangeListener, TextView.OnEditorActionListener, acq, bac {
    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_0x000009b0);
        this.z = new bab(this);
        q();
        r();
        s();
    }

    private void q() {
        try {
            gzf.a(this).a();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private void r() {
        Intent intent = getIntent();
        this.H = hnd.a(intent, "extra_box_enable", false);
        if (this.H) {
            this.x = (LinearLayout) findViewById(R.id.jadx_deobf_0x00001a73);
            this.x.setVisibility(0);
            this.t = (ImageView) findViewById(R.id.jadx_deobf_0x00001a77);
            this.t.setOnClickListener(this);
            this.s = (AutoCompleteTextView) findViewById(R.id.jadx_deobf_0x00001a76);
            this.s.setOnClickListener(this);
            this.s.setOnFocusChangeListener(this);
            this.s.setOnEditorActionListener(this);
            this.u = (ImageButton) findViewById(R.id.jadx_deobf_0x00001a79);
            this.u.setOnClickListener(this);
            this.v = (ImageView) findViewById(R.id.jadx_deobf_0x00001a74);
            this.v.setOnClickListener(this);
            gzf.a(this).a("msgbox", "wb_b", 1, false);
        } else {
            this.q = (DxTitleBar) findViewById(R.id.jadx_deobf_0x00000ef2);
            this.q.setVisibility(0);
            this.q.a((acq) this);
            String b = hnd.b(intent, "extra_title");
            this.F = hnd.a(intent, "extra_webtitle", false);
            this.E = hnd.a(intent, "extra_share", false);
            this.B = hnd.b(intent, "extra_share_info");
            if (b != null) {
                this.q.a(b);
            }
        }
        this.w = (LinearLayout) findViewById(R.id.jadx_deobf_0x00001a7b);
        this.y = (ProgressBar) findViewById(R.id.jadx_deobf_0x00001a7a);
        this.C = hnd.b(intent, "extra_url");
        if (this.C == null) {
            this.C = ick.a();
        }
    }

    private void s() {
        a(6);
        heg.a().b(new hmx(this));
    }

    private void t() {
        a(new hmp(this), new hmu(this), new hmt(this), new hmv(this), new hmo(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 u() {
        if (TextUtils.isEmpty(this.D)) {
            hnk.b(this, R.string.jadx_deobf_0x0000250a, 0);
            return;
        }
        if (hky.g(this, "com.baidu.searchbox") && hky.h(this, "com.baidu.searchbox")) {
            e("com.baidu.searchbox");
            gzf.a(this).a("msgbox", "wb_ub", 1, false);
        } else if (hky.g(this, "com.android.browser") && hky.h(this, "com.android.browser")) {
            e("com.android.browser");
            gzf.a(this).a("msgbox", "wb_us", 1, false);
        } else if (!hmd.a(this, "http://m.baidu.com/s?from=1009596a&word=" + this.D).booleanValue()) {
            hnk.b(this, R.string.jadx_deobf_0x00002508, 0);
        }
    }

    private void e(String str) {
        try {
            Intent intent = new Intent("android.intent.action.VIEW", Uri.parse("http://ak.dxsvr.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) {
        hug a = hug.a(this.s, "y", 0.0f, -100.0f);
        a.b(200L);
        a.a((htn) new hmy(this, str));
        a.a();
    }

    private void v() {
        heg.a().b(new hmz(this));
    }

    public ArrayList w() {
        String a = hna.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(21)
    protected void k() {
        if (Build.VERSION.SDK_INT >= 21) {
            if (d(hgn.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_0x00000d6c));
        }
    }

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

    @TargetApi(21)
    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 = fxi.a();
        if (!this.H) {
            if (a && this.E && this.B != null) {
                this.q.a(true);
                this.q.a(R.drawable.jadx_deobf_0x00000349, 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) {
            v();
        }
    }

    @Override
    public void b(int i) {
    }

    @Override
    public void m_() {
        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_0x00000d6e));
                this.t.setVisibility(0);
                this.G = true;
                return;
            } else {
                this.s.setTextColor(getResources().getColor(R.color.jadx_deobf_0x00000d6b));
                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();
            gzf.a(this).a("msgbox", "wb_c", 1, false);
            u();
        } else if (view == this.t) {
            this.s.setText("");
            this.D = "";
        } else if (this.r != null && view == this.r) {
            fxm.a(this, null, null, this.B, false);
            gzf.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);
                }
                t();
                d(this.C);
                return;
            case 1:
                List list = (List) message.obj;
                if (list.size() == 0) {
                    if (hki.c(this) && !this.I) {
                        v();
                        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, e.kh);
                    return;
                }
                return;
            default:
                return;
        }
    }
}