正在查看: Spermatid Pro v6.4.3 应用的 ServerResponse.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Spermatid Pro v6.4.3 应用的 ServerResponse.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.octopus.ad.internal.network;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.text.TextUtils;
import android.util.Pair;
import android.view.View;
import android.webkit.WebView;
import com.octopus.ad.NativeAdResponse;
import com.octopus.ad.Octopus;
import com.octopus.ad.R;
import com.octopus.ad.internal.i;
import com.octopus.ad.internal.l;
import com.octopus.ad.internal.m;
import com.octopus.ad.internal.nativead.c;
import com.octopus.ad.internal.p;
import com.octopus.ad.internal.q;
import com.octopus.ad.internal.utilities.HaoboLog;
import com.octopus.ad.internal.utilities.ImageManager;
import com.octopus.ad.internal.utilities.StringUtil;
import com.octopus.ad.internal.utilities.UrlUtil;
import com.octopus.ad.internal.utilities.ViewUtil;
import com.octopus.ad.internal.view.b;
import com.octopus.ad.model.ComplianceInfo;
import com.octopus.ad.model.c;
import com.octopus.ad.model.c$a;
import com.octopus.ad.model.c$b;
import com.octopus.ad.model.c$k;
import com.octopus.ad.model.c$t;
import com.octopus.ad.model.d;
import com.octopus.ad.model.e;
import com.octopus.ad.model.g;
import com.octopus.ad.model.h;
import com.octopus.ad.utils.OctUtil;
import com.octopus.ad.utils.ThreadUtils;
import com.octopus.ad.utils.b.j;
import com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
import java.io.File;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.json.JSONObject;
@SuppressLint({"NewApi"})
public class ServerResponse {
private int A;
private AdLogoInfo B;
private AdLogoInfo C;
private boolean D;
private boolean E;
private boolean F;
private boolean G;
private boolean H;
private int I;
private int J;
private int K;
private String L;
private String M;
private int N;
private int O;
private boolean P;
private boolean Q;
private boolean R;
private boolean S;
private Boolean T;
private boolean U;
private boolean V;
private String W;
private String X;
private String Y;
private String Z;
public String a;
private long aA;
private l aB;
private List<Pair<i, String>> aC;
private String aD;
private String aE;
private String aF;
private String aG;
private String aH;
private boolean aI;
private boolean aJ;
private boolean aK;
private LinkedList<String> aL;
private HashMap<String, Object> aM;
private boolean aN;
private boolean aO;
private boolean aP;
private long aQ;
private long aR;
private boolean aS;
private int aT;
private boolean aU;
private boolean aV;
private String f1796aa;
private String f1797ab;
private Map<String, Object> ac;
private com.octopus.ad.a.a f1798ad;
private c ae;
private b f1799af;
private c$k ag;
private c.l ah;
private h ai;
private Activity aj;
private WebView ak;
private e al;
private c$b.a am;
private int an;
private String ao;
private String ap;
private String aq;
private String ar;
private ComplianceInfo as;
private com.octopus.ad.model.i at;
private c$b au;
private c.o av;
private c.w aw;
private List<c.i> ax;
private String ay;
private String az;
public String b;
private g.a f1800c;
private int d;
private int e;
private int f;
private int g;
private int h;
private int f1801i;
private int f1802j;
private boolean f1803k;
private boolean f1804l;
private boolean m;
private boolean f1805n;
private boolean f1806o;
private boolean p;
private boolean q;
private boolean f1807r;
private boolean s;
private boolean t;
private boolean f1808u;
private boolean f1809v;
private int f1810w;
private int x;
private int y;
private boolean z;
public ServerResponse(c$t c_t, Map<String, List<String>> map, l lVar, String str) {
this.d = 0;
this.e = 1;
this.f = 0;
this.g = 0;
this.h = 0;
this.f1801i = 0;
this.f1802j = 0;
this.f1803k = false;
this.f1804l = false;
this.m = false;
this.f1805n = false;
this.f1806o = false;
this.p = true;
this.q = false;
this.f1807r = true;
this.s = false;
this.t = false;
this.f1808u = false;
this.f1809v = false;
this.f1810w = 0;
this.x = 0;
this.y = 0;
this.z = false;
this.A = 0;
this.B = new AdLogoInfo();
this.C = new AdLogoInfo();
this.D = false;
this.P = false;
this.Q = false;
this.R = true;
this.S = true;
this.aC = new LinkedList();
this.aL = new LinkedList<>();
this.aM = new HashMap<>();
this.aN = false;
this.aO = false;
this.aT = 0;
if (c_t == null) {
HaoboLog.clearLastResponse();
return;
}
HaoboLog.setLastResponse(c_t.toString());
HaoboLog.d(HaoboLog.httpRespLogTag, HaoboLog.getString(R.string.response_body, HaoboLog.getLastResponse()));
this.aB = lVar;
this.Y = str;
a(map);
a(c_t);
af();
}
private void af() {
if (!this.p || this.aL.isEmpty() || "m3u8".equalsIgnoreCase(this.f1796aa)) {
return;
}
ThreadUtils.runOnThreadPool(new 4(this));
}
private void ag() {
if (!m.a().e() || TextUtils.isEmpty(this.f1797ab)) {
return;
}
m.a().d();
com.octopus.ad.model.a aVar = new com.octopus.ad.model.a();
aVar.g(this.L);
aVar.a(this.Y);
aVar.f(this.f1797ab);
m.a().g.put("dpForbid", aVar);
}
public boolean A() {
return this.z;
}
public String B() {
return this.ay;
}
public int C() {
return this.f1810w;
}
public int D() {
return this.x;
}
public int E() {
return this.g;
}
public int F() {
return this.f;
}
public int G() {
return this.e;
}
public int H() {
return this.d;
}
public c.o I() {
return this.av;
}
public c.w J() {
return this.aw;
}
public boolean K() {
return this.f1808u;
}
public boolean L() {
return this.f1809v;
}
public boolean M() {
return this.S;
}
public Boolean N() {
return this.T;
}
public boolean O() {
return this.U;
}
public boolean P() {
return this.V;
}
public boolean Q() {
return true;
}
public String R() {
return this.aF;
}
public String S() {
return this.aG;
}
public Map<String, Object> T() {
return this.ac;
}
public void U() {
if (this.F) {
return;
}
this.F = true;
new com.octopus.ad.internal.h(UrlUtil.replaceCloseUrl(m.a().n() + "/sdk/closeUrl?slot_id=${SLOT_ID}&req_id=${REQ_ID}", this.L, this.Y)).execute();
}
public boolean V() {
c.w wVar = this.aw;
return (wVar == null || wVar.b() == null || this.aw.b().a() != 1) ? false : true;
}
public LinkedList<String> W() {
return this.aL;
}
public g.a X() {
return this.f1800c;
}
public void Y() {
List<c.y> r2;
c$b c_b = this.au;
if (c_b == null || this.aP || (r2 = c_b.r()) == null) {
return;
}
this.aQ = System.currentTimeMillis();
for (int i2 = 0; i2 < r2.size(); i2++) {
a(r2.get(i2).a());
this.aP = true;
}
}
public void Z() {
List<c.y> r2;
c$b c_b = this.au;
if (c_b == null || this.aS || !this.aP || (r2 = c_b.r()) == null) {
return;
}
for (int i2 = 0; i2 < r2.size(); i2++) {
a(r2.get(i2).b());
this.aS = true;
}
}
public void aa() {
List<c.y> r2;
c$b c_b = this.au;
if (c_b == null || this.aU || !this.aP || (r2 = c_b.r()) == null) {
return;
}
this.aR = System.currentTimeMillis();
for (int i2 = 0; i2 < r2.size(); i2++) {
a(r2.get(i2).f());
this.aU = true;
}
}
public void ab() {
List<c.y> r2;
c$b c_b = this.au;
if (c_b == null || this.aV || !this.aP || (r2 = c_b.r()) == null) {
return;
}
for (int i2 = 0; i2 < r2.size(); i2++) {
a(r2.get(i2).g());
this.aV = true;
}
}
public void ac() {
m.a().a((m.a) null);
if (this.ak != null) {
ThreadUtils.runOnUIThread(new 9(this));
} else {
ab();
}
}
public AdLogoInfo ad() {
return this.B;
}
public AdLogoInfo ae() {
return this.C;
}
public l h() {
return this.aB;
}
public List<Pair<i, String>> i() {
return this.aC;
}
public int j() {
return this.h;
}
public int k() {
return this.f1801i;
}
public int l() {
return this.J;
}
public int m() {
return this.K;
}
public String n() {
return this.M;
}
public String o() {
return this.az;
}
public long p() {
return this.aA;
}
public boolean q() {
return this.aN;
}
public boolean r() {
return this.aO;
}
public HashMap<String, Object> s() {
return this.aM;
}
public boolean t() {
return this.f1803k;
}
public boolean u() {
return this.f1806o;
}
public boolean v() {
return this.p;
}
public boolean w() {
return this.q;
}
public boolean x() {
return this.f1807r;
}
public boolean y() {
return this.s;
}
public boolean z() {
return this.t;
}
public void b(String str) {
if (TextUtils.isEmpty(str)) {
return;
}
try {
Context k2 = m.a().k();
ClipboardManager clipboardManager = (ClipboardManager) k2.getSystemService("clipboard");
if (clipboardManager != null) {
clipboardManager.setPrimaryClip(ClipData.newPlainText("wordText", str));
a(k2);
}
} catch (Exception e) {
com.octopus.ad.utils.b.g.a("OctopusAd", "An Exception Caught", e);
}
}
public String c() {
return this.W;
}
public String d() {
return this.X;
}
public String e() {
return this.f1796aa;
}
public c.l f() {
return this.ah;
}
public NativeAdResponse g() {
return this.ae;
}
private boolean c(c$t c_t) {
if (c_t.a() > 0) {
c.v vVar = c_t.t().get(0);
this.f1800c = vVar.c();
this.d = vVar.d();
this.Z = vVar.e();
this.e = vVar.f() == g.h.b ? 1 : 2;
this.f1801i = Integer.parseInt(vVar.h());
this.h = Integer.parseInt(vVar.i());
if (vVar.j() != null && X() == g.a.d) {
c.f j2 = vVar.j();
this.f = Integer.parseInt(j2.a());
this.g = Integer.parseInt(j2.b());
} else if (!StringUtil.isEmpty(vVar.b()) && X() == g.a.b) {
a("REWARD_ITEM", vVar.b());
}
this.L = vVar.a();
this.f1803k = vVar.w();
this.f1804l = vVar.x();
this.m = vVar.y();
this.f1805n = vVar.z();
this.f1806o = vVar.A();
this.p = vVar.u();
this.q = vVar.C();
this.f1807r = vVar.v();
this.s = vVar.m();
this.t = vVar.n();
this.f1808u = vVar.o();
this.f1809v = vVar.p();
this.f1810w = vVar.r();
this.x = vVar.q();
this.y = vVar.s();
this.z = vVar.B();
this.av = vVar.k();
this.aw = vVar.l();
this.N = vVar.E();
this.K = vVar.g();
this.f1802j = vVar.t();
List F = vVar.F();
if (F != null && !F.isEmpty()) {
this.J = ((c.d) F.get(0)).j();
this.M = ((c.d) F.get(0)).k();
this.aA = ((c.d) F.get(0)).c();
}
if (this.f1803k && this.f1801i == 0 && this.h == 0) {
this.f1801i = 720;
this.h = 1280;
}
if (vVar.G() > 0) {
int i2 = 0;
for (c.d dVar : vVar.F()) {
if (i2 == 0) {
this.az = dVar.b();
com.octopus.ad.utils.b.g.a("OctopusAd", "mAdid = " + this.az);
}
if (dVar.i() <= 0 || dVar.h().get(0) == null) {
this.ay = dVar.a();
c.c f = dVar.f();
if (f != null) {
if (!TextUtils.isEmpty(f.a())) {
AdLogoInfo.access$700(this.B, f.a());
AdLogoInfo.access$800(this.B, AdLogoInfo.TYPE_PIC);
} else {
AdLogoInfo.access$700(this.B, f.b());
AdLogoInfo.access$800(this.B, AdLogoInfo.TYPE_TEXT);
}
if (!TextUtils.isEmpty(f.c())) {
AdLogoInfo.access$700(this.C, f.c());
AdLogoInfo.access$800(this.C, AdLogoInfo.TYPE_PIC);
} else {
AdLogoInfo.access$700(this.C, f.d());
AdLogoInfo.access$800(this.C, AdLogoInfo.TYPE_TEXT);
}
}
if (dVar.e() > 0) {
for (c$a c_a : dVar.g()) {
if (this.p) {
for (int i4 = 0; i4 < c_a.e(); i4++) {
if (!StringUtil.isEmpty(c_a.d().get(i4).a())) {
this.aL.add(c_a.d().get(i4).a());
}
}
}
if ((c_a.a() == g.f.b || c_a.a() == g.f.f) && c_a.e() > 0) {
this.aC.add(Pair.create(i.a, c_a.d().get(0).a()));
} else {
String a = a(c_a);
this.aC.add(Pair.create(i.b, a));
if (a.contains("mraid.js")) {
a("MRAID", Boolean.TRUE);
}
}
}
}
if (dVar.d() != null) {
c$b d = dVar.d();
a(d);
c.i k2 = d.k();
if (k2 != null && !TextUtils.isEmpty(k2.a())) {
this.a = k2.a();
}
if (k2 != null && !TextUtils.isEmpty(k2.b())) {
this.b = k2.b();
}
if (k2 != null && !TextUtils.isEmpty(k2.e())) {
this.aD = k2.e();
}
}
}
i2++;
if (!this.aC.isEmpty()) {
break;
}
}
}
} else {
HaoboLog.e(HaoboLog.httpRespLogTag, HaoboLog.getString(R.string.blank_ad));
}
if (this.aC.isEmpty()) {
return false;
}
this.aN = true;
return true;
}
private boolean d(c$t c_t) {
if (c_t.a() > 0) {
for (c.v vVar : c_t.t()) {
this.p = vVar.u();
if (vVar.G() > 0) {
for (c.d dVar : vVar.F()) {
if (dVar.i() <= 0 || dVar.h().get(0) == null) {
if (dVar.e() > 0) {
for (c$a c_a : dVar.g()) {
if (this.p) {
for (int i2 = 0; i2 < c_a.e(); i2++) {
if (!StringUtil.isEmpty(c_a.d().get(i2).a())) {
this.aL.add(c_a.d().get(i2).a());
}
}
}
}
}
}
}
}
}
}
if (this.aL.isEmpty()) {
return false;
}
this.aN = true;
return true;
}
private boolean e(c$t c_t) {
if (c_t.a() > 0) {
c.v vVar = c_t.t().get(0);
this.f1800c = vVar.c();
this.d = vVar.d();
this.Z = vVar.e();
this.e = vVar.f() == g.h.b ? 1 : 2;
this.f1801i = Integer.parseInt(vVar.h());
this.h = Integer.parseInt(vVar.i());
this.K = vVar.g();
List F = vVar.F();
if (F != null && !F.isEmpty()) {
this.J = ((c.d) F.get(0)).j();
this.M = ((c.d) F.get(0)).k();
this.aA = ((c.d) F.get(0)).c();
}
this.L = vVar.a();
this.f1803k = vVar.w();
this.f1804l = vVar.x();
this.m = vVar.y();
this.f1805n = vVar.z();
this.f1806o = vVar.A();
this.p = vVar.u();
this.q = vVar.C();
this.f1807r = vVar.v();
this.s = vVar.m();
this.t = vVar.n();
this.f1808u = vVar.o();
this.f1809v = vVar.p();
this.f1810w = vVar.r();
this.x = vVar.q();
this.y = vVar.s();
this.z = vVar.B();
this.av = vVar.k();
this.aw = vVar.l();
this.N = vVar.E();
this.f1802j = vVar.t();
if (this.f1803k && this.f1801i == 0 && this.h == 0) {
this.f1801i = 720;
this.h = 1280;
}
if (vVar.G() > 0) {
for (c.d dVar : vVar.F()) {
if (dVar.i() <= 0 || dVar.h().get(0) == null) {
this.ay = dVar.a();
if (dVar.e() >= 0) {
for (c$a c_a : dVar.g()) {
if (this.p) {
for (int i2 = 0; i2 < c_a.e(); i2++) {
if (!StringUtil.isEmpty(c_a.d().get(i2).a())) {
this.aL.add(c_a.d().get(i2).a());
}
}
}
if (c_a.a() == g.f.e || c_a.a() == g.f.b) {
if (c_a.e() > 0) {
try {
c.c f = dVar.f();
if (f != null) {
if (!TextUtils.isEmpty(f.a())) {
AdLogoInfo.access$700(this.B, f.a());
AdLogoInfo.access$800(this.B, AdLogoInfo.TYPE_PIC);
} else {
AdLogoInfo.access$700(this.B, f.b());
AdLogoInfo.access$800(this.B, AdLogoInfo.TYPE_TEXT);
}
if (!TextUtils.isEmpty(f.c())) {
AdLogoInfo.access$700(this.C, f.c());
AdLogoInfo.access$800(this.C, AdLogoInfo.TYPE_PIC);
} else {
AdLogoInfo.access$700(this.C, f.d());
AdLogoInfo.access$800(this.C, AdLogoInfo.TYPE_TEXT);
}
}
com.octopus.ad.internal.nativead.c a = com.octopus.ad.internal.nativead.c.a(new JSONObject(c_a.b()));
this.ae = a;
a.a(this);
this.ae.a(m());
this.ae.b(ae());
this.ae.a(ad());
this.ae.b(vVar.D());
if (c_a.a() == g.f.b) {
this.ae.a(true);
}
if (!TextUtils.isEmpty(c_a.c())) {
this.ae.a(c_a.c());
}
if (dVar.d() != null) {
a(dVar.d());
c$b d = dVar.d();
this.ae.c(!StringUtil.isEmpty(this.aE) ? this.aE : this.aH);
this.ae.a(dVar.d());
c.i k2 = d.k();
if (k2 != null && !TextUtils.isEmpty(k2.a())) {
this.ae.d(k2.a());
}
if (k2 != null && !TextUtils.isEmpty(k2.b())) {
this.ae.e(k2.b());
}
List<c.i> s = d.s();
if (s != null && !s.isEmpty()) {
for (int i4 = 0; i4 < s.size(); i4++) {
String b = s.get(i4).b();
if (!TextUtils.isEmpty(b)) {
this.ae.e(b);
}
String a2 = s.get(i4).a();
if (!TextUtils.isEmpty(a2)) {
this.ae.d(a2);
}
}
}
}
} catch (Exception e) {
com.octopus.ad.utils.b.g.a("OctopusAd", "An Exception Caught", e);
}
if (this.ae != null) {
this.aN = true;
return true;
}
} else {
continue;
}
}
}
} else {
continue;
}
}
}
}
} else {
HaoboLog.e(HaoboLog.httpRespLogTag, HaoboLog.getString(R.string.blank_ad));
}
if (this.aC.isEmpty()) {
return false;
}
this.aN = true;
return true;
}
private boolean f(c$t c_t) {
if (c_t.a() > 0) {
c.v vVar = c_t.t().get(0);
List F = vVar.F();
if (F != null && !F.isEmpty()) {
c.d dVar = (c.d) F.get(0);
if (dVar.d() != null) {
c$b d = dVar.d();
a(d);
c.i k2 = d.k();
if (k2 != null && !TextUtils.isEmpty(k2.a())) {
this.a = k2.a();
}
if (k2 != null && !TextUtils.isEmpty(k2.b())) {
this.b = k2.b();
}
if (k2 != null && !TextUtils.isEmpty(k2.e())) {
this.aD = k2.e();
}
}
}
this.f1800c = vVar.c();
this.d = vVar.d();
this.Z = vVar.e();
this.e = vVar.f() == g.h.b ? 1 : 2;
this.h = Integer.parseInt(vVar.h());
this.f1801i = Integer.parseInt(vVar.i());
this.K = vVar.g();
List F2 = vVar.F();
if (F2 != null && !F2.isEmpty()) {
this.J = ((c.d) F2.get(0)).j();
this.M = ((c.d) F2.get(0)).k();
this.aA = ((c.d) F2.get(0)).c();
}
this.f = 0;
this.g = 0;
if (vVar.j() != null && X() == g.a.d) {
c.f j2 = vVar.j();
this.f = Integer.parseInt(j2.a());
this.g = Integer.parseInt(j2.b());
}
}
return false;
}
public void a(boolean z) {
this.D = z;
}
public c$b a() {
return this.au;
}
public String b() {
return this.L;
}
private void a(c$b c_b) {
this.au = c_b;
this.ax = c_b.s();
this.am = c_b.o();
this.al = c_b.q();
this.an = c_b.d();
this.ao = c_b.e();
this.ap = c_b.f();
this.aq = c_b.g();
this.ar = c_b.h();
this.as = c_b.i();
this.at = c_b.p();
this.aE = c_b.a();
this.aF = c_b.b();
this.aG = c_b.c();
this.aI = c_b.l();
this.aJ = c_b.m();
this.aK = c_b.n();
this.aH = c_b.j();
if (TextUtils.isEmpty(this.ap)) {
this.ap = "OctopusAd";
}
if (TextUtils.isEmpty(this.ao)) {
this.ao = "OctopusAd";
}
if (TextUtils.isEmpty(this.aq)) {
this.aq = "Ad Download";
}
if (!TextUtils.isEmpty(this.Z)) {
if (!this.Z.startsWith("https://") && !this.Z.startsWith("http://")) {
b(this.Z);
} else {
new p(this.Z).a(new 1(this)).execute();
}
}
if (this.aK) {
ThreadUtils.runOnUIThread(new 2(this));
}
}
private boolean b(c$t c_t) {
if (c_t.b() == 0) {
return true;
}
HaoboLog.e(HaoboLog.httpRespLogTag, HaoboLog.getString(R.string.response_error, c_t.c(), c_t.g()));
return false;
}
public void b(boolean z) {
this.Q = z;
}
private boolean b(Context context) {
if (this.at == null || !j.b("com.tencent.mm.opensdk.openapi.IWXAPI")) {
return false;
}
IWXAPI createWXAPI = WXAPIFactory.createWXAPI(context, this.at.b());
if (!createWXAPI.isWXAppInstalled()) {
return false;
}
WXLaunchMiniProgram.Req req = new WXLaunchMiniProgram.Req();
req.userName = this.at.c();
req.path = this.at.a();
req.miniprogramType = 0;
return createWXAPI.sendReq(req);
}
private void d(Context context) {
WebView webView;
if (TextUtils.isEmpty(this.aE)) {
return;
}
if (this.aI && this.D) {
if (this.aE.startsWith("http")) {
ag();
if (this.aK && (webView = this.ak) != null) {
ViewUtil.openLocalBrowser(webView, this.f1802j);
return;
} else {
ViewUtil.openLocalBrowser(this.aE, this.f1802j);
return;
}
}
return;
}
ViewUtil.openSystemBrowser(context, this.aE);
}
public void b(int i2) {
List<c.y> r2;
String e;
c$b c_b = this.au;
if (c_b == null || this.aT == i2 || !this.aP || (r2 = c_b.r()) == null) {
return;
}
for (int i4 = 0; i4 < r2.size(); i4++) {
c.y yVar = r2.get(i4);
if (i2 == 1) {
e = yVar.c();
} else if (i2 == 2) {
e = yVar.d();
} else {
e = i2 == 3 ? yVar.e() : "";
}
a(e);
this.aT = i2;
}
}
private void a(Context context) {
new Thread((Runnable) new 3(this, context)).start();
}
private void a(Map<String, List<String>> map) {
if (map != null) {
for (Map.Entry<String, List<String>> entry : map.entrySet()) {
if (entry.getKey() != null) {
for (String str : entry.getValue()) {
if (!TextUtils.isEmpty(str)) {
HaoboLog.v(HaoboLog.httpRespLogTag, HaoboLog.getString(R.string.response_header, entry.getKey(), str));
}
}
}
}
}
}
public ServerResponse(boolean z) {
this.d = 0;
this.e = 1;
this.f = 0;
this.g = 0;
this.h = 0;
this.f1801i = 0;
this.f1802j = 0;
this.f1803k = false;
this.f1804l = false;
this.m = false;
this.f1805n = false;
this.f1806o = false;
this.p = true;
this.q = false;
this.f1807r = true;
this.s = false;
this.t = false;
this.f1808u = false;
this.f1809v = false;
this.f1810w = 0;
this.x = 0;
this.y = 0;
this.z = false;
this.A = 0;
this.B = new AdLogoInfo();
this.C = new AdLogoInfo();
this.D = false;
this.P = false;
this.Q = false;
this.R = true;
this.S = true;
this.aC = new LinkedList();
this.aL = new LinkedList<>();
this.aM = new HashMap<>();
this.aN = false;
this.aO = false;
this.aT = 0;
this.aO = z;
}
private void a(c$t c_t) {
this.W = c_t.h();
this.X = c_t.i();
this.f1797ab = c_t.k();
this.S = c_t.l();
this.T = c_t.m();
this.U = c_t.n();
this.V = c_t.o();
this.ag = c_t.p();
this.ah = c_t.q();
this.f1796aa = c_t.j();
this.ai = c_t.r();
this.ac = c_t.s();
if (b(c_t)) {
l lVar = this.aB;
if (lVar == l.h) {
if (d(c_t)) {
return;
}
} else if (lVar != l.f && lVar != l.b && lVar != l.g) {
if (c(c_t)) {
return;
}
} else if (e(c_t)) {
return;
}
f(c_t);
}
}
public void a(b bVar) {
this.f1799af = bVar;
}
private String a(c$a c_a) {
if (c_a.a() != g.f.d && c_a.a() != g.f.c) {
return "";
}
if (c_a.a() == g.f.c && c_a.e() > 0) {
return (this.f1808u ? "<!DOCTYPE html><html lang='en'> <head> <meta charset='UTF-8'> <meta name='viewport' content='width=device-width, initial-scale=1.0'> <style> html, body { width: 100%; height: 100%; margin: 0; padding: 0 } .material-wrap { overflow: hidden; position: relative; height: 100%; background-repeat: no-repeat; background-position: center center; background-size: cover } .filter-shadow { content: ''; position: absolute; z-index: 2; top: -3%; left: -3%; right: -3%; bottom: -3%; background: inherit; filter: blur(40px) } .material-wrap .black-shadow { position: absolute; z-index: 3; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, .05) } .material-wrap .material { position: absolute; z-index: 3; top: 0; left: 0; width: 100%; height: 100%; background-repeat: no-repeat; background-position: center center; background-size: contain } </style> </head> <body> <div class='material-wrap' style=\"background-image: url('__IMAGE_SRC_PATH__')\"> <div class='filter-shadow'> </div> <div class='black-shadow'> </div> <div class='material' style=\"background-image: url('__IMAGE_SRC_PATH__')\"> </div> </div> </body></html>" : "<!DOCTYPE html><html lang='en' style='width: 100%; height: 100%;'> <head> <meta charset='UTF-8'> <meta name='viewport' id='viewport' content='width=device-width, height=device-height, initial-scale=1'> </head> <body style='width: 100%; height: 100%; padding: 0; margin: 0;'> <img style='width: 100%; height: 100%; object-fit: fill' src='__IMAGE_SRC_PATH__' alt=''/> </body></html>").replace("__IMAGE_SRC_PATH__", ImageManager.with((Context) null).load(c_a.d().get(0).a()).getImagePath());
}
Matcher matcher = Pattern.compile("\\{(\\d+)\\.value\\}").matcher(c_a.b());
HashMap hashMap = new HashMap();
for (int i2 = 0; i2 < c_a.e(); i2++) {
hashMap.put(Integer.valueOf(i2), c_a.d().get(i2).a());
}
StringBuffer stringBuffer = new StringBuffer();
while (matcher.find()) {
Integer valueOf = Integer.valueOf(Integer.parseInt(matcher.group(1)));
if (hashMap.get(valueOf) != null) {
matcher.appendReplacement(stringBuffer, (String) hashMap.get(valueOf));
} else {
matcher.appendReplacement(stringBuffer, "");
HaoboLog.e(HaoboLog.pbLogTag, HaoboLog.getString(R.string.invalid_string_placeholder, matcher.group(0)));
}
}
matcher.appendTail(stringBuffer);
return stringBuffer.toString();
}
public void a(String str, Object obj) {
this.aM.put(str, obj);
}
public void c(int i2) {
c$b c_b;
c$k c_k;
try {
if (this.H || (c_b = this.au) == null) {
return;
}
this.H = true;
List<c.i> s = c_b.s();
if (s != null) {
for (int i4 = 0; i4 < s.size(); i4++) {
c.i iVar = s.get(i4);
if (iVar != null && !TextUtils.isEmpty(iVar.c())) {
String c5 = iVar.c();
if (c5.contains("track=oct")) {
Boolean bool = Boolean.TRUE;
Boolean bool2 = this.T;
if (bool != bool2) {
if (!this.R) {
c5 = c5 + "&opt=4";
} else if (this.P) {
c5 = c5 + "&opt=10";
} else if (this.Q) {
c5 = c5 + "&opt=1";
} else if (this.O != 0) {
c5 = c5 + "&opt=" + this.O;
} else if (Boolean.FALSE == bool2) {
c5 = c5 + "&opt=8";
} else if (!this.S) {
c5 = c5 + "&opt=11";
} else if (this.U) {
c5 = c5 + "&opt=12";
}
}
String str = c5 + "&result=" + i2;
if (i2 == 0 && this.aj != null && (c_k = this.ag) != null && c_k.a() == 1) {
new com.octopus.ad.utils.a().a(this.aj, this.ag.c(), this.ag.d(), this.ag.b());
}
new com.octopus.ad.internal.h(str).execute();
} else {
new com.octopus.ad.internal.h(c5).execute();
}
}
}
}
} catch (Exception e) {
com.octopus.ad.utils.b.g.a("OctopusAd", "An Exception Caught", e);
}
}
public void a(View view, boolean z, com.octopus.ad.a aVar) {
List<c.i> s;
this.R = z;
int i2 = this.A;
if (i2 <= 0) {
this.A = i2 + 1;
if (!StringUtil.isEmpty(this.a)) {
new com.octopus.ad.internal.h(this.a).execute();
this.a = "";
}
c$b c_b = this.au;
if (c_b == null || (s = c_b.s()) == null) {
return;
}
for (int i4 = 0; i4 < s.size(); i4++) {
c.i iVar = s.get(i4);
if (iVar != null && !TextUtils.isEmpty(iVar.a()) && view != null) {
String a = iVar.a();
if (a.contains("?rv=1")) {
ViewUtil.openLocalBrowser(a, this.f1802j);
} else {
if (a.contains("track=oct")) {
if (!z) {
a = a + "&opt=4";
} else if (this.P) {
a = a + "&opt=10";
} else if (this.Q) {
a = a + "&opt=1";
} else if (!this.S) {
a = a + "&opt=11";
}
}
q qVar = new q(this.Y, this.L, "imp", a);
if (a.contains("track=octimp")) {
qVar.a(new 5(this, aVar, z));
}
qVar.a();
}
}
}
}
}
public void a(int i2) {
if (this.G) {
return;
}
this.G = true;
new com.octopus.ad.internal.h(UrlUtil.replaceWinUrl(m.a().n() + "/sdk/nurl?second_price=${SECOND_PRICE}&slot_id=${SLOT_ID}&adx_code=zysdk2", i2, this.L)).execute();
}
public void c(boolean z) {
this.P = z;
}
private void c(Context context) {
try {
if (TextUtils.isEmpty(this.aF)) {
return;
}
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(this.aF));
intent.setFlags(268500993);
context.startActivity(intent);
} catch (Exception unused) {
d(context);
c(1);
}
}
public void a(int i2, String str, String str2) {
if (this.G) {
return;
}
this.G = true;
new com.octopus.ad.internal.h(UrlUtil.replaceLossUrl(m.a().n() + "/sdk/lurl?win_price=${WIN_PRICE}&lose_reason=${LOSS_REASON}&win_bidder=${WIN_BIDDER}&slot_id=${SLOT_ID}&adx_code=zysdk2", i2, str, str2, this.L)).execute();
}
public void a(View view, int i2, boolean z, d dVar) {
Context context;
if (view == null) {
context = m.a().k();
} else {
context = view.getContext();
}
a(context, i2, this.P, this.Q, z, dVar);
}
private void a(d dVar) {
if (this.au == null || this.ax == null) {
return;
}
for (int i2 = 0; i2 < this.ax.size(); i2++) {
c.i iVar = this.ax.get(i2);
if (iVar != null && !TextUtils.isEmpty(iVar.b())) {
String b = iVar.b();
if (b.contains("?rv=1")) {
ViewUtil.openLocalBrowser(b, this.f1802j);
} else {
if (b.contains("track=oct")) {
Boolean bool = Boolean.TRUE;
Boolean bool2 = this.T;
if (bool != bool2) {
if (!this.R) {
b = b + "&opt=4";
} else if (this.P) {
b = b + "&opt=10";
} else if (this.Q) {
b = b + "&opt=1";
} else if (this.O != 0) {
b = b + "&opt=" + this.O;
} else if (Boolean.FALSE == bool2) {
b = b + "&opt=8";
} else if (!this.S) {
b = b + "&opt=11";
} else if (this.U) {
b = b + "&opt=12";
}
}
}
new q(this.Y, this.L, "clk", UrlUtil.replaceClickEventUrl(b, dVar, this.al)).a();
}
}
}
this.ax = null;
}
private void a(final Context context, final int i2, final String str) {
new Thread(new Runnable() {
@Override
public void run() {
try {
if (context == null) {
return;
}
JSONObject jSONObject = new JSONObject();
jSONObject.put("requestId", ServerResponse.this.Y);
jSONObject.put("slotId", ServerResponse.this.L);
jSONObject.put("packageName", context.getPackageName());
jSONObject.put("sdkVersion", "1.6.3.6");
jSONObject.put("oaid", Octopus.getOaid(context));
jSONObject.put("vendor", Build.MANUFACTURER);
jSONObject.put("model", Build.MODEL);
jSONObject.put("cpu", Build.CPU_ABI);
jSONObject.put("osVersion", Build.VERSION.RELEASE + "_" + Build.VERSION.SDK_INT);
jSONObject.put("code", i2);
jSONObject.put("message", str);
com.octopus.ad.utils.b.e.a(m.a().n() + "/sdk/soReport", jSONObject.toString().getBytes());
} catch (Exception e) {
com.octopus.ad.utils.b.g.a("OctopusAd", "An Exception Caught", e);
}
}
}).start();
}
@SuppressLint({"WrongConstant"})
public void a(Context context, int i2, boolean z, boolean z4, boolean z5, d dVar) {
this.I++;
this.O = i2;
this.P = z;
this.Q = z4;
this.R = z5;
if (z) {
this.O = 10;
} else if (z4) {
this.O = 1;
}
com.octopus.ad.utils.b.g.a("OctopusAd", "handleClick========" + this.E);
if (!this.E) {
this.E = true;
a(dVar);
}
com.octopus.ad.utils.b.g.a("OctopusAd", "mDeepLinkUrl:" + this.aF + ",appDownloadURL = " + this.ar + ",mLandingPageUrl = " + this.aE);
boolean a = com.octopus.ad.utils.b.d.a(context, this.ap);
if ((!this.f1804l || a || this.an == 3) && !TextUtils.isEmpty(this.aF)) {
try {
if (m.a().e()) {
if (!this.m) {
this.aG = null;
}
OctUtil.a().a(context.getApplicationContext(), this.aF, this.aG, this.f1805n, new 7(this, context));
} else {
c(context);
}
m.a().a(new 8(this));
return;
} catch (Exception unused) {
d(context);
c(1);
return;
}
}
if (TextUtils.isEmpty(this.ar) || this.an != 2) {
if (this.an == 6) {
boolean b = b(context);
c(!b ? 1 : 0);
if (b) {
return;
}
d(context);
return;
}
d(context);
return;
}
if (a) {
com.octopus.ad.utils.b.d.b(context, this.ap);
return;
}
if (V() && i2 == 0) {
i2 = 6;
}
File a2 = com.octopus.ad.utils.b.d.a(context);
String absolutePath = a2 != null ? a2.getAbsolutePath() : "";
com.octopus.ad.utils.c.a(context).b(context).a(this.Y).a(this.f1798ad).a(this.as).a(V()).a(i2).a(this.au).a(new com.octopus.ad.utils.b(this.ar, this.ap + ".apk", this.ap, absolutePath, this.ao, this.aq, context.getPackageName() + ".octopus.provider", this.am)).c();
}
public void a(Context context, String str) {
if (context != null) {
try {
if (TextUtils.isEmpty(str)) {
return;
}
int i2 = -1;
if (str.equals("1")) {
str = "";
i2 = 1;
} else {
if (!str.equals("-1")) {
if (str.startsWith("-2,")) {
i2 = -2;
str = str.substring(3);
} else if (str.equals("-3")) {
i2 = -3;
} else if (str.equals("-4")) {
if (this.aJ) {
d(context);
}
c(-1);
str = "";
i2 = -4;
} else {
i2 = -5;
}
}
str = "";
}
if (i2 != 1 && i2 != -4) {
c(context);
}
if (this.I == 1) {
a(context, i2, str);
}
} catch (Exception e) {
com.octopus.ad.utils.b.g.a("OctopusAd", "An Exception Caught", e);
}
}
}
public void a(com.octopus.ad.a.a aVar) {
this.f1798ad = aVar;
}
public void a(String str) {
if (TextUtils.isEmpty(str)) {
return;
}
new com.octopus.ad.internal.h(UrlUtil.replaceVideoTrackerUrl(str, this.ai, this.aQ, this.aR)).execute();
}
}