360 Wi-Fi v1.0.1版本的 MD5 值为:53dc85b63eb655b13344ce30ddaccae2
以下内容为反编译后的 h.java 源代码,内容仅作参考
package com.inmobi.media;
import LiLIiLLLiLllIi.illli;
import android.net.Uri;
import android.os.SystemClock;
import android.webkit.URLUtil;
import iIiilLLliIiIiL.iiIlllLIi;
import iiLi.IliIIiL;
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.json.JSONException;
import org.json.JSONObject;
public final class h {
public static final a b = new a();
public final z0 a;
public static final class a {
public final String a(f fVar, File file, long j, long j2) {
iiIlllLIi.illLlLIlllLILL(fVar, "asset");
iiIlllLIi.illLlLIlllLILL(file, "file");
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("url", fVar.b);
jSONObject.put("saved_url", Uri.fromFile(file));
jSONObject.put("size_in_bytes", file.length());
jSONObject.put("download_started_at", j);
jSONObject.put("download_ended_at", j2);
} catch (JSONException e) {
a aVar = h.b;
IliIIiL.lllLL(e, o5.a);
}
String jSONObject2 = jSONObject.toString();
iiIlllLIi.lllLL(jSONObject2, "obj.toString()");
return illli.IILliL(jSONObject2, "\"", "\\\"");
}
}
public h(z0 z0Var) {
iiIlllLIi.illLlLIlllLILL(z0Var, "mResultListener");
this.a = z0Var;
}
public final void a(f fVar, long j, 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 z;
BufferedOutputStream bufferedOutputStream;
InputStream inputStream15;
InputStream inputStream16;
iiIlllLIi.illLlLIlllLILL(fVar, "asset");
iiIlllLIi.illLlLIlllLILL(list, "allowedContentType");
if (t9.a.a() == null) {
?? r3 = "";
if (!iiIlllLIi.IilIL(fVar.b(), "") && URLUtil.isValidUrl(fVar.b())) {
Object[] array = list.toArray(new String[0]);
if (array != null) {
String[] strArr = (String[]) array;
BufferedOutputStream bufferedOutputStream2 = null;
try {
try {
try {
elapsedRealtime = SystemClock.elapsedRealtime();
openConnection = new URL(fVar.b()).openConnection();
} catch (Throwable th) {
th = th;
inputStream8 = r3;
}
} 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) {
HttpURLConnection httpURLConnection = (HttpURLConnection) openConnection;
httpURLConnection.setRequestMethod("GET");
httpURLConnection.setConnectTimeout(60000);
httpURLConnection.setReadTimeout(60000);
int responseCode = httpURLConnection.getResponseCode();
iiIlllLIi.LLlIiIILLiLli(Integer.valueOf(responseCode), "Response code: ");
if (responseCode < 400) {
try {
String contentType = httpURLConnection.getContentType();
iiIlllLIi.LLlIiIILLiLli(contentType, "Content Type: ");
int length = strArr.length;
int i2 = 0;
while (true) {
if (i2 >= length) {
z = false;
break;
}
String str = strArr[i2];
iiIlllLIi.LLlIiIILLiLli(str, "Allowed Type: ");
if (contentType != null && illli.lI(str, contentType, true)) {
z = true;
break;
}
i2++;
}
if (!z) {
fVar.a((byte) 3);
fVar.a(0);
this.a.a(fVar);
t9.a((Closeable) null);
t9.a((Closeable) null);
return;
}
} catch (Throwable th3) {
th = th3;
inputStream7 = null;
bufferedOutputStream2 = null;
inputStream8 = inputStream7;
t9.a((Closeable) inputStream8);
t9.a(bufferedOutputStream2);
throw th;
}
}
long contentLength = httpURLConnection.getContentLength();
long j2 = 0;
if (contentLength >= 0 && contentLength > j) {
fVar.a((byte) 4);
fVar.a(0);
this.a.a(fVar);
t9.a((Closeable) null);
t9.a((Closeable) null);
return;
}
httpURLConnection.connect();
File a2 = vb.a.a(fVar.b());
if (a2.exists()) {
a2.delete();
}
InputStream inputStream17 = httpURLConnection.getInputStream();
try {
BufferedOutputStream bufferedOutputStream3 = new BufferedOutputStream(new FileOutputStream(a2));
try {
byte[] bArr = new byte[1024];
inputStream16 = inputStream17;
while (true) {
int read = inputStream16.read(bArr);
if (read <= 0) {
break;
}
j2 += read;
if (j2 > j) {
try {
fVar.a((byte) 4);
fVar.a(0);
a(a2, httpURLConnection, bufferedOutputStream3);
BufferedOutputStream bufferedOutputStream4 = bufferedOutputStream3;
inputStream15 = inputStream16;
try {
a(elapsedRealtime, j2, SystemClock.elapsedRealtime());
this.a.a(fVar);
t9.a((Closeable) inputStream15);
t9.a(bufferedOutputStream4);
return;
} catch (FileNotFoundException unused7) {
bufferedOutputStream = bufferedOutputStream4;
bufferedOutputStream2 = bufferedOutputStream;
inputStream14 = inputStream15;
fVar.a((byte) 2);
this.a.a(fVar);
r3 = inputStream14;
BufferedOutputStream bufferedOutputStream5 = bufferedOutputStream2;
InputStream inputStream18 = r3;
t9.a((Closeable) inputStream18);
t9.a(bufferedOutputStream5);
return;
} catch (MalformedURLException unused8) {
bufferedOutputStream = bufferedOutputStream4;
bufferedOutputStream2 = bufferedOutputStream;
inputStream13 = inputStream15;
fVar.a((byte) 1);
this.a.a(fVar);
r3 = inputStream13;
BufferedOutputStream bufferedOutputStream52 = bufferedOutputStream2;
InputStream inputStream182 = r3;
t9.a((Closeable) inputStream182);
t9.a(bufferedOutputStream52);
return;
} catch (ProtocolException unused9) {
bufferedOutputStream = bufferedOutputStream4;
bufferedOutputStream2 = bufferedOutputStream;
inputStream12 = inputStream15;
fVar.a((byte) 5);
this.a.a(fVar);
r3 = inputStream12;
BufferedOutputStream bufferedOutputStream522 = bufferedOutputStream2;
InputStream inputStream1822 = r3;
t9.a((Closeable) inputStream1822);
t9.a(bufferedOutputStream522);
return;
} catch (SocketTimeoutException unused10) {
bufferedOutputStream = bufferedOutputStream4;
bufferedOutputStream2 = bufferedOutputStream;
inputStream11 = inputStream15;
fVar.a((byte) 2);
this.a.a(fVar);
r3 = inputStream11;
BufferedOutputStream bufferedOutputStream5222 = bufferedOutputStream2;
InputStream inputStream18222 = r3;
t9.a((Closeable) inputStream18222);
t9.a(bufferedOutputStream5222);
return;
} catch (IOException unused11) {
bufferedOutputStream = bufferedOutputStream4;
bufferedOutputStream2 = bufferedOutputStream;
inputStream10 = inputStream15;
fVar.a((byte) 5);
this.a.a(fVar);
r3 = inputStream10;
BufferedOutputStream bufferedOutputStream52222 = bufferedOutputStream2;
InputStream inputStream182222 = r3;
t9.a((Closeable) inputStream182222);
t9.a(bufferedOutputStream52222);
return;
} catch (Exception unused12) {
bufferedOutputStream = bufferedOutputStream4;
bufferedOutputStream2 = bufferedOutputStream;
inputStream9 = inputStream15;
fVar.a((byte) 0);
this.a.a(fVar);
r3 = inputStream9;
BufferedOutputStream bufferedOutputStream522222 = bufferedOutputStream2;
InputStream inputStream1822222 = r3;
t9.a((Closeable) inputStream1822222);
t9.a(bufferedOutputStream522222);
return;
} catch (Throwable th4) {
th = th4;
bufferedOutputStream2 = bufferedOutputStream4;
inputStream8 = inputStream15;
t9.a((Closeable) inputStream8);
t9.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;
t9.a((Closeable) inputStream8);
t9.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;
fVar.a((byte) 2);
this.a.a(fVar);
r3 = inputStream14;
BufferedOutputStream bufferedOutputStream5222222 = bufferedOutputStream2;
InputStream inputStream18222222 = r3;
t9.a((Closeable) inputStream18222222);
t9.a(bufferedOutputStream5222222);
return;
} catch (MalformedURLException unused20) {
bufferedOutputStream2 = bufferedOutputStream;
inputStream13 = inputStream15;
fVar.a((byte) 1);
this.a.a(fVar);
r3 = inputStream13;
BufferedOutputStream bufferedOutputStream52222222 = bufferedOutputStream2;
InputStream inputStream182222222 = r3;
t9.a((Closeable) inputStream182222222);
t9.a(bufferedOutputStream52222222);
return;
} catch (ProtocolException unused21) {
bufferedOutputStream2 = bufferedOutputStream;
inputStream12 = inputStream15;
fVar.a((byte) 5);
this.a.a(fVar);
r3 = inputStream12;
BufferedOutputStream bufferedOutputStream522222222 = bufferedOutputStream2;
InputStream inputStream1822222222 = r3;
t9.a((Closeable) inputStream1822222222);
t9.a(bufferedOutputStream522222222);
return;
} catch (SocketTimeoutException unused22) {
bufferedOutputStream2 = bufferedOutputStream;
inputStream11 = inputStream15;
fVar.a((byte) 2);
this.a.a(fVar);
r3 = inputStream11;
BufferedOutputStream bufferedOutputStream5222222222 = bufferedOutputStream2;
InputStream inputStream18222222222 = r3;
t9.a((Closeable) inputStream18222222222);
t9.a(bufferedOutputStream5222222222);
return;
} catch (IOException unused23) {
bufferedOutputStream2 = bufferedOutputStream;
inputStream10 = inputStream15;
fVar.a((byte) 5);
this.a.a(fVar);
r3 = inputStream10;
BufferedOutputStream bufferedOutputStream52222222222 = bufferedOutputStream2;
InputStream inputStream182222222222 = r3;
t9.a((Closeable) inputStream182222222222);
t9.a(bufferedOutputStream52222222222);
return;
} catch (Exception unused24) {
bufferedOutputStream2 = bufferedOutputStream;
inputStream9 = inputStream15;
fVar.a((byte) 0);
this.a.a(fVar);
r3 = inputStream9;
BufferedOutputStream bufferedOutputStream522222222222 = bufferedOutputStream2;
InputStream inputStream1822222222222 = r3;
t9.a((Closeable) inputStream1822222222222);
t9.a(bufferedOutputStream522222222222);
return;
} catch (Throwable th6) {
th = th6;
bufferedOutputStream2 = bufferedOutputStream;
inputStream8 = inputStream15;
t9.a((Closeable) inputStream8);
t9.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;
fVar.a((byte) 2);
this.a.a(fVar);
r3 = inputStream14;
BufferedOutputStream bufferedOutputStream5222222222222 = bufferedOutputStream2;
InputStream inputStream18222222222222 = r3;
t9.a((Closeable) inputStream18222222222222);
t9.a(bufferedOutputStream5222222222222);
return;
} catch (MalformedURLException unused32) {
inputStream5 = inputStream17;
bufferedOutputStream2 = null;
inputStream13 = inputStream5;
fVar.a((byte) 1);
this.a.a(fVar);
r3 = inputStream13;
BufferedOutputStream bufferedOutputStream52222222222222 = bufferedOutputStream2;
InputStream inputStream182222222222222 = r3;
t9.a((Closeable) inputStream182222222222222);
t9.a(bufferedOutputStream52222222222222);
return;
} catch (ProtocolException unused33) {
inputStream4 = inputStream17;
bufferedOutputStream2 = null;
inputStream12 = inputStream4;
fVar.a((byte) 5);
this.a.a(fVar);
r3 = inputStream12;
BufferedOutputStream bufferedOutputStream522222222222222 = bufferedOutputStream2;
InputStream inputStream1822222222222222 = r3;
t9.a((Closeable) inputStream1822222222222222);
t9.a(bufferedOutputStream522222222222222);
return;
} catch (SocketTimeoutException unused34) {
inputStream3 = inputStream17;
bufferedOutputStream2 = null;
inputStream11 = inputStream3;
fVar.a((byte) 2);
this.a.a(fVar);
r3 = inputStream11;
BufferedOutputStream bufferedOutputStream5222222222222222 = bufferedOutputStream2;
InputStream inputStream18222222222222222 = r3;
t9.a((Closeable) inputStream18222222222222222);
t9.a(bufferedOutputStream5222222222222222);
return;
} catch (IOException unused35) {
inputStream2 = inputStream17;
bufferedOutputStream2 = null;
inputStream10 = inputStream2;
fVar.a((byte) 5);
this.a.a(fVar);
r3 = inputStream10;
BufferedOutputStream bufferedOutputStream52222222222222222 = bufferedOutputStream2;
InputStream inputStream182222222222222222 = r3;
t9.a((Closeable) inputStream182222222222222222);
t9.a(bufferedOutputStream52222222222222222);
return;
} catch (Exception unused36) {
inputStream = inputStream17;
bufferedOutputStream2 = null;
inputStream9 = inputStream;
fVar.a((byte) 0);
this.a.a(fVar);
r3 = inputStream9;
BufferedOutputStream bufferedOutputStream522222222222222222 = bufferedOutputStream2;
InputStream inputStream1822222222222222222 = r3;
t9.a((Closeable) inputStream1822222222222222222);
t9.a(bufferedOutputStream522222222222222222);
return;
} catch (Throwable th8) {
th = th8;
inputStream7 = inputStream17;
bufferedOutputStream2 = null;
inputStream8 = inputStream7;
t9.a((Closeable) inputStream8);
t9.a(bufferedOutputStream2);
throw th;
}
t9.a((Closeable) inputStream1822222222222222222);
t9.a(bufferedOutputStream522222222222222222);
return;
}
throw new NullPointerException("null cannot be cast to non-null type java.net.HttpURLConnection");
}
throw new NullPointerException("null cannot be cast to non-null type kotlin.Array<T>");
}
fVar.a((byte) 1);
this.a.a(fVar);
return;
}
fVar.a((byte) 5);
this.a.a(fVar);
}
public final void a(long j, long j2, long j3) {
try {
yb ybVar = yb.a;
ybVar.c(0L);
ybVar.b(j2);
ybVar.a(j3 - j);
} catch (Exception e) {
iiIlllLIi.LLlIiIILLiLli(e.getMessage(), "Error in setting request-response data size. ");
IliIIiL.ILiIiliL(e, o5.a);
}
}
public final void a(File file, HttpURLConnection httpURLConnection, BufferedOutputStream bufferedOutputStream) {
try {
if (file.exists()) {
iiIlllLIi.LLlIiIILLiLli(Boolean.valueOf(file.delete()), "Deleted file: ");
}
httpURLConnection.disconnect();
t9.a(bufferedOutputStream);
} catch (Exception e) {
IliIIiL.ILiIiliL(e, o5.a);
}
}
}