360手机助手 v3.3.0版本的 MD5 值为:127c345ad16bbebee6e347381328afd0

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


package com.qihoo.express.mini.activity;

import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.text.TextUtils;
import com.qihoo.appstore.AppStoreApplication;
import com.qihoo.appstore.activities.MainActivity;
import com.qihoo.appstore.express.PushMessageHandle;
import com.qihoo.appstore.utils.bw;
import org.json.JSONException;
import org.json.JSONObject;

public class aa {
    private static volatile aa f;
    private static final byte[] g = new byte[0];

    private final as f4433a = new as(this);

    private e f4434b;
    private Context c;
    private com.qihoo.express.mini.service.a.m d;
    private com.qihoo.express.mini.service.a.j e;

    private aa() {
    }

    public static aa a() {
        if (f == null) {
            synchronized (g) {
                if (f == null) {
                    f = new aa();
                }
            }
        }
        return f;
    }

    public void a(int i) {
        a((DialogInterface) this.f4434b);
        this.f4434b = new e(this.c, b(i), i, new String[0]);
        a((Dialog) this.f4434b);
    }

    private void a(Dialog dialog) {
        if (dialog == null || dialog.isShowing()) {
            return;
        }
        dialog.show();
    }

    public void a(DialogInterface dialogInterface) {
        if (dialogInterface != null) {
            dialogInterface.dismiss();
        }
    }

    private void a(Intent intent) {
        this.f4433a.f4460b = intent.getStringExtra("key_request_pcname");
        this.f4433a.f4459a = intent.getStringExtra("key_request_token");
        try {
            this.f4433a.d = Integer.parseInt(intent.getStringExtra("key_request_pcver"));
        } catch (NumberFormatException e) {
        }
        if (this.f4433a.d <= 0) {
            this.f4433a.d = 2;
        }
        try {
            this.f4433a.f = Integer.parseInt(intent.getStringExtra("key_request_type"));
        } catch (NumberFormatException e2) {
        }
        this.f4433a.e = "sms";
        e();
    }

    public void a(String str, int i, String str2, int i2) {
        if (this.d == null) {
            this.d = new af(this);
        }
        PushMessageHandle.a(this.d.hashCode(), this.d);
        PushMessageHandle.a(str, i, 30000, str2, i2);
        com.qihoo.appstore.r.a.a("pccode", 1);
    }

    public void a(boolean z) {
        if (this.f4434b == null) {
            this.f4434b = new e(this.c, b(z), 3, new String[0]);
            a((Dialog) this.f4434b);
            h();
        } else {
            this.f4434b.a(3, new String[0]);
            this.f4434b.a(b(z));
            h();
        }
    }

    private void a(boolean z, boolean z2) {
        bw.a("PCLinkSettingActivity", new am(this, z2, z)).start();
    }

    public boolean a(as asVar) {
        try {
            return a(com.qihoo.appstore.http.h.a().b("http://intf1.zsall.mobilem.360.cn/intf/checkWirelessLinkToken?token=" + asVar.f4459a), asVar);
        } catch (Exception e) {
            AppStoreApplication.f593a.post(new aq(this));
            return false;
        }
    }

    private boolean a(String str, as asVar) {
        JSONObject jSONObject;
        try {
            jSONObject = new JSONObject(str);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        if (jSONObject.optInt("status") == 1) {
            asVar.c = jSONObject.optString("cid");
            return true;
        }
        AppStoreApplication.f593a.post(new ar(this));
        return false;
    }

    public static aa b() {
        return f;
    }

    private d b(int i) {
        return new ak(this, i);
    }

    private d b(boolean z) {
        return new ah(this, z);
    }

    private void b(Intent intent) {
        Uri data = intent.getData();
        if (data != null) {
            this.f4433a.f4460b = data.getQueryParameter("pc");
            this.f4433a.f4459a = data.getQueryParameter("token");
            this.f4433a.e = data.getQueryParameter("by");
            this.f4433a.c = data.getQueryParameter("mid");
            try {
                this.f4433a.d = Integer.parseInt(data.getQueryParameter("pcver"));
            } catch (NumberFormatException e) {
            }
            if (this.f4433a.d <= 0) {
                this.f4433a.d = 2;
            }
            try {
                this.f4433a.f = Integer.parseInt(data.getQueryParameter("type"));
            } catch (NumberFormatException e2) {
            }
        }
        if (intent.getBooleanExtra("key_request_first_link", false)) {
            e();
        } else {
            j();
        }
    }

    private void d() {
        if (this.e == null) {
            this.e = new ab(this);
            PushMessageHandle.a(this.e.hashCode(), this.e);
        }
    }

    private void e() {
        if (TextUtils.isEmpty(this.f4433a.f4459a)) {
            a(true);
        } else {
            a(false, true);
        }
    }

    public void f() {
        bw.a("PCLinkSettingActivity", new ai(this)).start();
    }

    public void g() {
        MainActivity.e().b(new Intent(MainActivity.e(), (Class<?>) PCLinkSettingActivity.class));
        c();
    }

    private void h() {
        AppStoreApplication.f593a.postDelayed(new al(this), 1000L);
    }

    public void i() {
        AppStoreApplication.f593a.post(new ao(this));
    }

    private void j() {
        if (!TextUtils.isEmpty(this.f4433a.c)) {
            k();
            a(this.f4433a.c, this.f4433a.d, this.f4433a.e, this.f4433a.f);
        } else if ("qrcode".equals(this.f4433a.e)) {
            a(false, false);
        } else {
            if (TextUtils.isEmpty(this.f4433a.f4459a) || this.f4433a.d <= 0) {
                return;
            }
            a(true, false);
        }
    }

    public void k() {
        String str = this.f4433a.f4460b;
        String str2 = Build.MODEL;
        if (this.f4434b == null) {
            this.f4434b = new e(this.c, l(), 6, str, str2);
        } else {
            this.f4434b.a(l());
            this.f4434b.a(6, str, str2);
        }
        a((Dialog) this.f4434b);
    }

    private d l() {
        return new ae(this);
    }

    public void a(Intent intent, Context context) {
        this.c = context;
        d();
        if (intent.getBooleanExtra("key_request_from_read_phonenum", false)) {
            a(intent);
        } else {
            b(intent);
        }
    }

    public void c() {
        a((DialogInterface) this.f4434b);
        this.f4434b = null;
        if (this.e != null) {
            PushMessageHandle.b(this.e.hashCode());
            this.e = null;
        }
        if (this.d != null) {
            PushMessageHandle.a(this.d.hashCode());
            this.d = null;
        }
        if (f != null) {
            synchronized (g) {
                if (f != null) {
                    f = null;
                }
            }
        }
    }
}