和通讯录 v3.9.6版本的 MD5 值为:669178e2ee1b2311daf378bd20c6bbe1
以下内容为反编译后的 SettingNewRegisterPassword.java 源代码,内容仅作参考
package com.chinamobile.contacts.im.login;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.android.common.speech.LoggingEvents;
import com.chinamobile.contacts.im.C0019R;
import com.chinamobile.contacts.im.ui.ICloudActivity;
import com.chinamobile.contacts.im.view.BaseToast;
import com.chinamobile.contacts.im.view.actionbar.IcloudActionBar;
import java.util.regex.Pattern;
public class SettingNewRegisterPassword extends ICloudActivity implements TextWatcher, View.OnClickListener, com.chinamobile.contacts.im.login.a.b {
public static String f2484a;
public static String f2485b;
public static String c;
private IcloudActionBar d;
private Button e;
private EditText f;
private EditText g;
private com.chinamobile.contacts.im.login.a.a h;
private Context i;
private int j;
private com.chinamobile.icloud.im.b.a.a k = new com.chinamobile.icloud.im.b.a.a();
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
requestWindowFeature(1);
setContentView(C0019R.layout.setting_new_login_register_password);
this.i = this;
this.h = com.chinamobile.contacts.im.login.a.a.a((Context) this);
Bundle extras = getIntent().getExtras();
if (extras != null) {
f2484a = extras.getString("mobile");
f2485b = extras.getString(LoggingEvents.VoiceIme.EXTRA_ERROR_CODE);
}
c();
a();
b();
}
@Override
public void onResume() {
super.onResume();
this.h.a((com.chinamobile.contacts.im.login.a.b) this);
}
@Override
public void onDestroy() {
super.onDestroy();
this.h.a((com.chinamobile.contacts.im.login.a.b) null);
}
private void a() {
this.e.setOnClickListener(this);
}
private void b() {
this.d = getIcloudActionBar();
this.d.setNavigationMode(2);
this.d.setDisplayAsUpTitle("注册");
this.d.setDisplayAsUpBack(C0019R.drawable.iab_green_back, this);
this.d.setDisplayAsUpTitleBtn("", null);
}
private void c() {
this.e = (Button) findViewById(C0019R.id.setting_register_now_btn);
this.e.setEnabled(false);
this.e.setTextColor(-3086108);
this.f = (EditText) findViewById(C0019R.id.setting_register_input_pw_et);
this.f.addTextChangedListener(this);
this.g = (EditText) findViewById(C0019R.id.setting_register_input_pw_again_et);
this.g.addTextChangedListener(this);
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case C0019R.id.iab_back_area:
finish();
return;
case C0019R.id.agreement_text:
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setData(Uri.parse("http://wap.cmpassport.com/resources/html/contract.html "));
startActivity(intent);
return;
case C0019R.id.setting_register_now_btn:
c = this.f.getText().toString();
String a2 = a(c, this.g.getText().toString());
if (a2.equals("ok")) {
this.j = 12;
this.h.a(this.j, f2484a, c, f2485b);
return;
} else {
BaseToast.makeText(this.i, a2, 1000).show();
this.f.setText("");
this.g.setText("");
return;
}
default:
return;
}
}
@Override
public void afterTextChanged(Editable editable) {
}
@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 (this.f.getText().toString().length() > 0 && this.g.getText().toString().length() > 0) {
this.e.setEnabled(true);
this.e.setTextColor(-1);
} else {
this.e.setEnabled(false);
this.e.setTextColor(-3086108);
}
}
public static Intent a(Context context, String str, String str2) {
Intent intent = new Intent(context, (Class<?>) SettingNewRegisterPassword.class);
if (str != null && str2 != null) {
Bundle bundle = new Bundle();
bundle.putString("mobile", str);
bundle.putString(LoggingEvents.VoiceIme.EXTRA_ERROR_CODE, str2);
intent.putExtras(bundle);
}
return intent;
}
private String a(String str, String str2) {
Boolean bool;
Boolean bool2;
Boolean bool3;
if (str.length() == 0 || str2.length() == 0) {
return "密码不能为空";
}
if (str.length() < 6) {
this.f.setText("");
this.g.setText("");
this.f.setFocusableInTouchMode(true);
this.f.requestFocus();
return "密码长度不能少于6位,请重新输入";
}
if (!str.equals(str2)) {
this.f.setText("");
this.g.setText("");
this.f.setFocusableInTouchMode(true);
this.f.requestFocus();
return "两次输入的密码不一致";
}
if (Pattern.compile("^[0-9]+$").matcher(str).find() && str.length() < 8) {
this.f.setText("");
this.g.setText("");
this.f.setFocusableInTouchMode(true);
this.f.requestFocus();
return "纯数字密码不能少于8位,请重新输入";
}
if (!Pattern.compile("^[A-Za-z0-9_~@\\$\\^]+$").matcher(str).find()) {
this.f.setText("");
this.g.setText("");
this.f.setFocusableInTouchMode(true);
this.f.requestFocus();
return "密码包含非法字符,请重新输入";
}
int i = 0;
while (true) {
if (i >= str.length() - 1) {
bool = true;
break;
}
char[] charArray = str.toCharArray();
if (charArray[i] > charArray[i + 1]) {
i++;
} else {
bool = false;
break;
}
}
int i2 = 0;
while (true) {
if (i2 >= str.length() - 1) {
bool2 = true;
break;
}
char[] charArray2 = str.toCharArray();
if (charArray2[i2] == charArray2[i2 + 1]) {
i2++;
} else {
bool2 = false;
break;
}
}
int i3 = 0;
while (true) {
if (i3 >= str.length() - 1) {
bool3 = true;
break;
}
char[] charArray3 = str.toCharArray();
if (charArray3[i3] < charArray3[i3 + 1]) {
i3++;
} else {
bool3 = false;
break;
}
}
if (bool.booleanValue() || bool2.booleanValue() || bool3.booleanValue()) {
this.f.setText("");
this.g.setText("");
this.f.setFocusableInTouchMode(true);
this.f.requestFocus();
return "密码不能为字符串联,如123456、AAAAAA";
}
return "ok";
}
@Override
public void a(String str) {
if (this.j == 10) {
}
}
@Override
public void a(int i, com.chinamobile.icloud.im.sync.a.a aVar) {
if ((i == 10 || i == 2) && aVar.f() == 1 && TextUtils.isEmpty(aVar.e())) {
new v(this).sendEmptyMessage(0);
return;
}
if (i == 12) {
if (aVar.f() == 1) {
Toast.makeText(this.i, "注册成功", 1000).show();
Intent intent = new Intent(this.i, (Class<?>) SettingRegisterFinished.class);
intent.putExtra("pass_id", aVar.d());
intent.putExtra("mobile", f2484a);
intent.putExtra("password", c);
intent.getFlags();
intent.setFlags(67108864);
intent.getFlags();
startActivity(intent);
finish();
return;
}
this.k.d(String.valueOf(3));
this.k.e(String.valueOf(aVar.g()));
com.chinamobile.icloud.im.b.b.b.a().a(this.k);
Toast.makeText(this.i, "注册失败:" + aVar.h(), 1000).show();
}
}
}