AI Chat v1.1.8版本的 MD5 值为:1bcdce875f86738c8cfbf1e5f4064353
以下内容为反编译后的 c.java 源代码,内容仅作参考
package com.mbridge.msdk.splash.signal;
import android.text.TextUtils;
import android.util.Base64;
import android.webkit.WebView;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.foundation.db.g;
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.f;
import com.mbridge.msdk.foundation.entity.l;
import com.mbridge.msdk.foundation.same.a.d;
import com.mbridge.msdk.foundation.tools.ab;
import com.mbridge.msdk.foundation.tools.x;
import java.io.File;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public final class c {
private static String a = "SplashSignalUtils";
private static int b = 0;
private static int c = 1;
public static void b(Object obj, JSONObject jSONObject) {
try {
JSONObject optJSONObject = jSONObject.optJSONObject("data");
if (optJSONObject == null) {
a(obj, "data is empty");
return;
}
final CampaignEx parseCampaignWithBackData = CampaignEx.parseCampaignWithBackData(optJSONObject);
if (parseCampaignWithBackData == null) {
a(obj, "data camapign is empty");
return;
}
new Thread(new Runnable() {
@Override
public final void run() {
try {
j a2 = j.a(g.a(com.mbridge.msdk.foundation.controller.a.d().f()));
if (a2 != null) {
if (!a2.a(CampaignEx.this.getId())) {
f fVar = new f();
fVar.a(CampaignEx.this.getId());
fVar.a(CampaignEx.this.getFca());
fVar.b(CampaignEx.this.getFcb());
fVar.d(0);
fVar.c(1);
fVar.a(System.currentTimeMillis());
a2.a(fVar);
} else {
a2.b(CampaignEx.this.getId());
}
}
c.a(CampaignEx.this.getCampaignUnitId(), CampaignEx.this);
} catch (Throwable th) {
x.b(c.a, th.getMessage(), th);
}
}
}).start();
try {
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("code", b);
JSONObject jSONObject3 = new JSONObject();
jSONObject3.put("id", "");
jSONObject2.put("data", jSONObject3);
com.mbridge.msdk.mbsignalcommon.windvane.g.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
} catch (Exception e) {
a(obj, e.getMessage());
x.a(a, e.getMessage());
}
} catch (Throwable th) {
a(obj, th.getMessage());
}
}
public static void a(Object obj, JSONObject jSONObject) {
String str;
String str2;
String str3;
String str4;
JSONArray jSONArray;
int i;
String str5;
String str6 = "";
JSONObject jSONObject2 = new JSONObject();
String str7 = "message";
int i2 = 1;
if (jSONObject == null) {
try {
jSONObject2.put("code", 1);
jSONObject2.put("message", "params is null");
com.mbridge.msdk.mbsignalcommon.windvane.g.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
return;
} catch (JSONException e) {
x.a(a, e.getMessage());
return;
}
}
try {
jSONObject2.put("code", 0);
jSONObject2.put("message", "");
JSONArray jSONArray2 = jSONObject.getJSONArray("resource");
try {
if (jSONArray2 != null && jSONArray2.length() > 0) {
JSONArray jSONArray3 = new JSONArray();
int length = jSONArray2.length();
int i3 = 0;
while (i3 < length) {
JSONObject jSONObject3 = jSONArray2.getJSONObject(i3);
String optString = jSONObject3.optString("ref", str6);
int i4 = jSONObject3.getInt("type");
JSONObject jSONObject4 = new JSONObject();
if (i4 == i2 && !TextUtils.isEmpty(optString)) {
JSONObject jSONObject5 = new JSONObject();
l a2 = o.a(g.a(com.mbridge.msdk.foundation.controller.a.d().f())).a(optString);
if (a2 != null) {
jSONArray = jSONArray2;
i = length;
x.a(a, "VideoBean not null");
jSONObject5.put("type", 1);
jSONObject5.put("videoDataLength", a2.c());
String e2 = a2.e();
str4 = str7;
if (TextUtils.isEmpty(e2)) {
x.a(a, "VideoPath null");
jSONObject5.put(MBridgeConstans.DYNAMIC_VIEW_WX_PATH, str6);
jSONObject5.put("path4Web", str6);
str3 = str6;
} else {
str3 = str6;
x.a(a, "VideoPath not null");
jSONObject5.put(MBridgeConstans.DYNAMIC_VIEW_WX_PATH, e2);
jSONObject5.put("path4Web", e2);
}
if (a2.d() == 5) {
jSONObject5.put("downloaded", 1);
} else {
jSONObject5.put("downloaded", 0);
}
jSONObject4.put(optString, jSONObject5);
jSONArray3.put(jSONObject4);
} else {
str3 = str6;
str4 = str7;
jSONArray = jSONArray2;
i = length;
x.a(a, "VideoBean null");
}
} else {
str3 = str6;
str4 = str7;
jSONArray = jSONArray2;
i = length;
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().b(optString) == null ? str3 : com.mbridge.msdk.videocommon.download.g.a().b(optString));
jSONObject4.put(optString, jSONObject6);
jSONArray3.put(jSONObject4);
} else if (i4 == 3 && !TextUtils.isEmpty(optString)) {
File file = new File(optString);
if (file.exists() && file.isFile() && file.canRead()) {
x.a(a, "getFileInfo Mraid file " + optString);
str5 = "file:////" + optString;
} else {
str5 = str3;
}
JSONObject jSONObject7 = new JSONObject();
jSONObject7.put("type", 3);
jSONObject7.put(MBridgeConstans.DYNAMIC_VIEW_WX_PATH, str5);
jSONObject4.put(optString, jSONObject7);
jSONArray3.put(jSONObject4);
} else if (i4 == 4 && !TextUtils.isEmpty(optString)) {
JSONObject jSONObject8 = new JSONObject();
jSONObject8.put("type", 4);
jSONObject8.put(MBridgeConstans.DYNAMIC_VIEW_WX_PATH, ab.a(optString) == null ? str3 : ab.a(optString));
jSONObject4.put(optString, jSONObject8);
jSONArray3.put(jSONObject4);
}
}
i3++;
jSONArray2 = jSONArray;
length = i;
str7 = str4;
str6 = str3;
i2 = 1;
}
jSONObject2.put("resource", jSONArray3);
com.mbridge.msdk.mbsignalcommon.windvane.g.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
return;
}
try {
jSONObject2.put("code", 1);
str = "message";
try {
try {
jSONObject2.put(str, "resource is null");
com.mbridge.msdk.mbsignalcommon.windvane.g.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
} catch (JSONException e3) {
e = e3;
x.a(a, e.getMessage());
}
} catch (Throwable th) {
th = th;
try {
jSONObject2.put("code", 1);
jSONObject2.put(str, th.getLocalizedMessage());
com.mbridge.msdk.mbsignalcommon.windvane.g.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
} catch (JSONException e4) {
x.a(a, e4.getMessage());
}
}
} catch (JSONException e5) {
e = e5;
str = "message";
}
} catch (Throwable th2) {
th = th2;
str = str2;
}
} catch (Throwable th3) {
th = th3;
str = str7;
}
}
public static String a(int i) {
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("code", i);
String jSONObject2 = jSONObject.toString();
return !TextUtils.isEmpty(jSONObject2) ? Base64.encodeToString(jSONObject2.getBytes(), 2) : "";
} catch (Throwable unused) {
x.d(a, "code to string is error");
return "";
}
}
private static void a(Object obj, String str) {
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("code", c);
jSONObject.put("message", str);
jSONObject.put("data", new JSONObject());
com.mbridge.msdk.mbsignalcommon.windvane.g.a().a(obj, Base64.encodeToString(jSONObject.toString().getBytes(), 2));
} catch (Exception e) {
x.a(a, e.getMessage());
}
}
public static void a(WebView webView, String str, String str2) {
com.mbridge.msdk.mbsignalcommon.windvane.g.a().a(webView, str, str2);
}
public static void a(WebView webView) {
x.d(a, "fireOnSignalCommunication");
com.mbridge.msdk.mbsignalcommon.windvane.g.a().a(webView);
}
public static void a(String str, CampaignEx campaignEx) {
if (d.h == null || TextUtils.isEmpty(campaignEx.getId())) {
return;
}
d.a(str, campaignEx, com.anythink.expressad.foundation.g.a.f.f);
}
}