Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,241 @@
package com.mbridge.msdk.mbbanner.common.communication;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.webkit.ValueCallback;
import android.webkit.WebView;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import com.google.android.gms.ads.AdError;
import com.ironsource.nb;
import com.mbridge.msdk.foundation.controller.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.tools.ab;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.ak;
import com.mbridge.msdk.mbsignalcommon.mraid.b;
import com.mbridge.msdk.mbsignalcommon.windvane.WindVaneWebView;
import com.mbridge.msdk.newreward.player.view.hybrid.util.MRAIDCommunicatorUtil;
import com.mbridge.msdk.widget.MBAdChoice;
import com.vungle.ads.internal.presenter.MRAIDPresenter;
import java.util.HashMap;
import java.util.List;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public class BannerExpandDialog extends Dialog {
private final String a;
private String b;
private boolean c;
private FrameLayout d;
private WindVaneWebView e;
private TextView f;
private String g;
private List<CampaignEx> h;
private com.mbridge.msdk.mbbanner.common.b.a i;
private b j;
public void setCampaignList(String str, List<CampaignEx> list) {
this.g = str;
this.h = list;
}
public BannerExpandDialog(Context context, Bundle bundle, com.mbridge.msdk.mbbanner.common.b.a aVar) {
super(context);
this.a = "BannerExpandDialog";
this.j = new b() { // from class: com.mbridge.msdk.mbbanner.common.communication.BannerExpandDialog.5
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
public final void expand(String str, boolean z) {
}
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
public final CampaignEx getMraidCampaign() {
return null;
}
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
public final void open(String str) {
try {
if (BannerExpandDialog.this.e == null || System.currentTimeMillis() - BannerExpandDialog.this.e.lastTouchTime <= com.mbridge.msdk.click.b.a.c || !com.mbridge.msdk.click.b.a.a((CampaignEx) BannerExpandDialog.this.h.get(0), BannerExpandDialog.this.e.getUrl(), com.mbridge.msdk.click.b.a.a)) {
af.b("BannerExpandDialog", str);
if (BannerExpandDialog.this.h.size() > 1) {
c.m().c().startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
str = null;
}
if (BannerExpandDialog.this.i != null) {
BannerExpandDialog.this.i.a(true, str);
}
}
} catch (Throwable th) {
af.b("BannerExpandDialog", MRAIDPresenter.OPEN, th);
}
}
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
public final void close() {
BannerExpandDialog.this.dismiss();
}
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
public final void unload() {
close();
}
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
public final void useCustomClose(boolean z) {
try {
BannerExpandDialog.this.f.setVisibility(z ? 4 : 0);
} catch (Throwable th) {
af.b("BannerExpandDialog", "useCustomClose", th);
}
}
};
if (bundle != null) {
this.b = bundle.getString("url");
this.c = bundle.getBoolean("shouldUseCustomClose");
}
this.i = aVar;
}
@Override // android.app.Dialog
public void onCreate(Bundle bundle) {
CampaignEx campaignEx;
super.onCreate(bundle);
requestWindowFeature(1);
setCanceledOnTouchOutside(false);
setCancelable(true);
FrameLayout frameLayout = new FrameLayout(getContext());
this.d = frameLayout;
frameLayout.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
WindVaneWebView windVaneWebView = new WindVaneWebView(getContext().getApplicationContext());
this.e = windVaneWebView;
windVaneWebView.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
this.d.addView(this.e);
TextView textView = new TextView(getContext());
this.f = textView;
textView.setBackgroundColor(0);
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(96, 96);
layoutParams.gravity = 8388661;
layoutParams.setMargins(30, 30, 30, 30);
this.f.setLayoutParams(layoutParams);
this.f.setVisibility(this.c ? 4 : 0);
this.f.setOnClickListener(new View.OnClickListener() { // from class: com.mbridge.msdk.mbbanner.common.communication.BannerExpandDialog.1
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
BannerExpandDialog.this.dismiss();
}
});
BitmapDrawable a = c.m().a(this.g, 296);
if (a != null) {
ImageView imageView = new ImageView(c.m().c());
ak.a(imageView, a, this.d.getResources().getDisplayMetrics());
this.d.addView(imageView, new ViewGroup.LayoutParams(-1, -1));
}
this.d.addView(this.f);
setContentView(this.d);
a();
this.e.setWebViewListener(new com.mbridge.msdk.mbsignalcommon.b.b() { // from class: com.mbridge.msdk.mbbanner.common.communication.BannerExpandDialog.2
@Override // com.mbridge.msdk.mbsignalcommon.b.b, com.mbridge.msdk.mbsignalcommon.windvane.d
public final void a(WebView webView, String str) {
super.a(webView, str);
webView.evaluateJavascript("javascript:" + com.mbridge.msdk.c.b.a.a().b(), new ValueCallback<String>() { // from class: com.mbridge.msdk.mbbanner.common.communication.BannerExpandDialog.2.1
@Override // android.webkit.ValueCallback
public final /* bridge */ /* synthetic */ void onReceiveValue(String str2) {
}
});
BannerExpandDialog.a(BannerExpandDialog.this);
}
});
this.e.setObject(this.j);
this.e.loadUrl(this.b);
List<CampaignEx> list = this.h;
if (list != null && list.size() > 0 && (campaignEx = this.h.get(0)) != null && campaignEx.getPrivacyButtonTemplateVisibility() != 0) {
MBAdChoice mBAdChoice = new MBAdChoice(c.m().c());
mBAdChoice.setCampaign(campaignEx);
FrameLayout.LayoutParams layoutParams2 = new FrameLayout.LayoutParams(ak.a(c.m().c(), 12.0f), ak.a(c.m().c(), 12.0f));
layoutParams2.gravity = 85;
layoutParams2.bottomMargin = layoutParams.topMargin;
layoutParams2.rightMargin = layoutParams.rightMargin;
mBAdChoice.setFeedbackDialogEventListener(new com.mbridge.msdk.foundation.d.a() { // from class: com.mbridge.msdk.mbbanner.common.communication.BannerExpandDialog.3
@Override // com.mbridge.msdk.foundation.d.a
public final void showed() {
}
@Override // com.mbridge.msdk.foundation.d.a
public final void close() {
BannerExpandDialog.this.a();
}
@Override // com.mbridge.msdk.foundation.d.a
public final void summit(String str) {
BannerExpandDialog.this.a();
}
});
this.d.addView(mBAdChoice, layoutParams2);
}
setOnDismissListener(new DialogInterface.OnDismissListener() { // from class: com.mbridge.msdk.mbbanner.common.communication.BannerExpandDialog.4
@Override // android.content.DialogInterface.OnDismissListener
public final void onDismiss(DialogInterface dialogInterface) {
if (BannerExpandDialog.this.i != null) {
BannerExpandDialog.this.i.a(false);
}
BannerExpandDialog.this.e.loadDataWithBaseURL(null, "", "text/html", nb.N, null);
BannerExpandDialog.this.d.removeView(BannerExpandDialog.this.e);
BannerExpandDialog.this.e.release();
BannerExpandDialog.this.e = null;
BannerExpandDialog.this.i = null;
}
});
}
/* JADX INFO: Access modifiers changed from: private */
public void a() {
if (getWindow() != null) {
getWindow().setBackgroundDrawable(new ColorDrawable(0));
getWindow().getDecorView().setPadding(0, 0, 0, 0);
WindowManager.LayoutParams attributes = getWindow().getAttributes();
attributes.width = -1;
attributes.height = -1;
getWindow().setAttributes(attributes);
getWindow().getDecorView().setSystemUiVisibility(4615);
}
}
public static /* synthetic */ void a(BannerExpandDialog bannerExpandDialog) {
try {
int i = c.m().c().getResources().getConfiguration().orientation;
JSONObject jSONObject = new JSONObject();
jSONObject.put("orientation", i == 2 ? "landscape" : i == 1 ? "portrait" : AdError.UNDEFINED_DOMAIN);
jSONObject.put("locked", "true");
float j = ab.j(c.m().c());
float h = ab.h(c.m().c());
HashMap i2 = ab.i(c.m().c());
int intValue = ((Integer) i2.get("width")).intValue();
int intValue2 = ((Integer) i2.get("height")).intValue();
HashMap hashMap = new HashMap();
hashMap.put(MRAIDCommunicatorUtil.KEY_PLACEMENTTYPE, "Interstitial");
hashMap.put("state", MRAIDCommunicatorUtil.STATES_EXPANDED);
hashMap.put(MRAIDCommunicatorUtil.KEY_VIEWABLE, "true");
hashMap.put(MRAIDCommunicatorUtil.KEY_CURRENTORIENTATION, jSONObject);
bannerExpandDialog.e.getLocationInWindow(new int[2]);
com.mbridge.msdk.mbsignalcommon.mraid.a.a().a(bannerExpandDialog.e, r1[0], r1[1], r11.getWidth(), bannerExpandDialog.e.getHeight());
com.mbridge.msdk.mbsignalcommon.mraid.a.a().b(bannerExpandDialog.e, r1[0], r1[1], r5.getWidth(), bannerExpandDialog.e.getHeight());
com.mbridge.msdk.mbsignalcommon.mraid.a.a().b(bannerExpandDialog.e, j, h);
com.mbridge.msdk.mbsignalcommon.mraid.a.a().c(bannerExpandDialog.e, intValue, intValue2);
com.mbridge.msdk.mbsignalcommon.mraid.a.a().a(bannerExpandDialog.e, hashMap);
com.mbridge.msdk.mbsignalcommon.mraid.a.a().a(bannerExpandDialog.e);
} catch (Throwable th) {
af.b("BannerExpandDialog", "notifyMraid", th);
}
}
}

