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

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


package com.qihoo.appstore.activities;

import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.Parcelable;
import android.telephony.TelephonyManager;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.AutoCompleteTextView;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.qihoo.appstore.personnalcenter.sdk.CustomAddAccountsActivity;
import com.qihoo.appstore.ui.ScrollScreenLayout;
import com.qihoo.freewifi.push.R;
import com.qihoo.speedometer.Config;
import com.qihoo360.accounts.QihooAccount;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.regex.Pattern;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class UserLoginActivity extends StatFragmentActivity implements View.OnClickListener {
    ProgressDialog c;
    String e;
    private AutoCompleteTextView g;
    private EditText h;
    private EditText i;
    private ImageView j;
    private CheckBox k;
    private CheckBox l;
    private ScrollScreenLayout m;
    private com.qihoo.appstore.personnalcenter.h n;
    private View o;
    private View p;
    private View q;
    private boolean r;
    private String s;
    private String t;
    private Intent u;
    private com.qihoo.appstore.d.a v;
    private boolean w;
    private int x;
    private QihooAccount y;

    boolean f725a = false;

    boolean f726b = false;
    String d = Config.INVALID_IP;
    Handler f = new Handler(new kk(this));

    public static void a(Context context) {
        Intent intent = new Intent(context, (Class<?>) WebviewFragementActivity.class);
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put("title", context.getString(R.string.personnal_user_login_forget_pwd));
            jSONObject.put("count", 1);
            JSONObject jSONObject2 = new JSONObject();
            jSONObject2.put("title", Config.INVALID_IP);
            jSONObject2.put("url", "http://i.360.cn/findpwdwap?client=app");
            jSONObject2.put("tag", Config.INVALID_IP);
            JSONArray jSONArray = new JSONArray();
            jSONArray.put(jSONObject2);
            jSONObject.put("data", jSONArray);
        } catch (JSONException e) {
        }
        intent.putExtra("content", jSONObject.toString());
        MainActivity.e().b(intent);
    }

    public void a(ImageView imageView) {
        if (this.w) {
            return;
        }
        this.w = true;
        if (this.j != null) {
            this.j.setVisibility(4);
        }
        new com.qihoo360.accounts.a.a.f(getApplicationContext(), com.qihoo.appstore.personnalcenter.sdk.e.b(), Looper.getMainLooper(), new lf(this, imageView)).a();
    }

    public void a(QihooAccount qihooAccount) {
        if (qihooAccount == null) {
            return;
        }
        String a2 = qihooAccount.a();
        if (TextUtils.isEmpty(a2)) {
            a2 = qihooAccount.d();
        }
        if (TextUtils.isEmpty(a2) || TextUtils.isEmpty(qihooAccount.c) || TextUtils.isEmpty(qihooAccount.d)) {
            Toast.makeText(getBaseContext(), R.string.personnal_user_login_auto_login_failed, 1).show();
            return;
        }
        this.c = ProgressDialog.show(MainActivity.e(), getString(R.string.tip), getString(R.string.loging_wait));
        this.c.setCancelable(true);
        new com.qihoo360.accounts.a.a.z(this, com.qihoo.appstore.personnalcenter.sdk.e.b(), Looper.myLooper(), new ky(this, qihooAccount)).a(a2, qihooAccount.c, qihooAccount.d, null, "q");
    }

    public void a(String str, String str2, String str3, String str4, String str5) {
        if (!com.qihoo.appstore.utils.de.p(getBaseContext())) {
            Toast.makeText(getBaseContext(), R.string.user_center_profile_change_pwd_no_network, 0).show();
            return;
        }
        View inflate = LayoutInflater.from(getApplicationContext()).inflate(R.layout.modify_temp_pwd_view, (ViewGroup) null);
        TextView textView = (TextView) inflate.findViewById(R.id.modify_old_pwd);
        String string = getString(R.string.user_center_modify_temp_pwd_1, new Object[]{str4, str5});
        SpannableString spannableString = new SpannableString(string);
        spannableString.setSpan(new ForegroundColorSpan(-28919), string.indexOf(str4), string.indexOf(str4) + str4.length(), 18);
        spannableString.setSpan(new ForegroundColorSpan(-28919), string.indexOf(str5), string.indexOf(str5) + str5.length(), 18);
        textView.setText(spannableString);
        EditText editText = (EditText) inflate.findViewById(R.id.new_psw_edit);
        ((ImageView) inflate.findViewById(R.id.new_pas_edit_controller)).setOnClickListener(new ko(this, editText));
        if (this.v != null && this.v.isShowing()) {
            this.v.dismiss();
        }
        this.v = new com.qihoo.appstore.d.a(this);
        this.v.setTitle(R.string.user_center_modify_temp_pwd_title);
        this.v.b(inflate);
        this.v.a(R.string.ok, new kp(this, editText, str4, str5));
        this.v.b(R.string.cancel, new kq(this, str, str2, str4));
        this.v.setOnDismissListener(new kr(this));
        this.v.setCancelable(true);
        this.v.show();
        com.qihoo.appstore.utils.de.C(getApplicationContext());
        if (this.n == null) {
            this.n = com.qihoo.appstore.personnalcenter.h.a(getApplicationContext());
        }
    }

    public void a(String str, String str2, String str3, String str4, String str5, String str6, String str7, int i) {
        if (MainActivity.e() == null || TextUtils.isEmpty(str2) || TextUtils.isEmpty(str3)) {
            h();
            return;
        }
        MainActivity e = MainActivity.e();
        ArrayList arrayList = new ArrayList();
        arrayList.add(new BasicNameValuePair("qid", str2));
        String[] a2 = MainActivity.f().a(str3);
        String str8 = a2[0];
        String str9 = a2[1];
        HashMap hashMap = new HashMap();
        hashMap.put("Q", str8);
        hashMap.put("T", str9);
        MainActivity.f().a(e, new kj(this, str, str2, str3, str4, str5, str6, str7, i)).a("CommonAccount.getSecurityInfo", arrayList, hashMap, new ArrayList(), com.qihoo360.accounts.a.b.RESPONSE_STRING, "secmobile");
    }

    public void a(QihooAccount[] qihooAccountArr) {
        this.x = 0;
        this.y = qihooAccountArr[0];
        com.qihoo.appstore.d.a aVar = new com.qihoo.appstore.d.a(this);
        ListView listView = (ListView) LayoutInflater.from(getApplicationContext()).inflate(R.layout.personnal_center_select_account_listview, (ViewGroup) null);
        ku kuVar = new ku(this, qihooAccountArr);
        listView.setAdapter((ListAdapter) kuVar);
        listView.setOnItemClickListener(new kv(this, kuVar));
        aVar.setTitle(getString(R.string.user_center_select_account_title));
        aVar.a(R.string.confirm, new kw(this));
        aVar.b(R.string.cancel, new kx(this));
        aVar.a(listView, new LinearLayout.LayoutParams(-1, -2));
        aVar.setCancelable(true);
        aVar.show();
    }

    public static boolean a(String str) {
        return Pattern.compile("[0-9]*").matcher(str).matches();
    }

    public int b(String str) {
        String str2 = "4";
        if (a(str) && str.length() >= 1) {
            str2 = "2";
        } else if (str.contains("@")) {
            str2 = "1";
        }
        return Integer.parseInt(str2);
    }

    private void b() {
        Intent intent = getIntent();
        boolean booleanExtra = intent.getBooleanExtra("shoudGoBack", false);
        this.t = intent.getStringExtra("login_route");
        this.r = intent.getBooleanExtra("extra_switch_account", false);
        this.s = intent.getStringExtra("extra_switch_text");
        Parcelable parcelableExtra = intent.getParcelableExtra("BUNDLE_TARGET_INTENT_AFTER_LOGIN");
        if (parcelableExtra instanceof Intent) {
            this.u = (Intent) parcelableExtra;
        } else if (booleanExtra) {
            this.u = null;
        } else {
            this.u = new Intent(MainActivity.e(), (Class<?>) UserInfoActivity1.class);
        }
    }

    private void c() {
        findViewById(R.id.back).setOnClickListener(this);
        findViewById(R.id.button_login).setOnClickListener(this);
        findViewById(R.id.button_register).setOnClickListener(this);
        findViewById(R.id.one_key_login).setOnClickListener(this);
        findViewById(R.id.register_license1).setOnClickListener(this);
        findViewById(R.id.register_license2).setOnClickListener(this);
        findViewById(R.id.slide_to_left).setOnClickListener(this);
        findViewById(R.id.slide_to_right).setOnClickListener(this);
        ((TextView) findViewById(R.id.forget_pwd)).setOnClickListener(this);
        this.k = (CheckBox) findViewById(R.id.register_read_lisence1);
        this.l = (CheckBox) findViewById(R.id.register_read_lisence2);
        this.g = (AutoCompleteTextView) findViewById(R.id.edittext_account);
        this.g.setDropDownBackgroundResource(R.drawable.user_center_account_history_bg);
        this.h = (EditText) findViewById(R.id.edittext_password);
        this.q = findViewById(R.id.verification_code);
        this.i = (EditText) findViewById(R.id.edittext_verfication_code);
        this.j = (ImageView) findViewById(R.id.imageview_verfication_code);
        this.j.setOnClickListener(this);
        this.o = findViewById(R.id.button_pwd_clear);
        this.o.setOnClickListener(this);
        this.p = findViewById(R.id.button_account_clear);
        this.p.setOnClickListener(this);
        this.g.setOnFocusChangeListener(new kt(this));
        this.g.addTextChangedListener(new kz(this));
        this.h.addTextChangedListener(new la(this));
        this.g.setOnClickListener(new lb(this));
        this.m = (ScrollScreenLayout) findViewById(R.id.viewpager);
        this.m.setScrollableByTouch(false);
    }

    public void c(String str) {
        com.qihoo.appstore.d.a aVar = new com.qihoo.appstore.d.a(MainActivity.e());
        aVar.setTitle(R.string.tip);
        aVar.c(R.string.register_sim_registered);
        aVar.a(R.string.login_directly, new kl(this, str));
        aVar.b(R.string.personnal_user_login_forget_pwd, new km(this));
        aVar.show();
    }

    public void d() {
        Intent intent = new Intent(this, (Class<?>) CustomAddAccountsActivity.class);
        intent.putExtra("extra_switch_account", this.r);
        intent.putExtra("BUNDLE_TARGET_INTENT_AFTER_LOGIN", this.u);
        intent.putExtra("add_type", com.qihoo.appstore.personnalcenter.sdk.g.c);
        intent.putExtra("init_user", Config.INVALID_IP);
        intent.putExtra("add_email_type", com.qihoo.appstore.personnalcenter.sdk.g.f3013b);
        intent.putExtra("add_email", com.qihoo.appstore.personnalcenter.sdk.g.f3012a);
        intent.putExtra("add_mobile_type", com.qihoo.appstore.personnalcenter.sdk.g.c);
        intent.putExtra("client_auth_from", "mpc_zhushou");
        intent.putExtra("client_auth_sign_key", "973dbf24m");
        intent.putExtra("client_auth_crypt_key", "j8a7i2u6");
        MainActivity.e().b(intent);
    }

    private void e() {
        ArrayList arrayList = new ArrayList();
        String b2 = com.qihoo.appstore.personnalcenter.g.b(getBaseContext(), "input_account", Config.INVALID_IP);
        if (b2.length() > 0 && !TextUtils.isEmpty(b2)) {
            arrayList.add(b2);
            this.d = b2;
        }
        if (getIntent().getStringExtra("account") != null) {
            this.g.setText(getIntent().getStringExtra("account"));
        } else {
            com.qihoo.appstore.personnalcenter.h.a(getBaseContext()).a(getBaseContext(), new le(this, arrayList));
        }
    }

    public void f() {
        if (!this.k.isChecked()) {
            Toast.makeText(this, R.string.qihoo_accounts_register_error_license, 0).show();
            return;
        }
        if (!com.qihoo.appstore.utils.de.p(this)) {
            Toast.makeText(this, R.string.no_net_cannt_regist_retry_later, 0).show();
            return;
        }
        if (i()) {
            this.c = ProgressDialog.show(MainActivity.e(), getString(R.string.tip), !this.r ? getString(R.string.loging_wait) : !TextUtils.isEmpty(this.s) ? this.s : getString(R.string.user_center_switching_account));
            new com.qihoo.appstore.personnalcenter.sdk.h(this, new kn(this)).a();
            return;
        }
        Message.obtain(this.f, 0, getString(R.string.regist_failed_no_simcard)).sendToTarget();
        d();
        if (com.qihoo360.mobilesafe.a.a.f5313a) {
            com.qihoo.appstore.utils.bk.b("UserLoginActivity", "register failed no simcard");
        }
    }

    public void g() {
        new Thread(new ks(this)).start();
    }

    public void h() {
        if (MainActivity.e() == null || isFinishing() || this.c == null || !this.c.isShowing()) {
            return;
        }
        this.c.dismiss();
    }

    private boolean i() {
        try {
            return ((TelephonyManager) getSystemService("phone")).getSimState() == 5;
        } catch (Exception e) {
            return false;
        }
    }

    public void a() {
        try {
            InputMethodManager inputMethodManager = (InputMethodManager) getSystemService("input_method");
            inputMethodManager.hideSoftInputFromWindow(this.h.getWindowToken(), 0);
            inputMethodManager.hideSoftInputFromWindow(this.g.getWindowToken(), 0);
            inputMethodManager.hideSoftInputFromWindow(this.i.getWindowToken(), 0);
        } catch (Exception e) {
        }
    }

    public void a(String str, String str2, String str3, String str4) {
        new com.qihoo360.accounts.a.a.n(this, com.qihoo.appstore.personnalcenter.sdk.e.b(), Looper.getMainLooper(), new ld(this, str)).a(str, str2, str3, str4);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.back:
                com.qihoo.appstore.utils.de.n(this);
                onkeyBack();
                return;
            case R.id.one_key_login:
                f();
                return;
            case R.id.register_license1:
            case R.id.register_license2:
                MainActivity.f().b(this);
                return;
            case R.id.slide_to_right:
                this.m.a(1);
                return;
            case R.id.button_account_clear:
                if (this.g != null) {
                    this.g.setText(Config.INVALID_IP);
                    return;
                }
                return;
            case R.id.button_pwd_clear:
                if (this.h != null) {
                    this.h.setText(Config.INVALID_IP);
                    return;
                }
                return;
            case R.id.forget_pwd:
                a((Context) this);
                return;
            case R.id.imageview_verfication_code:
                a(this.j);
                return;
            case R.id.button_register:
                d();
                return;
            case R.id.button_login:
                if (!this.l.isChecked()) {
                    Toast.makeText(this, R.string.qihoo_accounts_register_error_license, 0).show();
                    return;
                }
                if (!com.qihoo.appstore.utils.de.p(getBaseContext())) {
                    Toast.makeText(getBaseContext(), R.string.no_net_retry_later, 0).show();
                    return;
                }
                String trim = this.g.getText().toString().trim();
                String trim2 = this.h.getText().toString().trim();
                if (TextUtils.isEmpty(trim) || TextUtils.isEmpty(trim2)) {
                    Toast.makeText(getBaseContext(), R.string.password_or_account_cant_empty, 0).show();
                    return;
                }
                String trim3 = this.f725a ? this.i.getText().toString().trim() : null;
                String str = this.f725a ? this.e : null;
                if (this.f725a && TextUtils.isEmpty(trim3)) {
                    Toast.makeText(getBaseContext(), R.string.verification_code_cant_empty, 0).show();
                    return;
                }
                com.qihoo.appstore.personnalcenter.g.a(getBaseContext(), "input_account", trim);
                com.qihoo.appstore.personnalcenter.g.a(getBaseContext(), "auto_login", true);
                a();
                this.f.postDelayed(new lc(this, trim, trim2, str, trim3), 200L);
                return;
            case R.id.slide_to_left:
                this.m.a(0);
                return;
            default:
                return;
        }
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        this.mStatTag = "login01";
        setContentView(R.layout.user_login_activity);
        b();
        c();
        this.n = com.qihoo.appstore.personnalcenter.h.a(MainActivity.e());
        if (!this.r) {
            g();
        } else if (i()) {
            this.f.sendEmptyMessageDelayed(3, 300L);
        } else {
            Toast.makeText(this, R.string.user_center_switch_account_sim_failed, 1).show();
        }
        if (com.qihoo.appstore.personnalcenter.friends.b.a(this, this.u)) {
            new Handler().postDelayed(new ki(this), 100L);
        }
    }

    @Override
    public boolean onKeyDown(int i, KeyEvent keyEvent) {
        if (i != 4) {
            return super.onKeyDown(i, keyEvent);
        }
        onkeyBack();
        return true;
    }

    @Override
    public void onPause() {
        if (this.g != null) {
            this.g.clearFocus();
        }
        if (this.h != null) {
            this.h.clearFocus();
        }
        if (this.i != null) {
            this.i.clearFocus();
        }
        super.onPause();
    }

    @Override
    public void onResume() {
        super.onResume();
        e();
    }
}