OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 PasswordResetActivity.java 源代码,内容仅作参考
package com.excelliance.kxqp.user;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.text.Editable;
import android.text.Selection;
import android.text.Spannable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.text.method.HideReturnsTransformationMethod;
import android.text.method.PasswordTransformationMethod;
import android.util.Log;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.excelliance.kxqp.GameUtil;
import com.excelliance.kxqp.ui.BaseActivity;
import com.excelliance.kxqp.util.ToastUtil;
import com.excelliance.kxqp.util.ac;
import com.excelliance.kxqp.util.ag;
import com.excelliance.kxqp.util.aj;
import com.excelliance.kxqp.util.n;
import com.excelliance.kxqp.util.t;
import java.util.regex.Pattern;
import org.json.JSONObject;
public class PasswordResetActivity extends BaseActivity implements View.OnClickListener {
private Context f14796a;
private View f14797b;
private ImageView c;
private EditText d;
private TextView e;
private TextView f;
private EditText g;
private ImageView h;
private TextView i;
private EditText j;
private SharedPreferences k;
private String l;
private RelativeLayout m;
private RelativeLayout n;
private boolean o = false;
@Override
public void onCreate(Bundle bundle) {
requestWindowFeature(1);
super.onCreate(bundle);
this.f14796a = this;
this.f14797b = com.excelliance.kxqp.swipe.a.a.getLayout(this.f14796a, "activity_reset_pwd");
if (this.f14797b != null) {
setContentView(this.f14797b);
a();
}
this.k = getSharedPreferences("USERINFO", Build.VERSION.SDK_INT < 11 ? 0 : 4);
this.l = aj.a().a(this.k, n.h);
}
private void a() {
t a2 = t.a(this.f14796a);
this.m = (RelativeLayout) a2.a("step1_layout", this.f14797b);
this.n = (RelativeLayout) a2.a("step2_layout", this.f14797b);
this.c = (ImageView) a2.a(this.f14797b, "iv_back", 0);
this.c.setOnClickListener(this);
this.d = (EditText) a2.a("edit_old_pwd", this.f14797b);
this.e = (TextView) a2.a(this.f14797b, "send", 1);
this.e.setOnClickListener(this);
this.f = (TextView) a2.a(this.f14797b, "forget_pwd", 2);
this.f.setOnClickListener(this);
this.g = (EditText) a2.a("new_pwd_input", this.f14797b);
this.g.addTextChangedListener(new a() {
@Override
public void afterTextChanged(Editable editable) {
if (!TextUtils.isEmpty(editable) || PasswordResetActivity.this.j == null) {
return;
}
PasswordResetActivity.this.j.setText("");
}
});
this.j = (EditText) a2.a("new_pwd_confirm", this.f14797b);
this.h = (ImageView) a2.a(this.f14797b, "iv_switch", 3);
this.h.setOnClickListener(this);
this.i = (TextView) a2.a(this.f14797b, "btn_confirm_new_pwd", 4);
this.i.setOnClickListener(this);
}
@Override
public void onClick(View view) {
switch (Integer.valueOf(view.getTag().toString()).intValue()) {
case 0:
d();
return;
case 1:
c();
a(this.d);
return;
case 2:
int identifier = getResources().getIdentifier("slide_left_int", "anim", getPackageName());
int identifier2 = getResources().getIdentifier("slide_left_out", "anim", getPackageName());
startActivity(new Intent(this.f14796a, (Class<?>) GetBackPwdActivity.class));
finish();
overridePendingTransition(identifier, identifier2);
return;
case 3:
if (this.g != null) {
if (!this.o) {
this.g.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
} else {
this.g.setTransformationMethod(PasswordTransformationMethod.getInstance());
}
this.o = !this.o;
this.g.postInvalidate();
Editable text = this.g.getText();
if (text instanceof Spannable) {
Selection.setSelection(text, text.length());
}
}
int idOfDrawable = com.excelliance.kxqp.swipe.a.a.getIdOfDrawable(this.f14796a, "eye_open");
int idOfDrawable2 = com.excelliance.kxqp.swipe.a.a.getIdOfDrawable(this.f14796a, "eye_close");
if (!this.o) {
this.h.setImageDrawable(this.f14796a.getResources().getDrawable(idOfDrawable2));
return;
} else {
this.h.setImageDrawable(this.f14796a.getResources().getDrawable(idOfDrawable));
return;
}
case 4:
e();
return;
default:
return;
}
}
private void c() {
GameUtil.getIntance();
if (!GameUtil.isNetworkConnected(this.f14796a)) {
ToastUtil.showToast(this.f14796a, com.excelliance.kxqp.swipe.a.a.getString(this.f14796a, "network_unavailable"));
return;
}
String a2 = aj.a().a(this.k, "USER_P002");
String trim = this.d.getText().toString().trim();
if (TextUtils.isEmpty(trim)) {
ToastUtil.showToast(this.f14796a, com.excelliance.kxqp.swipe.a.a.getString(this.f14796a, "please_enter_pwd"));
return;
}
if (trim.length() < 6 || trim.length() > 20) {
ToastUtil.showToast(this.f14796a, com.excelliance.kxqp.swipe.a.a.getString(this.f14796a, "user_pwd_be_error"));
return;
}
if (!a(trim)) {
ToastUtil.showToast(this.f14796a, com.excelliance.kxqp.swipe.a.a.getString(this.f14796a, "user_pwd_be_error"));
} else if (!a2.equals(trim)) {
ToastUtil.showToast(this.f14796a, com.excelliance.kxqp.swipe.a.a.getString(this.f14796a, "user_pwd_be_error"));
} else {
ToastUtil.showToast(this.f14796a, com.excelliance.kxqp.swipe.a.a.getString(this.f14796a, "pwd_reset_confirm_success"));
this.m.setVisibility(8);
this.n.setVisibility(0);
}
}
@Override
public void onBackPressed() {
super.onBackPressed();
d();
}
private void d() {
a(this.d);
finish();
overridePendingTransition(0, getResources().getIdentifier("slide_right_out", "anim", getPackageName()));
}
private void e() {
final String trim = this.g.getText().toString().trim();
if (TextUtils.isEmpty(trim)) {
ToastUtil.showToast(this.f14796a, com.excelliance.kxqp.swipe.a.a.getString(this.f14796a, "please_set_password"));
return;
}
String trim2 = this.j.getText().toString().trim();
if (TextUtils.isEmpty(trim2)) {
ToastUtil.showToast(this.f14796a, com.excelliance.kxqp.swipe.a.a.getString(this.f14796a, "please_repeat_password"));
return;
}
if (TextUtils.isEmpty(trim) || trim.length() < 6 || trim.length() > 20 || TextUtils.isEmpty(trim2) || trim2.length() < 6 || trim2.length() > 20) {
ToastUtil.showToast(this.f14796a, com.excelliance.kxqp.swipe.a.a.getString(this.f14796a, "account_password_length"));
return;
}
b a2 = b.a();
if (!a2.a(trim) || !a2.a(trim2)) {
ToastUtil.showToast(this.f14796a, com.excelliance.kxqp.swipe.a.a.getString(this.f14796a, "password_group"));
return;
}
if (!TextUtils.equals(trim, trim2)) {
ToastUtil.showToast(this.f14796a, com.excelliance.kxqp.swipe.a.a.getString(this.f14796a, "two_unlike"));
return;
}
GameUtil.getIntance();
if (!GameUtil.isNetworkConnected(this.f14796a)) {
ToastUtil.showToast(this.f14796a, com.excelliance.kxqp.swipe.a.a.getString(this.f14796a, "network_unavailable"));
return;
}
final ag a3 = ag.a();
a3.a(this.f14796a);
a3.a("user_pwd_resetting");
ac.a().a("http://folder.appota.cn/modifypwd.php", com.excelliance.kxqp.util.b.a(b(this.l, trim)), new ac.a() {
@Override
public void a(String str) {
Log.d("PassWordReset", "startSearch = " + str);
a3.b();
if (!TextUtils.isEmpty(str)) {
PasswordResetActivity.this.a(str, trim);
return;
}
Log.d("PassWordReset", "startSearch is empty");
ToastUtil.showToast(PasswordResetActivity.this.f14796a, com.excelliance.kxqp.swipe.a.a.getString(PasswordResetActivity.this.f14796a, "server_exception"));
}
@Override
public void b(String str) {
a3.b();
Log.d("PassWordReset", "onFailed = " + str);
ToastUtil.showToast(PasswordResetActivity.this.f14796a, com.excelliance.kxqp.swipe.a.a.getString(PasswordResetActivity.this.f14796a, "server_exception"));
}
});
}
public void a(String str, String str2) {
try {
JSONObject jSONObject = new JSONObject(str);
String optString = jSONObject.optString("status");
String optString2 = jSONObject.optString("flag");
Log.d("PassWordReset", "status = " + optString + ", flag = " + optString2);
if (TextUtils.equals(optString, "1")) {
if (TextUtils.equals(optString2, "1")) {
ToastUtil.showToast(this.f14796a, com.excelliance.kxqp.swipe.a.a.getString(this.f14796a, "user_pwd_success_reset"));
aj.a().a(this.k, "USER_P002", str2);
d();
} else if (TextUtils.equals(optString2, "2")) {
ToastUtil.showToast(this.f14796a, com.excelliance.kxqp.swipe.a.a.getString(this.f14796a, "user_phone_num_un_bound"));
} else if (TextUtils.equals(optString2, "3")) {
ToastUtil.showToast(this.f14796a, com.excelliance.kxqp.swipe.a.a.getString(this.f14796a, "user_pwd_reset_sample"));
} else {
ToastUtil.showToast(this.f14796a, com.excelliance.kxqp.swipe.a.a.getString(this.f14796a, "server_exception"));
}
} else {
ToastUtil.showToast(this.f14796a, com.excelliance.kxqp.swipe.a.a.getString(this.f14796a, "server_exception"));
}
} catch (Exception e) {
e.printStackTrace();
Log.d("PassWordReset", "exception = " + e.getMessage());
ToastUtil.showToast(this.f14796a, com.excelliance.kxqp.swipe.a.a.getString(this.f14796a, "server_exception"));
}
}
private String b(String str, String str2) {
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("phoneNum", str);
jSONObject.put("pwd", str2);
return jSONObject.toString();
} catch (Exception e) {
e.printStackTrace();
Log.d("PassWordReset", "excepiton = " + e.getMessage());
return null;
}
}
private void a(View view) {
InputMethodManager inputMethodManager;
if (view == null || (inputMethodManager = (InputMethodManager) this.f14796a.getSystemService("input_method")) == null) {
return;
}
inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
private boolean a(String str) {
return Pattern.compile("^[0-9A-Za-z]{6,20}$").matcher(str).matches();
}
private class a implements TextWatcher {
@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) {
}
private a() {
}
}
}