View File

@@ -0,0 +1,596 @@
package com.mbridge.msdk.mbbanner.common.communication;
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.ironsource.v8;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.c.h;
import com.mbridge.msdk.c.k;
import com.mbridge.msdk.foundation.db.n;
import com.mbridge.msdk.foundation.download.download.H5DownLoadManager;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.entity.m;
import com.mbridge.msdk.foundation.same.a.b;
import com.mbridge.msdk.foundation.tools.ab;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.aj;
import com.mbridge.msdk.foundation.tools.ak;
import com.mbridge.msdk.foundation.tools.j;
import com.mbridge.msdk.mbbid.common.BidResponsedEx;
import com.mbridge.msdk.mbsignalcommon.communication.c;
import com.mbridge.msdk.mbsignalcommon.communication.d;
import com.mbridge.msdk.mbsignalcommon.windvane.g;
import com.vungle.ads.internal.presenter.MRAIDPresenter;
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;
/* loaded from: classes4.dex */
public final class a extends c {
private WeakReference<Context> b;
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 final void a() {
if (this.g != null) {
this.g = null;
}
if (this.h != null) {
this.h = null;
}
}
public final void a(int i) {
this.f = i;
}
public final void a(com.mbridge.msdk.mbbanner.common.b.a aVar) {
if (aVar != null) {
this.g = aVar;
}
}
public final void a(List<CampaignEx> list) {
this.c = list;
}
public a(Context context, String str, String str2) {
this.d = str;
this.e = str2;
this.b = new WeakReference<>(context);
}
@Override // com.mbridge.msdk.mbsignalcommon.communication.a, com.mbridge.msdk.mbsignalcommon.communication.b
public final void c(Object obj, String str) {
if (obj != null) {
try {
int optInt = new JSONObject(str).optInt("isReady", 1);
g.a().a(obj, d.a(0));
com.mbridge.msdk.mbbanner.common.b.a aVar = this.g;
if (aVar != null) {
aVar.b(optInt);
}
} catch (Throwable th) {
af.b("BannerSignalCommunicationImpl", "readyStatus", th);
}
}
}
@Override // com.mbridge.msdk.mbsignalcommon.communication.a, com.mbridge.msdk.mbsignalcommon.communication.b
public final void a(Object obj, String str) {
af.b("BannerSignalCommunicationImpl", "BANNER INIT INVOKE");
try {
JSONObject jSONObject = new JSONObject();
j jVar = new j(com.mbridge.msdk.foundation.controller.c.m().c());
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("dev_close_state", this.f);
jSONObject.put("sdkSetting", jSONObject2);
jSONObject.put("device", jVar.a());
jSONObject.put("campaignList", CampaignEx.parseCamplistToJson(this.c));
k d = h.a().d(com.mbridge.msdk.foundation.controller.c.m().k(), this.e);
if (d == null) {
d = k.d(this.e);
}
if (!TextUtils.isEmpty(this.d)) {
d.a(this.d);
}
jSONObject.put("unitSetting", d.x());
String g = h.a().g(com.mbridge.msdk.foundation.controller.c.m().k());
if (!TextUtils.isEmpty(g)) {
jSONObject.put("appSetting", new JSONObject(g));
}
jSONObject.put("sdk_info", com.mbridge.msdk.mbsignalcommon.base.d.a);
af.b("BannerSignalCommunicationImpl", v8.a.e + jSONObject.toString());
g.a().a(obj, Base64.encodeToString(jSONObject.toString().getBytes(), 2));
} catch (Throwable th) {
af.b("BannerSignalCommunicationImpl", v8.a.e, th);
}
}
@Override // com.mbridge.msdk.mbsignalcommon.communication.a, com.mbridge.msdk.mbsignalcommon.communication.b
public final void b(Object obj, String str) {
af.b("BannerSignalCommunicationImpl", "click");
try {
List<CampaignEx> list = this.c;
if (list == null) {
return;
}
CampaignEx campaignEx = (list == null || list.size() <= 0) ? null : this.c.get(0);
if (TextUtils.isEmpty(str)) {
return;
}
try {
JSONObject campaignToJsonObject = CampaignEx.campaignToJsonObject(campaignEx);
JSONObject jSONObject = new JSONObject(str).getJSONObject("pt");
Iterator<String> keys = jSONObject.keys();
while (keys.hasNext()) {
String next = keys.next();
campaignToJsonObject.put(next, jSONObject.getString(next));
}
CampaignEx parseCampaignWithBackData = CampaignEx.parseCampaignWithBackData(campaignToJsonObject);
String optString = campaignToJsonObject.optString("unitId");
if (!TextUtils.isEmpty(optString)) {
parseCampaignWithBackData.setCampaignUnitId(optString);
}
campaignEx = parseCampaignWithBackData;
} catch (JSONException e) {
e.printStackTrace();
}
com.mbridge.msdk.mbbanner.common.b.a aVar = this.g;
if (aVar != null) {
aVar.a(campaignEx);
}
} catch (Throwable th) {
af.b("BannerSignalCommunicationImpl", "click", th);
}
}
@Override // com.mbridge.msdk.mbsignalcommon.communication.a, com.mbridge.msdk.mbsignalcommon.communication.b
public final void d(Object obj, String str) {
af.b("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) {
af.b("BannerSignalCommunicationImpl", "toggleCloseBtn", th);
}
}
@Override // com.mbridge.msdk.mbsignalcommon.communication.a, com.mbridge.msdk.mbsignalcommon.communication.b
public final void e(Object obj, String str) {
af.b("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, d.a(0));
} catch (Throwable th) {
af.b("BannerSignalCommunicationImpl", "triggerCloseBtn", th);
g.a().a(obj, d.a(-1));
}
}
@Override // com.mbridge.msdk.mbsignalcommon.communication.a, com.mbridge.msdk.mbsignalcommon.communication.b
public final void i(Object obj, String str) {
af.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)) {
b.a(this.e, campaignEx, "banner");
arrayList.add(string);
}
}
}
com.mbridge.msdk.foundation.same.f.a.b().execute(new Runnable() { // from class: com.mbridge.msdk.mbbanner.common.communication.a.1
@Override // java.lang.Runnable
public final void run() {
try {
com.mbridge.msdk.foundation.db.j a = com.mbridge.msdk.foundation.db.j.a(com.mbridge.msdk.foundation.db.g.a(com.mbridge.msdk.foundation.controller.c.m().c()));
Iterator it = arrayList.iterator();
while (it.hasNext()) {
a.a((String) it.next());
}
} catch (Exception e) {
af.b("BannerSignalCommunicationImpl", e.getMessage());
}
}
});
} catch (Throwable th) {
af.b("BannerSignalCommunicationImpl", "sendImpressions", th);
}
}
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
public final void open(String str) {
af.b("BannerSignalCommunicationImpl", MRAIDPresenter.OPEN);
try {
af.b("BannerSignalCommunicationImpl", str);
if (this.c.size() > 1) {
com.mbridge.msdk.foundation.controller.c.m().c().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) {
af.b("BannerSignalCommunicationImpl", MRAIDPresenter.OPEN, th);
}
}
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
public final void close() {
af.b("BannerSignalCommunicationImpl", "close");
try {
com.mbridge.msdk.mbbanner.common.b.a aVar = this.g;
if (aVar != null) {
aVar.a();
}
} catch (Throwable th) {
af.b("BannerSignalCommunicationImpl", "close", th);
}
}
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
public final void unload() {
close();
}
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
public final CampaignEx getMraidCampaign() {
List<CampaignEx> list = this.c;
if (list == null || list.size() <= 0) {
return null;
}
return this.c.get(0);
}
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
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) {
af.b("BannerSignalCommunicationImpl", "useCustomClose", th);
}
}
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
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.b;
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);
}
String str3 = this.e;
CampaignEx mraidCampaign = getMraidCampaign();
try {
JSONObject jSONObject = new JSONObject();
if (mraidCampaign.isBidCampaign()) {
jSONObject.put("hb", 1);
}
jSONObject.put("key", "2000070");
jSONObject.put("rid_n", mraidCampaign.getRequestIdNotice());
jSONObject.put("rid", mraidCampaign.getRequestId());
jSONObject.put(BidResponsedEx.KEY_CID, mraidCampaign.getId());
jSONObject.put(MBridgeConstans.PROPERTIES_UNIT_ID, str3);
jSONObject.put(CampaignEx.JSON_KEY_CLICK_URL, str);
jSONObject.put("network_type", String.valueOf(ab.m(com.mbridge.msdk.foundation.controller.c.m().c())));
com.mbridge.msdk.foundation.same.report.d.d.a().a(jSONObject);
} catch (Exception e) {
af.b("BannerReport", e.getMessage());
}
} catch (Throwable th) {
af.b("BannerSignalCommunicationImpl", "expand", th);
}
}
@Override // com.mbridge.msdk.mbsignalcommon.communication.a, com.mbridge.msdk.mbsignalcommon.communication.b
public final void j(Object obj, String str) {
if (TextUtils.isEmpty(str)) {
d.a(obj, "params is empty");
return;
}
try {
a(obj, new JSONObject(str));
} catch (Throwable th) {
af.a("BannerSignalCommunicationImpl", th.getMessage());
}
}
private static void a(Object obj, JSONObject jSONObject) {
String str;
String str2;
String str3;
String str4;
int i;
boolean z;
String str5;
File file;
JSONObject jSONObject2 = new JSONObject();
String str6 = "message";
String str7 = "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) {
af.a("BannerSignalCommunicationImpl", e.getMessage());
return;
}
}
try {
jSONObject2.put("code", 0);
jSONObject2.put("message", "");
JSONArray jSONArray = jSONObject.getJSONArray("resource");
if (jSONArray != null) {
try {
if (jSONArray.length() > 0) {
JSONArray 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");
JSONObject jSONObject4 = new JSONObject();
JSONArray jSONArray3 = jSONArray;
if (i4 == i2 && !TextUtils.isEmpty(optString)) {
JSONObject jSONObject5 = new JSONObject();
m a = n.a(com.mbridge.msdk.foundation.db.g.a(com.mbridge.msdk.foundation.controller.c.m().c())).a(optString);
if (a != null) {
i = length;
af.a("BannerSignalCommunicationImpl", "VideoBean not null");
jSONObject5.put("type", 1);
str3 = str6;
try {
jSONObject5.put("videoDataLength", a.d());
String e2 = a.e();
str4 = str7;
if (TextUtils.isEmpty(e2)) {
try {
af.a("BannerSignalCommunicationImpl", "VideoPath null");
jSONObject5.put("path", "");
jSONObject5.put("path4Web", "");
} catch (Throwable th) {
th = th;
str = str3;
str2 = str4;
try {
jSONObject2.put(str2, 1);
jSONObject2.put(str, th.getLocalizedMessage());
g.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
} catch (JSONException e3) {
af.a("BannerSignalCommunicationImpl", e3.getMessage());
return;
}
}
} else {
af.a("BannerSignalCommunicationImpl", "VideoPath not null");
jSONObject5.put("path", e2);
jSONObject5.put("path4Web", e2);
}
if (a.b() == 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;
str4 = str7;
str = str3;
str2 = str4;
jSONObject2.put(str2, 1);
jSONObject2.put(str, th.getLocalizedMessage());
g.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
}
} else {
str3 = str6;
str4 = str7;
i = length;
z = false;
af.a("BannerSignalCommunicationImpl", "VideoBean null");
}
i3++;
jSONArray = jSONArray3;
length = i;
str6 = str3;
str7 = str4;
i2 = 1;
} else {
str3 = str6;
str4 = str7;
i = length;
z = false;
if (i4 == 2 && !TextUtils.isEmpty(optString)) {
JSONObject jSONObject6 = new JSONObject();
jSONObject6.put("type", 2);
jSONObject6.put("path", H5DownLoadManager.getInstance().getResAddress(optString) == null ? "" : H5DownLoadManager.getInstance().getH5ResAddress(optString));
jSONObject4.put(optString, jSONObject6);
jSONArray2.put(jSONObject4);
} else if (i4 == 3 && !TextUtils.isEmpty(optString)) {
try {
file = new File(optString);
} catch (Throwable th3) {
if (MBridgeConstans.DEBUG) {
th3.printStackTrace();
}
}
if (file.exists() && file.isFile() && file.canRead()) {
af.a("BannerSignalCommunicationImpl", "getFileInfo Mraid file " + optString);
str5 = "file:////" + optString;
JSONObject jSONObject7 = new JSONObject();
jSONObject7.put("type", 3);
jSONObject7.put("path", str5);
jSONObject4.put(optString, jSONObject7);
jSONArray2.put(jSONObject4);
}
str5 = "";
JSONObject jSONObject72 = new JSONObject();
jSONObject72.put("type", 3);
jSONObject72.put("path", str5);
jSONObject4.put(optString, jSONObject72);
jSONArray2.put(jSONObject4);
} else if (i4 == 4 && !TextUtils.isEmpty(optString)) {
JSONObject jSONObject8 = new JSONObject();
jSONObject8.put("type", 4);
jSONObject8.put("path", aj.a(optString) == null ? "" : aj.a(optString));
jSONObject4.put(optString, jSONObject8);
jSONArray2.put(jSONObject4);
}
i3++;
jSONArray = jSONArray3;
length = i;
str6 = str3;
str7 = str4;
i2 = 1;
}
}
str3 = str6;
str4 = str7;
jSONObject2.put("resource", jSONArray2);
g.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
return;
}
} catch (Throwable th4) {
th = th4;
str3 = str6;
}
}
str2 = "code";
str = 1;
} catch (Throwable th5) {
th = th5;
str = "message";
str2 = "code";
}
try {
try {
jSONObject2.put(str2, 1);
str = "message";
try {
jSONObject2.put(str, "resource is null");
g.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
} catch (JSONException e4) {
e = e4;
af.a("BannerSignalCommunicationImpl", e.getMessage());
}
} catch (Throwable th6) {
th = th6;
jSONObject2.put(str2, 1);
jSONObject2.put(str, th.getLocalizedMessage());
g.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
}
} catch (JSONException e5) {
e = e5;
str = "message";
} catch (Throwable th7) {
th = th7;
str = "message";
jSONObject2.put(str2, 1);
jSONObject2.put(str, th.getLocalizedMessage());
g.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
}
}
@Override // com.mbridge.msdk.mbsignalcommon.communication.a, com.mbridge.msdk.mbsignalcommon.communication.b
public final void k(Object obj, String str) {
af.a("BannerSignalCommunicationImpl", "reportUrls:" + str);
if (TextUtils.isEmpty(str)) {
d.a(obj, "params is null");
return;
}
if (TextUtils.isEmpty(str)) {
return;
}
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 = ak.a(jSONObject.optString("url"), "&tun=", ab.q() + "");
int optInt2 = jSONObject.optInt("report");
if (optInt2 == 0) {
Context c = com.mbridge.msdk.foundation.controller.c.m().c();
List<CampaignEx> list = this.c;
com.mbridge.msdk.click.a.a(c, list != null ? list.get(0) : null, "", a, false, optInt != 0);
} else {
Context c2 = com.mbridge.msdk.foundation.controller.c.m().c();
List<CampaignEx> list2 = this.c;
com.mbridge.msdk.click.a.a(c2, list2 != null ? list2.get(0) : null, "", a, false, optInt != 0, optInt2);
}
}
g.a().a(obj, d.a(0));
} catch (Throwable th) {
af.b("BannerSignalCommunicationImpl", "reportUrls", th);
}
}
}