换机精灵 v2.5.2版本的 MD5 值为:469dcb6202646d6ec40973ea20c8c14b

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


package com.cx.launcher;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.cx.base.c.i;
import com.cx.base.c.q;
import com.cx.base.c.r;
import com.cx.base.c.s;
import com.cx.base.widgets.l;
import com.cx.huanji.R;
import com.cx.module.launcher.e.j;
import com.cx.module.quest.widget.RoundProgressBar;
import com.cx.tools.i.e;
import com.cx.tools.i.k;
import com.tencent.mm.sdk.constants.ConstantsAPI;
import java.io.File;

public class a implements q {
    private static a g;

    private final Context f2932a;

    private final String f2933b;

    private com.cx.module.launcher.c.c f2934c;
    private i e;
    private com.cx.base.c.a f;
    private Dialog d = null;
    private final String h = "http://121.15.220.153/dd.myapp.com/16891/A529520B1D77742BD5F5231891A5E802.apk?mkey=5551ee0794654584&f=a00e&fsname=com.tencent.mobileqq_5.6.0_242.apk&asr=8eff&p=.apk";
    private final String i = "http://113.105.73.150/dd.myapp.com/16891/4584DB7F7F6EF00006EE7BDFFB8B56F6.apk?mkey=5551ee9b94654584&f=950e&fsname=com.tencent.mm_6.1.0.76r1119377_543.apk&asr=8eff&p=.apk";
    private final String j = "http://183.61.62.150/dd.myapp.com/16891/59F1CCBA937942E211264AA4F1702C0F.apk?mkey=5551b7cc94654584&f=a20e&fsname=com.sina.weibo_5.2.8_1920.apk&asr=8eff&p=.apk";

    private a(Context context) {
        this.e = null;
        this.f = null;
        this.f2932a = context;
        this.f2933b = com.cx.base.d.a.a(this.f2932a) + "/huanji/download" + File.separator;
        this.e = i.a(this.f2932a);
        this.f = com.cx.base.c.a.a(this.f2932a);
    }

    public static a a(Context context) {
        if (g == null) {
            synchronized (a.class) {
                if (g == null) {
                    g = new a(context);
                }
            }
        }
        return g;
    }

    private void a(s sVar, int i, View view) {
        if (e.e(this.f2932a)) {
            this.d = l.a(this.f2932a, this.f2932a.getString(R.string.dialog_title_tips), this.f2932a.getString(R.string.launcher_not_wifi_status_tip), this.f2932a.getString(R.string.confirm), new b(this, sVar, i, view), this.f2932a.getString(R.string.cancel), new c(this));
            if (this.d != null) {
                this.d.show();
                return;
            }
            return;
        }
        if (!e.f(this.f2932a)) {
            j.a(this.f2932a, this.f2932a.getResources().getString(R.string.no_network));
            return;
        }
        if (sVar != null) {
            sVar.i();
            return;
        }
        com.cx.base.f.a e = e(i);
        d c2 = c(i, view);
        s sVar2 = new s(e, this.f2933b);
        sVar2.b(100);
        sVar2.a(this);
        sVar2.a(c2);
        this.e.b(sVar2);
    }

    private void b(Context context) {
        this.f2934c = com.cx.module.launcher.e.a.c(context, 2);
        if (this.f2934c == null) {
            com.cx.module.launcher.b.a(context).a(2);
        }
    }

