钱能钱包 v3.10.2版本的 MD5 值为:339a4b585ef2aa3bfaf7e4baeb254647
以下内容为反编译后的 RegisterActivity.java 源代码,内容仅作参考
package com.tech.pay.ui.main;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Intent;
import android.net.http.SslError;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.text.Html;
import android.text.TextUtils;
import android.text.method.HideReturnsTransformationMethod;
import android.text.method.PasswordTransformationMethod;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.webkit.CookieManager;
import android.webkit.SslErrorHandler;
import android.webkit.ValueCallback;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.EditText;
import android.widget.Toast;
import cn.jiguang.internal.JConstants;
import cn.jpush.android.api.JPushInterface;
import cn.jpush.android.api.JThirdPlatFormInterface;
import cn.jpush.android.service.WakedResultReceiver;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.parser.Feature;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.qn.app.wallet.R;
import com.tech.network.bean.BaseResp;
import com.tech.pay.base.BaseWalletActivity;
import com.tech.pay.ui.main.RegisterActivity;
import e.h.a.b.j;
import e.h.a.b.l;
import e.h.a.b.m;
import e.h.c.c.h2;
import e.h.c.c.p0;
import java.util.HashMap;
import java.util.Locale;
import okhttp3.Call;
public class RegisterActivity extends BaseWalletActivity {
public p0 f6116k;
public String f6117l;
public String m;
public boolean n;
public class a extends e.h.b.d.c.b {
public class C0136a extends TypeReference<BaseResp<String>> {
public C0136a() {
}
}
public a() {
}
@Override
public void d(Call call, Exception exc, int i2) {
RegisterActivity.this.h();
j.a().d(RegisterActivity.this, exc.getMessage());
}
@Override
public void e(String str, int i2) {
RegisterActivity.this.h();
BaseResp baseResp = (BaseResp) JSON.parseObject(str, new C0136a(), new Feature[0]);
if (baseResp.errcode == 0) {
e.h.c.b.a.i().D(JSON.parseObject((String) baseResp.data).getString(JThirdPlatFormInterface.KEY_TOKEN));
Toast.makeText(RegisterActivity.this, "注册成功", 1).show();
RegisterActivity.this.startActivity(new Intent(RegisterActivity.this, MainActivity.class));
e.h.c.a.d.f().d();
return;
}
Toast.makeText(RegisterActivity.this, baseResp.errmsg, 1).show();
}
}
public class b extends e.h.b.d.c.b {
public b() {
}
@Override
public void d(Call call, Exception exc, int i2) {
RegisterActivity.this.h();
j.a().d(RegisterActivity.this, exc.getMessage());
}
@Override
public void e(String str, int i2) {
RegisterActivity.this.h();
JSONObject parseObject = JSON.parseObject(str);
if (parseObject.getIntValue("errcode") == 0) {
JSONObject jSONObject = parseObject.getJSONObject(JThirdPlatFormInterface.KEY_DATA);
RegisterActivity.this.f6117l = jSONObject.getString("paynotice");
if (!TextUtils.isEmpty(RegisterActivity.this.f6117l)) {
RegisterActivity.this.X();
return;
} else {
Toast.makeText(RegisterActivity.this, "未配置用户须知", 1).show();
return;
}
}
Toast.makeText(RegisterActivity.this, parseObject.getString("errmsg"), 1).show();
}
}
public class c extends WebViewClient {
public c() {
}
@Override
public void onReceivedError(WebView webView, int i2, String str, String str2) {
super.onReceivedError(webView, i2, str, str2);
}
@Override
public void onReceivedHttpError(WebView webView, WebResourceRequest webResourceRequest, WebResourceResponse webResourceResponse) {
super.onReceivedHttpError(webView, webResourceRequest, webResourceResponse);
}
@Override
public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
super.onReceivedSslError(webView, sslErrorHandler, sslError);
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
webView.loadUrl(str, e.h.b.b.b.d().g());
return true;
}
@Override
public void onReceivedError(WebView webView, WebResourceRequest webResourceRequest, WebResourceError webResourceError) {
super.onReceivedError(webView, webResourceRequest, webResourceError);
}
}
public class d extends e.h.b.d.c.b {
public d() {
}
@Override
public void d(Call call, Exception exc, int i2) {
RegisterActivity.this.h();
j.a().d(RegisterActivity.this.f5969c, exc.getMessage());
}
@Override
public void e(String str, int i2) {
RegisterActivity.this.h();
if (str != null) {
if (((JsonElement) new Gson().fromJson(str, (Class<Object>) JsonElement.class)).getAsJsonObject().get(JThirdPlatFormInterface.KEY_DATA).getAsJsonObject().get("status").getAsInt() != 1) {
j.a().d(RegisterActivity.this.f5969c, "图形验证失败,请重试!");
return;
}
RegisterActivity registerActivity = RegisterActivity.this;
registerActivity.A(registerActivity.f6116k.f8744c.getText().toString(), RegisterActivity.this.m);
}
}
}
public class e extends e.h.b.d.c.b {
public class a extends TypeReference<BaseResp<String>> {
public a() {
}
}
public e() {
}
@Override
public void d(Call call, Exception exc, int i2) {
RegisterActivity.this.h();
j.a().d(RegisterActivity.this.f5969c, exc.getMessage());
}
@Override
public void e(String str, int i2) {
RegisterActivity.this.h();
BaseResp baseResp = (BaseResp) JSON.parseObject(str, new a(), new Feature[0]);
if (baseResp.errcode == 0) {
RegisterActivity.this.z();
}
Toast.makeText(RegisterActivity.this.f5969c, baseResp.errmsg, 1).show();
}
}
public class f extends CountDownTimer {
public f(long j2, long j3) {
super(j2, j3);
}
@Override
public void onFinish() {
RegisterActivity.this.f6116k.f8751j.setEnabled(true);
RegisterActivity.this.f6116k.f8751j.setText("获取验证码");
}
@Override
public void onTick(long j2) {
RegisterActivity.this.f6116k.f8751j.setText(String.format(Locale.getDefault(), "重新发送(%ds)", Long.valueOf(j2 / 1000)));
}
}
public void E(View view) {
if (!TextUtils.isEmpty(this.f6117l)) {
X();
} else {
B();
}
}
public void G(View view) {
if (this.f6116k.f8746e.getTransformationMethod() == HideReturnsTransformationMethod.getInstance()) {
this.f6116k.f8746e.setTransformationMethod(PasswordTransformationMethod.getInstance());
EditText editText = this.f6116k.f8746e;
editText.setSelection(editText.getText().length());
this.f6116k.f8748g.setImageResource(R.drawable.ic_login_eye_show);
return;
}
this.f6116k.f8746e.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
EditText editText2 = this.f6116k.f8746e;
editText2.setSelection(editText2.getText().length());
this.f6116k.f8748g.setImageResource(R.drawable.ic_login_eye_hide);
}
public void I(View view) {
if (this.f6116k.f8747f.getTransformationMethod() == HideReturnsTransformationMethod.getInstance()) {
this.f6116k.f8747f.setTransformationMethod(PasswordTransformationMethod.getInstance());
EditText editText = this.f6116k.f8747f;
editText.setSelection(editText.getText().length());
this.f6116k.f8749h.setImageResource(R.drawable.ic_login_eye_show);
return;
}
this.f6116k.f8747f.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
EditText editText2 = this.f6116k.f8747f;
editText2.setSelection(editText2.getText().length());
this.f6116k.f8749h.setImageResource(R.drawable.ic_login_eye_hide);
}
public void K(View view) {
String obj = this.f6116k.f8744c.getText().toString();
if (!TextUtils.isEmpty(obj) && obj.length() == 11 && obj.startsWith(WakedResultReceiver.CONTEXT_KEY)) {
W();
} else {
Toast.makeText(this, "请正确输入手机号", 1).show();
}
}
public void M(View view) {
String obj = this.f6116k.f8744c.getText().toString();
String obj2 = this.f6116k.f8746e.getText().toString();
String obj3 = this.f6116k.f8747f.getText().toString();
String obj4 = this.f6116k.f8745d.getText().toString();
if (TextUtils.isEmpty(obj)) {
Toast.makeText(this, (int) R.string.input_mobile, 1).show();
} else if (TextUtils.isEmpty(obj2)) {
Toast.makeText(this, (int) R.string.input_password, 1).show();
} else if (obj2.length() >= 8 && obj2.length() <= 32) {
if (!obj2.equals(obj3)) {
Toast.makeText(this, "两次输入的密码不一致,请重新输入", 1).show();
} else if (TextUtils.isEmpty(obj4)) {
Toast.makeText(this, (int) R.string.input_mobile_code, 1).show();
} else {
V(obj, obj2, obj4);
}
} else {
Toast.makeText(this, "密码长度必须在8-32位之间,请重新输入", 1).show();
}
}
public void P(String str) {
if (!TextUtils.isEmpty(str) && !"null".equals(str)) {
this.n = true;
this.m = str.replace("\"", "");
} else {
this.n = false;
}
if (this.n) {
A(this.f6116k.f8744c.getText().toString(), this.m);
} else {
j.a().d(this.f5969c, "图形验证失败,请重试!");
}
}
public void R(WebView webView, String str) {
if (WakedResultReceiver.CONTEXT_KEY.equals(str)) {
webView.evaluateJavascript("javascript:window.getToken()", new ValueCallback() {
@Override
public final void onReceiveValue(Object obj) {
RegisterActivity.this.P((String) obj);
}
});
} else {
Y();
}
}
public void T(String str, final WebView webView, AlertDialog alertDialog, View view) {
e.h.b.b.b.d().k(str, CookieManager.getInstance().getCookie(str));
webView.evaluateJavascript("javascript:window.is_token", new ValueCallback() {
@Override
public final void onReceiveValue(Object obj) {
RegisterActivity.this.R(webView, (String) obj);
}
});
alertDialog.dismiss();
}
public final void A(String str, String str2) {
n();
HashMap hashMap = new HashMap();
hashMap.put("mobile", str);
hashMap.put("type", 1);
hashMap.put(JThirdPlatFormInterface.KEY_TOKEN, str2);
e.h.b.d.a.i().a(this).b(m.a + "member/user/guest-send-captcha").d(JSON.toJSONString(hashMap)).c().b(new e());
}
public final void B() {
n();
HashMap hashMap = new HashMap();
hashMap.put(JThirdPlatFormInterface.KEY_CODE, "paynotice");
e.h.b.d.a.i().d(JSON.toJSONString(hashMap)).b(m.a + "config/config/get-by-code").c().b(new b());
}
public final void C() {
}
public final void V(String str, String str2, String str3) {
n();
HashMap hashMap = new HashMap();
hashMap.put("type", 1);
hashMap.put("client", 3);
hashMap.put("mobile", str);
hashMap.put("password", str2);
hashMap.put("confirm_password", str2);
hashMap.put("captcha", str3);
hashMap.put("registration_id", JPushInterface.getRegistrationID(this));
e.h.b.d.a.i().b(m.a + "member/user/new-register").a(this).d(JSON.toJSONString(hashMap)).c().b(new a());
}
public final void W() {
final String str = m.a + "captcha/captcha/captcha-show?type=1&client=3&time=" + l.a();
View inflate = getLayoutInflater().inflate(R.layout.qn_popup_window_register_captcha, (ViewGroup) null);
final WebView webView = (WebView) inflate.findViewById(R.id.web_view);
e.h.b.b.b.d().i();
WebSettings settings = webView.getSettings();
settings.setJavaScriptEnabled(true);
settings.setAppCacheEnabled(true);
settings.setSupportMultipleWindows(true);
settings.setDomStorageEnabled(true);
settings.setDatabaseEnabled(true);
settings.setCacheMode(2);
webView.setWebViewClient(new c());
webView.loadUrl(str, e.h.b.b.b.d().g());
final AlertDialog create = new AlertDialog.Builder(this, R.style.dialog_activity).setView(inflate).create();
create.setCanceledOnTouchOutside(false);
create.show();
inflate.findViewById(R.id.iv_close).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
create.dismiss();
}
});
inflate.findViewById(R.id.tv_confirm).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
RegisterActivity.this.T(str, webView, create, view);
}
});
}
public final void X() {
final Dialog dialog = new Dialog(this, R.style.walletDialog);
h2 c2 = h2.c(getLayoutInflater());
dialog.setContentView(c2.b());
c2.f8456b.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
dialog.dismiss();
}
});
c2.f8457c.setText(this.f6117l);
dialog.show();
Window window = dialog.getWindow();
WindowManager.LayoutParams attributes = window.getAttributes();
attributes.gravity = 80;
attributes.width = -1;
window.setAttributes(attributes);
}
public final void Y() {
n();
e.h.b.d.a.d().b(m.a + "captcha/captcha/check?type=1&client=3token=&time=" + l.a()).a(this).d().b(new d());
}
public final void initView() {
this.f6116k.f8752k.setText(Html.fromHtml(getString(R.string.register_notice_tip)));
this.f6116k.f8752k.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
RegisterActivity.this.E(view);
}
});
this.f6116k.f8748g.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
RegisterActivity.this.G(view);
}
});
this.f6116k.f8749h.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
RegisterActivity.this.I(view);
}
});
this.f6116k.f8751j.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
RegisterActivity.this.K(view);
}
});
this.f6116k.f8743b.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
RegisterActivity.this.M(view);
}
});
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
p0 c2 = p0.c(getLayoutInflater());
this.f6116k = c2;
setContentView(c2.b());
setSupportActionBar(this.f6116k.f8750i);
getSupportActionBar().s(true);
getSupportActionBar().t(false);
e.h.c.d.a.b.j(this);
e.h.c.d.a.b.h(this, -1);
initView();
C();
}
public final void z() {
this.f6116k.f8751j.setEnabled(false);
new f(JConstants.MIN, 1000L).start();
}
}