暗网解密 v2.0.4版本的 MD5 值为:d3a04548fef88e775cbe4c3c6e7d81ad
以下内容为反编译后的 i.java 源代码,内容仅作参考
package c.d.a;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.camera.camera2.internal.Camera2CameraImpl;
import com.danikula.videocache.InterruptedProxyCacheException;
import com.danikula.videocache.ProxyCacheException;
import com.lzy.okgo.model.HttpHeaders;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InterruptedIOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.Map;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
public class i implements o {
public final c.d.a.t.c f1251a;
public final c.d.a.s.b f1252b;
public final HostnameVerifier f1253c;
public final TrustManager[] f1254d;
public p f1255e;
public HttpURLConnection f1256f;
public InputStream f1257g;
public i(String str, HostnameVerifier hostnameVerifier, TrustManager[] trustManagerArr) {
this(str, c.d.a.t.d.a(), hostnameVerifier, trustManagerArr);
}
@Override
public void a(long j) {
try {
HttpURLConnection g2 = g(j, -1);
this.f1256f = g2;
String contentType = g2.getContentType();
this.f1257g = new BufferedInputStream(this.f1256f.getInputStream(), 8192);
HttpURLConnection httpURLConnection = this.f1256f;
p pVar = new p(this.f1255e.f1275a, h(httpURLConnection, j, httpURLConnection.getResponseCode()), contentType);
this.f1255e = pVar;
this.f1251a.a(pVar.f1275a, pVar);
} catch (IOException e2) {
throw new ProxyCacheException("Error opening connection for " + this.f1255e.f1275a + " with offset " + j, e2);
}
}
public final void b() {
HttpURLConnection httpURLConnection;
?? r0 = 0;
InputStream inputStream = null;
try {
try {
httpURLConnection = g(0L, Camera2CameraImpl.StateCallback.CameraReopenMonitor.REOPEN_LIMIT_MS);
try {
long c2 = c(httpURLConnection);
String contentType = httpURLConnection.getContentType();
inputStream = httpURLConnection.getInputStream();
p pVar = new p(this.f1255e.f1275a, c2, contentType);
this.f1255e = pVar;
this.f1251a.a(pVar.f1275a, pVar);
n.c(inputStream);
r0 = httpURLConnection;
} catch (IOException e2) {
e = e2;
f.b("Error fetching info from " + this.f1255e.f1275a, e);
n.c(inputStream);
r0 = httpURLConnection;
if (httpURLConnection == null) {
return;
}
r0.disconnect();
}
} catch (Throwable th) {
th = th;
n.c(inputStream);
if (r0 != 0) {
r0.disconnect();
}
throw th;
}
} catch (IOException e3) {
e = e3;
httpURLConnection = null;
} catch (Throwable th2) {
th = th2;
r0 = 0;
n.c(inputStream);
if (r0 != 0) {
}
throw th;
}
r0.disconnect();
}
public final long c(HttpURLConnection httpURLConnection) {
String headerField = httpURLConnection.getHeaderField(HttpHeaders.HEAD_KEY_CONTENT_LENGTH);
if (headerField == null) {
return -1L;
}
return Long.parseLong(headerField);
}
@Override
public void close() {
HttpURLConnection httpURLConnection = this.f1256f;
if (httpURLConnection != null) {
try {
httpURLConnection.disconnect();
} catch (ArrayIndexOutOfBoundsException e2) {
f.b("Error closing connection correctly. Should happen only on Android L. If anybody know how to fix it, please visit https://github.com/danikula/AndroidVideoCache/issues/88. Until good solution is not know, just ignore this issue :(", e2);
} catch (IllegalArgumentException e3) {
e = e3;
throw new RuntimeException("Wait... but why? WTF!? Really shouldn't happen any more after fixing https://github.com/danikula/AndroidVideoCache/issues/43. If you read it on your device log, please, notify me danikula@gmail.com or create issue here https://github.com/danikula/AndroidVideoCache/issues.", e);
} catch (NullPointerException e4) {
e = e4;
throw new RuntimeException("Wait... but why? WTF!? Really shouldn't happen any more after fixing https://github.com/danikula/AndroidVideoCache/issues/43. If you read it on your device log, please, notify me danikula@gmail.com or create issue here https://github.com/danikula/AndroidVideoCache/issues.", e);
}
}
}
public synchronized String d() {
if (TextUtils.isEmpty(this.f1255e.f1277c)) {
b();
}
return this.f1255e.f1277c;
}
public String e() {
return this.f1255e.f1275a;
}
public final void f(HttpURLConnection httpURLConnection, String str) {
Map<String, String> a2 = this.f1252b.a(str);
if (a2 == null) {
return;
}
f.a("****** injectCustomHeaders ****** :" + a2.size());
for (Map.Entry<String, String> entry : a2.entrySet()) {
httpURLConnection.setRequestProperty(entry.getKey(), entry.getValue());
}
}
public final HttpURLConnection g(long j, int i) {
HttpURLConnection httpURLConnection;
boolean z;
String str = this.f1255e.f1275a;
int i2 = 0;
do {
if (str.startsWith("https") && this.f1253c != null && this.f1254d != null) {
httpURLConnection = (HttpURLConnection) new URL(str).openConnection();
((HttpsURLConnection) httpURLConnection).setHostnameVerifier(this.f1253c);
try {
SSLContext sSLContext = SSLContext.getInstance("SSL");
sSLContext.init(null, this.f1254d, new SecureRandom());
((HttpsURLConnection) httpURLConnection).setSSLSocketFactory(sSLContext.getSocketFactory());
((HttpsURLConnection) httpURLConnection).setHostnameVerifier(this.f1253c);
} catch (KeyManagementException | NoSuchAlgorithmException e2) {
e2.printStackTrace();
}
} else {
httpURLConnection = (HttpURLConnection) new URL(str).openConnection();
}
f(httpURLConnection, str);
if (j > 0) {
httpURLConnection.setRequestProperty(HttpHeaders.HEAD_KEY_RANGE, "bytes=" + j + "-");
}
if (i > 0) {
httpURLConnection.setConnectTimeout(i);
httpURLConnection.setReadTimeout(i);
}
int responseCode = httpURLConnection.getResponseCode();
z = responseCode == 301 || responseCode == 302 || responseCode == 303;
if (z) {
str = httpURLConnection.getHeaderField(HttpHeaders.HEAD_KEY_LOCATION);
i2++;
httpURLConnection.disconnect();
}
if (i2 > 5) {
throw new ProxyCacheException("Too many redirects: " + i2);
}
} while (z);
return httpURLConnection;
}
public final long h(HttpURLConnection httpURLConnection, long j, int i) {
long c2 = c(httpURLConnection);
return i == 200 ? c2 : i == 206 ? c2 + j : this.f1255e.f1276b;
}
@Override
public synchronized long length() {
if (this.f1255e.f1276b == -2147483648L) {
b();
}
return this.f1255e.f1276b;
}
@Override
public int read(byte[] bArr) {
InputStream inputStream = this.f1257g;
if (inputStream != null) {
try {
return inputStream.read(bArr, 0, bArr.length);
} catch (InterruptedIOException e2) {
throw new InterruptedProxyCacheException("Reading source " + this.f1255e.f1275a + " is interrupted", e2);
} catch (IOException e3) {
throw new ProxyCacheException("Error reading data from " + this.f1255e.f1275a, e3);
}
}
throw new ProxyCacheException("Error reading data from " + this.f1255e.f1275a + ": connection is absent!");
}
@NonNull
public String toString() {
return "HttpUrlSource{sourceInfo='" + this.f1255e + "}";
}
public i(String str, c.d.a.t.c cVar, HostnameVerifier hostnameVerifier, TrustManager[] trustManagerArr) {
this(str, cVar, new c.d.a.s.a(), hostnameVerifier, trustManagerArr);
}
public i(String str, c.d.a.t.c cVar, c.d.a.s.b bVar, HostnameVerifier hostnameVerifier, TrustManager[] trustManagerArr) {
this.f1251a = (c.d.a.t.c) l.d(cVar);
this.f1252b = (c.d.a.s.b) l.d(bVar);
this.f1253c = hostnameVerifier;
this.f1254d = trustManagerArr;
p pVar = cVar.get(str);
this.f1255e = pVar == null ? new p(str, -2147483648L, n.g(str)) : pVar;
}
public i(i iVar) {
this.f1255e = iVar.f1255e;
this.f1251a = iVar.f1251a;
this.f1252b = iVar.f1252b;
this.f1254d = iVar.f1254d;
this.f1253c = iVar.f1253c;
}
}