    public d c(int i, View view) {
        d dVar = null;
        switch (i) {
            case 16:
                d dVar2 = new d(this);
                dVar2.f3332a = (RoundProgressBar) view.findViewById(R.id.ic_weibo_download_progress);
                dVar2.f3333b = (TextView) view.findViewById(R.id.tv_launcher_weibo);
                view.setTag(dVar2);
                dVar = dVar2;
                break;
            case 17:
                d dVar3 = new d(this);
                dVar3.f3332a = (RoundProgressBar) view.findViewById(R.id.ic_weixin_download_progress);
                dVar3.f3333b = (TextView) view.findViewById(R.id.tv_launcher_weixin);
                view.setTag(dVar3);
                dVar = dVar3;
                break;
            case 18:
                d dVar4 = new d(this);
                dVar4.f3332a = (RoundProgressBar) view.findViewById(R.id.ic_qq_download_progress);
                dVar4.f3333b = (TextView) view.findViewById(R.id.tv_launcher_qq);
                view.setTag(dVar4);
                dVar = dVar4;
                break;
        }
        if (dVar != null) {
            dVar.f3332a.setProgress(100);
            dVar.f3332a.setIsnegativeDirection(true);
            dVar.f3332a.setStyle(0);
            dVar.f3334c = f(i);
        }
        return dVar;
    }

    public com.cx.base.f.a e(int i) {
        com.cx.module.launcher.c.a aVar = new com.cx.module.launcher.c.a();
        aVar.f1083c = f(i);
        switch (i) {
            case 16:
                if (this.f2934c == null || this.f2934c.b() == null || this.f2934c.b().equals("")) {
                    aVar.f1082b = "http://183.61.62.150/dd.myapp.com/16891/59F1CCBA937942E211264AA4F1702C0F.apk?mkey=5551b7cc94654584&f=a20e&fsname=com.sina.weibo_5.2.8_1920.apk&asr=8eff&p=.apk";
                } else {
                    aVar.f1082b = this.f2934c.b();
                }
                aVar.z = this.f2932a.getResources().getString(R.string.launcher_callme_weibo);
                break;
            case 17:
                if (this.f2934c == null || this.f2934c.c() == null || this.f2934c.c().equals("")) {
                    aVar.f1082b = "http://113.105.73.150/dd.myapp.com/16891/4584DB7F7F6EF00006EE7BDFFB8B56F6.apk?mkey=5551ee9b94654584&f=950e&fsname=com.tencent.mm_6.1.0.76r1119377_543.apk&asr=8eff&p=.apk";
                } else {
                    aVar.f1082b = this.f2934c.c();
                }
                aVar.z = this.f2932a.getResources().getString(R.string.launcher_callme_weixin);
                break;
            case 18:
                if (this.f2934c == null || this.f2934c.a() == null || this.f2934c.a().equals("")) {
                    aVar.f1082b = "http://121.15.220.153/dd.myapp.com/16891/A529520B1D77742BD5F5231891A5E802.apk?mkey=5551ee0794654584&f=a00e&fsname=com.tencent.mobileqq_5.6.0_242.apk&asr=8eff&p=.apk";
                } else {
                    aVar.f1082b = this.f2934c.a();
                }
                aVar.z = this.f2932a.getResources().getString(R.string.launcher_callme_qq);
                break;
        }
    }

    private String f(int i) {
        switch (i) {
            case 16:
                return "com.sina.weibo";
            case 17:
                return ConstantsAPI.WXApp.WXAPP_PACKAGE_NAME;
            case 18:
                return "com.tencent.mobileqq";
            default:
                return "";
        }
    }

    public void a() {
        b(this.f2932a);
    }

    public void a(int i, View view) {
        s c2 = this.e.c(f(i));
        d c3 = c(i, view);
        if (c2 != null) {
            c2.a(c3);
            c2.a(this);
            com.cx.tools.e.a.c("CommAppDownload", "restoreStatus-->" + i + "," + c2.g());
            switch (c2.g()) {
                case 0:
                    c3.f3332a.setVisibility(0);
                    c3.f3333b.setText(this.f2932a.getString(R.string.app_state_downloading));
                    c3.f3332a.setProgress(100 - c2.b());
                    return;
                case 1:
                    c3.f3333b.setText(this.f2932a.getString(R.string.app_state_pausing));
                    c3.f3332a.setProgress(100 - c2.b());
                    c3.f3332a.setVisibility(0);
                    return;
                case 2:
                    c3.f3333b.setText(c2.f().z);
                    c3.f3332a.setVisibility(8);
                    return;
                case 3:
                    c3.f3333b.setText(this.f2932a.getString(R.string.task_waiting));
                    c3.f3332a.setVisibility(0);
                    return;
                default:
                    return;
            }
        }
    }

