和通讯录 v3.9.6版本的 MD5 值为:669178e2ee1b2311daf378bd20c6bbe1

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


package com.chinamobile.contacts.im.login;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v4.view.ViewPager;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.chinamobile.contacts.im.App;
import com.chinamobile.contacts.im.C0019R;
import com.chinamobile.contacts.im.cloudserver.al;
import com.chinamobile.contacts.im.config.LoginInfoSP;
import com.chinamobile.contacts.im.data.ContactAccessor;
import com.chinamobile.contacts.im.mobilecard.OneCardLoginController;
import com.chinamobile.contacts.im.mobilecard.dao.OneCardDao;
import com.chinamobile.contacts.im.mobilecard.data.SubPhonesCache;
import com.chinamobile.contacts.im.service.PushService;
import com.chinamobile.contacts.im.setting.ManageSIMMActivity;
import com.chinamobile.contacts.im.sync.d.ab;
import com.chinamobile.contacts.im.sync.d.z;
import com.chinamobile.contacts.im.ui.ICloudActivity;
import com.chinamobile.contacts.im.utils.ApplicationUtils;
import com.chinamobile.contacts.im.utils.aq;
import com.chinamobile.contacts.im.view.BaseToast;
import com.chinamobile.contacts.im.view.HintsDialog;
import com.chinamobile.contacts.im.view.ProgressDialog;
import com.chinamobile.contacts.im.view.actionbar.IcloudActionBar;
import com.umeng.analytics.MobclickAgent;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class SettingNewLoginMainActivity extends ICloudActivity implements TextWatcher, View.OnClickListener, com.chinamobile.contacts.im.login.a.b, OneCardLoginController.OnLoadCompletedListener {
    public static String e;
    private LinearLayout A;
    private EditText B;
    private EditText C;
    private Button D;
    private Button E;
    private Button F;
    private ImageButton G;
    private ImageButton H;
    private ProgressDialog I;
    private LinearLayout J;
    private TextView K;
    private LocalBroadcastManager L;
    private BroadcastReceiver M;
    private String O;
    private long Q;

    DisplayMetrics f2481a;
    Handler g;
    p h;
    private IcloudActionBar i;
    private Context j;
    private List<View> k;
    private Toast l;
    private ViewPager m;
    private Button n;
    private Button o;
    private ImageView p;
    private com.chinamobile.contacts.im.login.a.a q;
    private int r;
    private EditText s;
    private EditText t;
    private Button u;
    private Button v;
    private ImageButton w;
    private ImageButton x;
    private LinearLayout y;
    private LinearLayout z;

    public static boolean f2480b = true;
    public static boolean c = true;
    public static boolean d = true;
    public static String f = "loginSource";
    private com.chinamobile.icloud.im.b.a.a N = new com.chinamobile.icloud.im.b.a.a();
    private Intent P = null;
    private Handler R = new b(this);

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        c = true;
        this.L = LocalBroadcastManager.getInstance(this);
        this.M = new o(this, null);
        this.L.registerReceiver(this.M, new IntentFilter("register"));
        requestWindowFeature(1);
        setContentView(C0019R.layout.setting_new_login_success);
        b();
        a();
        c();
        this.q = com.chinamobile.contacts.im.login.a.a.a(this.j);
        if (f2480b) {
            j();
            e();
        } else {
            k();
            d();
        }
        this.h = new p(this);
        this.g = new a(this);
    }

    private void a() {
        this.n = (Button) findViewById(C0019R.id.btn_login_static);
        this.o = (Button) findViewById(C0019R.id.btn_login_dynamic);
        this.J = (LinearLayout) findViewById(C0019R.id.title_layout);
        this.p = (ImageView) findViewById(C0019R.id.cursor);
        try {
            this.f2481a = new DisplayMetrics();
            getWindowManager().getDefaultDisplay().getMetrics(this.f2481a);
            this.p.setLayoutParams(new LinearLayout.LayoutParams(this.f2481a.widthPixels / 4, 4));
        } catch (Exception e2) {
        }
    }

    private void b() {
        this.j = this;
        this.k = new ArrayList();
        Intent intent = getIntent();
        if (intent != null) {
            this.O = intent.getStringExtra(f);
        } else {
            this.O = "";
        }
        if (intent != null) {
            String stringExtra = intent.getStringExtra("plugins_intent_uri");
            if (!TextUtils.isEmpty(stringExtra)) {
                try {
                    this.P = Intent.parseUri(stringExtra, 1);
                    aq.d("long", "plugin url = " + this.P);
                } catch (URISyntaxException e2) {
                    e2.printStackTrace();
                }
            }
        }
    }

    private void c() {
        this.i = getIcloudActionBar();
        this.i.setNavigationMode(2);
        this.i.setDisplayAsUpTitle("登录");
        this.i.setDisplayAsUpBack(C0019R.drawable.iab_green_back, this);
        this.i.setDisplayAsUpTitleBtn("", null);
    }

    private void a(View view) {
        this.D = (Button) view.findViewById(C0019R.id.setting_new_login_success_btn_login);
        this.D.setEnabled(false);
        this.D.setTextColor(-3086108);
        this.B = (EditText) view.findViewById(C0019R.id.setting_input_phone_number);
        this.B.addTextChangedListener(this);
        this.B.setOnEditorActionListener(new e(this));
        this.G = (ImageButton) view.findViewById(C0019R.id.input_del_btn);
        this.G.setOnClickListener(this);
    }

    private void b(View view) {
        this.z = (LinearLayout) view.findViewById(C0019R.id.login_static_phonenum_bg);
        this.A = (LinearLayout) view.findViewById(C0019R.id.login_static_password_bg);
        this.u = (Button) view.findViewById(C0019R.id.setting_new_login_mobile_btn_login);
        this.u.setEnabled(false);
        this.u.setTextColor(-3086108);
        this.v = (Button) view.findViewById(C0019R.id.setting_new_login_btn_register);
        this.y = (LinearLayout) view.findViewById(C0019R.id.setting_new_login_btn_forgot_pw);
        this.s = (EditText) view.findViewById(C0019R.id.setting_new_login_mobile_et_num);
        this.s.addTextChangedListener(this);
        this.s.setOnFocusChangeListener(new f(this));
        this.t = (EditText) view.findViewById(C0019R.id.setting_new_login_mobile_et_password);
        this.t.addTextChangedListener(this);
        this.t.setOnEditorActionListener(new g(this));
        this.t.setOnFocusChangeListener(new h(this));
        this.w = (ImageButton) view.findViewById(C0019R.id.account_input_del_btn);
        this.w.setOnClickListener(this);
        this.x = (ImageButton) view.findViewById(C0019R.id.password_input_del_btn);
        this.x.setOnClickListener(this);
    }

    private void c(View view) {
        this.E = (Button) view.findViewById(C0019R.id.setting_new_login_sms_btn_login);
        this.E.setOnClickListener(this);
        this.F = (Button) view.findViewById(C0019R.id.setting_new_login_success_btn_send_pass);
        this.F.setOnClickListener(this);
        this.C = (EditText) view.findViewById(C0019R.id.setting_new_login_success_et_pass);
        this.C.addTextChangedListener(this);
        this.K = (TextView) view.findViewById(C0019R.id.info);
        this.H = (ImageButton) view.findViewById(C0019R.id.dynapassword_input_del_btn);
        this.H.setOnClickListener(this);
    }

    @Override
    protected void onResume() {
        super.onResume();
        this.q = com.chinamobile.contacts.im.login.a.a.a(this.j);
        this.q.a((com.chinamobile.contacts.im.login.a.b) this);
        String item = LoginInfoSP.getItem(this);
        Matcher matcher = Pattern.compile("^(1)\\d{10}$").matcher(item);
        if (!TextUtils.isEmpty(item)) {
            if (f2480b) {
                this.s.setText(item);
                this.s.setSelection(this.s.getText().toString().length());
            }
            if (matcher.find() && f2480b) {
                this.B.setText(item);
                this.B.setSelection(this.B.getText().toString().length());
            }
        } else {
            String line1Number = App.a().f().getLine1Number();
            if (!TextUtils.isEmpty(line1Number)) {
                if (line1Number.length() > 11) {
                    line1Number = line1Number.substring(line1Number.length() - 11, line1Number.length());
                }
                if (f2480b) {
                    this.s.setText(line1Number);
                    this.B.setText(line1Number);
                    this.B.setSelection(this.B.getText().toString().length());
                    this.s.setSelection(this.s.getText().toString().length());
                }
            }
        }
        if (this.B != null && this.B.getText() != null) {
            this.B.setSelection(this.B.getText().toString().length());
        }
        if (this.s != null && this.s.getText() != null) {
            this.s.setSelection(this.s.getText().toString().length());
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        this.q.a((com.chinamobile.contacts.im.login.a.b) null);
        if (this.L != null && this.M != null) {
            try {
                this.L.unregisterReceiver(this.M);
            } catch (Exception e2) {
                e2.printStackTrace();
            }
        }
    }

    private void d() {
        this.n.setOnClickListener(this);
        this.o.setOnClickListener(this);
        this.u.setOnClickListener(this);
        this.v.setOnClickListener(this);
        this.y.setOnClickListener(this);
    }

    private void e() {
        this.n.setOnClickListener(this);
        this.o.setOnClickListener(this);
        this.u.setOnClickListener(this);
        this.v.setOnClickListener(this);
        this.y.setOnClickListener(this);
        this.D.setOnClickListener(this);
    }

    @Override
    public void afterTextChanged(Editable editable) {
        if (!c && this.C != null && !TextUtils.isEmpty(this.C.getText()) && !this.E.isEnabled()) {
            this.E.setEnabled(true);
            this.E.setTextColor(-1);
            this.H.setVisibility(0);
        }
    }

    @Override
    public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
    }

    @Override
    public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        if (c) {
            if (this.B != null && !TextUtils.isEmpty(this.B.getText()) && this.D != null) {
                this.D.setEnabled(true);
                this.D.setTextColor(-1);
                this.G.setVisibility(0);
            } else if (this.D != null) {
                this.D.setEnabled(false);
                this.D.setTextColor(-3086108);
                this.G.setVisibility(8);
            }
        } else if (this.C != null && !TextUtils.isEmpty(this.C.getText())) {
            this.E.setEnabled(true);
            this.E.setTextColor(-1);
            this.H.setVisibility(0);
        } else if (this.E != null) {
            this.E.setEnabled(false);
            this.E.setTextColor(-3086108);
            this.H.setVisibility(8);
        }
        if (!TextUtils.isEmpty(this.s.getText())) {
            this.w.setVisibility(0);
        } else {
            this.w.setVisibility(8);
        }
        if (!TextUtils.isEmpty(this.t.getText())) {
            this.x.setVisibility(0);
        } else {
            this.x.setVisibility(8);
        }
        if (!TextUtils.isEmpty(this.t.getText()) && !TextUtils.isEmpty(this.s.getText()) && this.u != null) {
            this.u.setEnabled(true);
            this.u.setTextColor(-1);
        } else if (this.u != null) {
            this.u.setEnabled(false);
            this.u.setTextColor(-3086108);
        }
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
        f2480b = true;
    }

    @Override
    public void onClick(View view) {
        this.q.a((com.chinamobile.contacts.im.login.a.b) this);
        switch (view.getId()) {
            case C0019R.id.iab_back_area:
                InputMethodManager inputMethodManager = (InputMethodManager) getSystemService("input_method");
                if (!inputMethodManager.hideSoftInputFromWindow(view.getApplicationWindowToken(), 2)) {
                    inputMethodManager.hideSoftInputFromInputMethod(view.getApplicationWindowToken(), 2);
                }
                if (ApplicationUtils.getSystemVersion() <= 10) {
                    new Handler().postDelayed(new i(this), 200L);
                } else {
                    finish();
                }
                f2480b = true;
                return;
            case C0019R.id.input_del_btn:
                i();
                MobclickAgent.onEvent(this, "login_input_del_btn");
                return;
            case C0019R.id.setting_new_login_success_btn_login:
                if (m().booleanValue()) {
                    String str = e;
                    this.r = 1;
                    this.q.a(1, str);
                    return;
                }
                return;
            case C0019R.id.dynapassword_input_del_btn:
                f();
                MobclickAgent.onEvent(this, "login_input_del_btn");
                return;
            case C0019R.id.setting_new_login_success_btn_send_pass:
                long currentTimeMillis = System.currentTimeMillis();
                if (currentTimeMillis - this.Q >= 800) {
                    this.Q = currentTimeMillis;
                    String str2 = e;
                    this.r = 1;
                    this.q.a(1, str2);
                    return;
                }
                return;
            case C0019R.id.setting_new_login_sms_btn_login:
                this.r = 11;
                String obj = this.C.getText().toString();
                String a2 = a(this.r, e, obj);
                if (a2.equals("ok")) {
                    this.q.a(11, e, obj);
                    return;
                } else {
                    BaseToast.makeText(this.j, a2, 1000).show();
                    return;
                }
            case C0019R.id.account_input_del_btn:
                h();
                MobclickAgent.onEvent(this, "login_input_del_btn");
                return;
            case C0019R.id.password_input_del_btn:
                g();
                MobclickAgent.onEvent(this, "login_input_del_btn");
                return;
            case C0019R.id.setting_new_login_btn_register:
                startActivity(new Intent().setClass(this.j, SettingNewRegisterActivity.class));
                return;
            case C0019R.id.setting_new_login_mobile_btn_login:
                n();
                return;
            case C0019R.id.setting_new_login_btn_forgot_pw:
                Intent intent = new Intent();
                intent.setAction("android.intent.action.VIEW");
                intent.setData(Uri.parse("http://wap.cmpassport.com/fm?optype=10&sourceid=6&backurl=&check=57028feb6dea2afc46be28cd9c224cbb"));
                startActivity(intent);
                return;
            case C0019R.id.btn_login_static:
                MobclickAgent.onEvent(this.j, "loginRegister_login_static");
                this.m.setCurrentItem(0);
                return;
            case C0019R.id.btn_login_dynamic:
                MobclickAgent.onEvent(this.j, "loginRegister_login_dynamic");
                this.m.setCurrentItem(1);
                return;
            default:
                return;
        }
    }

    private void f() {
        try {
            if (this.C != null) {
                this.C.setText("");
            }
        } catch (Exception e2) {
            e2.printStackTrace();
        }
    }

    private void g() {
        try {
            if (this.t != null) {
                this.t.setText("");
            }
        } catch (Exception e2) {
            e2.printStackTrace();
        }
    }

    private void h() {
        try {
            if (this.s != null) {
                this.s.setText("");
                this.s.setFocusableInTouchMode(true);
                this.s.requestFocus();
            }
        } catch (Exception e2) {
            e2.printStackTrace();
        }
    }

    private void i() {
        try {
            if (this.B != null) {
                this.B.setText("");
            }
        } catch (Exception e2) {
            e2.printStackTrace();
        }
    }

    private String a(int i, String... strArr) {
        String str = strArr[0];
        if (str.length() == 0) {
            return "帐号不能为空";
        }
        switch (i) {
            case 2:
            case 10:
                if (strArr.length == 2) {
                    if (a(i, str) == "ok") {
                        String str2 = strArr[1];
                        if (str2.length() == 0) {
                            return "密码不能为空";
                        }
                        return b(i, str2);
                    }
                    return a(i, str);
                }
                return a(i, str);
            case 9:
            case 11:
                if (strArr.length == 2) {
                    if (a(i, str) == "ok") {
                        String str3 = strArr[1];
                        if (str3.length() == 0) {
                            return "密码不能为空";
                        }
                        return b(i, str3);
                    }
                    return a(i, str);
                }
                return a(i, str);
            default:
                return "ok";
        }
    }

    private String a(int i, String str) {
        Matcher matcher = Pattern.compile("^\\d+$").matcher(str);
        switch (i) {
            case 2:
            case 10:
            case 11:
                if (matcher.find() && !Pattern.compile("^(1)\\d{10}$").matcher(str).find()) {
                    return getString(C0019R.string.phone_number_error);
                }
                LoginInfoSP.saveItem(this, str);
                return "ok";
            case 9:
                if (matcher.find()) {
                    if (str.length() < 9) {
                        return getString(C0019R.string.accoutshort);
                    }
                    if (str.length() > 15) {
                        return getString(C0019R.string.accoutlong);
                    }
                } else {
                    if (str.indexOf("@") < 0 || str.length() > 50) {
                        return getString(C0019R.string.accoutformaterror);
                    }
                    if (str.indexOf("@") > 0 && str.length() < 6) {
                        return getString(C0019R.string.accoutshort);
                    }
                }
                LoginInfoSP.saveItem(this, str);
                return "ok";
            default:
                LoginInfoSP.saveItem(this, str);
                return "ok";
        }
    }

    private String b(int i, String str) {
        switch (i) {
            case 9:
                if (str.length() < 6) {
                    return "输入的密码过短,请重新输入";
                }
                if (str.length() > 30) {
                    return "输入的密码过长,请重新输入";
                }
                return "ok";
            case 11:
                if (!Pattern.compile("^\\d{6}$").matcher(str).find()) {
                    return "请输入6位纯数字验证码";
                }
                break;
        }
    }

    @Override
    public void a(String str) {
        if (this.r != 2 && this.r != 1) {
            this.I = new ProgressDialog(this.j, str);
            this.I.setCancelable(false);
            this.I.show();
        }
        if (this.r == 10 || this.r == 2) {
        }
    }

    @Override
    public void a(int i, com.chinamobile.icloud.im.sync.a.a aVar) {
        d = true;
        if ((i == 10 || i == 2 || i == 1) && aVar.f() == 1 && TextUtils.isEmpty(aVar.e())) {
            this.h.sendEmptyMessage(0);
            return;
        }
        if (this.I != null) {
            this.I.dismiss();
            this.h.sendEmptyMessage(1);
            this.h.sendEmptyMessage(2);
        }
        if (i == 9 || i == 11) {
            if (aVar.f() == 1) {
                if (!TextUtils.isEmpty(aVar.l())) {
                    try {
                        if (getIntent().getBooleanExtra("subphoneDialogSource", false)) {
                            this.j.startActivity(new Intent(this.j, (Class<?>) ManageSIMMActivity.class));
                        }
                    } catch (Exception e2) {
                        e2.printStackTrace();
                    }
                    a(aVar);
                    if ("CM".equals(LoginInfoSP.getMobileNet(this))) {
                        if (!TextUtils.isEmpty(this.O) && (this.O.equals("simm_login") || this.O.equals("simm_login_from_callfragment") || this.O.equals("user_layout"))) {
                            this.I = new ProgressDialog(this.j, "正在获取副号信息");
                            this.I.show();
                            SubPhonesCache.getInstance().startLoadingSubPhones(this);
                            return;
                        } else {
                            BaseToast.makeText(this, "登录成功!", 2000).show();
                            SubPhonesCache.getInstance().startLoadingSubPhones(null);
                            finish();
                            return;
                        }
                    }
                    BaseToast.makeText(this, "登录成功!", 2000).show();
                    finish();
                    return;
                }
                return;
            }
            if (aVar.f() == 0) {
                this.N.d(String.valueOf(2));
                this.N.e(String.valueOf(aVar.g()));
                com.chinamobile.icloud.im.b.b.b.a().a(this.N);
                this.t.setText("");
                if (aVar.h().contains("超时:请检查网络配置") || aVar.g() == 2015) {
                    if (aVar.g() == 2015) {
                        MobclickAgent.onEvent(this, "ip_islocked_error_password");
                    }
                    BaseToast.makeText(this, aVar.h(), 2000).show();
                    return;
                }
                if (aVar.g() == 2014 || aVar.g() == 2016 || aVar.g() == 3002014 || aVar.g() == 3004010 || aVar.g() == -32228) {
                    if (aVar.g() == 2014) {
                        MobclickAgent.onEvent(this, "account_islocked_error_password");
                    }
                    if (aVar.g() == 2016) {
                        MobclickAgent.onEvent(this, "same_password_islocked");
                    }
                    if (aVar.g() == 3004010) {
                        MobclickAgent.onEvent(this, "get_smscode_hour_limit");
                        this.h.sendEmptyMessage(0);
                    } else if (aVar.g() == -32228) {
                        MobclickAgent.onEvent(this, "get_smscode_day_limit");
                        this.h.sendEmptyMessage(0);
                    }
                    String h = aVar.h();
                    if (h.length() > 11) {
                        h = b(h);
                    }
                    HintsDialog hintsDialog = new HintsDialog(this, "温馨提示", h);
                    hintsDialog.setButton(new j(this));
                    hintsDialog.setStyle(1);
                    hintsDialog.show();
                    return;
                }
                if (!aVar.h().contains("请查收短信")) {
                    BaseToast.makeText(this, getString(C0019R.string.loginunifiederror), 2000).show();
                    return;
                }
                return;
            }
            return;
        }
        if (i == 1) {
            if (aVar.f() == 1 && aVar.e() != null) {
                try {
                    this.C.setText(aVar.e());
                    if (this.B != null && this.B.getText().toString() != null) {
                        this.q.a(11, this.B.getText().toString(), aVar.e());
                        return;
                    }
                    return;
                } catch (Exception e3) {
                    return;
                }
            }
            if (aVar.g() == 8) {
                BaseToast.makeText(this.j, aVar.h(), 2000).show();
                return;
            }
            d = false;
            String h2 = aVar.h();
            if (TextUtils.isEmpty(h2)) {
                h2 = "服务异常";
            } else if (h2.length() > 11) {
                h2 = b(aVar.h());
            }
            if (aVar.g() == 3004010) {
                MobclickAgent.onEvent(this, "get_smscode_hour_limit");
                this.h.sendEmptyMessage(0);
            } else if (aVar.g() == -32228) {
                MobclickAgent.onEvent(this, "get_smscode_day_limit");
                this.h.sendEmptyMessage(0);
            }
            HintsDialog hintsDialog2 = new HintsDialog(this, "温馨提示", h2);
            hintsDialog2.setButton(new k(this));
            hintsDialog2.setStyle(1);
            hintsDialog2.show();
            return;
        }
        if (i == 2) {
            if (aVar.f() == 1 && aVar.e() != null) {
                this.q.a(11, this.B.getText().toString(), aVar.e());
                return;
            }
            if (aVar.g() == 8) {
                BaseToast.makeText(this.j, aVar.h(), 2000).show();
                return;
            }
            if (aVar.h().equals("请求超时:请检查网络配置")) {
                BaseToast.makeText(this.j, aVar.h(), 2000).show();
                return;
            }
            if (aVar.g() == 3004010 || aVar.g() == -32228) {
                if (aVar.g() == 3004010) {
                    MobclickAgent.onEvent(this, "get_smscode_hour_limit");
                    this.h.sendEmptyMessage(0);
                } else if (aVar.g() == -32228) {
                    MobclickAgent.onEvent(this, "get_smscode_day_limit");
                    this.h.sendEmptyMessage(0);
                }
                String h3 = aVar.h();
                if (TextUtils.isEmpty(h3)) {
                    h3 = "服务异常";
                }
                HintsDialog hintsDialog3 = new HintsDialog(this, "温馨提示", h3);
                hintsDialog3.setButton(new l(this));
                hintsDialog3.setStyle(1);
                hintsDialog3.show();
                return;
            }
            d = false;
            c = false;
            this.k.remove(1);
            this.k.remove(0);
            k();
            e();
            f2480b = false;
        }
    }

    private void j() {
        View inflate = View.inflate(getApplicationContext(), C0019R.layout.setting_new_login_static, null);
        View inflate2 = View.inflate(getApplicationContext(), C0019R.layout.setting_new_login_dynamic, null);
        this.k.add(0, inflate2);
        this.k.add(1, inflate);
        this.m = (ViewPager) findViewById(C0019R.id.login_pager);
        this.m.setAdapter(new q(this, this.k, null));
        this.m.setOnPageChangeListener(new m(this));
        this.m.setCurrentItem(0);
        b(inflate);
        a(inflate2);
    }

    private void k() {
        View inflate = View.inflate(getApplicationContext(), C0019R.layout.setting_new_login_static, null);
        View inflate2 = View.inflate(getApplicationContext(), C0019R.layout.setting_new_login_dynamic_finish, null);
        this.k.add(0, inflate2);
        this.k.add(1, inflate);
        this.m = (ViewPager) findViewById(C0019R.id.login_pager);
        this.m.setAdapter(new q(this, this.k, null));
        this.m.setOnPageChangeListener(new m(this));
        this.m.setCurrentItem(0);
        b(inflate);
        c(inflate2);
        this.E.setEnabled(false);
        this.E.setTextColor(-3086108);
        this.K.setText(e);
    }

    public static Intent a(Context context) {
        return new Intent(context, (Class<?>) SettingNewLoginMainActivity.class);
    }

    public void l() {
        AlertDialog.Builder builder = new AlertDialog.Builder(this.j);
        builder.setTitle(C0019R.string.upgrade_title1);
        builder.setMessage(C0019R.string.upgrade_text1);
        builder.setPositiveButton(getString(C0019R.string.cancel), new c(this));
        builder.setNeutralButton(getString(C0019R.string.upgrade_btn_text2), new d(this));
        builder.setNegativeButton(getString(C0019R.string.cancel), (DialogInterface.OnClickListener) null);
        builder.create().show();
    }

    public Boolean m() {
        this.r = 2;
        e = this.B.getText().toString();
        String obj = this.B.getText().toString();
        this.r = 2;
        String a2 = a(this.r, obj);
        if (a2.equals("ok")) {
            if (a((Activity) this)) {
                MobclickAgent.onEvent(this.j, "loginRegister_dynamic_login");
                d = false;
                c = false;
                this.k.remove(1);
                this.k.remove(0);
                k();
                e();
                f2480b = false;
                return true;
            }
            try {
                BaseToast.makeText(this.j, "网络不稳定,请稍候", 1000).show();
            } catch (Exception e2) {
                e2.printStackTrace();
            }
        } else {
            Toast.makeText(this.j, a2, 1000).show();
        }
        return false;
    }

    public void n() {
        if (ApplicationUtils.query_is_register(this.j)) {
            this.r = 9;
            String obj = this.s.getText().toString();
            String obj2 = this.t.getText().toString();
            String a2 = a(this.r, obj, obj2);
            if (a2.equals("ok")) {
                MobclickAgent.onEvent(this.j, "loginRegister_passport_login");
                this.q.a(9, obj, obj2);
                return;
            } else {
                BaseToast.makeText(this.j, a2, 1000).show();
                return;
            }
        }
        BaseToast.makeText(this.j, "网络不稳定,请稍候", 1000).show();
        ApplicationUtils.doRegister(this.j);
    }

    public boolean a(Activity activity) {
        NetworkInfo[] allNetworkInfo;
        ConnectivityManager connectivityManager = (ConnectivityManager) activity.getApplicationContext().getSystemService("connectivity");
        if (connectivityManager == null || (allNetworkInfo = connectivityManager.getAllNetworkInfo()) == null || allNetworkInfo.length <= 0) {
            return false;
        }
        for (NetworkInfo networkInfo : allNetworkInfo) {
            if (networkInfo.getState() == NetworkInfo.State.CONNECTED) {
                return true;
            }
        }
        return false;
    }

    private void a(com.chinamobile.icloud.im.sync.a.a aVar) {
        LoginInfoSP.saveSession(this.j, aVar.l());
        LoginInfoSP.saveLogin(this.j, true);
        z.a(this.j, aVar);
        LoginInfoSP.saveUserName(this.j, aVar.k());
        if (ApplicationUtils.isCMCCPhone(aVar.k())) {
            LoginInfoSP.saveBunding(this.j, true);
        }
        f2480b = true;
        SubPhonesCache.getInstance().clearCache();
        new OneCardDao(App.b()).deleteAll();
        LoginInfoSP.savefirstloginvnet(this.j, true);
        com.chinamobile.contacts.im.service.m.b().a((Object) 8226);
        PushService.a(this.j);
        com.chinamobile.contacts.im.mms2.voicesms.l.a().g();
        com.chinamobile.contacts.im.f.c.d b2 = com.chinamobile.contacts.im.f.c.a.a().b();
        int i = com.chinamobile.contacts.im.f.c.a.f2459a;
        com.chinamobile.contacts.im.f.c.a.f2459a = i + 1;
        b2.a(i);
        setResult(-1);
        com.chinamobile.contacts.im.contacts.d.v.a(this.j, 0L);
        if (com.chinamobile.contacts.im.config.h.q) {
            ab.a().b();
        }
        if (this.P != null) {
            String stringExtra = this.P.getStringExtra("url");
            if (!TextUtils.isEmpty(stringExtra) && stringExtra.contains("token=null")) {
                this.P.putExtra("url", stringExtra.replace("token=null", "token=" + ContactAccessor.getAuth(this.j).l()));
            }
            startActivity(this.P);
        }
        al.a().b();
    }

    @Override
    public void onLoadCompleted(String str) {
        if (this.I != null && this.I.isShowing()) {
            this.I.dismiss();
        }
        if (!TextUtils.isEmpty(str)) {
            BaseToast.makeText(this.j, str, 1000).show();
        } else {
            com.jeremyfeinstein.slidingmenu.lib.i.a().b();
            if (this.O.equals("simm_login")) {
                al.b(this);
            }
        }
        finish();
    }

    public static String b(String str) {
        return str.replaceAll("请2小时后再试", "请 2小时后再试").replaceAll("请1小时后再试", "请 1小时后再试").replaceAll("请联系客服QQ:", "请联系客服 QQ: ");
    }
}