笔 趣 阁 破 解 版2023 v4.18.00版本的 MD5 值为:35c48a89f5572ff5a659afd7c5a81cad
以下内容为反编译后的 j.java 源代码,内容仅作参考
package com.anythink.expressad.atsignalcommon.windvane;
import android.text.TextUtils;
import android.util.Base64;
import android.webkit.WebView;
import org.json.JSONObject;
public final class j implements b {
public static j f4926a = new j();
public static j a() {
return f4926a;
}
@Override
public final void b(Object obj, String str) {
if (obj instanceof a) {
a aVar = (a) obj;
if (TextUtils.isEmpty(str)) {
String.format("javascript:window.WindVane.onFailure(%s,'');", aVar.g);
} else {
str = n.c(str);
}
String format = String.format("javascript:window.WindVane.onFailure(%s,'%s');", aVar.g, str);
WindVaneWebView windVaneWebView = aVar.f4912a;
if (windVaneWebView == null || windVaneWebView.isDestroyed()) {
return;
}
try {
aVar.f4912a.loadUrl(format);
} catch (Exception e) {
e.printStackTrace();
} catch (Throwable th) {
th.printStackTrace();
}
}
}
@Override
public final void a(Object obj, String str, String str2) {
String format;
if (obj instanceof a) {
a aVar = (a) obj;
if (TextUtils.isEmpty(str2)) {
format = String.format("javascript:window.WindVane.fireEvent('%s', '');", str);
} else {
format = String.format("javascript:window.WindVane.fireEvent('%s','%s');", str, n.c(str2));
}
WindVaneWebView windVaneWebView = aVar.f4912a;
if (windVaneWebView == null || windVaneWebView.isDestroyed()) {
return;
}
try {
aVar.f4912a.loadUrl(format);
} catch (Exception e) {
e.printStackTrace();
} catch (Throwable th) {
th.printStackTrace();
}
}
}
public static void b(WebView webView) {
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("api_version", "1.0.0");
a(webView, "onJSBridgeConnected", Base64.encodeToString(jSONObject.toString().getBytes(), 2));
} catch (Exception unused) {
a(webView, "onJSBridgeConnected", "");
} catch (Throwable unused2) {
a(webView, "onJSBridgeConnected", "");
}
}
public static void a(WebView webView, String str, String str2) {
String format;
if (TextUtils.isEmpty(str2)) {
format = String.format("javascript:window.WindVane.fireEvent('%s', '');", str);
} else {
format = String.format("javascript:window.WindVane.fireEvent('%s','%s');", str, n.c(str2));
}
if (webView != null) {
if ((webView instanceof WindVaneWebView) && ((WindVaneWebView) webView).isDestroyed()) {
return;
}
try {
webView.loadUrl(format);
} catch (Exception e) {
e.printStackTrace();
} catch (Throwable th) {
th.printStackTrace();
}
}
}
@Override
public final void a(Object obj, String str) {
if (obj instanceof a) {
a aVar = (a) obj;
String format = TextUtils.isEmpty(str) ? String.format("javascript:window.WindVane.onSuccess(%s,'');", aVar.g) : String.format("javascript:window.WindVane.onSuccess(%s,'%s');", aVar.g, n.c(str));
WindVaneWebView windVaneWebView = aVar.f4912a;
if (windVaneWebView == null || windVaneWebView.isDestroyed()) {
return;
}
try {
aVar.f4912a.loadUrl(format);
} catch (Exception e) {
e.printStackTrace();
} catch (Throwable th) {
th.printStackTrace();
}
}
}
public static void a(WebView webView) {
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("api_version", "1.0.0");
a(webView, com.anythink.expressad.atsignalcommon.base.e.j, Base64.encodeToString(jSONObject.toString().getBytes(), 2));
} catch (Exception unused) {
a(webView, com.anythink.expressad.atsignalcommon.base.e.j, "");
} catch (Throwable unused2) {
a(webView, com.anythink.expressad.atsignalcommon.base.e.j, "");
}
}
}