暗网解密 v2.0.4版本的 MD5 值为:d3a04548fef88e775cbe4c3c6e7d81ad

以下内容为反编译后的 k.java 源代码,内容仅作参考


package c.d.a;

import com.danikula.videocache.ProxyCacheException;
import java.io.OutputStream;
import java.net.Proxy;
import java.net.ProxySelector;
import java.net.Socket;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
public class k {
    public final ExecutorService f1262a = Executors.newSingleThreadExecutor();
    public final String f1263b;
    public final int f1264c;

    public class b implements Callable<Boolean> {
        public b() {
        }

        @Override
        public Boolean call() {
            return Boolean.valueOf(k.this.f());
        }
    }

    public k(String str, int i) {
        this.f1263b = (String) l.d(str);
        this.f1264c = i;
    }

    public final List<Proxy> b() {
        try {
            return ProxySelector.getDefault().select(new URI(c()));
        } catch (URISyntaxException e2) {
            throw new IllegalStateException(e2);
        }
    }

    public final String c() {
        return String.format(Locale.US, "http://%s:%d/%s", this.f1263b, Integer.valueOf(this.f1264c), "ping");
    }

    public boolean d(String str) {
        return "ping".equals(str);
    }

    public boolean e(int i, int i2) {
        l.b(i >= 1);
        l.b(i2 > 0);
        int i3 = 0;
        while (i3 < i) {
            try {
            } catch (InterruptedException e2) {
                e = e2;
                f.b("Error pinging server due to unexpected error", e);
            } catch (ExecutionException e3) {
                e = e3;
                f.b("Error pinging server due to unexpected error", e);
            } catch (TimeoutException unused) {
                f.f("Error pinging server (attempt: " + i3 + ", timeout: " + i2 + "). ");
            }
            if (((Boolean) this.f1262a.submit(new b()).get(i2, TimeUnit.MILLISECONDS)).booleanValue()) {
                return true;
            }
            i3++;
            i2 *= 2;
        }
        String format = String.format(Locale.US, "Error pinging server (attempts: %d, max timeout: %d). If you see this message, please, report at https://github.com/danikula/AndroidVideoCache/issues/134. Default proxies are: %s", Integer.valueOf(i3), Integer.valueOf(i2 / 2), b());
        f.b(format, new ProxyCacheException(format));
        return false;
    }

    public final boolean f() {
        i iVar = new i(c(), null, null);
        try {
            byte[] bytes = "ping ok".getBytes();
            iVar.a(0L);
            byte[] bArr = new byte[bytes.length];
            iVar.read(bArr);
            boolean equals = Arrays.equals(bytes, bArr);
            f.d("Ping response: `" + new String(bArr) + "`, pinged? " + equals);
            return equals;
        } catch (ProxyCacheException e2) {
            f.b("Error reading ping response", e2);
            return false;
        } finally {
            iVar.close();
        }
    }

    public void g(Socket socket) {
        OutputStream outputStream = socket.getOutputStream();
        outputStream.write("HTTP/1.1 200 OK\n\n".getBytes());
        outputStream.write("ping ok".getBytes());
    }
}