正在查看: 六分钟步行测试管理软件 v1.1.0.2112120029 应用的 ChangePasswordActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 六分钟步行测试管理软件 v1.1.0.2112120029 应用的 ChangePasswordActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package cn.neoprint.padmonitor.ui;
import android.app.Activity;
import android.graphics.Typeface;
import android.os.Bundle;
import android.os.PowerManager;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.TextView;
import cn.neoprint.padmonitor.R;
import cn.neoprint.padmonitor.app.AppGlobal;
import cn.neoprint.padmonitor.utils.EncryptAndDecryptUtil;
import cn.neoprint.padmonitor.utils.FontManager;
import cn.neoprint.padmonitor.utils.PwdCheckUtil;
import cn.neoprint.padmonitor.utils.ToastUtils;
import cn.neoprint.padmonitor.utils.constant.GzjSharePref;
import com.sayeasytech.base.log.KLog;
public class ChangePasswordActivity extends Activity implements View.OnClickListener {
EditText confirmPwdEt;
EditText newPwdEt;
EditText oldPwdEt;
AppGlobal myApp = null;
public PowerManager powerManager = null;
public PowerManager.WakeLock wakeLock = null;
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
requestWindowFeature(1);
AppGlobal appGlobal = AppGlobal.getInstance();
this.myApp = appGlobal;
appGlobal.setSystemBarVisible(this, false);
setContentView(R.layout.activity_change_password);
PowerManager powerManager = (PowerManager) getSystemService("power");
this.powerManager = powerManager;
PowerManager.WakeLock newWakeLock = powerManager.newWakeLock(26, "report Lock");
this.wakeLock = newWakeLock;
newWakeLock.acquire();
setFinishOnTouchOutside(false);
FontManager.changeFonts((ViewGroup) getWindow().getDecorView(), this, Typeface.createFromAsset(getAssets(), "fonts/MSBlack.ttf"));
this.oldPwdEt = (EditText) findViewById(R.id.old_pwd_et);
this.newPwdEt = (EditText) findViewById(R.id.new_pwd_et);
this.confirmPwdEt = (EditText) findViewById(R.id.confirm_pwd_et);
((TextView) findViewById(R.id.confirm_pwd_btn)).setOnClickListener(this);
((TextView) findViewById(R.id.back_btn)).setOnClickListener(this);
}
@Override
public void finish() {
super.finish();
overridePendingTransition(0, R.anim.zoomout);
}
@Override
public void onClick(View view) {
int id = view.getId();
if (id == 2131362170) {
finish();
} else {
if (id != 2131362347) {
return;
}
updatePassword();
}
}
private void updatePassword() {
String valueByDefault;
if (this.oldPwdEt.getText().toString().isEmpty() || this.newPwdEt.getText().toString().isEmpty() || this.confirmPwdEt.getText().toString().isEmpty()) {
ToastUtils.showMessage(this, R.string.input_user_password);
return;
}
try {
valueByDefault = EncryptAndDecryptUtil.decrypt(this, GzjSharePref.getValueByDefault(this, GzjSharePref.KEY_USER_PASSWORD, EncryptAndDecryptUtil.encrypt(this, getString(R.string.default_password))));
} catch (Exception e) {
KLog.e("decrypt old password error", e);
valueByDefault = GzjSharePref.getValueByDefault(this, GzjSharePref.KEY_USER_PASSWORD, getString(R.string.default_password));
}
if (!this.oldPwdEt.getText().toString().equals(valueByDefault)) {
ToastUtils.showMessage(this, R.string.old_password_error);
return;
}
if (!this.newPwdEt.getText().toString().equals(this.confirmPwdEt.getText().toString())) {
ToastUtils.showMessage(this, R.string.new_password_not_match);
return;
}
if (this.newPwdEt.getText().toString().length() != 6) {
ToastUtils.showMessage(this, R.string.new_password_need_length);
return;
}
if (!PwdCheckUtil.isLetterDigit(this.newPwdEt.getText().toString())) {
ToastUtils.showMessage(this, R.string.new_password_need_letter_digit);
return;
}
try {
GzjSharePref.setValue(this, GzjSharePref.KEY_USER_PASSWORD, EncryptAndDecryptUtil.encrypt(this, this.newPwdEt.getText().toString()));
} catch (Exception e2) {
KLog.e("change password failed.", e2);
}
KLog.i("user change password success");
finish();
}
}