整点视频 v3.3.0版本的 MD5 值为:cba0457dc37421eed445b30f92de25d3
以下内容为反编译后的 a.java 源代码,内容仅作参考
package com.beizi.ad.internal.network;
import android.annotation.TargetApi;
import android.os.AsyncTask;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import com.baidu.mobads.sdk.internal.an;
import com.beizi.ad.R;
import com.beizi.ad.a.a.j;
import com.beizi.ad.a.a.k;
import com.beizi.ad.a.a.o;
import com.beizi.ad.c.a;
import com.beizi.ad.c.b;
import com.beizi.ad.c.d;
import com.beizi.ad.c.e;
import com.beizi.ad.internal.d;
import com.beizi.ad.internal.e;
import com.beizi.ad.internal.g;
import com.beizi.ad.internal.l;
import com.beizi.ad.internal.utilities.DeviceInfo;
import com.beizi.ad.internal.utilities.DeviceInfoUtil;
import com.beizi.ad.internal.utilities.HaoboLog;
import com.beizi.ad.internal.utilities.HashingFunctions;
import com.beizi.ad.internal.utilities.StringUtil;
import com.beizi.ad.internal.utilities.UserEnvInfo;
import com.beizi.ad.internal.utilities.UserEnvInfoUtil;
import com.beizi.ad.internal.utilities.WebviewUtil;
import com.ss.android.socialbase.downloader.utils.DownloadUtils;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.ref.SoftReference;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
public class a extends AsyncTask<Void, Integer, ServerResponse> {
private SoftReference<e> a;
private final Set<String> d;
private final Bundle e;
private final Set<String> f;
private Date g;
private String h;
private int i;
private boolean j;
private String k;
private int l;
private boolean m;
private static final ServerResponse c = new ServerResponse(true);
public static final String b = HashingFunctions.md5("emulator");
public static final class C0035a {
private Date d;
private String e;
private String h;
private boolean j;
private final HashSet<String> a = new HashSet<>();
private final Bundle b = new Bundle();
private final HashSet<String> c = new HashSet<>();
private int f = -1;
private boolean g = false;
private int i = -1;
public void a(String str) {
this.a.add(str);
}
public void b(String str) {
this.c.add(str);
}
public void c(String str) {
this.e = str;
}
public void d(String str) {
this.h = str;
}
public com.beizi.ad.b.a e() {
return new com.beizi.ad.b.a(this.d, this.f, this.a, false);
}
public void a(Class<? extends com.beizi.ad.b.b> cls, Bundle bundle) {
this.b.putBundle(cls.getName(), bundle);
}
public void b(boolean z) {
this.j = z;
}
public int c() {
return this.f;
}
public Set<String> d() {
return this.a;
}
public void a(Date date) {
this.d = date;
}
public String b() {
return this.e;
}
public void a(int i) {
this.f = i;
}
public void a(boolean z) {
this.i = z ? 1 : 0;
}
public Date a() {
return this.d;
}
public Bundle a(Class<? extends com.beizi.ad.b.b> cls) {
return this.b.getBundle(cls.getName());
}
}
public a() {
this.d = new HashSet();
this.e = null;
this.f = new HashSet();
}
private boolean b(int i) {
if (i != 200) {
HaoboLog.i(HaoboLog.httpRespLogTag, HaoboLog.getString(R.string.http_bad_status, i));
return false;
}
return true;
}
public void a(e eVar) {
this.a = new SoftReference<>(eVar);
d c2 = eVar.c();
if (c2 != null && c2.b() != null) {
DeviceInfoUtil.retrieveDeviceInfo(c2.b().getApplicationContext());
UserEnvInfoUtil.retrieveUserEnvInfo(c2.b().getApplicationContext());
if (c.a(c2.b().getApplicationContext()).b(c2.b())) {
return;
}
a(2);
cancel(true);
return;
}
a(0);
cancel(true);
}
@Override
@TargetApi(11)
public void onCancelled(ServerResponse serverResponse) {
super.onCancelled(serverResponse);
HaoboLog.w(HaoboLog.httpRespLogTag, HaoboLog.getString(R.string.cancel_request));
}
public a(C0035a c0035a) {
this.g = c0035a.d;
this.h = c0035a.e;
this.i = c0035a.f;
this.d = Collections.unmodifiableSet(c0035a.a);
this.e = c0035a.b;
this.f = Collections.unmodifiableSet(c0035a.c);
this.j = c0035a.g;
this.k = c0035a.h;
this.l = c0035a.i;
this.m = c0035a.j;
}
private void a(int i) {
e eVar = this.a.get();
if (eVar != null) {
eVar.a(i);
}
HaoboLog.clearLastResponse();
}
@Override
public ServerResponse doInBackground(Void... voidArr) {
d c2;
e eVar = this.a.get();
if (eVar == null || (c2 = eVar.c()) == null) {
return null;
}
try {
boolean z = c2.i() == l.PREFETCH;
g a = g.a();
DeviceInfo deviceInfo = DeviceInfo.getInstance();
d.a a2 = new d.a.C0028a().a(deviceInfo.sdkUID).j(DeviceInfo.density).l(com.beizi.ad.a.a.l.a(g.a().i)).m(com.beizi.ad.a.a.l.b(g.a().i)).n(deviceInfo.bootMark).o(deviceInfo.updateMark).b("").c(deviceInfo.os).a(e.EnumC0029e.PLATFORM_ANDROID).a(deviceInfo.devType).d(deviceInfo.brand).e(deviceInfo.model).f(deviceInfo.manufacturer).g(deviceInfo.resolution).h(deviceInfo.screenSize).i(deviceInfo.language).k(deviceInfo.root).p(deviceInfo.agVercode).a(deviceInfo.wxInstalled).q(DeviceInfo.physicalMemoryByte).r(DeviceInfo.harddiskSizeByte).s(deviceInfo.hmsCoreVersion).a();
UserEnvInfo userEnvInfo = UserEnvInfo.getInstance();
a.b.C0025a c3 = new a.b.C0025a().a("3.4.20.37").a(e.i.SRC_APP).c(UserEnvInfoUtil.getVersionName(g.a().i)).a(z ? e.g.REQ_WIFI_PRELOAD : e.g.REQ_AD).a(o.c()).b(a.d()).a(a2).a(new d.c.a().a(userEnvInfo.net).a(userEnvInfo.isp).a()).c(o.d(c2.b())).d(o.c(c2.b())).b(o.a(c2.b())).c(o.b(c2.b()));
if (z) {
for (String str : g.a().l()) {
if (!StringUtil.isEmpty(str)) {
c3.a(new a.C0023a.C0024a().a(str).c(c2.a()).a());
}
}
} else {
c3.a(new a.C0023a.C0024a().a(c2.c()).c(c2.a()).b(c2.k()).a());
}
a.b a3 = c3.a();
byte[] bytes = com.beizi.ad.a.a.a.a(j.a(), a3.toString()).getBytes();
k.d("lance", "sdkRequest:" + a3.toString());
String n = g.a().n();
k.d("lance", "getRequestBaseUrl:" + n);
HaoboLog.setLastRequest(a3.toString());
HaoboLog.i(HaoboLog.httpReqLogTag, HaoboLog.getString(R.string.fetch_url, HaoboLog.getLastRequest()));
HttpURLConnection a4 = a(new URL(n));
a(a4, bytes);
a4.connect();
if (!b(a4.getResponseCode())) {
return c;
}
if (a4.getContentLength() == 0) {
HaoboLog.e(HaoboLog.httpRespLogTag, HaoboLog.getString(R.string.response_blank));
}
InputStream inputStream = a4.getInputStream();
b.i a5 = b.i.a(inputStream);
inputStream.close();
return new ServerResponse(a5, a4.getHeaderFields(), c2.i());
} catch (IllegalArgumentException unused) {
HaoboLog.e(HaoboLog.httpReqLogTag, HaoboLog.getString(R.string.http_unknown));
return c;
} catch (SecurityException unused2) {
HaoboLog.e(HaoboLog.httpReqLogTag, HaoboLog.getString(R.string.permissions_internet));
return c;
} catch (MalformedURLException unused3) {
HaoboLog.e(HaoboLog.httpReqLogTag, HaoboLog.getString(R.string.http_url_malformed));
return c;
} catch (IOException unused4) {
HaoboLog.e(HaoboLog.httpReqLogTag, HaoboLog.getString(R.string.http_io));
return c;
} catch (Exception e) {
e.printStackTrace();
HaoboLog.e(HaoboLog.httpReqLogTag, Log.getStackTraceString(e));
HaoboLog.e(HaoboLog.httpReqLogTag, HaoboLog.getString(R.string.unknown_exception));
return c;
}
}
private HttpURLConnection a(URL url) throws IOException {
HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
httpURLConnection.setConnectTimeout(5000);
httpURLConnection.setReadTimeout(5000);
httpURLConnection.setDoOutput(true);
httpURLConnection.setDoInput(true);
httpURLConnection.setUseCaches(false);
httpURLConnection.setRequestMethod(an.b);
return httpURLConnection;
}
private void a(HttpURLConnection httpURLConnection, byte[] bArr) throws IOException {
httpURLConnection.setRequestProperty("User-Agent", g.a().d);
httpURLConnection.setRequestProperty(DownloadUtils.CONTENT_TYPE, an.d);
httpURLConnection.setRequestProperty("Accept", an.d);
String cookie = WebviewUtil.getCookie();
if (!TextUtils.isEmpty(cookie)) {
httpURLConnection.setRequestProperty("Cookie", cookie);
}
httpURLConnection.setRequestProperty("Connect-Length", Integer.toString(bArr.length));
httpURLConnection.setFixedLengthStreamingMode(bArr.length);
OutputStream outputStream = httpURLConnection.getOutputStream();
outputStream.write(bArr);
outputStream.flush();
outputStream.close();
}
@Override
public void onPostExecute(ServerResponse serverResponse) {
if (serverResponse == null) {
HaoboLog.v(HaoboLog.httpRespLogTag, HaoboLog.getString(R.string.no_response));
a(2);
} else if (serverResponse.a()) {
a(2);
} else {
com.beizi.ad.internal.e eVar = this.a.get();
if (eVar != null) {
eVar.a(serverResponse);
}
}
}
}