50度灰 v5.8.2版本的 MD5 值为:9fe3d350fdc75fa1a3ec45509fa0107e
以下内容为反编译后的 a.java 源代码,内容仅作参考
package f.b;
import com.google.android.gms.common.ConnectionResult;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.Timer;
import java.util.TimerTask;
public abstract class a extends g {
private static final org.slf4j.c f11966a = org.slf4j.d.i(a.class);
private TimerTask E;
private int F = 60;
private boolean G = false;
private final Object H = new Object();
private boolean f11967b;
private boolean f11968c;
private Timer s;
public class C0373a extends TimerTask {
private ArrayList<f> f11969a = new ArrayList<>();
C0373a() {
}
@Override
public void run() {
this.f11969a.clear();
try {
this.f11969a.addAll(a.this.M());
long currentTimeMillis = System.currentTimeMillis() - (a.this.F * ConnectionResult.DRIVE_EXTERNAL_STORAGE_REQUIRED);
Iterator<f> it = this.f11969a.iterator();
while (it.hasNext()) {
a.this.K(it.next(), currentTimeMillis);
}
} catch (Exception unused) {
}
this.f11969a.clear();
}
}
private void J() {
Timer timer = this.s;
if (timer != null) {
timer.cancel();
this.s = null;
}
TimerTask timerTask = this.E;
if (timerTask != null) {
timerTask.cancel();
this.E = null;
}
}
public void K(f fVar, long j) {
if (fVar instanceof i) {
i iVar = (i) fVar;
if (iVar.G() < j) {
f11966a.trace("Closing connection due to no pong received: {}", iVar);
iVar.E(1006, "The connection was closed because the other endpoint did not respond with a pong in time. For more information check: https://github.com/TooTallNate/Java-WebSocket/wiki/Lost-connection-detection");
} else if (iVar.isOpen()) {
iVar.y();
} else {
f11966a.trace("Trying to ping a non open connection: {}", iVar);
}
}
}
private void P() {
J();
this.s = new Timer("WebSocketTimer");
C0373a c0373a = new C0373a();
this.E = c0373a;
Timer timer = this.s;
int i = this.F;
timer.scheduleAtFixedRate(c0373a, i * 1000, 1000 * i);
}
public int L() {
int i;
synchronized (this.H) {
i = this.F;
}
return i;
}
protected abstract Collection<f> M();
public boolean N() {
return this.f11968c;
}
public boolean O() {
return this.f11967b;
}
public void Q(int i) {
synchronized (this.H) {
this.F = i;
if (i <= 0) {
f11966a.trace("Connection lost timer stopped");
J();
return;
}
if (this.G) {
f11966a.trace("Connection lost timer restarted");
try {
Iterator it = new ArrayList(M()).iterator();
while (it.hasNext()) {
f fVar = (f) it.next();
if (fVar instanceof i) {
((i) fVar).Q();
}
}
} catch (Exception e2) {
f11966a.error("Exception during connection lost restart", (Throwable) e2);
}
P();
}
}
}
public void R(boolean z) {
this.f11968c = z;
}
public void S(boolean z) {
this.f11967b = z;
}
public void T() {
synchronized (this.H) {
if (this.F <= 0) {
f11966a.trace("Connection lost timer deactivated");
return;
}
f11966a.trace("Connection lost timer started");
this.G = true;
P();
}
}
public void U() {
synchronized (this.H) {
if (this.s != null || this.E != null) {
this.G = false;
f11966a.trace("Connection lost timer stopped");
J();
}
}
}
}