钱能钱包 v3.10.2版本的 MD5 值为:339a4b585ef2aa3bfaf7e4baeb254647
以下内容为反编译后的 LauncherActivity.java 源代码,内容仅作参考
package com.tech.pay.ui.main;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.widget.Toast;
import cn.jpush.android.api.JPushInterface;
import cn.jpush.android.api.JThirdPlatFormInterface;
import cn.jpush.android.local.JPushConstants;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.parser.Feature;
import com.qn.app.wallet.R;
import com.tech.pay.ui.main.LauncherActivity;
import com.tech.pay.ui.qrscan.ScanPayOrderActivity;
import com.tech.pay.ui.setting.NetworkDetectionActivity;
import com.wang.avi.AVLoadingIndicatorView;
import e.h.a.b.h;
import e.h.a.b.m;
import e.h.a.c.a;
import e.h.c.g.b0.e;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Timer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;
public class LauncherActivity extends Activity {
public AVLoadingIndicatorView f6087c;
public e f6089i;
public byte f6091k;
public e.h.c.g.b0.e n;
public final int a = 100;
public byte f6086b = 3;
public Timer f6088d = null;
public d f6090j = d.FIRST;
public List<String> f6092l = new ArrayList();
public int m = 0;
public String o = "";
public e.h.b.d.c.b p = new a();
public class a extends e.h.b.d.c.b {
public a() {
}
@Override
public void d(Call call, Exception exc, int i2) {
LauncherActivity.this.s();
if (LauncherActivity.this.m == LauncherActivity.this.f6092l.size() - 1) {
LauncherActivity.this.m = 0;
m.a = (String) LauncherActivity.this.f6092l.get(LauncherActivity.this.m);
if (LauncherActivity.this.f6091k < LauncherActivity.this.f6086b) {
if (TextUtils.isEmpty(LauncherActivity.this.o)) {
LauncherActivity.this.v();
return;
} else {
LauncherActivity.this.G();
return;
}
}
h.b("LauncherActivity", "域名列表轮询三次失败,退出APP");
LauncherActivity.this.t();
return;
}
LauncherActivity.j(LauncherActivity.this, 1);
m.a = (String) LauncherActivity.this.f6092l.get(LauncherActivity.this.m);
LauncherActivity.this.F();
}
@Override
public void e(String str, int i2) {
LauncherActivity.this.s();
JSONObject parseObject = JSON.parseObject(str);
if (parseObject.getIntValue("errcode") == 0) {
JSONObject jSONObject = parseObject.getJSONObject(JThirdPlatFormInterface.KEY_DATA);
h.b("LauncherActivity", "最终使用域名: " + m.a);
e.h.a.a.a.a("sp_wallet_api_address").g("sp_wallet_api_address", m.a);
e.h.b.b.b.d().j(m.a);
LauncherActivity.this.s();
LauncherActivity.this.f6089i.sendMessageDelayed(LauncherActivity.this.f6089i.obtainMessage(1, Integer.valueOf(jSONObject.getIntValue("is_login"))), 500L);
}
}
}
public class b extends e.h.b.d.c.b {
public class a extends TypeReference<List<String>> {
public a() {
}
}
public b() {
}
@Override
public void d(Call call, Exception exc, int i2) {
LauncherActivity.this.E();
}
@Override
public void e(String str, int i2) {
for (String str2 : (List) JSON.parseObject(JSON.parseObject(str).getString("list"), new a(), new Feature[0])) {
String J = LauncherActivity.this.J(str2);
if (LauncherActivity.this.A(J)) {
LauncherActivity.this.f6092l.add(J);
}
}
LauncherActivity.this.E();
}
}
public class c implements Callback {
public c() {
}
public void b() {
LauncherActivity.this.G();
}
public void d() {
LauncherActivity.this.G();
}
@Override
public void onFailure(Call call, IOException iOException) {
LauncherActivity.this.runOnUiThread(new Runnable() {
@Override
public final void run() {
LauncherActivity.c.this.b();
}
});
}
@Override
public void onResponse(Call call, Response response) {
LauncherActivity launcherActivity = LauncherActivity.this;
launcherActivity.o = launcherActivity.x(response.body().string());
LauncherActivity.this.runOnUiThread(new Runnable() {
@Override
public final void run() {
LauncherActivity.c.this.d();
}
});
}
}
public enum d {
FIRST,
SAME,
DIFFERENT
}
public static class e extends Handler {
public WeakReference<LauncherActivity> a;
public e(LauncherActivity launcherActivity, a aVar) {
this(launcherActivity);
}
@Override
public void handleMessage(Message message) {
if (this.a.get() != null) {
this.a.get().I(((Integer) message.obj).intValue());
}
}
public e(LauncherActivity launcherActivity) {
this.a = new WeakReference<>(launcherActivity);
}
}
public void D(int i2) {
if (e.h.b.b.a.a(this) == e.h.b.b.a.a) {
Toast.makeText(this, "无网络连接,请检查网络", 0).show();
G();
return;
}
this.f6091k = (byte) (this.f6091k + 1);
H();
if (i2 == 0) {
startActivityForResult(NetworkDetectionActivity.n(this, (ArrayList) this.f6092l), 100);
} else if (i2 != 1) {
} else {
w();
}
}
public static int j(LauncherActivity launcherActivity, int i2) {
int i3 = launcherActivity.m + i2;
launcherActivity.m = i3;
return i3;
}
public boolean A(String str) {
if (str == null) {
return false;
}
if (str.endsWith("/")) {
str = str.substring(0, str.length() - 1);
}
return Pattern.compile("^(http|https|ftp)://([a-zA-Z0-9.\\-]+(:[a-zA-Z0-9.&%$\\-]+)*@)?((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|([a-zA-Z0-9\\-]+\\.)*[a-zA-Z0-9\\-]+\\.[a-zA-Z]{2,4})(:[0-9]+)?(/[^/][a-zA-Z0-9.,?'\\\\/+&%$=~_\\-@]*)*$").matcher(str).matches();
}
public final void E() {
this.f6089i = new e(this, null);
m.a = J(e.h.c.b.a.i().h());
e.h.a.b.e.f8055c = J(e.h.c.b.a.i().m());
if (A(m.a)) {
this.f6092l.add(m.a);
}
if (A(e.h.a.b.e.f8055c)) {
this.f6092l.add(e.h.a.b.e.f8055c);
}
if (e.h.a.b.e.f8056d.contains(",")) {
for (String str : e.h.a.b.e.f8056d.split(",")) {
String J = J(str);
if (A(J)) {
this.f6092l.add(J);
}
}
} else {
String J2 = J(e.h.a.b.e.f8056d);
e.h.a.b.e.f8056d = J2;
if (A(J2)) {
this.f6092l.add(e.h.a.b.e.f8056d);
}
}
if (e.h.a.b.e.f8057e.contains(",")) {
for (String str2 : e.h.a.b.e.f8057e.split(",")) {
String J3 = J(str2);
if (A(J3)) {
this.f6092l.add(J3);
}
}
} else {
String J4 = J(e.h.a.b.e.f8057e);
e.h.a.b.e.f8057e = J4;
if (A(J4)) {
this.f6092l.add(e.h.a.b.e.f8057e);
}
}
ArrayList arrayList = new ArrayList(new LinkedHashSet(this.f6092l));
this.f6092l = arrayList;
m.a = (String) arrayList.get(0);
u();
F();
}
public final void F() {
H();
e.h.b.d.a.h().b(m.a + "member/user/check-login").a(this).e().b(this.p);
}
public final void G() {
if (this.n == null) {
this.n = new e.h.c.g.b0.e(this, this.f6092l, this.o);
}
if (this.n.isShowing()) {
return;
}
this.n.d(new e.b() {
@Override
public final void a(int i2) {
LauncherActivity.this.D(i2);
}
});
if (isFinishing()) {
return;
}
this.n.show();
}
public final void H() {
this.f6087c.smoothToShow();
}
public final void I(int i2) {
Intent intent;
Uri data = getIntent().getData();
String queryParameter = data != null ? data.getQueryParameter("id") : "";
String stringExtra = getIntent().getStringExtra(JPushInterface.EXTRA_NOTIFICATION_TITLE);
String stringExtra2 = getIntent().getStringExtra(JPushInterface.EXTRA_ALERT);
if (i2 == 1) {
if (!TextUtils.isEmpty(queryParameter)) {
intent = new Intent(this, ScanPayOrderActivity.class);
intent.putExtra("payId", queryParameter);
} else {
intent = new Intent(this, MainActivity.class);
if (!TextUtils.isEmpty(stringExtra) && !TextUtils.isEmpty(stringExtra2)) {
intent.putExtra(JPushInterface.EXTRA_NOTIFICATION_TITLE, stringExtra);
intent.putExtra(JPushInterface.EXTRA_ALERT, stringExtra2);
}
}
startActivity(intent);
} else {
Intent intent2 = new Intent(this, LoginActivity.class);
if (!TextUtils.isEmpty(queryParameter)) {
intent2.putExtra("payId", queryParameter);
} else if (!TextUtils.isEmpty(stringExtra) && !TextUtils.isEmpty(stringExtra2)) {
intent2.putExtra(JPushInterface.EXTRA_NOTIFICATION_TITLE, stringExtra);
intent2.putExtra(JPushInterface.EXTRA_ALERT, stringExtra2);
}
startActivity(intent2);
}
finish();
}
public final String J(String str) {
if (str.startsWith("http")) {
if (!str.endsWith("/")) {
str = str + "/";
}
} else if (str.endsWith("/")) {
str = JPushConstants.HTTPS_PRE + str;
} else {
str = JPushConstants.HTTPS_PRE + str + "/";
}
h.c("LauncherActivity", "检验当前域名: " + str);
return str;
}
@Override
public void onActivityResult(int i2, int i3, Intent intent) {
super.onActivityResult(i2, i3, intent);
if (100 == i2) {
G();
}
}
@Override
public void onBackPressed() {
System.exit(0);
super.onBackPressed();
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.activity_wallet_launcher);
e.h.c.d.a.a.a(this);
z();
y();
}
@Override
public void onDestroy() {
Timer timer = this.f6088d;
if (timer != null) {
timer.cancel();
}
super.onDestroy();
}
public final void s() {
this.f6087c.smoothToHide();
}
public final void t() {
e.h.a.c.a aVar = new e.h.a.c.a(this, e.h.a.b.e.f8061i, "退出应用");
aVar.c(new a.c() {
@Override
public final void a() {
e.h.c.a.d.f().c();
}
});
if (isFinishing()) {
return;
}
aVar.show();
}
public final void u() {
if (e.h.c.b.a.i().e() == null) {
this.f6090j = d.FIRST;
} else if (e.h.c.b.a.i().e().equals(e.h.b.d.e.d.d(this))) {
this.f6090j = d.SAME;
} else {
this.f6090j = d.DIFFERENT;
}
h.c("LauncherActivity", "STATUS : " + this.f6090j);
}
public final void v() {
e.h.b.d.a.d().b("https://www.taobao.com/help/getip.php").a(this).d().a(null).enqueue(new c());
}
public final void w() {
H();
e.h.b.d.a.d().b("https://openapiweb.oss-accelerate.aliyuncs.com/prod-api.json").a(this).d().b(new b());
}
public final String x(String str) {
Matcher matcher = Pattern.compile("\"(.*?)\"").matcher(str);
return matcher.find() ? matcher.group(1) : str;
}
public final void y() {
w();
}
public final void z() {
this.f6087c = (AVLoadingIndicatorView) findViewById(R.id.launcher_icon_loadding);
}
}