OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046

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


package com.excelliance.kxqp.ui;

import android.app.Activity;
import android.app.ActivityManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import com.bytedance.sdk.open.aweme.common.constants.ParamKeyConstants;
import com.excean.bytedancebi.manager.BiManager;
import com.excelliance.kxqp.gs.thpool.tp;
import com.excelliance.kxqp.gs.util.a;
import com.excelliance.kxqp.gs.util.az;
import com.excelliance.kxqp.gs.util.bw;
import com.excelliance.kxqp.gs.util.bx;
import com.excelliance.kxqp.gs.util.by;
import com.excelliance.kxqp.gs.util.cj;
import com.excelliance.kxqp.gs.util.w;
import com.excelliance.kxqp.helper.InitHelper;
import com.excelliance.kxqp.info.DataInfo;
import com.excelliance.kxqp.r;
import com.excelliance.kxqp.s;
import com.excelliance.kxqp.sdk.StatisticsBuilder;
import com.excelliance.kxqp.ui.detail.category.CategoryListActivity;
import com.excelliance.kxqp.util.q;
import com.excelliance.kxqp.utils.ApkDownloadCompleteReceiver;
import com.excelliance.kxqp.utils.CKService;
import com.excelliance.kxqp.utils.f;
import com.excelliance.kxqp.utils.i;
import com.umeng.analytics.pro.am;
import io.github.prototypez.appjoint.AppJoint;
import io.github.prototypez.service.adModule.IAdModule;
import io.github.prototypez.service.main.IMainRouter;
import java.util.List;
import org.apache.http.HttpStatus;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class HelloActivity extends Activity {

    public static boolean f13767a = false;
    private static boolean d = true;
    private static boolean e = true;
    private static int f = -1;

    public Bundle f13768b;
    private View h;
    private Context i;
    private String k;
    private ApkDownloadCompleteReceiver l;
    private HelloPresenter n;
    private r o;
    private IMainRouter p;
    private i q;
    private int g = 2;
    private boolean j = false;
    boolean c = false;
    private Handler m = new Handler() {
        @Override
        public void handleMessage(Message message) {
            int i = message.what;
            if (i == 0) {
                Intent intent = new Intent("com.excelliance.kxqp.action.init");
                intent.setComponent(new ComponentName(HelloActivity.this.i.getPackageName(), "com.excelliance.kxqp.SmtServService"));
                HelloActivity.this.i.startService(intent);
                return;
            }
            boolean z = true;
            switch (i) {
                case 9:
                    if (HelloActivity.f13767a || HelloActivity.this == null || HelloActivity.this.isFinishing()) {
                        return;
                    }
                    HelloActivity.this.finish();
                    return;
                case 10:
                    List<ActivityManager.RunningServiceInfo> runningServices = ((ActivityManager) HelloActivity.this.i.getSystemService("activity")).getRunningServices(HttpStatus.SC_BAD_REQUEST);
                    if (runningServices != null) {
                        int size = runningServices.size();
                        Log.d("HelloActivity", "serviceList size = " + size);
                        for (int i2 = 0; i2 < size; i2++) {
                            Log.d("HelloActivity", "serviceList[" + i2 + "] = " + runningServices.get(i2).service.getClassName());
                            if ("com.excelliance.kxqp.SmtServService".equals(runningServices.get(i2).service.getClassName())) {
                                if (z) {
                                    return;
                                }
                                HelloActivity.this.m.removeMessages(10);
                                HelloActivity.this.m.sendMessageDelayed(HelloActivity.this.m.obtainMessage(10), 20000L);
                                return;
                            }
                        }
                    }
                    z = false;
                    if (z) {
                    }
                default:
                    switch (i) {
                        case 20:
                            HelloActivity.c(HelloActivity.this);
                            if (HelloActivity.this.g <= 0) {
                                HelloActivity.this.m.removeMessages(20);
                                HelloActivity.this.d();
                                return;
                            } else {
                                HelloActivity.this.m.sendEmptyMessageDelayed(20, 1000L);
                                return;
                            }
                        case 21:
                            Bundle data = message.getData();
                            String str = (String) data.get("serverVersionCode");
                            Log.d("HelloActivity", "serverVersionCode = " + str);
                            String str2 = (String) data.get("showDialog");
                            by a2 = by.a(HelloActivity.this.i, "download_sp");
                            if (!TextUtils.isEmpty(str)) {
                                boolean z2 = data.getShort("b64", (short) 0) == 1;
                                com.excelliance.kxqp.utils.c a3 = com.excelliance.kxqp.utils.c.a(HelloActivity.this.i);
                                Boolean a4 = a3.a(a3.a(z2), Integer.parseInt(str));
                                a2.a("isNewVersion", a4.booleanValue());
                                StringBuilder sb = new StringBuilder();
                                sb.append("isCheckVn");
                                sb.append(z2 ? "_b64" : "");
                                String b2 = a2.b(sb.toString(), "");
                                String string = data.getString("verName");
                                boolean equals = !TextUtils.isEmpty(string) ? TextUtils.equals(b2, string) : true;
                                int c = a2.c(HelloActivity.this.i.getPackageName() + "_lastVer", 0);
                                Boolean valueOf = Boolean.valueOf(z2 ? false : a3.a(c, Integer.parseInt(str)).booleanValue());
                                if (a4.booleanValue() || valueOf.booleanValue()) {
                                    final Message obtainMessage = HelloActivity.this.m.obtainMessage(10);
                                    Log.d("HelloActivity", "showDialog = " + str2 + " verName: " + string);
                                    if (TextUtils.equals(str2, "2")) {
                                        if (!equals) {
                                            if (!a4.booleanValue() && valueOf.booleanValue()) {
                                                data.putInt("_lastVer", c);
                                                data.putInt("serverVersionCode_lastVer", Integer.parseInt(str));
                                            }
                                            data.putInt(CategoryListActivity.TAG_NAME, 0);
                                            obtainMessage.obj = data;
                                            tp.i(new Runnable() {
                                                @Override
                                                public void run() {
                                                    if (HelloActivity.this.i == null || ((Activity) HelloActivity.this.i).isDestroyed()) {
                                                        return;
                                                    }
                                                    HelloActivity.this.a(obtainMessage);
                                                }
                                            });
                                        }
                                    } else if (TextUtils.equals(str2, "3")) {
                                        if (!a4.booleanValue() && valueOf.booleanValue()) {
                                            data.putInt("_lastVer", c);
                                            data.putInt("serverVersionCode_lastVer", Integer.parseInt(str));
                                        }
                                        data.putInt(CategoryListActivity.TAG_NAME, 1);
                                        obtainMessage.obj = data;
                                        tp.i(new Runnable() {
                                            @Override
                                            public void run() {
                                                HelloActivity.this.a(obtainMessage);
                                            }
                                        });
                                    }
                                    Intent intent2 = new Intent();
                                    intent2.setAction("HaveNewVersion");
                                    intent2.putExtra("msg", "msg");
                                    intent2.putExtra("showDialog", str2);
                                    intent2.putExtra(ParamKeyConstants.WebViewConstants.QUERY_FROM, "main");
                                    HelloActivity.this.i.sendBroadcast(intent2);
                                    return;
                                }
                                return;
                            }
                            a2.a("isNewVersion");
                            return;
                        default:
                            return;
                    }
            }
        }
    };

    private static void a(Context context) {
    }

    static int c(HelloActivity helloActivity) {
        int i = helloActivity.g;
        helloActivity.g = i - 1;
        return i;
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        this.i = this;
        this.n = new HelloPresenter(this, this);
        this.n.a();
        this.k = getPackageName();
        if ((cj.f11967a != 610035 || cj.c != 109) && (cj.f11968b != 610035 || cj.c != 109)) {
            by.a(this.i, "sp_total_info").a("sp_key_sport_download_pkg", true);
        }
        if (d) {
            com.excelliance.kxqp.util.b.a.d("HelloActivity", "is code boot");
            getSharedPreferences("hello", 0).edit().putBoolean("needSplash", true).apply();
            d = false;
        } else {
            getSharedPreferences("hello", 0).edit().putBoolean("needSplash", false).apply();
        }
        Intent intent = getIntent();
        String str = null;
        if (intent != null) {
            str = intent.getStringExtra("hello");
            if (!TextUtils.equals(str, "hello")) {
                this.f13768b = intent.getBundleExtra("fromCkService");
                int a2 = com.excelliance.kxqp.utils.c.a(this.i).a();
                this.c = getSharedPreferences("hello", 0).getBoolean("hasNewVersion" + a2, false);
            }
        }
        Log.d("HelloActivity", "onCreate mFromCkService = " + this.f13768b + ", from = " + str + ", hasNewVersion = " + this.c + ", this = " + this);
        if (this.f13768b != null && TextUtils.equals(str, "hello")) {
            com.excelliance.kxqp.util.b.a.d("HelloActivity", "onCreate: from nav finish");
            com.excelliance.kxqp.util.b.a.e("HelloActivity", "finish00010");
            finish();
            return;
        }
        if (this.f13768b != null) {
            Message obtainMessage = this.m.obtainMessage();
            obtainMessage.what = 21;
            obtainMessage.setData(this.f13768b);
            this.m.sendMessage(obtainMessage);
        }
        if (com.excelliance.kxqp.process.e.f12820b && InitHelper.getPrivacyAgreed(this.i.getApplicationContext())) {
            try {
                Intent intent2 = new Intent(this.i, (Class<?>) CKService.class);
                intent2.setAction(this.i.getPackageName() + ".action.checkcomp");
                this.i.startService(intent2);
                if (this.f13768b == null) {
                    c();
                }
            } catch (Exception e2) {
                e2.printStackTrace();
            }
        }
        d();
    }

    @Override
    public void onNewIntent(Intent intent) {
        String str;
        super.onNewIntent(intent);
        setIntent(intent);
        if (intent != null) {
            str = intent.getStringExtra("hello");
            if (!TextUtils.equals(str, "hello")) {
                this.f13768b = intent.getBundleExtra("fromCkService");
                int a2 = com.excelliance.kxqp.utils.c.a(this.i).a();
                this.c = getSharedPreferences("hello", 0).getBoolean("hasNewVersion" + a2, false);
            }
        } else {
            str = null;
        }
        Log.d("HelloActivity", "onNewIntent mFromCkService = " + this.f13768b + ", from = " + str + ", hasNewVersion = " + this.c + ", this = " + this);
        if (this.f13768b != null && TextUtils.equals(str, "hello")) {
            com.excelliance.kxqp.util.b.a.d("HelloActivity", "onNewIntent: from nav finish");
            com.excelliance.kxqp.util.b.a.e("HelloActivity", "onNewIntent finish00010");
            finish();
        } else if (this.f13768b != null) {
            Message obtainMessage = this.m.obtainMessage();
            obtainMessage.what = 21;
            obtainMessage.setData(this.f13768b);
            this.m.sendMessage(obtainMessage);
        }
    }

    private void c() {
        Log.d("HelloActivity", "startServiceForCheckNewVersion: ");
        try {
            Intent intent = new Intent(this.i, (Class<?>) CKService.class);
            intent.setAction(this.i.getPackageName() + ".action_check_new_version");
            startService(intent);
        } catch (Exception e2) {
            Log.e("HelloActivity", "startServiceForCheckNewVersion: " + e2.getMessage());
        }
    }

    @Override
    public void onResume() {
        super.onResume();
        a();
        if (com.excelliance.kxqp.process.e.f12820b && this.o != null) {
            this.o.a(f, this, new r.a() {
                @Override
                public void call() {
                    HelloActivity.this.f();
                }
            });
        }
    }

    public void a() {
        if (Build.VERSION.SDK_INT >= 19) {
            Window window = getWindow();
            if (Build.VERSION.SDK_INT >= 21) {
                window.clearFlags(67108864);
                window.addFlags(Integer.MIN_VALUE);
                window.setStatusBarColor(0);
            } else {
                window.addFlags(67108864);
            }
            if (this.h == null) {
                this.h = new View(this);
            }
            window.addFlags(Integer.MIN_VALUE);
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        this.m.removeCallbacksAndMessages(null);
        try {
            if (this.l != null) {
                unregisterReceiver(this.l);
                this.l = null;
            }
        } catch (Exception e2) {
            e2.printStackTrace();
        }
    }

    public boolean d() {
        this.j = by.a(this.i, "hello").b("nav", false).booleanValue();
        SharedPreferences sharedPreferences = com.excelliance.kxqp.gs.ui.medal.a.d.a((Context) this).getSharedPreferences("global_config", Build.VERSION.SDK_INT < 11 ? 0 : 4);
        f = sharedPreferences.getInt("defDisplayStyle", 62);
        if (!this.j) {
            if (e) {
                f = com.excelliance.kxqp.gs.util.a.a();
                Log.d("HelloActivity", "initStart: defDisplayStyle = " + f);
                if (f == 28 || f == 32) {
                    sharedPreferences.edit().putLong("temp_flow_version_time", System.currentTimeMillis()).apply();
                }
                com.excelliance.kxqp.util.b.a.d("HelloActivity", "!mGuided dispaly:" + f);
                sharedPreferences.edit().putInt("defDisplayStyle", f).putString("abTestType", com.excelliance.kxqp.gs.util.a.a(f, false)).apply();
                String a2 = com.excelliance.kxqp.gs.util.a.a(f);
                if (!TextUtils.isEmpty(a2)) {
                    BiManager.setUserPresetParam(BiManager.AB_TEST, a2);
                }
                if (f == 256) {
                    tp.f(new Runnable() {
                        @Override
                        public void run() {
                            com.excelliance.kxqp.e.a.a.f3732a.init(HelloActivity.this.getApplication());
                        }
                    });
                }
            }
            long c = c(3);
            sharedPreferences.edit().putLong("temp_flow_version_time", c).apply();
            String str = "";
            boolean z = ContextCompat.checkSelfPermission(this, "android.permission.WRITE_EXTERNAL_STORAGE") == 0;
            boolean privacyAgreed = InitHelper.getPrivacyAgreed(this);
            if (privacyAgreed && z) {
                str = bw.a(Environment.getExternalStorageDirectory() + "/." + this.i.getPackageName(), "init_time.txt");
            }
            if (TextUtils.isEmpty(str)) {
                if (privacyAgreed && z) {
                    bw.a(Environment.getExternalStorageDirectory() + "/." + this.i.getPackageName(), "init_time.txt", com.excelliance.kxqp.gs.util.c.a(String.valueOf(c)));
                } else {
                    bw.a(this.i.getFilesDir().getAbsolutePath(), "init_time.txt", com.excelliance.kxqp.gs.util.c.a(String.valueOf(c)));
                }
                if (sharedPreferences.getInt("old_upgrade_to_version_k_flag", -1) == -1) {
                    sharedPreferences.edit().putInt("old_upgrade_to_version_k_flag", -4).apply();
                }
            }
            if (InitHelper.getPrivacyAgreed(this.i.getApplicationContext())) {
                Intent intent = new Intent("com.excelliance.kxqp.action.init");
                intent.setComponent(new ComponentName(this.i.getPackageName(), "com.excelliance.kxqp.SmtServService"));
                intent.putExtra("defDisplayStyle", f);
                this.i.startService(intent);
            }
            Intent intent2 = new Intent(this, (Class<?>) NavigationActivity.class);
            intent2.setPackage(getPackageName());
            intent2.putExtra("defDisplayStyle", f);
            startActivity(intent2);
            tp.f(new Runnable() {
                @Override
                public void run() {
                    if (HelloActivity.this.f13768b == null) {
                        HelloActivity.this.finish();
                    }
                }
            });
        } else {
            if (!com.excelliance.kxqp.process.e.f12820b) {
                e();
                return true;
            }
            b(f);
            if ((f == 181 || f == 194 || f == 203) && !s.a(this)) {
                setContentView(new View(this));
                View decorView = getWindow().getDecorView();
                if (decorView != null) {
                    decorView.setBackgroundResource(w.j(this, "start_pager"));
                }
                this.o = new r();
                this.o.a(this, false);
            } else {
                f();
            }
        }
        return true;
    }

    private void e() {
        this.p = (IMainRouter) AppJoint.service(IMainRouter.class);
        this.p.showArchCompatFixView(this.i);
    }

    private void b(int i) {
        com.excelliance.kxqp.gs.util.a.a(this.i, i, new a.c() {
            @Override
            public void a(int i2, int i3) {
                com.excelliance.kxqp.util.b.a.d("HelloActivity", " [real: " + i2 + " | tar: " + i3 + " ]");
                if (i3 == -1) {
                    return;
                }
                by a2 = by.a(HelloActivity.this.i, "global_config");
                int unused = HelloActivity.f = i3;
                if (i3 != 38) {
                    if (i3 == 54) {
                        a2.d("abTestType", com.excelliance.kxqp.gs.util.a.a(HelloActivity.f, false));
                        by.a(HelloActivity.this.i, "sp_total_info").a(".basic.icon.show.state");
                    }
                    a2.d("abTestType", com.excelliance.kxqp.gs.util.a.a(HelloActivity.f, false));
                    by.a(HelloActivity.this.i, "sp_total_info").a(".basic.icon.show.state");
                } else {
                    if (a2.c("old_upgrade_to_version_k_flag", -1) == -1) {
                        a2.b("old_upgrade_to_version_k_flag", -2);
                    }
                    if (a2.a("defDisplayStyle_flow_ab_test_switch_to_flow_vk", (Long) (-1L)) == -1) {
                        a2.b("defDisplayStyle_flow_ab_test_switch_to_flow_vk", -2L);
                        a2.b("temp_flow_version_time", -1L);
                    }
                }
                String a3 = com.excelliance.kxqp.gs.util.a.a(HelloActivity.f);
                if (TextUtils.isEmpty(a3)) {
                    return;
                }
                BiManager.setUserPresetParam(BiManager.AB_TEST, a3);
            }
        });
    }

    public void f() {
        Intent intent = new Intent();
        intent.addFlags(268435456);
        intent.setComponent(new ComponentName(getPackageName(), "com.excelliance.kxqp.gs.main.MainActivity"));
        Bundle bundleExtra = getIntent().getBundleExtra("notifi_action");
        if (bundleExtra != null) {
            intent.putExtra("notifi_action", bundleExtra);
        }
        com.excelliance.kxqp.util.b.a.d("HelloActivity", "initStart extras: " + bundleExtra + ", hasNewVersion = " + this.c + ", mFromCkService = " + this.f13768b + ", mContext = " + this.i);
        if (this.f13768b == null) {
            if (q.a(this.i)) {
                StatisticsBuilder.getInstance().builder().setDescription("networkConnected").setPriKey1(148000).setPriKey2(13).setIntKey0().build(this);
                boolean n = bx.a().n(this.i);
                IAdModule iAdModule = (IAdModule) AppJoint.service(IAdModule.class);
                boolean checlLocalHasAdConfig = iAdModule.checlLocalHasAdConfig(this.i);
                boolean adTimeIsOk = iAdModule.adTimeIsOk(this.i);
                Log.d("HelloActivity", "checkShowAdOrMain hasAdConfig = " + checlLocalHasAdConfig + " , adTimeIsOk:" + adTimeIsOk);
                if (checlLocalHasAdConfig) {
                    StatisticsBuilder.getInstance().builder().setDescription("hasAdConfig").setPriKey1(148000).setPriKey2(15).setIntKey0().build(this);
                    Log.d("HelloActivity", "checkShowAdOrMain adTimeIsOk = " + adTimeIsOk);
                    if (adTimeIsOk) {
                        StatisticsBuilder.getInstance().builder().setDescription("adCheckDisplayResult_isDisPlay").setPriKey1(148000).setPriKey2(18).setIntKey0().build(this);
                        StatisticsBuilder.getInstance().builder().setDescription("startAdSplashActivity").setPriKey1(148000).setPriKey2(20).setIntKey0().build(this);
                        String oaid = com.excelliance.kxqp.gs.router.a.a.e.getOaid(this.i);
                        if (!TextUtils.isEmpty(oaid)) {
                            DataInfo.setOaid(oaid);
                        }
                        by a2 = by.a(this.i, "sp_customization");
                        DataInfo.setS2sURL("https://3rd.ourplay.com.cn/terrace_api.php");
                        DataInfo.setPersonalizedStatus(a2.b(am.aw, true).booleanValue());
                        iAdModule.isShowToastDebug(this.i);
                        iAdModule.startAdSplashActivity(this.i, true, com.excean.gspace.R.drawable.start_pager, com.excean.gspace.R.drawable.icon, 1);
                    } else {
                        StatisticsBuilder.getInstance().builder().setDescription("adCheckDisplayResult_not_isDisPlay").setPriKey1(148000).setPriKey2(19).setIntKey0().build(this);
                        startActivity(intent);
                    }
                } else {
                    StatisticsBuilder.getInstance().builder().setDescription("noAdConfig").setPriKey1(148000).setPriKey2(16).setIntKey0().build(this);
                    startActivity(intent);
                }
                a(n, checlLocalHasAdConfig, adTimeIsOk, iAdModule.getAdJarVerJson(this.i), iAdModule.isNewUser(this.i));
            } else {
                StatisticsBuilder.getInstance().builder().setDescription("networkNotConnected").setPriKey1(148000).setPriKey2(14).setIntKey0().build(this);
                startActivity(intent);
            }
        }
        a(this.i.getApplicationContext());
        final boolean z = this.f13768b == null;
        tp.f(new Runnable() {
            @Override
            public void run() {
                if (z) {
                    try {
                        HelloActivity.this.finish();
                    } catch (Exception e2) {
                        e2.printStackTrace();
                        Log.e("HelloActivity", "HelloActivity/enterMain run:" + e2.toString());
                    }
                }
            }
        });
    }

    private void a(boolean z, boolean z2, boolean z3, String str, boolean z4) {
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put("isVIP", !z ? 1 : 0);
            jSONObject.put("hasAdConfig", z2 ? 1 : 0);
            jSONObject.put("newUser", !z4 ? 1 : 0);
            jSONObject.put("adTimeIsOk", z3 ? 1 : 0);
            if (!TextUtils.isEmpty(str)) {
                jSONObject.put("adJarVersion", new JSONArray(str));
            }
        } catch (JSONException e2) {
            e2.printStackTrace();
        } catch (Exception e3) {
            e3.printStackTrace();
        }
        az.d("HelloActivity", "toStatisticForAdCondition: " + jSONObject.toString());
        StatisticsBuilder.getInstance().builder().setDescription("广告相关-用户广告条件").setPriKey1(148000).setPriKey2(6).setStringKey1(jSONObject.toString()).buildImmediate(this.i);
    }

    private static long c(int i) {
        long currentTimeMillis = System.currentTimeMillis() / 1000;
        return ((currentTimeMillis - ((28800 + currentTimeMillis) % 86400)) + ((i - 1) * 86400)) * 1000;
    }

    @Override
    public void onRequestPermissionsResult(int i, @NonNull String[] strArr, @NonNull int[] iArr) {
        super.onRequestPermissionsResult(i, strArr, iArr);
        if (this.o != null) {
            this.o.a(this, i, strArr, iArr, new r.a() {
                @Override
                public void call() {
                    if ((HelloActivity.f == 181 || HelloActivity.f == 194 || HelloActivity.f == 203) && s.a(HelloActivity.this.i)) {
                        HelloActivity.this.f();
                    }
                }
            });
        }
    }

    public void a(Message message) {
        if (this.q == null || !this.q.isShowing()) {
            int o = w.o(this.i, "theme_dialog_no_title2");
            int i = message.what;
            this.q = new i(this.i, o, i == 10 ? "dialog_update" : "dialog_update");
            this.q.a(new f.b() {
                @Override
                public void a(int i2, Message message2, int i3) {
                    if (i2 == 10) {
                        Bundle bundle = (Bundle) message2.obj;
                        i.a(HelloActivity.this.i, bundle);
                        if (i.b(bundle)) {
                            if (HelloActivity.this.q.b()) {
                                return;
                            }
                            HelloActivity.this.q.dismiss();
                        } else {
                            HelloActivity.this.a(bundle.getString("apkUrl"));
                            Toast.makeText(HelloActivity.this.i, w.e(HelloActivity.this.i, "update_now"), 0).show();
                        }
                    }
                }

                @Override
                public void b(int i2, Message message2, int i3) {
                    Object obj;
                    if (i2 == 10) {
                        if (message2 != null && (obj = message2.obj) != null && (obj instanceof Bundle)) {
                            Bundle bundle = (Bundle) obj;
                            boolean z = bundle.getBoolean("checkBox");
                            Log.d("HelloActivity", "negativeClick: " + z);
                            by a2 = by.a(HelloActivity.this.i, "download_sp");
                            boolean z2 = bundle.getShort("b64", (short) 0) == 1;
                            if (z) {
                                String string = bundle.getString("verName");
                                StringBuilder sb = new StringBuilder();
                                sb.append("isCheckVn");
                                sb.append(z2 ? "_b64" : "");
                                a2.a(sb.toString(), string);
                            } else {
                                StringBuilder sb2 = new StringBuilder();
                                sb2.append("isCheckVn");
                                sb2.append(z2 ? "_b64" : "");
                                a2.a(sb2.toString());
                            }
                        }
                        if (HelloActivity.this.j) {
                            HelloActivity.this.f13768b = null;
                            HelloActivity.this.c = false;
                        }
                        HelloActivity.this.finish();
                    }
                }
            });
            if (this.q.isShowing()) {
                return;
            }
            String str = "";
            String str2 = "";
            String str3 = null;
            if (i == 10) {
                this.q.b(true);
                str2 = w.e(this.i, "update_apk_now");
                str3 = w.e(this.i, "update_apk_nocare");
                str = ((Bundle) message.obj).getString("content");
            }
            this.q.show();
            this.q.a(i);
            this.q.a(message);
            this.q.a(str);
            this.q.a(true, str2, str3);
            if (i == 10) {
                final Bundle bundle = (Bundle) message.obj;
                this.q.c(true);
                int i2 = bundle.getInt(CategoryListActivity.TAG_NAME);
                Log.d("HelloActivity", "showUpdateDialog: " + i2);
                this.q.d(i2 == 0);
                this.q.a(i2 != 0);
                this.q.e(i2 == 0);
                this.q.f(i2 == 0);
                this.q.a(bundle);
                bundle.getShort("b64", (short) 0);
                if (i.b(bundle)) {
                    this.q.b(w.e(this.i, "now_is_new_version") + "");
                    this.q.a(true, w.e(this.i, "exit_dialog_yes"), str3);
                }
                this.q.setOnDismissListener(new DialogInterface.OnDismissListener() {
                    @Override
                    public void onDismiss(DialogInterface dialogInterface) {
                        i.a(HelloActivity.this.i, bundle);
                    }
                });
            }
            this.q.setOnKeyListener(new DialogInterface.OnKeyListener() {
                @Override
                public boolean onKey(DialogInterface dialogInterface, int i3, KeyEvent keyEvent) {
                    if (i3 != 4) {
                        return false;
                    }
                    HelloActivity.this.finish();
                    return false;
                }
            });
        }
    }

    protected void a(String str) {
        IntentFilter intentFilter = new IntentFilter();
        intentFilter.addAction("android.intent.action.DOWNLOAD_COMPLETE");
        intentFilter.addAction("android.intent.action.DOWNLOAD_NOTIFICATION_CLICKED");
        this.l = new ApkDownloadCompleteReceiver();
        this.i.registerReceiver(this.l, intentFilter);
        Log.d("HelloActivity", "checkHaveApk: durl = " + str);
        if (TextUtils.isEmpty(str) || str == null) {
            return;
        }
        moveTaskToBack(true);
        com.excelliance.kxqp.utils.b.a(this.i, str);
    }
}