正在查看: 95爱播免登录版 v3.1.9 应用的 a.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 95爱播免登录版 v3.1.9 应用的 a.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.mobile.auth.d;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.Network;
import android.net.NetworkInfo;
import android.os.Build;
import android.text.TextUtils;
import com.mobile.auth.d.e;
import com.mobile.auth.d.i;
import com.xiaomi.mipush.sdk.Constants;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.jivesoftware.smackx.Form;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public final class a {
private static final String a = "a";
static String a() {
try {
return a;
} catch (Throwable th) {
com.mobile.auth.gatewayauth.a.a(th);
return null;
}
}
public static String a(Context context, String str, String str2, Network network) {
try {
return c(context, d.a(context, str, network), str2, network);
} catch (Throwable th) {
com.mobile.auth.gatewayauth.a.a(th);
return null;
}
}
private String a(Context context, String str, String str2, String str3, Network network, String str4) {
try {
String b = b();
String a2 = g.a(context, str, str2, str3, b);
String str5 = a;
com.mobile.auth.a.a.a(str5, "request params : " + a2);
String a3 = d.a(context, "https://id6.me/auth/preauth.do", a2, network, str4);
com.mobile.auth.a.a.a(str5, "request result : " + a3);
String b2 = b(context, a3, b, network);
if (TextUtils.isEmpty(b2)) {
return "{\"result\":80001,\"msg\":\"请求异常\"}";
}
com.mobile.auth.c.e.a(str4, b2, a2);
return b2;
} catch (Throwable th) {
com.mobile.auth.gatewayauth.a.a(th);
return null;
}
}
private static String a(Context context, List<String> list, String str, Network network) {
for (int i2 = 0; i2 < list.size(); i2++) {
try {
try {
String str2 = list.get(i2);
if (!TextUtils.isEmpty(list.get(i2)) && context != null && Build.VERSION.SDK_INT < 21) {
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
if (connectivityManager.getNetworkInfo(5).getState().compareTo(NetworkInfo.State.CONNECTED) == 0) {
int a2 = e.a(e.b(str2));
Class<?> cls = Class.forName("android.net.ConnectivityManager");
Class<?> cls2 = Integer.TYPE;
((Boolean) cls.getMethod("requestRouteToHost", cls2, cls2).invoke(connectivityManager, 5, Integer.valueOf(a2))).booleanValue();
}
}
String a3 = a(context, list.get(i2), str, network);
try {
JSONObject jSONObject = !TextUtils.isEmpty(a3) ? new JSONObject(a3) : null;
if (jSONObject != null && jSONObject.getInt(Form.TYPE_RESULT) == 0) {
return a3;
}
} catch (Exception e2) {
e2.printStackTrace();
}
} catch (Exception e3) {
e3.printStackTrace();
}
} catch (Throwable th) {
com.mobile.auth.gatewayauth.a.a(th);
return null;
}
}
return null;
}
static String a(a aVar, Context context, String str, String str2, String str3, Network network, String str4) {
try {
return aVar.a(context, str, str2, str3, network, str4);
} catch (Throwable th) {
com.mobile.auth.gatewayauth.a.a(th);
return null;
}
}
public static String a(String str, String str2) {
try {
return com.mobile.auth.b.a.c(str, str2);
} catch (Throwable th) {
com.mobile.auth.gatewayauth.a.a(th);
return null;
}
}
private void a(final Context context, final String str, final i.a aVar, final int i2, final com.mobile.auth.a.b bVar) {
try {
final Future b = i.b(aVar);
i.a(new Runnable() {
@Override
public void run() {
Future future;
Future future2;
try {
try {
b.get(i2, TimeUnit.MILLISECONDS);
future2 = b;
} catch (Throwable th) {
try {
aVar.a(true);
if (th instanceof TimeoutException) {
com.mobile.auth.c.e.a(str, "{\"result\":80000,\"msg\":\"请求超时\"}", "");
com.mobile.auth.c.e.a(str).h("submitOnTimeoutInterrupted()");
com.mobile.auth.a.a.b(context, "{\"result\":80000,\"msg\":\"请求超时\"}", str, bVar);
} else {
com.mobile.auth.c.e.a(str, "{\"result\":80001,\"msg\":\"请求异常\"}", "");
com.mobile.auth.c.e.a(str).h("submitOnTimeoutInterrupted other exception : " + th.getMessage());
com.mobile.auth.a.a.a(a.a(), "submitOnTimeoutInterrupted other exception", th);
com.mobile.auth.a.a.b(context, "{\"result\":80001,\"msg\":\"请求异常\"}", str, bVar);
}
Future future3 = b;
if (future3 == null || future3.isDone()) {
return;
} else {
future = b;
}
} catch (Throwable th2) {
Future future4 = b;
if (future4 != null && !future4.isDone()) {
b.cancel(true);
}
throw th2;
}
}
if (future2 == null || future2.isDone()) {
return;
}
future = b;
future.cancel(true);
} catch (Throwable th3) {
com.mobile.auth.gatewayauth.a.a(th3);
}
}
});
} catch (Throwable th) {
com.mobile.auth.gatewayauth.a.a(th);
}
}
private String b() {
try {
String uuid = UUID.randomUUID().toString();
if (TextUtils.isEmpty(uuid)) {
return "";
}
String replace = uuid.replace(Constants.ACCEPT_TIME_SEPARATOR_SERVER, "");
return replace.length() >= 16 ? replace.substring(0, 16) : replace;
} catch (Throwable th) {
try {
com.mobile.auth.a.a.a(a, "generateAesKey error", th);
return "";
} catch (Throwable th2) {
com.mobile.auth.gatewayauth.a.a(th2);
return null;
}
}
}
private String b(Context context, String str, String str2, Network network) {
try {
if (TextUtils.isEmpty(str)) {
return null;
}
try {
JSONObject jSONObject = new JSONObject(str);
int optInt = jSONObject.optInt(Form.TYPE_RESULT);
String optString = jSONObject.optString("data");
if ((optInt == 0 || optInt == 30002) && !TextUtils.isEmpty(optString)) {
String a2 = a(optString, str2);
if (!TextUtils.isEmpty(a2)) {
try {
jSONObject.put("data", new JSONObject(a2));
} catch (JSONException e2) {
e2.printStackTrace();
jSONObject.put("data", a2);
}
if (optInt != 30002) {
return jSONObject.toString();
}
JSONObject jSONObject2 = (JSONObject) jSONObject.opt("data");
ArrayList arrayList = new ArrayList();
JSONArray optJSONArray = jSONObject2.optJSONArray("urls");
if (optJSONArray != null) {
for (int i2 = 0; i2 < optJSONArray.length(); i2++) {
arrayList.add(optJSONArray.getString(i2));
}
}
if (arrayList.isEmpty()) {
return null;
}
return a(context, arrayList, str2, network);
}
}
return jSONObject.toString();
} catch (Throwable th) {
com.mobile.auth.a.a.a(a, "decryptResult error", th);
return null;
}
} catch (Throwable th2) {
com.mobile.auth.gatewayauth.a.a(th2);
return null;
}
}
private static String c(Context context, String str, String str2, Network network) {
try {
if (TextUtils.isEmpty(str)) {
return null;
}
try {
JSONObject jSONObject = new JSONObject(str);
int optInt = jSONObject.optInt(Form.TYPE_RESULT);
String optString = jSONObject.optString("data");
if (optInt == 0 && !TextUtils.isEmpty(optString)) {
String a2 = a(optString, str2);
if (!TextUtils.isEmpty(a2)) {
try {
jSONObject.put("data", new JSONObject(a2));
} catch (JSONException e2) {
e2.printStackTrace();
jSONObject.put("data", a2);
}
}
}
return jSONObject.toString();
} catch (Throwable th) {
com.mobile.auth.a.a.a(a, "decryptResult error", th);
return null;
}
} catch (Throwable th2) {
com.mobile.auth.gatewayauth.a.a(th2);
return null;
}
}
public void a(final Context context, final String str, final String str2, final String str3, final com.mobile.auth.a.b bVar) {
try {
int i2 = com.mobile.auth.a.a.c;
int i3 = i2 <= 0 ? 10000 : i2;
final String a2 = c.a();
com.mobile.auth.c.e.a(a2).a(str).b(c.a(context)).d("preauth").c(f.f(context));
a(context, a2, new i.a() {
@Override
public void run() {
try {
String a3 = a.a(a.this, context, str, str2, str3, null, a2);
if (a()) {
return;
}
com.mobile.auth.a.a.b(context, a3, a2, bVar);
} catch (Throwable th) {
com.mobile.auth.gatewayauth.a.a(th);
}
}
}, i3, bVar);
} catch (Throwable th) {
com.mobile.auth.gatewayauth.a.a(th);
}
}
public void b(final Context context, final String str, final String str2, final String str3, final com.mobile.auth.a.b bVar) {
try {
int i2 = com.mobile.auth.a.a.c;
int i3 = i2 <= 0 ? 10000 : i2;
final String a2 = c.a();
com.mobile.auth.c.e.a(a2).a(str).b(c.a(context)).d("preauth").c(f.f(context));
if (Build.VERSION.SDK_INT >= 21) {
e eVar = new e();
eVar.a(context, new e.a() {
private boolean f1247h = false;
private boolean f1248i = false;
@Override
public synchronized void a() {
try {
this.f1247h = true;
if (!this.f1248i) {
com.mobile.auth.c.e.a(a2, "{\"result\":80000,\"msg\":\"请求超时\"}", "");
com.mobile.auth.a.a.b(context, "{\"result\":80000,\"msg\":\"请求超时\"}", a2, bVar);
}
} finally {
}
}
@Override
public synchronized void a(int i4, String str4, long j2) {
try {
} finally {
}
if (!this.f1247h && !this.f1248i) {
this.f1248i = true;
com.mobile.auth.c.e.a(a2).h("switchToMobile_L onFail() expendTime : " + j2).a(i4).f(str4).b(j2);
com.mobile.auth.a.a.b(context, h.a(i4, str4), a2, bVar);
com.mobile.auth.a.a.a(a.a(), "Switching network failed (L), errorMsg :" + str4 + " , expendTime :" + j2);
}
}
@Override
public void a(Network network, long j2) {
try {
com.mobile.auth.a.a.a(a.a(), "Switching network successfully (L) , expendTime :" + j2);
if (!this.f1247h && !this.f1248i) {
com.mobile.auth.c.e.a(a2).b(j2);
String a3 = a.a(a.this, context, str, str2, str3, network, a2);
synchronized (this) {
if (!this.f1247h && !this.f1248i) {
this.f1248i = true;
com.mobile.auth.a.a.b(context, a3, a2, bVar);
}
}
}
} catch (Throwable th) {
com.mobile.auth.gatewayauth.a.a(th);
}
}
});
eVar.a(i3);
} else {
a(context, a2, new i.a() {
@Override
public void run() {
try {
if (new e().a(context, "https://id6.me/auth/preauth.do")) {
if (a()) {
return;
}
String a3 = a.a(a.this, context, str, str2, str3, null, a2);
if (a()) {
} else {
com.mobile.auth.a.a.b(context, a3, a2, bVar);
}
} else if (a()) {
} else {
com.mobile.auth.a.a.b(context, h.a(80800, "WIFI切换超时"), a2, bVar);
}
} catch (Throwable th) {
com.mobile.auth.gatewayauth.a.a(th);
}
}
}, i3, bVar);
}
} catch (Throwable th) {
com.mobile.auth.gatewayauth.a.a(th);
}
}
}