佳GO v3.0.0版本的 MD5 值为:febdbe251c5346d8ea051b2f02d4ce89
以下内容为反编译后的 y21.java 源代码,内容仅作参考
package p.a.y.e.a.s.e.net;
import android.text.TextUtils;
import android.util.Log;
import com.getmessage.module_base.app.BaseApplication;
import com.google.android.exoplayer2.metadata.id3.InternalFrame;
import com.google.android.exoplayer2.trackselection.AdaptiveTrackSelection;
import java.io.IOException;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import p.a.y.e.a.s.e.net.wb1;
public class y21 implements wb1.a {
private static int lite_break = 0;
private static final String lite_byte = "/im_lite/messages/feed/off?uid=";
private static final String lite_case = "SpareConnectionHelper";
private static y21 lite_char = null;
private static Thread lite_else = null;
private static final int lite_goto = 1;
private static final int lite_long = -1;
private static final int lite_this = 0;
private static final String lite_try = "/im_lite/messages/feed?uid=";
private static final int lite_void = 2000;
private wb1 lite_for;
private x21 lite_int;
private String lite_do = "http://10.10.10.61:8889";
private int lite_if = -1;
private boolean lite_new = false;
public class a extends Thread {
public a(String str) {
super(str);
}
@Override
public void run() {
super.run();
while (y21.lite_else != null && !y21.lite_else.isInterrupted()) {
try {
Log.d(y21.lite_case, "备用连接检测线程正在运行...当前线程=" + Thread.currentThread().getName());
if (y21.lite_char.lite_break()) {
Log.d(y21.lite_case, "备用连接连接中...");
} else if (y21.lite_char.lite_new) {
Log.d(y21.lite_case, "连接已断开...");
y21.lite_this().lite_goto();
} else {
Log.e(y21.lite_case, "备用连接无法重新连接,本地无网络...");
}
Thread.sleep(AdaptiveTrackSelection.DEFAULT_MIN_TIME_BETWEEN_BUFFER_REEVALUTATION_MS);
} catch (InterruptedException e) {
e.printStackTrace();
return;
}
}
}
}
public class b implements Callback {
public b() {
}
@Override
public void onFailure(Call call, IOException iOException) {
StringBuilder b = r5.b("备用连接退出异常....错误");
b.append(iOException.getMessage());
m62.lite_new(b.toString(), new Object[0]);
}
@Override
public void onResponse(Call call, Response response) throws IOException {
int code = response.code();
if (code == 200) {
Log.i(y21.lite_case, "备用连接退出成功....");
} else {
r5.x("备用连接退出异常..code:", code, y21.lite_case);
}
}
}
private y21() {
}
public static void lite_class() {
Thread thread = lite_else;
if (thread == null || thread.isInterrupted()) {
StringBuilder b2 = r5.b("备用连接检测线程--");
int i = lite_break;
lite_break = i + 1;
b2.append(i);
a aVar = new a(b2.toString());
lite_else = aVar;
aVar.start();
}
}
private void lite_final(int i) {
synchronized (y21.class) {
this.lite_if = i;
}
}
public static y21 lite_this() {
y21 y21Var;
synchronized (y21.class) {
if (lite_char == null) {
lite_char = new y21();
}
y21Var = lite_char;
}
return y21Var;
}
public boolean lite_break() {
return this.lite_if == 1;
}
@Override
public void lite_byte(wb1 wb1Var) {
Log.e(lite_case, "onClosed");
lite_final(-1);
x21 x21Var = this.lite_int;
if (x21Var != null) {
x21Var.lite_for();
}
}
public void lite_catch() {
new OkHttpClient().newCall(new Request.Builder().url(this.lite_do + lite_byte + BaseApplication.getInstance().getUserInfoBean().getUser_uid()).build()).enqueue(new b());
}
public void lite_const(boolean z) {
this.lite_new = z;
if (z) {
return;
}
lite_final(-1);
}
@Override
public Request lite_do(wb1 wb1Var, Request request) {
Log.e(lite_case, "onPreRetry");
lite_final(0);
return null;
}
public void lite_float(x21 x21Var) {
this.lite_int = x21Var;
}
@Override
public void lite_for(wb1 wb1Var, String str) {
Log.i(lite_case, "onComment:");
}
public synchronized void lite_goto() {
if (this.lite_if == -1) {
Request build = new Request.Builder().url(this.lite_do + lite_try + BaseApplication.getInstance().getUserInfoBean().getUser_uid()).build();
ub1 ub1Var = new ub1();
wb1 wb1Var = this.lite_for;
if (wb1Var != null) {
wb1Var.close();
}
lite_final(0);
this.lite_for = ub1Var.lite_if(build, this);
lite_class();
Log.i(lite_case, "开始连接...");
} else {
Log.i(lite_case, "正在连接...");
}
}
@Override
public void lite_if(wb1 wb1Var, Response response) {
Log.i(lite_case, "onOpen");
lite_final(1);
x21 x21Var = this.lite_int;
if (x21Var != null) {
x21Var.lite_if();
}
}
@Override
public boolean lite_int(wb1 wb1Var, Throwable th, Response response) {
String str;
StringBuilder b2 = r5.b("onRetryError---");
b2.append(th.getMessage());
b2.append(InternalFrame.ID);
if (response != null) {
str = response.message() + "---code:" + response.code();
} else {
str = "";
}
b2.append(str);
Log.e(lite_case, b2.toString());
lite_final(0);
return true;
}
public void lite_long() {
try {
Thread thread = lite_else;
if (thread != null) {
thread.interrupt();
lite_else = null;
}
wb1 wb1Var = this.lite_for;
if (wb1Var != null) {
wb1Var.close();
this.lite_for = null;
Log.i(lite_case, "关闭连接...");
}
lite_catch();
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void lite_new(wb1 wb1Var, String str, String str2, String str3) {
Log.i(lite_case, "onMessage:" + str3);
if (str3.equals("ok")) {
lite_final(1);
return;
}
x21 x21Var = this.lite_int;
if (x21Var != null) {
x21Var.lite_do(str, str2, str3);
}
}
@Override
public boolean lite_try(wb1 wb1Var, long j) {
Log.i(lite_case, "onRetryTime");
return false;
}
public void lite_void(String str) {
if (TextUtils.isEmpty(str)) {
return;
}
this.lite_do = str;
}
}