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

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


package dxoptimizer;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Html;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.RelativeLayout;
import android.widget.TextView;
import cn.opda.a.phonoalbumshoushou.R;
import com.dianxinos.common.ui.view.DxProgressBar;
import com.dianxinos.optimizer.module.appmanager.appssearch.mode.AppsSearchConfigItem;
import com.dianxinos.optimizer.module.appmanager.appssearch.view.HorizontalListView;
import com.dianxinos.optimizer.ui.DXEmptyView;
import com.dianxinos.optimizer.ui.DXLoadingInside;
import com.dianxinos.optimizer.ui.DxRevealButton;
import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.json.JSONException;
import org.json.JSONObject;

public class cwp extends axi implements View.OnClickListener, aei, axc, ayj, cxp {
    public AppsSearchConfigItem e;
    public String f;
    public boolean g = false;
    private DxProgressBar h;
    private TextView j;
    private DXEmptyView k;
    private HorizontalListView l;
    private cxa m;
    private DXLoadingInside n;
    private RelativeLayout o;
    private hlr p;
    private LinearLayout q;
    private DxRevealButton r;
    private DxRevealButton s;
    private boolean t;
    private mo u;
    private Handler v;
    private Intent w;

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        aww.a((Context) this).a((axc) this);
        C();
    }

    @Override
    public void onResume() {
        super.onResume();
        if (!hqo.c(this)) {
            r();
            q();
        }
    }

    @Override
    public void onDestroy() {
        aww.a((Context) this).b(this);
        super.onDestroy();
    }

    @Override
    public void a(axb axbVar) {
        if (axbVar instanceof awz) {
            awz awzVar = (awz) axbVar;
            if (awzVar.c == 2 || awzVar.c == 4) {
                a(awzVar);
            }
            if (awzVar.a.equals(this.b.b)) {
                if (awzVar.c == 2) {
                    this.h.post(new cwq(this));
                } else if (awzVar.c == 3) {
                    this.h.post(new cwr(this));
                }
            }
        }
    }

    private void a(awz awzVar) {
        if (awzVar != null && awzVar.a.equals("com.baidu.appsearch")) {
            if (this.w != null && hqf.a(this, this.w)) {
                startActivity(this.w);
            }
            hts.a(this);
            hts.a("am_as", "as_d_if", (Number) 1);
        }
    }

    @Override
    public void onClick(View view) {
        if (view == this.h) {
            if (this.c == 1 || this.c == 7 || this.c == 2) {
                A();
                return;
            }
            if (hrf.g(this, this.b.b)) {
                if (!hrf.h(this, this.b.b)) {
                    hny.a(R.string.jadx_deobf_0x000020c1, 0);
                    return;
                } else {
                    z();
                    return;
                }
            }
            c(this.g);
            return;
        }
        if (view == this.k.getImageView()) {
            C();
            return;
        }
        if (view == this.o.getTag()) {
            v();
            C();
            return;
        }
        if (view == this.r) {
            if (this.c != 1 && this.c != 2 && this.c != 7) {
                c(false);
                return;
            }
            return;
        }
        if (view == this.s) {
            w();
            hts.a(this);
            hts.a("as_d_hdc", this.b.b, (Number) 1);
        }
    }

    @Override
    public aky b() {
        if (this.e == null) {
            return null;
        }
        return this.e.createDownloadInfo(this.f);
    }

    @Override
    public void c() {
        setContentView(R.layout.jadx_deobf_0x000007e4);
        hsq.a(this, R.id.jadx_deobf_0x00000f95, m(), this);
        this.v = new ayi(this);
        this.u = new mo(this, R.drawable.jadx_deobf_0x000003a3);
        ImageView imageView = (ImageView) findViewById(R.id.jadx_deobf_0x0000008c);
        TextView textView = (TextView) findViewById(R.id.app_name);
        TextView textView2 = (TextView) findViewById(R.id.jadx_deobf_0x00001168);
        TextView textView3 = (TextView) findViewById(R.id.jadx_deobf_0x00001169);
        if (this.b != null) {
            if (!TextUtils.isEmpty(this.b.h)) {
                new mo(this).a(this.b.h, imageView);
            }
            textView.setText(this.b.c);
            textView2.setText(getString(R.string.jadx_deobf_0x00001e75, new Object[]{hsf.a(this.b.f)}));
            if (TextUtils.isEmpty(this.b.d)) {
                textView3.setVisibility(8);
            } else {
                textView3.setText(getString(R.string.jadx_deobf_0x00001e76, new Object[]{this.b.d.split(":")[1].trim()}));
            }
        }
        this.j = (TextView) findViewById(R.id.jadx_deobf_0x0000116a);
        this.h = (DxProgressBar) findViewById(R.id.jadx_deobf_0x0000117b);
        this.h.setOnClickListener(this);
        this.q = (LinearLayout) findViewById(R.id.jadx_deobf_0x0000117c);
        this.r = (DxRevealButton) findViewById(R.id.jadx_deobf_0x0000117d);
        this.r.setOnClickListener(this);
        this.s = (DxRevealButton) findViewById(R.id.jadx_deobf_0x0000117e);
        this.s.setOnClickListener(this);
        this.l = (HorizontalListView) findViewById(R.id.jadx_deobf_0x00001178);
        this.l.setOnItemClickListener(new cws(this));
        this.k = (DXEmptyView) findViewById(R.id.jadx_deobf_0x00001175);
        this.k.a(R.drawable.jadx_deobf_0x0000030e, R.string.jadx_deobf_0x000020cb);
        this.k.setOnClickListener(this);
        this.o = (RelativeLayout) findViewById(R.id.jadx_deobf_0x00001176);
        View findViewById = this.o.findViewById(R.id.jadx_deobf_0x0000115d);
        findViewById.setOnClickListener(this);
        this.o.setTag(findViewById);
        this.n = (DXLoadingInside) findViewById(R.id.jadx_deobf_0x00001179);
    }

    @Override
    public void d() {
        if (this.c == 1 || this.c == 7 || this.c == 2) {
            o();
        } else {
            n();
        }
    }

    @Override
    public void e() {
        o();
    }

    @Override
    public void f() {
        o();
    }

    @Override
    public void g() {
        n();
    }

    @Override
    public void h() {
        this.h.setProgress(100);
        this.h.setProgressTextVisible(false);
        this.h.setText(getString(R.string.jadx_deobf_0x000020b3));
        this.h.setEnabled(false);
    }

    @Override
    public void a(boolean z) {
        if (z) {
            z();
        } else {
            n();
        }
    }

    @Override
    public void a(String str) {
        JSONObject jSONObject;
        JSONException e;
        try {
            jSONObject = new JSONObject();
        } catch (JSONException e2) {
            jSONObject = null;
            e = e2;
        }
        try {
            jSONObject.put("as_ap", this.e.pkgName);
            jSONObject.put("as_af", this.e.source);
        } catch (JSONException e3) {
            e = e3;
            e.printStackTrace();
            hts.a(this);
            hts.a("am_dlf", jSONObject);
        }
        hts.a(this);
        hts.a("am_dlf", jSONObject);
    }

    private String m() {
        if (this.e == null) {
            return null;
        }
        return this.e.appName;
    }

    private void n() {
        this.h.setProgress(100);
        this.h.setEnabled(true);
        this.h.setProgressTextVisible(false);
        b(false);
        if (hrf.g(this, this.b.b)) {
            this.h.setText(getResources().getString(R.string.jadx_deobf_0x000020cf));
            return;
        }
        if (new File(this.b.a()).exists()) {
            this.h.setText(getResources().getString(R.string.jadx_deobf_0x000020ac));
        } else if (!this.g) {
            this.h.setText(getResources().getString(R.string.jadx_deobf_0x000020ac));
        } else {
            b(true);
        }
    }

    private void b(boolean z) {
        this.h.setVisibility(z ? 8 : 0);
        this.q.setVisibility(z ? 0 : 8);
    }

    private void o() {
        this.h.setProgress(this.d);
        this.h.setProgressTextVisible(true);
        this.h.setText(getResources().getString(R.string.jadx_deobf_0x0000208c));
        this.h.setEnabled(true);
    }

    private void p() {
        if (this.k.isShown()) {
            this.k.setVisibility(8);
        }
    }

    private void q() {
        if (!this.k.isShown()) {
            this.k.setVisibility(0);
        }
    }

    private void r() {
        if (this.n.isShown()) {
            this.n.setVisibility(8);
        }
    }

    private void s() {
        if (!this.n.isShown()) {
            this.n.setVisibility(0);
        }
    }

    private void t() {
        this.o.setVisibility(0);
    }

    private void v() {
        this.o.setVisibility(8);
    }

    private void a(List list) {
        List b = b(list);
        if (this.m == null) {
            this.m = new cxa(this, this.u, b);
        }
        this.l.setAdapter((ListAdapter) this.m);
        this.m.a(hqo.b(this));
        this.m.a(b);
    }

    private List b(List list) {
        if (list == null) {
            return null;
        }
        ArrayList arrayList = new ArrayList(list.size());
        Iterator it = list.iterator();
        while (it.hasNext()) {
            arrayList.add(new cxz((String) it.next()));
        }
        return arrayList;
    }

    private void b(String str) {
        if (!TextUtils.isEmpty(str)) {
            this.j.setText(Html.fromHtml(str));
        }
    }

    private void c(boolean z) {
        String a = this.b.a();
        if (new File(a).exists() && this.b.g.equals(this.e.downloadUrl)) {
            c(a);
        } else if (z) {
            w();
        } else {
            b(false);
            y();
        }
    }

    private void w() {
        Intent a;
        if (x()) {
            if (this.e != null && (a = cyb.a(this).a(this.e)) != null && hqf.a(this, a)) {
                startActivity(a);
                hts.a(this);
                hts.a("am_as", "as_d_hd", (Number) 1);
                return;
            }
            return;
        }
        cyb a2 = cyb.a(this);
        this.w = a2.a(this.e);
        a2.a(this, D(), new cwt(this), "f_detail");
    }

    private boolean x() {
        boolean z = false;
        awv b = aww.a((Context) this).b("com.baidu.appsearch");
        if (b != null && b.h() > 16782633) {
            z = hrf.h(this, "com.baidu.appsearch");
        }
        awv b2 = aww.a((Context) this).b("com.dragon.android.pandaspace");
        if (b2 != null && b2.h() > 16785162) {
            return hrf.h(this, "com.dragon.android.pandaspace");
        }
        return z;
    }

    private void y() {
        bbv.a(this, this.b.f, this.c, new cww(this));
    }

    public void z() {
        hrf.m(this, this.b.b);
        finish();
    }

    private void A() {
        this.a.a(this.b);
        this.h.setEnabled(false);
        setResult(1000, new Intent().putExtra("extra.pkg", this.b.b));
    }

    private void c(String str) {
        hlr hlrVar = new hlr(this, R.string.jadx_deobf_0x000020b3);
        hlrVar.show();
        hlrVar.setCancelable(false);
        new cwx(this, getApplicationContext(), str, hlrVar).start();
    }

    private void a(Message message) {
        super.handleMessage(message);
        if (!isFinishing()) {
            switch (message.what) {
                case 1:
                    r();
                    b(this.e.updateDesc);
                    a(this.e.snapShotList);
                    return;
                case 2:
                    t();
                    return;
                default:
                    return;
            }
        }
    }

    private void B() {
        a((List) null);
        b("");
    }

    private void C() {
        if (hqo.c(this)) {
            B();
            p();
            s();
            cxr.a().a(this, this.e.id, "480*800", this.e.source, "haina".equals(this.e.source), this);
            return;
        }
        q();
        htt.a(this, R.string.jadx_deobf_0x000023f0, 0);
    }

    public void a(cxz cxzVar, View view) {
        if (!TextUtils.isEmpty(cxzVar.a())) {
            cyd.a(this, cxzVar.a(), (ImageView) view.findViewById(R.id.jadx_deobf_0x0000117f), new cwz(view, cxzVar));
        }
    }

    @Override
    public void a(String str, boolean z) {
        if (z) {
            cyc.a(str, this.e);
            this.v.sendEmptyMessage(1);
        } else {
            this.v.sendEmptyMessage(2);
        }
    }

    @Override
    public void handleMessage(Message message) {
        a(message);
    }

    public void d(boolean z) {
        if (z) {
            this.p = new hlr(this, getResources().getString(R.string.jadx_deobf_0x00001e8d));
            this.p.setCancelable(true);
            this.p.setOnCancelListener(new cwy(this));
            this.p.show();
            return;
        }
        if (this.p != null && this.p.isShowing()) {
            this.p.cancel();
        }
    }

    public aky D() {
        aky akyVar = new aky();
        akyVar.a = this.f;
        akyVar.b = "com.baidu.appsearch";
        akyVar.c = getResources().getString(R.string.jadx_deobf_0x00001e78);
        akyVar.e = 16785259;
        akyVar.d = "6.3.1";
        akyVar.f = 6297462L;
        akyVar.g = "https://sjwssu.baidu.com/own/yhds/gaosuxiazai";
        akyVar.h = "https://sjwssu.baidu.com/bd/appsearch_android/icon";
        akyVar.j = hpg.l;
        return akyVar;
    }
}