正在查看: 公务员之家 v1.0.1 应用的 e.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 公务员之家 v1.0.1 应用的 e.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.mobile.auth.gatewayauth.detectnet;
import android.content.Context;
import android.net.Network;
import android.text.TextUtils;
import com.mobile.auth.c.j;
import com.mobile.auth.gatewayauth.ExceptionProcessor;
import com.mobile.auth.gatewayauth.utils.i;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
public class e {
private static volatile e a;
private String g;
private String h;
private AtomicBoolean c = new AtomicBoolean(false);
private int e = 3;
private int f = 2;
private ExecutorService b = new ThreadPoolExecutor(1, 1, 0, TimeUnit.SECONDS, new ArrayBlockingQueue(3), new ThreadPoolExecutor.CallerRunsPolicy());
private ConcurrentHashMap<String, String> d = new ConcurrentHashMap<>();
public e() {
this.h = "eco.taobao.com";
try {
this.h = new URL("https://dypnsapi.aliyuncs.com/?").getHost();
} catch (MalformedURLException unused) {
}
}
static DetectResult a(e eVar, String str, DetectResult detectResult) {
try {
return eVar.b(str, detectResult);
} catch (Throwable th) {
try {
ExceptionProcessor.processException(th);
return null;
} catch (Throwable th2) {
ExceptionProcessor.processException(th2);
return null;
}
}
}
private DetectResult a(String str, DetectResult detectResult) {
try {
i.a("pingNet: ping检测top默认");
c a2 = a(str, this.h);
detectResult.setTopConnected(a2.a());
if (a2.a()) {
detectResult.setTopWholeMS(a2.b());
} else {
detectResult.setTopWholeMS(0L);
}
return detectResult;
} catch (Throwable th) {
try {
ExceptionProcessor.processException(th);
return null;
} catch (Throwable th2) {
ExceptionProcessor.processException(th2);
return null;
}
}
}
public static e a() {
try {
if (a == null) {
synchronized (e.class) {
if (a == null) {
a = new e();
}
}
}
return a;
} catch (Throwable th) {
try {
ExceptionProcessor.processException(th);
return null;
} catch (Throwable th2) {
ExceptionProcessor.processException(th2);
return null;
}
}
}
static AtomicBoolean a(e eVar) {
try {
return eVar.c;
} catch (Throwable th) {
try {
ExceptionProcessor.processException(th);
return null;
} catch (Throwable th2) {
ExceptionProcessor.processException(th2);
return null;
}
}
}
private void a(Context context, final String str, final a aVar) {
try {
i.a("pingNet:检测 默认网络和蜂窝网络");
final DetectResult detectResult = new DetectResult();
detectResult.setRequestIds(this.d.keySet()).setSessionIds(this.d.values());
a(str, detectResult);
new j().a(context, new j.a() {
@Override
public void a() {
try {
i.a("pingNet:切换蜂窝网络超时!");
detectResult.setTopCellularConnected(false).setTopCellularWholeMS(0L).setCuCellularConnected(false).setCuCellularWholeMS(0L);
e.a(e.this).set(false);
a aVar2 = aVar;
if (aVar2 != null) {
aVar2.a(detectResult);
}
} catch (Throwable th) {
try {
ExceptionProcessor.processException(th);
} catch (Throwable th2) {
ExceptionProcessor.processException(th2);
}
}
}
@Override
public void a(int i, String str2, long j) {
try {
i.a("pingNet:切换蜂窝网络失败!");
detectResult.setTopCellularConnected(false).setTopCellularWholeMS(0L).setCuCellularConnected(false).setCuCellularWholeMS(0L);
e.a(e.this).set(false);
a aVar2 = aVar;
if (aVar2 != null) {
aVar2.a(detectResult);
}
} catch (Throwable th) {
try {
ExceptionProcessor.processException(th);
} catch (Throwable th2) {
ExceptionProcessor.processException(th2);
}
}
}
@Override
public void a(Network network, long j) {
try {
i.a("pingNet:切换蜂窝网络成功!");
e.a(e.this, str, detectResult);
e.b(e.this, str, detectResult);
e.a(e.this).set(false);
a aVar2 = aVar;
if (aVar2 != null) {
aVar2.a(detectResult);
}
} catch (Throwable th) {
try {
ExceptionProcessor.processException(th);
} catch (Throwable th2) {
ExceptionProcessor.processException(th2);
}
}
}
});
} catch (Throwable th) {
try {
ExceptionProcessor.processException(th);
} catch (Throwable th2) {
ExceptionProcessor.processException(th2);
}
}
}
static void a(e eVar, Context context, String str, a aVar) {
try {
eVar.a(context, str, aVar);
} catch (Throwable th) {
try {
ExceptionProcessor.processException(th);
} catch (Throwable th2) {
ExceptionProcessor.processException(th2);
}
}
}
static DetectResult b(e eVar, String str, DetectResult detectResult) {
try {
return eVar.c(str, detectResult);
} catch (Throwable th) {
try {
ExceptionProcessor.processException(th);
return null;
} catch (Throwable th2) {
ExceptionProcessor.processException(th2);
return null;
}
}
}
private DetectResult b(String str, DetectResult detectResult) {
try {
i.a("pingNet: ping检测top蜂窝");
c a2 = a(str, this.h);
detectResult.setTopCellularConnected(a2.a());
if (a2.a()) {
detectResult.setTopCellularWholeMS(a2.b());
} else {
detectResult.setTopCellularWholeMS(0L);
}
return detectResult;
} catch (Throwable th) {
try {
ExceptionProcessor.processException(th);
return null;
} catch (Throwable th2) {
ExceptionProcessor.processException(th2);
return null;
}
}
}
static ConcurrentHashMap b(e eVar) {
try {
return eVar.d;
} catch (Throwable th) {
try {
ExceptionProcessor.processException(th);
return null;
} catch (Throwable th2) {
ExceptionProcessor.processException(th2);
return null;
}
}
}
static DetectResult c(e eVar, String str, DetectResult detectResult) {
try {
return eVar.a(str, detectResult);
} catch (Throwable th) {
try {
ExceptionProcessor.processException(th);
return null;
} catch (Throwable th2) {
ExceptionProcessor.processException(th2);
return null;
}
}
}
private DetectResult c(String str, DetectResult detectResult) {
try {
i.a("pingNet: ping检测蜂窝");
if (TextUtils.isEmpty(this.g)) {
detectResult.setCuCellularConnected(false).setCuCellularWholeMS(0L);
} else {
c a2 = a(str, this.g);
detectResult.setCuCellularConnected(a2.a());
if (a2.a()) {
detectResult.setCuCellularWholeMS(a2.b());
} else {
detectResult.setCuCellularWholeMS(0L);
}
}
return detectResult;
} catch (Throwable th) {
try {
ExceptionProcessor.processException(th);
return null;
} catch (Throwable th2) {
ExceptionProcessor.processException(th2);
return null;
}
}
}
public c a(String str, String str2) {
try {
i.a("pingNet:" + str + " ping start");
c cVar = new c();
int i = 0;
while (i < this.f) {
cVar = d.a(str2, this.e);
i.a("pingNet:第" + i + "次 result:" + cVar.toString());
i++;
if (cVar.a()) {
break;
}
}
i.a("pingNet:" + str + " ping stop");
i.a("pingNet:" + str + " 总共 ping了:" + i + "次");
return cVar;
} catch (Throwable th) {
try {
ExceptionProcessor.processException(th);
return null;
} catch (Throwable th2) {
ExceptionProcessor.processException(th2);
return null;
}
}
}
public e a(String str) {
try {
this.g = str;
return this;
} catch (Throwable th) {
try {
ExceptionProcessor.processException(th);
return null;
} catch (Throwable th2) {
ExceptionProcessor.processException(th2);
return null;
}
}
}
public void a(final Context context, final String str, final String str2, final a aVar) {
try {
i.a("pingNet:" + str + " startDetect");
this.b.execute(new Runnable() {
@Override
public void run() {
throw new UnsupportedOperationException("Method not decompiled: com.mobile.auth.gatewayauth.detectnet.e.AnonymousClass1.run():void");
}
});
} catch (Throwable th) {
try {
ExceptionProcessor.processException(th);
} catch (Throwable th2) {
ExceptionProcessor.processException(th2);
}
}
}
}