Weather Tracker v1.0.0版本的 MD5 值为:3edef27647e42a8ea0e7c0d2dbf56f97
以下内容为反编译后的 a.java 源代码,内容仅作参考
package com.mbridge.msdk.mbbanner.common.bridge;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Base64;
import com.google.android.exoplayer2.text.ttml.TtmlNode;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.c.e;
import com.mbridge.msdk.foundation.db.j;
import com.mbridge.msdk.foundation.db.o;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.entity.m;
import com.mbridge.msdk.foundation.same.a.d;
import com.mbridge.msdk.foundation.tools.ac;
import com.mbridge.msdk.foundation.tools.ad;
import com.mbridge.msdk.foundation.tools.c;
import com.mbridge.msdk.foundation.tools.u;
import com.mbridge.msdk.foundation.tools.y;
import com.mbridge.msdk.mbsignalcommon.communication.b;
import com.mbridge.msdk.mbsignalcommon.windvane.g;
import com.tp.common.Constants;
import com.vungle.warren.model.ReportDBAdapter;
import java.io.File;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public final class a extends com.mbridge.msdk.mbsignalcommon.communication.a {
private WeakReference<Context> f3908b;
private List<CampaignEx> c;
private String d;
private String e;
private int f;
private com.mbridge.msdk.mbbanner.common.b.a g;
private BannerExpandDialog h;
private boolean i = false;
public a(Context context, String str, String str2) {
this.d = str;
this.e = str2;
this.f3908b = new WeakReference<>(context);
}
public final void a(com.mbridge.msdk.mbbanner.common.b.a aVar) {
if (aVar != null) {
this.g = aVar;
}
}
@Override
public final void b(Object obj, String str) {
y.d("BannerSignalCommunicationImpl", "click");
try {
if (this.c == null || TextUtils.isEmpty(str)) {
return;
}
CampaignEx parseCampaignWithBackData = CampaignEx.parseCampaignWithBackData(new JSONObject(str).getJSONObject("pt"));
com.mbridge.msdk.mbbanner.common.b.a aVar = this.g;
if (aVar != null) {
aVar.a(parseCampaignWithBackData);
}
} catch (Throwable th) {
y.b("BannerSignalCommunicationImpl", "click", th);
}
}
@Override
public final void c(Object obj, String str) {
if (obj != null) {
try {
int optInt = new JSONObject(str).optInt("isReady", 1);
g.a().a(obj, b.a(0));
com.mbridge.msdk.mbbanner.common.b.a aVar = this.g;
if (aVar != null) {
aVar.b(optInt);
}
} catch (Throwable th) {
y.b("BannerSignalCommunicationImpl", "readyStatus", th);
}
}
}
@Override
public final void close() {
y.d("BannerSignalCommunicationImpl", "close");
try {
com.mbridge.msdk.mbbanner.common.b.a aVar = this.g;
if (aVar != null) {
aVar.a();
}
} catch (Throwable th) {
y.b("BannerSignalCommunicationImpl", "close", th);
}
}
@Override
public final void d(Object obj, String str) {
y.d("BannerSignalCommunicationImpl", "toggleCloseBtn");
try {
if (TextUtils.isEmpty(str)) {
return;
}
int optInt = new JSONObject(str).optInt("state");
com.mbridge.msdk.mbbanner.common.b.a aVar = this.g;
if (aVar != null) {
aVar.a(optInt);
}
} catch (Throwable th) {
y.b("BannerSignalCommunicationImpl", "toggleCloseBtn", th);
}
}
@Override
public final void e(Object obj, String str) {
y.d("BannerSignalCommunicationImpl", "triggerCloseBtn");
try {
if (TextUtils.isEmpty(str)) {
return;
}
String optString = new JSONObject(str).optString("state");
com.mbridge.msdk.mbbanner.common.b.a aVar = this.g;
if (aVar != null) {
aVar.a(optString);
}
g.a().a(obj, b.a(0));
} catch (Throwable th) {
y.b("BannerSignalCommunicationImpl", "triggerCloseBtn", th);
g.a().a(obj, b.a(-1));
}
}
@Override
public final void expand(String str, boolean z) {
Context context;
try {
String str2 = "";
if (getMraidCampaign() != null) {
if (TextUtils.isEmpty(getMraidCampaign().getBannerHtml())) {
str2 = getMraidCampaign().getBannerUrl();
} else {
str2 = "file:////" + getMraidCampaign().getBannerHtml();
}
}
Bundle bundle = new Bundle();
if (!TextUtils.isEmpty(str)) {
str2 = str;
}
bundle.putString("url", str2);
bundle.putBoolean("shouldUseCustomClose", z);
WeakReference<Context> weakReference = this.f3908b;
if (weakReference != null && (context = weakReference.get()) != null) {
BannerExpandDialog bannerExpandDialog = this.h;
if (bannerExpandDialog != null && bannerExpandDialog.isShowing()) {
return;
}
BannerExpandDialog bannerExpandDialog2 = new BannerExpandDialog(context, bundle, this.g);
this.h = bannerExpandDialog2;
bannerExpandDialog2.setCampaignList(this.e, this.c);
this.h.show();
}
com.mbridge.msdk.mbbanner.common.b.a aVar = this.g;
if (aVar != null) {
aVar.a(true);
}
com.mbridge.msdk.mbbanner.common.d.a.a(this.e, getMraidCampaign(), str);
} catch (Throwable th) {
y.b("BannerSignalCommunicationImpl", "expand", th);
}
}
@Override
public final CampaignEx getMraidCampaign() {
List<CampaignEx> list = this.c;
if (list == null || list.size() <= 0) {
return null;
}
return this.c.get(0);
}
@Override
public final void i(Object obj, String str) {
y.a("BannerSignalCommunicationImpl", "sendImpressions:" + str);
try {
if (TextUtils.isEmpty(str)) {
return;
}
JSONArray jSONArray = new JSONArray(str);
final ArrayList arrayList = new ArrayList();
for (int i = 0; i < jSONArray.length(); i++) {
String string = jSONArray.getString(i);
for (CampaignEx campaignEx : this.c) {
if (campaignEx.getId().equals(string)) {
d.a(this.e, campaignEx, "banner");
arrayList.add(string);
}
}
}
new Thread(new Runnable() {
@Override
public final void run() {
try {
j a = j.a(com.mbridge.msdk.foundation.db.g.a(com.mbridge.msdk.foundation.controller.a.d().f()));
Iterator it = arrayList.iterator();
while (it.hasNext()) {
a.b((String) it.next());
}
} catch (Exception e) {
y.d("BannerSignalCommunicationImpl", e.getMessage());
}
}
}).start();
} catch (Throwable th) {
y.b("BannerSignalCommunicationImpl", "sendImpressions", th);
}
}
@Override
public final void j(Object obj, String str) {
if (TextUtils.isEmpty(str)) {
b.a(obj, "params is empty");
return;
}
try {
a(obj, new JSONObject(str));
} catch (Throwable th) {
y.a("BannerSignalCommunicationImpl", th.getMessage());
}
}
@Override
public final void k(Object obj, String str) {
y.a("BannerSignalCommunicationImpl", "reportUrls:" + str);
if (TextUtils.isEmpty(str)) {
b.a(obj, "params is null");
} else if (!TextUtils.isEmpty(str)) {
try {
JSONArray jSONArray = new JSONArray(str);
for (int i = 0; i < jSONArray.length(); i++) {
JSONObject jSONObject = jSONArray.getJSONObject(i);
int optInt = jSONObject.optInt("type");
String a = ad.a(jSONObject.optString("url"), "&tun=", u.w() + "");
int optInt2 = jSONObject.optInt(ReportDBAdapter.ReportColumns.TABLE_NAME);
if (optInt2 == 0) {
Context f = com.mbridge.msdk.foundation.controller.a.d().f();
List<CampaignEx> list = this.c;
com.mbridge.msdk.click.a.a(f, list != null ? list.get(0) : null, "", a, false, optInt != 0);
} else {
Context f2 = com.mbridge.msdk.foundation.controller.a.d().f();
List<CampaignEx> list2 = this.c;
com.mbridge.msdk.click.a.a(f2, list2 != null ? list2.get(0) : null, "", a, false, optInt != 0, optInt2);
}
}
g.a().a(obj, b.a(0));
} catch (Throwable th) {
y.b("BannerSignalCommunicationImpl", "reportUrls", th);
}
}
}
@Override
public final void open(String str) {
y.d("BannerSignalCommunicationImpl", TtmlNode.TEXT_EMPHASIS_MARK_OPEN);
try {
y.d("BannerSignalCommunicationImpl", str);
if (this.c.size() > 1) {
com.mbridge.msdk.foundation.controller.a.d().f().startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
str = null;
}
com.mbridge.msdk.mbbanner.common.b.a aVar = this.g;
if (aVar != null) {
aVar.a(true, str);
}
} catch (Throwable th) {
y.b("BannerSignalCommunicationImpl", TtmlNode.TEXT_EMPHASIS_MARK_OPEN, th);
}
}
@Override
public final void unload() {
close();
}
@Override
public final void useCustomClose(boolean z) {
int i = z ? 2 : 1;
try {
com.mbridge.msdk.mbbanner.common.b.a aVar = this.g;
if (aVar != null) {
aVar.a(i);
}
} catch (Throwable th) {
y.b("BannerSignalCommunicationImpl", "useCustomClose", th);
}
}
public final void a(List<CampaignEx> list) {
this.c = list;
}
public final void a(int i) {
this.f = i;
}
public final void a() {
if (this.g != null) {
this.g = null;
}
if (this.h != null) {
this.h = null;
}
}
@Override
public final void a(Object obj, String str) {
try {
JSONObject jSONObject = new JSONObject();
c cVar = new c(com.mbridge.msdk.foundation.controller.a.d().f());
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("dev_close_state", this.f);
jSONObject.put("sdkSetting", jSONObject2);
jSONObject.put("device", cVar.a());
jSONObject.put("campaignList", CampaignEx.parseCamplistToJson(this.c));
e e = com.mbridge.msdk.c.c.a().e(com.mbridge.msdk.foundation.controller.a.d().g(), this.e);
if (e == null) {
e = e.d(this.e);
}
if (!TextUtils.isEmpty(this.d)) {
e.g(this.d);
}
jSONObject.put("unitSetting", e.t());
String c = com.mbridge.msdk.c.c.a().c(com.mbridge.msdk.foundation.controller.a.d().g());
if (!TextUtils.isEmpty(c)) {
jSONObject.put("appSetting", new JSONObject(c));
}
jSONObject.put("sdk_info", com.mbridge.msdk.mbsignalcommon.base.d.a);
y.d("BannerSignalCommunicationImpl", "init" + jSONObject.toString());
g.a().a(obj, Base64.encodeToString(jSONObject.toString().getBytes(), 2));
} catch (Throwable th) {
y.b("BannerSignalCommunicationImpl", "init", th);
}
}
private static void a(Object obj, JSONObject jSONObject) {
String str;
String str2;
String str3;
String str4;
String str5;
int i;
boolean z;
String str6;
?? jSONObject2 = new JSONObject();
String str7 = "message";
String str8 = "code";
int i2 = 1;
if (jSONObject == null) {
try {
jSONObject2.put("code", 1);
jSONObject2.put("message", "params is null");
g.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
return;
} catch (JSONException e) {
y.a("BannerSignalCommunicationImpl", e.getMessage());
return;
}
}
try {
jSONObject2.put("code", 0);
jSONObject2.put("message", "");
JSONArray jSONArray = jSONObject.getJSONArray(Constants.VAST_RESOURCE);
if (jSONArray != null && jSONArray.length() > 0) {
?? jSONArray2 = new JSONArray();
int length = jSONArray.length();
int i3 = 0;
while (i3 < length) {
JSONObject jSONObject3 = jSONArray.getJSONObject(i3);
String optString = jSONObject3.optString("ref", "");
int i4 = jSONObject3.getInt("type");
?? jSONObject4 = new JSONObject();
JSONArray jSONArray3 = jSONArray;
if (i4 == i2 && !TextUtils.isEmpty(optString)) {
JSONObject jSONObject5 = new JSONObject();
m a = o.a(com.mbridge.msdk.foundation.db.g.a(com.mbridge.msdk.foundation.controller.a.d().f())).a(optString);
if (a != null) {
i = length;
y.a("BannerSignalCommunicationImpl", "VideoBean not null");
jSONObject5.put("type", 1);
str3 = str7;
try {
jSONObject5.put("videoDataLength", a.c());
String e2 = a.e();
str5 = str8;
if (TextUtils.isEmpty(e2)) {
try {
y.a("BannerSignalCommunicationImpl", "VideoPath null");
jSONObject5.put(MBridgeConstans.DYNAMIC_VIEW_WX_PATH, "");
jSONObject5.put("path4Web", "");
} catch (Throwable th) {
th = th;
str = str3;
str2 = str5;
jSONObject2.put(str2, 1);
jSONObject2.put(str, th.getLocalizedMessage());
g.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
return;
}
} else {
y.a("BannerSignalCommunicationImpl", "VideoPath not null");
jSONObject5.put(MBridgeConstans.DYNAMIC_VIEW_WX_PATH, e2);
jSONObject5.put("path4Web", e2);
}
if (a.d() == 5) {
jSONObject5.put("downloaded", 1);
z = false;
} else {
z = false;
jSONObject5.put("downloaded", 0);
}
jSONObject4.put(optString, jSONObject5);
jSONArray2.put(jSONObject4);
} catch (Throwable th2) {
th = th2;
str2 = str8;
str = str3;
jSONObject2.put(str2, 1);
jSONObject2.put(str, th.getLocalizedMessage());
g.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
return;
}
} else {
str3 = str7;
str5 = str8;
i = length;
z = false;
y.a("BannerSignalCommunicationImpl", "VideoBean null");
}
} else {
str3 = str7;
str5 = str8;
i = length;
z = false;
if (i4 == 2 && !TextUtils.isEmpty(optString)) {
JSONObject jSONObject6 = new JSONObject();
jSONObject6.put("type", 2);
jSONObject6.put(MBridgeConstans.DYNAMIC_VIEW_WX_PATH, com.mbridge.msdk.videocommon.download.g.a().a(optString) == null ? "" : com.mbridge.msdk.videocommon.download.g.a().b(optString));
jSONObject4.put(optString, jSONObject6);
jSONArray2.put(jSONObject4);
} else if (i4 == 3 && !TextUtils.isEmpty(optString)) {
File file = new File(optString);
if (file.exists() && file.isFile() && file.canRead()) {
y.a("BannerSignalCommunicationImpl", "getFileInfo Mraid file " + optString);
str6 = "file:////" + optString;
} else {
str6 = "";
}
JSONObject jSONObject7 = new JSONObject();
jSONObject7.put("type", 3);
jSONObject7.put(MBridgeConstans.DYNAMIC_VIEW_WX_PATH, str6);
jSONObject4.put(optString, jSONObject7);
jSONArray2.put(jSONObject4);
} else if (i4 == 4 && !TextUtils.isEmpty(optString)) {
JSONObject jSONObject8 = new JSONObject();
jSONObject8.put("type", 4);
jSONObject8.put(MBridgeConstans.DYNAMIC_VIEW_WX_PATH, ac.a(optString) == null ? "" : ac.a(optString));
jSONObject4.put(optString, jSONObject8);
jSONArray2.put(jSONObject4);
}
}
i3++;
jSONArray = jSONArray3;
length = i;
str7 = str3;
str8 = str5;
i2 = 1;
}
str3 = str7;
str5 = str8;
jSONObject2.put(Constants.VAST_RESOURCE, jSONArray2);
g.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
return;
}
str3 = "message";
str2 = "code";
str = 1;
try {
try {
jSONObject2.put(str2, 1);
str4 = str3;
} catch (Throwable th3) {
th = th3;
try {
jSONObject2.put(str2, 1);
jSONObject2.put(str, th.getLocalizedMessage());
g.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
return;
} catch (JSONException e3) {
y.a("BannerSignalCommunicationImpl", e3.getMessage());
return;
}
}
} catch (JSONException e4) {
e = e4;
str4 = str3;
} catch (Throwable th4) {
th = th4;
str = str3;
jSONObject2.put(str2, 1);
jSONObject2.put(str, th.getLocalizedMessage());
g.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
return;
}
try {
jSONObject2.put(str4, "resource is null");
g.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
str = str4;
} catch (JSONException e5) {
e = e5;
y.a("BannerSignalCommunicationImpl", e.getMessage());
str = str4;
}
} catch (Throwable th5) {
th = th5;
str = str7;
str2 = str8;
}
}
}