Chomp v9.11版本的 MD5 值为:8dd6a6008d51ff2822fc9bfb17203c9f
以下内容为反编译后的 g.java 源代码,内容仅作参考
package com.inmobi.media;
import android.net.Uri;
import android.os.SystemClock;
import android.webkit.URLUtil;
import com.inmobi.commons.core.configs.AdConfig;
import java.io.BufferedOutputStream;
import java.io.Closeable;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.net.SocketTimeoutException;
import java.net.URL;
import java.net.URLConnection;
import java.util.List;
import org.apache.http.client.methods.HttpGet;
import org.json.JSONException;
import org.json.JSONObject;
public final class g {
public static final a f8250b = new a();
public final w0 f8251a;
public static final class a {
public final String a(e eVar, File file, long j4, long j10) {
x5.j.i(eVar, "asset");
x5.j.i(file, "file");
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("url", eVar.f8091b);
jSONObject.put("saved_url", Uri.fromFile(file));
jSONObject.put("size_in_bytes", file.length());
jSONObject.put("download_started_at", j4);
jSONObject.put("download_ended_at", j10);
} catch (JSONException e10) {
a aVar = g.f8250b;
a.a.w(e10, z2.f9312a);
}
String jSONObject2 = jSONObject.toString();
x5.j.h(jSONObject2, "obj.toString()");
return pb.o.u1(false, jSONObject2, "\"", "\\\"");
}
}
public g(w0 w0Var) {
x5.j.i(w0Var, "mResultListener");
this.f8251a = w0Var;
}
public final void a(long j4, long j10, long j11) {
try {
fb fbVar = fb.f8238a;
fbVar.c(0L);
fbVar.b(j10);
fbVar.a(j11 - j4);
} catch (Exception e10) {
x5.j.P(e10.getMessage(), "Error in setting request-response data size. ");
a.a.s(e10, z2.f9312a);
}
}
public final void a(e eVar, long j4, List<String> list) {
InputStream inputStream;
InputStream inputStream2;
InputStream inputStream3;
InputStream inputStream4;
InputStream inputStream5;
InputStream inputStream6;
InputStream inputStream7;
InputStream inputStream8;
InputStream inputStream9;
InputStream inputStream10;
InputStream inputStream11;
InputStream inputStream12;
InputStream inputStream13;
InputStream inputStream14;
long elapsedRealtime;
URLConnection openConnection;
boolean z10;
BufferedOutputStream bufferedOutputStream;
InputStream inputStream15;
InputStream inputStream16;
x5.j.i(eVar, "asset");
x5.j.i(list, AdConfig.ALLOWED_CONTENT_TYPE);
if (c9.f7994a.a() != null) {
eVar.a((byte) 5);
this.f8251a.a(eVar);
return;
}
?? r32 = "";
if (x5.j.d(eVar.b(), "") || !URLUtil.isValidUrl(eVar.b())) {
eVar.a((byte) 1);
this.f8251a.a(eVar);
return;
}
Object[] array = list.toArray(new String[0]);
if (array == null) {
throw new NullPointerException("null cannot be cast to non-null type kotlin.Array<T>");
}
String[] strArr = (String[]) array;
BufferedOutputStream bufferedOutputStream2 = null;
try {
try {
try {
elapsedRealtime = SystemClock.elapsedRealtime();
openConnection = new URL(eVar.b()).openConnection();
} catch (Throwable th) {
th = th;
inputStream8 = r32;
}
} catch (Throwable th2) {
th = th2;
inputStream7 = null;
}
} catch (FileNotFoundException unused) {
inputStream6 = null;
} catch (MalformedURLException unused2) {
inputStream5 = null;
} catch (ProtocolException unused3) {
inputStream4 = null;
} catch (SocketTimeoutException unused4) {
inputStream3 = null;
} catch (IOException unused5) {
inputStream2 = null;
} catch (Exception unused6) {
inputStream = null;
}
if (openConnection == null) {
throw new NullPointerException("null cannot be cast to non-null type java.net.HttpURLConnection");
}
HttpURLConnection httpURLConnection = (HttpURLConnection) openConnection;
httpURLConnection.setRequestMethod(HttpGet.METHOD_NAME);
httpURLConnection.setConnectTimeout(60000);
httpURLConnection.setReadTimeout(60000);
int responseCode = httpURLConnection.getResponseCode();
x5.j.P(Integer.valueOf(responseCode), "Response code: ");
if (responseCode < 400) {
try {
String contentType = httpURLConnection.getContentType();
x5.j.P(contentType, "Content Type: ");
int length = strArr.length;
int i10 = 0;
while (true) {
if (i10 >= length) {
z10 = false;
break;
}
String str = strArr[i10];
x5.j.P(str, "Allowed Type: ");
if (contentType != null && pb.o.d1(str, contentType, true)) {
z10 = true;
break;
}
i10++;
}
if (!z10) {
eVar.a((byte) 3);
eVar.a(0);
this.f8251a.a(eVar);
c9.a((Closeable) null);
c9.a((Closeable) null);
return;
}
} catch (Throwable th3) {
th = th3;
inputStream7 = null;
bufferedOutputStream2 = null;
inputStream8 = inputStream7;
c9.a((Closeable) inputStream8);
c9.a(bufferedOutputStream2);
throw th;
}
}
long contentLength = httpURLConnection.getContentLength();
long j10 = 0;
if (contentLength >= 0 && contentLength > j4) {
eVar.a((byte) 4);
eVar.a(0);
this.f8251a.a(eVar);
c9.a((Closeable) null);
c9.a((Closeable) null);
return;
}
httpURLConnection.connect();
File a4 = cb.f7995a.a(eVar.b());
if (a4.exists()) {
a4.delete();
}
InputStream inputStream17 = httpURLConnection.getInputStream();
try {
BufferedOutputStream bufferedOutputStream3 = new BufferedOutputStream(new FileOutputStream(a4));
try {
byte[] bArr = new byte[1024];
inputStream16 = inputStream17;
while (true) {
int read = inputStream16.read(bArr);
if (read <= 0) {
break;
}
j10 += read;
if (j10 > j4) {
try {
eVar.a((byte) 4);
eVar.a(0);
a(a4, httpURLConnection, bufferedOutputStream3);
BufferedOutputStream bufferedOutputStream4 = bufferedOutputStream3;
inputStream15 = inputStream16;
try {
a(elapsedRealtime, j10, SystemClock.elapsedRealtime());
this.f8251a.a(eVar);
c9.a((Closeable) inputStream15);
c9.a(bufferedOutputStream4);
return;
} catch (FileNotFoundException unused7) {
bufferedOutputStream = bufferedOutputStream4;
bufferedOutputStream2 = bufferedOutputStream;
inputStream14 = inputStream15;
eVar.a((byte) 2);
this.f8251a.a(eVar);
r32 = inputStream14;
BufferedOutputStream bufferedOutputStream5 = bufferedOutputStream2;
InputStream inputStream18 = r32;
c9.a((Closeable) inputStream18);
c9.a(bufferedOutputStream5);
} catch (MalformedURLException unused8) {
bufferedOutputStream = bufferedOutputStream4;
bufferedOutputStream2 = bufferedOutputStream;
inputStream13 = inputStream15;
eVar.a((byte) 1);
this.f8251a.a(eVar);
r32 = inputStream13;
BufferedOutputStream bufferedOutputStream52 = bufferedOutputStream2;
InputStream inputStream182 = r32;
c9.a((Closeable) inputStream182);
c9.a(bufferedOutputStream52);
} catch (ProtocolException unused9) {
bufferedOutputStream = bufferedOutputStream4;
bufferedOutputStream2 = bufferedOutputStream;
inputStream12 = inputStream15;
eVar.a((byte) 5);
this.f8251a.a(eVar);
r32 = inputStream12;
BufferedOutputStream bufferedOutputStream522 = bufferedOutputStream2;
InputStream inputStream1822 = r32;
c9.a((Closeable) inputStream1822);
c9.a(bufferedOutputStream522);
} catch (SocketTimeoutException unused10) {
bufferedOutputStream = bufferedOutputStream4;
bufferedOutputStream2 = bufferedOutputStream;
inputStream11 = inputStream15;
eVar.a((byte) 2);
this.f8251a.a(eVar);
r32 = inputStream11;
BufferedOutputStream bufferedOutputStream5222 = bufferedOutputStream2;
InputStream inputStream18222 = r32;
c9.a((Closeable) inputStream18222);
c9.a(bufferedOutputStream5222);
} catch (IOException unused11) {
bufferedOutputStream = bufferedOutputStream4;
bufferedOutputStream2 = bufferedOutputStream;
inputStream10 = inputStream15;
eVar.a((byte) 5);
this.f8251a.a(eVar);
r32 = inputStream10;
BufferedOutputStream bufferedOutputStream52222 = bufferedOutputStream2;
InputStream inputStream182222 = r32;
c9.a((Closeable) inputStream182222);
c9.a(bufferedOutputStream52222);
} catch (Exception unused12) {
bufferedOutputStream = bufferedOutputStream4;
bufferedOutputStream2 = bufferedOutputStream;
inputStream9 = inputStream15;
eVar.a((byte) 0);
this.f8251a.a(eVar);
r32 = inputStream9;
BufferedOutputStream bufferedOutputStream522222 = bufferedOutputStream2;
InputStream inputStream1822222 = r32;
c9.a((Closeable) inputStream1822222);
c9.a(bufferedOutputStream522222);
} catch (Throwable th4) {
th = th4;
bufferedOutputStream2 = bufferedOutputStream4;
inputStream8 = inputStream15;
c9.a((Closeable) inputStream8);
c9.a(bufferedOutputStream2);
throw th;
}
} catch (FileNotFoundException unused13) {
inputStream15 = inputStream16;
bufferedOutputStream = bufferedOutputStream3;
} catch (MalformedURLException unused14) {
inputStream15 = inputStream16;
bufferedOutputStream = bufferedOutputStream3;
} catch (ProtocolException unused15) {
inputStream15 = inputStream16;
bufferedOutputStream = bufferedOutputStream3;
} catch (SocketTimeoutException unused16) {
inputStream15 = inputStream16;
bufferedOutputStream = bufferedOutputStream3;
} catch (IOException unused17) {
inputStream15 = inputStream16;
bufferedOutputStream = bufferedOutputStream3;
} catch (Exception unused18) {
inputStream15 = inputStream16;
bufferedOutputStream = bufferedOutputStream3;
} catch (Throwable th5) {
th = th5;
bufferedOutputStream2 = bufferedOutputStream3;
inputStream8 = inputStream16;
c9.a((Closeable) inputStream8);
c9.a(bufferedOutputStream2);
throw th;
}
} else {
bufferedOutputStream = bufferedOutputStream3;
inputStream15 = inputStream16;
try {
bufferedOutputStream.write(bArr, 0, read);
bufferedOutputStream3 = bufferedOutputStream;
inputStream16 = inputStream15;
} catch (FileNotFoundException unused19) {
bufferedOutputStream2 = bufferedOutputStream;
inputStream14 = inputStream15;
eVar.a((byte) 2);
this.f8251a.a(eVar);
r32 = inputStream14;
BufferedOutputStream bufferedOutputStream5222222 = bufferedOutputStream2;
InputStream inputStream18222222 = r32;
c9.a((Closeable) inputStream18222222);
c9.a(bufferedOutputStream5222222);
} catch (MalformedURLException unused20) {
bufferedOutputStream2 = bufferedOutputStream;
inputStream13 = inputStream15;
eVar.a((byte) 1);
this.f8251a.a(eVar);
r32 = inputStream13;
BufferedOutputStream bufferedOutputStream52222222 = bufferedOutputStream2;
InputStream inputStream182222222 = r32;
c9.a((Closeable) inputStream182222222);
c9.a(bufferedOutputStream52222222);
} catch (ProtocolException unused21) {
bufferedOutputStream2 = bufferedOutputStream;
inputStream12 = inputStream15;
eVar.a((byte) 5);
this.f8251a.a(eVar);
r32 = inputStream12;
BufferedOutputStream bufferedOutputStream522222222 = bufferedOutputStream2;
InputStream inputStream1822222222 = r32;
c9.a((Closeable) inputStream1822222222);
c9.a(bufferedOutputStream522222222);
} catch (SocketTimeoutException unused22) {
bufferedOutputStream2 = bufferedOutputStream;
inputStream11 = inputStream15;
eVar.a((byte) 2);
this.f8251a.a(eVar);
r32 = inputStream11;
BufferedOutputStream bufferedOutputStream5222222222 = bufferedOutputStream2;
InputStream inputStream18222222222 = r32;
c9.a((Closeable) inputStream18222222222);
c9.a(bufferedOutputStream5222222222);
} catch (IOException unused23) {
bufferedOutputStream2 = bufferedOutputStream;
inputStream10 = inputStream15;
eVar.a((byte) 5);
this.f8251a.a(eVar);
r32 = inputStream10;
BufferedOutputStream bufferedOutputStream52222222222 = bufferedOutputStream2;
InputStream inputStream182222222222 = r32;
c9.a((Closeable) inputStream182222222222);
c9.a(bufferedOutputStream52222222222);
} catch (Exception unused24) {
bufferedOutputStream2 = bufferedOutputStream;
inputStream9 = inputStream15;
eVar.a((byte) 0);
this.f8251a.a(eVar);
r32 = inputStream9;
BufferedOutputStream bufferedOutputStream522222222222 = bufferedOutputStream2;
InputStream inputStream1822222222222 = r32;
c9.a((Closeable) inputStream1822222222222);
c9.a(bufferedOutputStream522222222222);
} catch (Throwable th6) {
th = th6;
bufferedOutputStream2 = bufferedOutputStream;
inputStream8 = inputStream15;
c9.a((Closeable) inputStream8);
c9.a(bufferedOutputStream2);
throw th;
}
}
}
} catch (FileNotFoundException unused25) {
bufferedOutputStream = bufferedOutputStream3;
inputStream15 = inputStream16;
} catch (MalformedURLException unused26) {
bufferedOutputStream = bufferedOutputStream3;
inputStream15 = inputStream16;
} catch (ProtocolException unused27) {
bufferedOutputStream = bufferedOutputStream3;
inputStream15 = inputStream16;
} catch (SocketTimeoutException unused28) {
bufferedOutputStream = bufferedOutputStream3;
inputStream15 = inputStream16;
} catch (IOException unused29) {
bufferedOutputStream = bufferedOutputStream3;
inputStream15 = inputStream16;
} catch (Exception unused30) {
bufferedOutputStream = bufferedOutputStream3;
inputStream15 = inputStream16;
} catch (Throwable th7) {
th = th7;
bufferedOutputStream2 = bufferedOutputStream3;
inputStream8 = inputStream16;
}
} catch (FileNotFoundException unused31) {
inputStream6 = inputStream17;
bufferedOutputStream2 = null;
inputStream14 = inputStream6;
eVar.a((byte) 2);
this.f8251a.a(eVar);
r32 = inputStream14;
BufferedOutputStream bufferedOutputStream5222222222222 = bufferedOutputStream2;
InputStream inputStream18222222222222 = r32;
c9.a((Closeable) inputStream18222222222222);
c9.a(bufferedOutputStream5222222222222);
} catch (MalformedURLException unused32) {
inputStream5 = inputStream17;
bufferedOutputStream2 = null;
inputStream13 = inputStream5;
eVar.a((byte) 1);
this.f8251a.a(eVar);
r32 = inputStream13;
BufferedOutputStream bufferedOutputStream52222222222222 = bufferedOutputStream2;
InputStream inputStream182222222222222 = r32;
c9.a((Closeable) inputStream182222222222222);
c9.a(bufferedOutputStream52222222222222);
} catch (ProtocolException unused33) {
inputStream4 = inputStream17;
bufferedOutputStream2 = null;
inputStream12 = inputStream4;
eVar.a((byte) 5);
this.f8251a.a(eVar);
r32 = inputStream12;
BufferedOutputStream bufferedOutputStream522222222222222 = bufferedOutputStream2;
InputStream inputStream1822222222222222 = r32;
c9.a((Closeable) inputStream1822222222222222);
c9.a(bufferedOutputStream522222222222222);
} catch (SocketTimeoutException unused34) {
inputStream3 = inputStream17;
bufferedOutputStream2 = null;
inputStream11 = inputStream3;
eVar.a((byte) 2);
this.f8251a.a(eVar);
r32 = inputStream11;
BufferedOutputStream bufferedOutputStream5222222222222222 = bufferedOutputStream2;
InputStream inputStream18222222222222222 = r32;
c9.a((Closeable) inputStream18222222222222222);
c9.a(bufferedOutputStream5222222222222222);
} catch (IOException unused35) {
inputStream2 = inputStream17;
bufferedOutputStream2 = null;
inputStream10 = inputStream2;
eVar.a((byte) 5);
this.f8251a.a(eVar);
r32 = inputStream10;
BufferedOutputStream bufferedOutputStream52222222222222222 = bufferedOutputStream2;
InputStream inputStream182222222222222222 = r32;
c9.a((Closeable) inputStream182222222222222222);
c9.a(bufferedOutputStream52222222222222222);
} catch (Exception unused36) {
inputStream = inputStream17;
bufferedOutputStream2 = null;
inputStream9 = inputStream;
eVar.a((byte) 0);
this.f8251a.a(eVar);
r32 = inputStream9;
BufferedOutputStream bufferedOutputStream522222222222222222 = bufferedOutputStream2;
InputStream inputStream1822222222222222222 = r32;
c9.a((Closeable) inputStream1822222222222222222);
c9.a(bufferedOutputStream522222222222222222);
} catch (Throwable th8) {
th = th8;
inputStream7 = inputStream17;
bufferedOutputStream2 = null;
inputStream8 = inputStream7;
c9.a((Closeable) inputStream8);
c9.a(bufferedOutputStream2);
throw th;
}
c9.a((Closeable) inputStream1822222222222222222);
c9.a(bufferedOutputStream522222222222222222);
}
public final void a(File file, HttpURLConnection httpURLConnection, BufferedOutputStream bufferedOutputStream) {
try {
if (file.exists()) {
x5.j.P(Boolean.valueOf(file.delete()), "Deleted file: ");
}
httpURLConnection.disconnect();
c9.a(bufferedOutputStream);
} catch (Exception e10) {
a.a.s(e10, z2.f9312a);
}
}
}