    @Override
    public void a(r rVar, int i, long j, com.cx.base.f.a aVar) {
        if (rVar instanceof d) {
            ((d) rVar).f3332a.setProgress(100 - i);
        }
    }

    @Override
    public void a(r rVar, int i, com.cx.base.f.a aVar) {
        if (rVar instanceof d) {
            ((d) rVar).f3333b.setText(this.f2932a.getString(R.string.app_state_pausing));
            String str = "";
            switch (i) {
                case 0:
                    str = this.f2932a.getResources().getString(R.string.launcher_failure_net_exception);
                    break;
                case 1:
                    str = this.f2932a.getResources().getString(R.string.launcher_failure_user_stoped);
                    break;
                case 3:
                    str = this.f2932a.getResources().getString(R.string.launcher_failure_no_left_space);
                    break;
            }
            Toast.makeText(this.f2932a, str, 0).show();
        }
    }

    @Override
    public void a(r rVar, int i, com.cx.base.f.a aVar, s sVar) {
        com.cx.tools.e.a.c("CommAppDownload", "onDownloadCase :" + i + "," + rVar);
        if (rVar instanceof d) {
            d dVar = (d) rVar;
            dVar.f3332a.setVisibility(0);
            switch (i) {
                case 0:
                    dVar.f3333b.setText(this.f2932a.getString(R.string.app_state_downloading));
                    return;
                case 1:
                    dVar.f3333b.setText(this.f2932a.getString(R.string.app_state_pausing));
                    return;
                case 2:
                    dVar.f3333b.setText(aVar.z);
                    dVar.f3332a.setVisibility(8);
                    return;
                case 3:
                    dVar.f3333b.setText(this.f2932a.getString(R.string.task_waiting));
                    return;
                default:
                    return;
            }
        }
    }

    public void a(String str, int i) {
        this.f.a(str, false, f(i));
    }

    public boolean a(int i) {
        s c2 = this.e.c(f(i));
        if (c2 != null) {
            com.cx.tools.e.a.c("CommAppDownload", "isDownloading :" + i + "," + c2.g() + "," + f(i));
        } else {
            com.cx.tools.e.a.c("CommAppDownload", "isDownloading,task is null");
        }
        return c2 != null && (c2.g() == 1 || c2.g() == 0 || c2.g() == 3);
    }

    @Override
    public boolean a(com.cx.base.f.a aVar) {
        return false;
    }

    public String b(int i) {
        s c2 = this.e.c(f(i));
        if (c2 != null) {
            String e = c2.e();
            com.cx.tools.e.a.c("CommAppDownload", "Is exist apk file type:" + i + "," + e);
            if (new File(e).exists()) {
                return e;
            }
        }
        return null;
    }

    public boolean b(int i, View view) {
        s c2 = this.e.c(f(i));
        if (c2 != null) {
            switch (c2.g()) {
                case 0:
                case 3:
                    c2.j();
                    break;
                case 1:
                    a(c2, i, view);
                    break;
                case 2:
                    String e = c2.e();
                    if (!k.a(e) && new File(e).exists()) {
                        a(e, i);
                        break;
                    } else {
                        Toast.makeText(this.f2932a, this.f2932a.getString(R.string.launcher_apk_local_path_not_found), 0).show();
                        return false;
                    }
                    break;
            }
        } else {
            a(c2, i, view);
        }
        return true;
    }

    public boolean c(int i) {
        return com.cx.module.launcher.e.d.a(this.f2932a, f(i)) != null;
    }

    public void d(int i) {
        this.f.a(f(i));
    }
}