OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 GetBackPwdActivity.java 源代码,内容仅作参考
package com.excelliance.kxqp.gs.user;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.excelliance.kxqp.gs.base.BaseActivity;
import com.excelliance.kxqp.gs.util.ao;
import com.excelliance.kxqp.gs.util.av;
import com.excelliance.kxqp.gs.util.bk;
import com.excelliance.kxqp.gs.util.bp;
import com.excelliance.kxqp.gs.util.bu;
import com.excelliance.kxqp.gs.util.bx;
import com.excelliance.kxqp.gs.util.c;
import com.excelliance.kxqp.gs.util.cd;
import com.excelliance.kxqp.gs.util.cg;
import com.excelliance.kxqp.gs.util.ci;
import com.excelliance.kxqp.gs.util.t;
import com.excelliance.kxqp.gs.util.w;
import org.json.JSONException;
import org.json.JSONObject;
public class GetBackPwdActivity extends BaseActivity {
Handler f11611a = new Handler() {
@Override
public void handleMessage(Message message) {
super.handleMessage(message);
if (message.what != 100 || GetBackPwdActivity.this.i == null || GetBackPwdActivity.this.j == null) {
return;
}
if (GetBackPwdActivity.this.o <= 0) {
GetBackPwdActivity.this.i.setVisibility(0);
GetBackPwdActivity.this.j.setVisibility(8);
return;
}
GetBackPwdActivity.d(GetBackPwdActivity.this);
String e = w.e(GetBackPwdActivity.this.mContext, "user_get_indentify_code_again");
GetBackPwdActivity.this.j.setText(GetBackPwdActivity.this.o + e);
GetBackPwdActivity.this.f11611a.removeMessages(100);
GetBackPwdActivity.this.f11611a.sendEmptyMessageDelayed(100, 1000L);
}
};
private View f11612b;
private ImageView c;
private LinearLayout d;
private LinearLayout e;
private EditText f;
private String g;
private EditText h;
private TextView i;
private TextView j;
private TextView k;
private EditText l;
private EditText m;
private TextView n;
private int o;
private SharedPreferences p;
private SharedPreferences q;
private String r;
private String s;
private boolean t;
private String u;
static int d(GetBackPwdActivity getBackPwdActivity) {
int i = getBackPwdActivity.o;
getBackPwdActivity.o = i - 1;
return i;
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
this.q = getSharedPreferences("USERINFO", Build.VERSION.SDK_INT < 11 ? 0 : 4);
this.p = this.mContext.getSharedPreferences("MSG_INDENTIFY_CODE", Build.VERSION.SDK_INT < 11 ? 0 : 4);
this.f11612b = w.b(this.mContext, "activity_get_back_pwd");
this.t = getIntent().getBooleanExtra("isResetPassword", false);
this.u = getIntent().getStringExtra("phone_number");
if (this.f11612b != null) {
setContentView(this.f11612b);
a();
initStatusbar();
}
}
private void a() {
ao a2 = ao.a(this.mContext);
this.c = (ImageView) a2.a(this.f11612b, "iv_back", 0);
this.c.setOnClickListener(this);
this.d = (LinearLayout) a2.a("first_step", this.f11612b);
this.f = (EditText) a2.a("et_input_phone_number", this.f11612b);
if (TextUtils.isEmpty(this.u)) {
this.f.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public void afterTextChanged(Editable editable) {
if (!TextUtils.isEmpty(editable) || GetBackPwdActivity.this.h == null) {
return;
}
GetBackPwdActivity.this.h.setText("");
}
});
} else {
this.f.setText(this.u);
this.f.setEnabled(false);
}
this.h = (EditText) a2.a("et_input_identify_code", this.f11612b);
this.h.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
if (i != 2) {
return false;
}
GetBackPwdActivity.this.c();
return true;
}
});
this.h.addTextChangedListener(new cd.a() {
@Override
public void afterTextChanged(Editable editable) {
if (!cd.a(GetBackPwdActivity.this.h.getText().toString().trim())) {
GetBackPwdActivity.this.k.setEnabled(true);
GetBackPwdActivity.this.k.setTextColor(-1);
} else {
GetBackPwdActivity.this.k.setEnabled(false);
GetBackPwdActivity.this.k.setTextColor(w.l(GetBackPwdActivity.this.mContext, "login_button_text"));
}
}
});
this.i = (TextView) a2.a(this.f11612b, "tv_get_indentify_code", 1);
this.i.setOnClickListener(this);
this.j = (TextView) a2.a("tv_time_down", this.f11612b);
this.k = (TextView) a2.a(this.f11612b, "tv_next_step", 2);
this.k.setOnClickListener(this);
this.e = (LinearLayout) a2.a("second_step", this.f11612b);
this.l = (EditText) a2.a("et_set_new_pwd", this.f11612b);
this.m = (EditText) a2.a("et_sure_new_pwd", this.f11612b);
this.m.addTextChangedListener(new cd.a() {
@Override
public void afterTextChanged(Editable editable) {
String trim = GetBackPwdActivity.this.l.getText().toString().trim();
String trim2 = GetBackPwdActivity.this.m.getText().toString().trim();
if (cd.a(trim.toString().trim()) || trim.toString().trim().length() < 6 || cd.a(trim2) || trim2.length() < 6) {
GetBackPwdActivity.this.n.setEnabled(false);
GetBackPwdActivity.this.n.setTextColor(w.l(GetBackPwdActivity.this.mContext, "login_button_text"));
} else {
GetBackPwdActivity.this.n.setEnabled(true);
GetBackPwdActivity.this.n.setTextColor(-1);
}
}
});
this.l.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public void afterTextChanged(Editable editable) {
Editable text = GetBackPwdActivity.this.l.getText();
if (TextUtils.isEmpty(text) && GetBackPwdActivity.this.m != null) {
GetBackPwdActivity.this.m.setText("");
}
String trim = GetBackPwdActivity.this.m.getText().toString().trim();
if (cd.a(text.toString().trim()) || text.toString().trim().length() < 6 || cd.a(trim) || trim.length() < 6) {
GetBackPwdActivity.this.n.setEnabled(false);
GetBackPwdActivity.this.n.setTextColor(w.l(GetBackPwdActivity.this.mContext, "login_button_text"));
} else {
GetBackPwdActivity.this.n.setEnabled(true);
GetBackPwdActivity.this.n.setTextColor(-1);
}
}
});
this.n = (TextView) a2.a(this.f11612b, "tv_finish", 3);
this.n.setOnClickListener(this);
TextView textView = (TextView) a2.a("title", this.f11612b);
if (this.t) {
this.s = w.e(this, "user_info_reset_password");
textView.setText(this.s);
this.f.setText(bx.a().a(this.q, t.j));
this.f.setEnabled(false);
this.h.setFocusable(true);
this.h.requestFocus();
this.h.setSelection(0);
}
}
@Override
public void singleClick(View view) {
switch (Integer.parseInt(view.getTag().toString())) {
case 0:
a(this.c);
d();
return;
case 1:
e();
if (this.h != null) {
this.h.setFocusable(true);
this.h.requestFocus();
return;
}
return;
case 2:
c();
return;
case 3:
b();
a(this.n);
return;
default:
return;
}
}
private void b() {
final String trim = this.l.getText().toString().trim();
if (TextUtils.isEmpty(trim)) {
cg.a(this.mContext, w.e(this.mContext, "please_set_password"));
return;
}
String trim2 = this.m.getText().toString().trim();
if (TextUtils.isEmpty(trim2)) {
cg.a(this.mContext, w.e(this.mContext, "please_repeat_password"));
return;
}
if (TextUtils.isEmpty(trim) || trim.length() < 6 || trim.length() > 20 || TextUtils.isEmpty(trim2) || trim2.length() < 6 || trim2.length() > 20) {
cg.a(this.mContext, w.e(this.mContext, "account_password_length"));
return;
}
ci a2 = ci.a();
if (!a2.a(trim) || !a2.a(trim2)) {
cg.a(this.mContext, w.e(this.mContext, "password_group"));
return;
}
if (!TextUtils.equals(trim, trim2)) {
cg.a(this.mContext, w.e(this.mContext, "two_unlike"));
} else {
if (!av.a().b(this.mContext)) {
cg.a(this.mContext, w.e(this.mContext, "network_unavailable"));
return;
}
final bu a3 = bu.a();
a3.a(this.mContext);
a3.a("user_pwd_resetting");
bk.a().a("https://sdk.ourplay.com.cn/account/modifypwd.php", c.a(b(this.r, trim)), new bk.a() {
@Override
public void a(String str) {
Log.d("GetBackPwdActivity", "response = " + str);
a3.b();
if (!TextUtils.isEmpty(str)) {
GetBackPwdActivity.this.a(str, trim);
return;
}
Log.d("GetBackPwdActivity", "response is empty");
cg.a(GetBackPwdActivity.this.mContext, w.e(GetBackPwdActivity.this.mContext, "server_exception"));
}
@Override
public void b(String str) {
a3.b();
Log.d("GetBackPwdActivity", "onFailed = " + str);
cg.a(GetBackPwdActivity.this.mContext, w.e(GetBackPwdActivity.this.mContext, "server_exception"));
}
});
}
}
public void a(String str, String str2) {
String e;
try {
JSONObject jSONObject = new JSONObject(str);
String optString = jSONObject.optString("status");
String optString2 = jSONObject.optString("flag");
Log.d("GetBackPwdActivity", "status = " + optString + ", flag = " + optString2);
if (TextUtils.equals(optString, "1")) {
if (TextUtils.equals(optString2, "1")) {
if (this.t) {
e = w.e(this.mContext, "user_pwd_success_reset");
} else {
e = w.e(this.mContext, "user_pwd_reset_success");
}
cg.a(this.mContext, e);
bx.a().b(this.q, t.j, this.g);
bx.a().b(this.q, "USER_P002", str2);
d();
return;
}
if (TextUtils.equals(optString2, "2")) {
cg.a(this.mContext, w.e(this.mContext, "user_phone_num_un_bound"));
return;
} else if (TextUtils.equals(optString2, "3")) {
cg.a(this.mContext, w.e(this.mContext, "user_pwd_reset_sample"));
return;
} else {
cg.a(this.mContext, w.e(this.mContext, "server_exception"));
return;
}
}
cg.a(this.mContext, w.e(this.mContext, "server_exception"));
} catch (Exception e2) {
e2.printStackTrace();
Log.d("GetBackPwdActivity", "exception = " + e2.getMessage());
cg.a(this.mContext, w.e(this.mContext, "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("GetBackPwdActivity", "excepiton = " + e.getMessage());
return null;
}
}
public void c() {
this.r = a(ci.a());
if (TextUtils.isEmpty(this.r)) {
return;
}
if (TextUtils.isEmpty(this.h.getText().toString().trim())) {
cg.a(this.mContext, w.e(this.mContext, "user_input_indentify_code"));
return;
}
String trim = this.h.getText().toString().trim();
String string = this.p.getString("MSG_CODE_" + this.f.getText().toString().trim(), "");
long j = this.p.getLong("MSG_TIME_" + this.f.getText().toString().trim(), 0L);
int currentTimeMillis = (int) ((System.currentTimeMillis() - j) / 60000);
Log.d("GetBackPwdActivity", "diffTime = " + currentTimeMillis);
if (currentTimeMillis > 30 && j != 0) {
cg.a(this.mContext, w.e(this.mContext, "user_get_code_has_died"));
} else if (!TextUtils.equals(trim, string)) {
cg.a(this.mContext, w.e(this.mContext, "user_get_code_error"));
} else {
if (this.d == null || this.e == null) {
return;
}
this.g = this.f.getText().toString();
this.d.setVisibility(8);
this.e.setVisibility(0);
}
}
private void d() {
finish();
overridePendingTransition(0, getResources().getIdentifier("slide_right_out", "anim", getPackageName()));
}
@Override
public void onBackPressed() {
d();
}
private void a(View view) {
InputMethodManager inputMethodManager;
if (view == null || (inputMethodManager = (InputMethodManager) this.mContext.getSystemService("input_method")) == null) {
return;
}
inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
private void e() {
ci a2 = ci.a();
String a3 = a(a2);
if (TextUtils.isEmpty(a3)) {
return;
}
a2.a(a3, 2, new ci.a() {
@Override
public void a(String str) {
Log.d("GetBackPwdActivity", "response = " + str);
if (!TextUtils.isEmpty(str)) {
GetBackPwdActivity.this.a(str);
return;
}
cg.a(GetBackPwdActivity.this.mContext, w.e(GetBackPwdActivity.this.mContext, "user_get_indentify_code_failed"));
Log.d("GetBackPwdActivity", "response is null");
}
@Override
public void b(String str) {
String e = w.e(GetBackPwdActivity.this.mContext, "user_get_indentify_code_failed");
Log.d("GetBackPwdActivity", "msgFailed = " + str);
cg.a(GetBackPwdActivity.this.mContext, e);
}
});
cg.a(this.mContext, w.e(this.mContext, "user_get_code_has_send"));
if (this.i == null || this.j == null) {
return;
}
this.i.setVisibility(8);
this.j.setVisibility(0);
this.o = 60;
String e = w.e(this.mContext, "user_get_indentify_code_again");
this.j.setText(this.o + e);
this.f11611a.removeMessages(100);
this.f11611a.sendEmptyMessageDelayed(100, 1000L);
}
private String a(ci ciVar) {
if (this.f != null) {
String trim = this.f.getText().toString().trim();
if (TextUtils.isEmpty(trim)) {
cg.a(this.mContext, w.e(this.mContext, "user_input_phone_number"));
return null;
}
if (!ciVar.b(trim)) {
cg.a(this.mContext, w.e(this.mContext, "user_input_legal_phone_number"));
return null;
}
if (av.a().b(this.mContext)) {
return trim;
}
cg.a(this.mContext, w.e(this.mContext, "network_unavailable"));
return null;
}
Log.d("GetBackPwdActivity", "获取不到控件");
return null;
}
public void a(String str) {
String str2;
try {
str2 = bp.a(str, t.f12027a, "utf-8");
} catch (Exception e) {
e.printStackTrace();
Log.d("GetBackPwdActivity", "exception = " + e.getMessage());
str2 = null;
}
if (!TextUtils.isEmpty(str2)) {
try {
JSONObject jSONObject = new JSONObject(str2);
if (TextUtils.equals(jSONObject.optString("status", "0"), "1")) {
String optString = jSONObject.optString("flag", "0");
if (TextUtils.equals(optString, "0")) {
String optString2 = jSONObject.optString("code");
if (!TextUtils.isEmpty(optString2)) {
this.p.edit().putString("MSG_CODE_" + this.f.getText().toString().trim(), optString2).apply();
this.p.edit().putLong("MSG_TIME_" + this.f.getText().toString().trim(), System.currentTimeMillis()).apply();
} else {
Log.d("GetBackPwdActivity", "code is empty");
}
} else if (TextUtils.equals(optString, "1")) {
cg.a(this.mContext, w.e(this.mContext, "user_get_code_reach_limit"));
} else if (TextUtils.equals(optString, "2")) {
cg.a(this.mContext, w.e(this.mContext, "user_phone_num_un_bound"));
} else {
Log.d("GetBackPwdActivity", "暂无处理");
}
} else {
cg.a(this.mContext, w.e(this.mContext, "user_get_indentify_code_failed"));
}
return;
} catch (JSONException e2) {
e2.printStackTrace();
Log.d("GetBackPwdActivity", "exception = " + e2.getMessage());
return;
}
}
Log.d("GetBackPwdActivity", "data is empty");
}
@Override
public void onDestroy() {
super.onDestroy();
this.f11611a.removeCallbacksAndMessages(null);
}
}