笔 趣 阁 破 解 版2023 v4.18.00版本的 MD5 值为:35c48a89f5572ff5a659afd7c5a81cad
以下内容为反编译后的 SplashJsUtils.java 源代码,内容仅作参考
package com.anythink.expressad.splash.js;
import android.text.TextUtils;
import android.util.Base64;
import android.webkit.WebView;
import com.anythink.core.common.b.m;
import com.anythink.expressad.atsignalcommon.windvane.j;
import com.anythink.expressad.foundation.c.d;
import com.anythink.expressad.foundation.d.c;
import com.anythink.expressad.foundation.d.q;
import com.anythink.expressad.foundation.g.a.f;
import com.anythink.expressad.foundation.h.n;
import com.anythink.expressad.foundation.h.r;
import com.anythink.expressad.videocommon.b.g;
import java.io.File;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class SplashJsUtils {
public static final String f5841a = "onSystemPause";
public static final String f5842b = "onSystemResume";
public static final String f5843c = "onSystemDestory";
public static String f5844d = "SplashJsUtils";
public static int e = 0;
public static int f = 1;
public static void b(String str, c cVar) {
if (f.o == null || TextUtils.isEmpty(cVar.ba())) {
return;
}
f.a(str, cVar, f.f);
}
public static void callbackExcep(Object obj, String str) {
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("code", f);
jSONObject.put("message", str);
jSONObject.put("data", new JSONObject());
j.a().a(obj, Base64.encodeToString(jSONObject.toString().getBytes(), 2));
} catch (Exception e2) {
n.a(f5844d, e2.getMessage());
}
}
public static void callbackSuccess(Object obj, String str) {
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("code", e);
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("id", str);
jSONObject.put("data", jSONObject2);
j.a().a(obj, Base64.encodeToString(jSONObject.toString().getBytes(), 2));
} catch (Exception e2) {
callbackExcep(obj, e2.getMessage());
n.a(f5844d, e2.getMessage());
}
}
public static String codeToJsonString(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) {
n.d(f5844d, "code to string is error");
return "";
}
}
public static void fireOnJSBridgeConnected(WebView webView) {
n.d(f5844d, "fireOnJSBridgeConnected");
j.a();
j.b(webView);
}
public static void getFileInfo(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");
j.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
return;
} catch (JSONException e2) {
n.a(f5844d, e2.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();
q a2 = d.a(com.anythink.expressad.foundation.c.c.a(m.a().e())).a(optString);
if (a2 != null) {
jSONArray = jSONArray2;
i = length;
n.a(f5844d, "VideoBean not null");
jSONObject5.put("type", 1);
jSONObject5.put("videoDataLength", a2.c());
String e3 = a2.e();
str4 = str7;
if (TextUtils.isEmpty(e3)) {
n.a(f5844d, "VideoPath null");
jSONObject5.put("path", str6);
jSONObject5.put("path4Web", str6);
str3 = str6;
} else {
str3 = str6;
n.a(f5844d, "VideoPath not null");
jSONObject5.put("path", e3);
jSONObject5.put("path4Web", e3);
}
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;
n.a(f5844d, "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("path", g.a().c(optString) == null ? str3 : g.a().c(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()) {
n.a(f5844d, "getFileInfo Mraid file ".concat(String.valueOf(optString)));
str5 = "file:////".concat(String.valueOf(optString));
} else {
str5 = str3;
}
JSONObject jSONObject7 = new JSONObject();
jSONObject7.put("type", 3);
jSONObject7.put("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("path", r.a(optString) == null ? str3 : r.a(optString));
jSONObject4.put(optString, jSONObject8);
jSONArray3.put(jSONObject4);
}
}
i3++;
jSONArray2 = jSONArray;
length = i;
str7 = str4;
str6 = str3;
i2 = 1;
}
jSONObject2.put("resource", jSONArray3);
j.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");
j.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
} catch (JSONException e4) {
e = e4;
n.a(f5844d, e.getMessage());
}
} catch (Throwable th) {
th = th;
try {
jSONObject2.put("code", 1);
jSONObject2.put(str, th.getLocalizedMessage());
j.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
} catch (JSONException e5) {
n.a(f5844d, e5.getMessage());
}
}
} catch (JSONException e6) {
e = e6;
str = "message";
}
} catch (Throwable th2) {
th = th2;
str = str2;
}
} catch (Throwable th3) {
th = th3;
str = str7;
}
}
public static void increaseOfferFrequence(Object obj, JSONObject jSONObject) {
try {
JSONObject optJSONObject = jSONObject.optJSONObject("data");
if (optJSONObject == null) {
callbackExcep(obj, "data is empty");
return;
}
c b2 = c.b(optJSONObject);
if (b2 == null) {
callbackExcep(obj, "data camapign is empty");
return;
}
updateFrequence(b2);
callbackSuccess(obj, "");
} catch (Throwable th) {
callbackExcep(obj, th.getMessage());
}
}
public static void sendEventToH5(WebView webView, String str, String str2) {
j.a();
j.a(webView, str, str2);
}
public static void updateFrequence(final c cVar) {
new Thread(new Runnable() {
@Override
public void run() {
try {
SplashJsUtils.a(c.this.I(), c.this);
} catch (Throwable th) {
n.b(SplashJsUtils.f5844d, th.getMessage(), th);
}
}
}).start();
}
public static void a(String str, c cVar) {
if (f.o == null || TextUtils.isEmpty(cVar.ba())) {
return;
}
f.a(str, cVar, f.f);
}
}