- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
456 lines
16 KiB
Java
456 lines
16 KiB
Java
package com.mbridge.msdk.splash.signal;
|
|
|
|
import android.content.Context;
|
|
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.j;
|
|
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.mbbid.common.BidResponsedEx;
|
|
import com.mbridge.msdk.mbsignalcommon.windvane.WindVaneWebView;
|
|
import com.mbridge.msdk.mbsignalcommon.windvane.g;
|
|
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 class a implements b {
|
|
private WeakReference<Context> b;
|
|
private List<CampaignEx> c;
|
|
private String d;
|
|
private String e;
|
|
private int f;
|
|
private int g;
|
|
private int i;
|
|
private com.mbridge.msdk.splash.d.a j;
|
|
private SplashExpandDialog k;
|
|
protected String a = "SplashSignalCommunicationImpl";
|
|
private int h = 5;
|
|
|
|
public final com.mbridge.msdk.splash.d.a a() {
|
|
return this.j;
|
|
}
|
|
|
|
public final void a(int i) {
|
|
this.g = i;
|
|
}
|
|
|
|
public final void a(com.mbridge.msdk.splash.d.a aVar) {
|
|
if (aVar != null) {
|
|
this.j = aVar;
|
|
}
|
|
}
|
|
|
|
public final void a(List<CampaignEx> list) {
|
|
this.c = list;
|
|
}
|
|
|
|
public final List<CampaignEx> b() {
|
|
return this.c;
|
|
}
|
|
|
|
public final void b(int i) {
|
|
this.h = i;
|
|
}
|
|
|
|
public final void c(int i) {
|
|
this.i = i;
|
|
}
|
|
|
|
public a(Context context, String str, String str2) {
|
|
this.e = str;
|
|
this.d = str2;
|
|
this.b = new WeakReference<>(context);
|
|
}
|
|
|
|
public final void a(Context context) {
|
|
this.b = new WeakReference<>(context);
|
|
}
|
|
|
|
public final void a(Object obj, String str) {
|
|
try {
|
|
JSONObject jSONObject = new JSONObject();
|
|
com.mbridge.msdk.splash.a.b bVar = new com.mbridge.msdk.splash.a.b(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", bVar.a());
|
|
jSONObject.put("campaignList", CampaignEx.parseCamplistToJson(this.c));
|
|
k d = h.a().d(com.mbridge.msdk.foundation.controller.c.m().k(), this.d);
|
|
if (d == null) {
|
|
d = k.d(this.d);
|
|
}
|
|
if (!TextUtils.isEmpty(this.e)) {
|
|
d.a(this.e);
|
|
}
|
|
d.b(this.d);
|
|
d.g(this.h);
|
|
d.b(this.g);
|
|
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(this.a, v8.a.e + jSONObject.toString());
|
|
g.a().a(obj, Base64.encodeToString(jSONObject.toString().getBytes(), 2));
|
|
} catch (Throwable th) {
|
|
af.b(this.a, v8.a.e, th);
|
|
}
|
|
}
|
|
|
|
public final void b(Object obj, String str) {
|
|
try {
|
|
if (TextUtils.isEmpty(str)) {
|
|
return;
|
|
}
|
|
int optInt = new JSONObject(str).optInt("state");
|
|
com.mbridge.msdk.splash.d.a aVar = this.j;
|
|
if (aVar != null) {
|
|
aVar.a(optInt);
|
|
}
|
|
} catch (Throwable th) {
|
|
af.b(this.a, "toggleCloseBtn", th);
|
|
}
|
|
}
|
|
|
|
public final void c(Object obj, String str) {
|
|
com.mbridge.msdk.splash.d.a aVar = this.j;
|
|
if (aVar != null) {
|
|
aVar.a(obj, str);
|
|
}
|
|
}
|
|
|
|
public final void d(Object obj, String str) {
|
|
af.b(this.a, "install");
|
|
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);
|
|
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.splash.d.a aVar = this.j;
|
|
if (aVar != null) {
|
|
aVar.a(campaignEx);
|
|
}
|
|
} catch (Throwable th) {
|
|
af.b(this.a, "click", th);
|
|
}
|
|
}
|
|
|
|
public final void e(Object obj, String str) {
|
|
WindVaneWebView windVaneWebView;
|
|
af.b(this.a, "openURL:" + str);
|
|
if (TextUtils.isEmpty(str)) {
|
|
com.mbridge.msdk.mbsignalcommon.communication.d.a(obj, "params is null");
|
|
return;
|
|
}
|
|
Context c = com.mbridge.msdk.foundation.controller.c.m().c();
|
|
if (TextUtils.isEmpty(str)) {
|
|
return;
|
|
}
|
|
if (c == null) {
|
|
try {
|
|
if ((obj instanceof com.mbridge.msdk.mbsignalcommon.windvane.a) && (windVaneWebView = ((com.mbridge.msdk.mbsignalcommon.windvane.a) obj).b) != null) {
|
|
c = windVaneWebView.getContext();
|
|
}
|
|
} catch (Exception e) {
|
|
af.b(this.a, e.getMessage());
|
|
}
|
|
}
|
|
if (c == null) {
|
|
return;
|
|
}
|
|
try {
|
|
JSONObject jSONObject = new JSONObject(str);
|
|
String optString = jSONObject.optString("url");
|
|
int optInt = jSONObject.optInt("type");
|
|
if (optInt == 1) {
|
|
com.mbridge.msdk.click.c.d(c, optString);
|
|
} else if (optInt == 2) {
|
|
com.mbridge.msdk.click.c.f(c, optString);
|
|
}
|
|
} catch (JSONException e2) {
|
|
af.b(this.a, e2.getMessage());
|
|
} catch (Throwable th) {
|
|
af.b(this.a, th.getMessage());
|
|
}
|
|
}
|
|
|
|
public final void f(Object obj, String str) {
|
|
try {
|
|
if (TextUtils.isEmpty(str)) {
|
|
return;
|
|
}
|
|
int i = new JSONObject(str).getInt("countdown");
|
|
com.mbridge.msdk.splash.d.a aVar = this.j;
|
|
if (aVar != null) {
|
|
aVar.b(i);
|
|
}
|
|
} catch (JSONException e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
|
|
public void open(String str) {
|
|
com.mbridge.msdk.splash.d.a aVar = this.j;
|
|
if (aVar != null) {
|
|
aVar.a(true, str);
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
|
|
public void close() {
|
|
af.b(this.a, "close");
|
|
try {
|
|
com.mbridge.msdk.splash.d.a aVar = this.j;
|
|
if (aVar != null) {
|
|
aVar.a();
|
|
}
|
|
} catch (Throwable th) {
|
|
af.b(this.a, "close", th);
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
|
|
public void unload() {
|
|
close();
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
|
|
public 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 void useCustomClose(boolean z) {
|
|
int i = z ? 2 : 1;
|
|
try {
|
|
com.mbridge.msdk.splash.d.a aVar = this.j;
|
|
if (aVar != null) {
|
|
aVar.a(i);
|
|
}
|
|
} catch (Throwable th) {
|
|
af.b(this.a, "useCustomClose", th);
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
|
|
public void expand(String str, boolean z) {
|
|
try {
|
|
Bundle bundle = new Bundle();
|
|
bundle.putString("url", str);
|
|
bundle.putBoolean("shouldUseCustomClose", z);
|
|
WeakReference<Context> weakReference = this.b;
|
|
if (weakReference == null || weakReference.get() == null) {
|
|
return;
|
|
}
|
|
SplashExpandDialog splashExpandDialog = this.k;
|
|
if (splashExpandDialog == null || !splashExpandDialog.isShowing()) {
|
|
SplashExpandDialog splashExpandDialog2 = new SplashExpandDialog(this.b.get(), bundle, this.j);
|
|
this.k = splashExpandDialog2;
|
|
splashExpandDialog2.setCampaignList(this.d, this.c);
|
|
this.k.show();
|
|
com.mbridge.msdk.splash.d.a aVar = this.j;
|
|
if (aVar != null) {
|
|
aVar.a(true);
|
|
}
|
|
String str2 = this.d;
|
|
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, str2);
|
|
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("SplashReport", e.getMessage());
|
|
}
|
|
}
|
|
} catch (Throwable th) {
|
|
af.b(this.a, "expand", th);
|
|
}
|
|
}
|
|
|
|
public final void g(Object obj, String str) {
|
|
af.a(this.a, "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)) {
|
|
com.mbridge.msdk.foundation.same.a.b.a(this.d, campaignEx, "splash");
|
|
arrayList.add(string);
|
|
}
|
|
}
|
|
}
|
|
new Thread(new Runnable() { // from class: com.mbridge.msdk.splash.signal.a.1
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
try {
|
|
j a = 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 unused) {
|
|
af.b(a.this.a, "campain can't insert db");
|
|
}
|
|
}
|
|
}).start();
|
|
} catch (Throwable th) {
|
|
af.b(this.a, "sendImpressions", th);
|
|
}
|
|
}
|
|
|
|
public final void h(Object obj, String str) {
|
|
af.a(this.a, "reportUrls:" + str);
|
|
if (TextUtils.isEmpty(str)) {
|
|
com.mbridge.msdk.mbsignalcommon.communication.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(this.a, "reportUrls", th);
|
|
}
|
|
}
|
|
|
|
public final void i(Object obj, String str) {
|
|
try {
|
|
if (obj instanceof com.mbridge.msdk.mbsignalcommon.windvane.a) {
|
|
g.a().a(((com.mbridge.msdk.mbsignalcommon.windvane.a) obj).b);
|
|
}
|
|
} catch (Throwable th) {
|
|
af.b(this.a, "onJSBridgeConnect", th);
|
|
}
|
|
}
|
|
|
|
public final void j(Object obj, String str) {
|
|
JSONObject jSONObject = new JSONObject();
|
|
try {
|
|
jSONObject.put("code", 0);
|
|
jSONObject.put("message", "Call pause count down success.");
|
|
JSONObject jSONObject2 = new JSONObject();
|
|
jSONObject2.put("countdown", this.i);
|
|
jSONObject.put("data", jSONObject2);
|
|
g.a().a(obj, Base64.encodeToString(jSONObject.toString().getBytes(), 2));
|
|
} catch (Exception e) {
|
|
af.b(this.a, e.getMessage());
|
|
}
|
|
com.mbridge.msdk.splash.d.a aVar = this.j;
|
|
if (aVar != null) {
|
|
aVar.a(1, -1);
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:5:0x0030 */
|
|
/* JADX WARN: Removed duplicated region for block: B:8:? A[RETURN, SYNTHETIC] */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public final void k(java.lang.Object r3, java.lang.String r4) {
|
|
/*
|
|
r2 = this;
|
|
boolean r0 = android.text.TextUtils.isEmpty(r4)
|
|
r1 = 0
|
|
if (r0 != 0) goto L2c
|
|
org.json.JSONObject r0 = new org.json.JSONObject // Catch: java.lang.Exception -> L22
|
|
r0.<init>(r4) // Catch: java.lang.Exception -> L22
|
|
java.lang.String r4 = "countdown"
|
|
int r4 = r0.optInt(r4) // Catch: java.lang.Exception -> L22
|
|
com.mbridge.msdk.mbsignalcommon.windvane.g r0 = com.mbridge.msdk.mbsignalcommon.windvane.g.a() // Catch: java.lang.Exception -> L1f
|
|
java.lang.String r1 = com.mbridge.msdk.splash.signal.d.a(r1) // Catch: java.lang.Exception -> L1f
|
|
r0.a(r3, r1) // Catch: java.lang.Exception -> L1f
|
|
r1 = r4
|
|
goto L2c
|
|
L1f:
|
|
r3 = move-exception
|
|
r1 = r4
|
|
goto L23
|
|
L22:
|
|
r3 = move-exception
|
|
L23:
|
|
java.lang.String r4 = r2.a
|
|
java.lang.String r3 = r3.getMessage()
|
|
com.mbridge.msdk.foundation.tools.af.b(r4, r3)
|
|
L2c:
|
|
com.mbridge.msdk.splash.d.a r3 = r2.j
|
|
if (r3 == 0) goto L34
|
|
r4 = 2
|
|
r3.a(r4, r1)
|
|
L34:
|
|
return
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.splash.signal.a.k(java.lang.Object, java.lang.String):void");
|
|
}
|
|
}
|