超媒网络 v3.0.0版本的 MD5 值为:e72248abb238993f421967424d9a9515

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


package p.a.y.e.a.s.e.net;

import com.danikula.videocache.ProxyCacheException;
import java.io.IOException;
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 vm {
    private static final String lite_int = "ping";
    private static final String lite_new = "ping ok";
    private final ExecutorService lite_do = Executors.newSingleThreadExecutor();
    private final int lite_for;
    private final String lite_if;

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

        @Override
        public Boolean call() throws Exception {
            return Boolean.valueOf(vm.this.lite_try());
        }
    }

    public vm(String str, int i) {
        this.lite_if = (String) wm.lite_int(str);
        this.lite_for = i;
    }

    private String lite_for() {
        return String.format(Locale.US, "http://%s:%d/%s", this.lite_if, Integer.valueOf(this.lite_for), lite_int);
    }

    private List<Proxy> lite_if() {
        try {
            return ProxySelector.getDefault().select(new URI(lite_for()));
        } catch (URISyntaxException e) {
            throw new IllegalStateException(e);
        }
    }

    public boolean lite_try() throws ProxyCacheException {
        tm tmVar = new tm(lite_for());
        try {
            byte[] bytes = lite_new.getBytes();
            tmVar.lite_do(0L);
            byte[] bArr = new byte[bytes.length];
            tmVar.read(bArr);
            boolean equals = Arrays.equals(bytes, bArr);
            qm.lite_case("Ping response: `" + new String(bArr) + "`, pinged? " + equals);
            return equals;
        } catch (ProxyCacheException e) {
            qm.lite_try("Error reading ping response", e);
            return false;
        } finally {
            tmVar.close();
        }
    }

    public void lite_byte(Socket socket) throws IOException {
        OutputStream outputStream = socket.getOutputStream();
        outputStream.write("HTTP/1.1 200 OK\n\n".getBytes());
        outputStream.write(lite_new.getBytes());
    }

    public boolean lite_int(String str) {
        return lite_int.equals(str);
    }

    public boolean lite_new(int i, int i2) {
        wm.lite_if(i >= 1);
        wm.lite_if(i2 > 0);
        int i3 = 0;
        while (i3 < i) {
            try {
            } catch (InterruptedException e) {
                e = e;
                qm.lite_try("Error pinging server due to unexpected error", e);
            } catch (ExecutionException e2) {
                e = e2;
                qm.lite_try("Error pinging server due to unexpected error", e);
            } catch (TimeoutException unused) {
                qm.lite_else("Error pinging server (attempt: " + i3 + ", timeout: " + i2 + "). ");
            }
            if (((Boolean) this.lite_do.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), lite_if());
        qm.lite_try(format, new ProxyCacheException(format));
        return false;
    }
}