Files
rr3-apk/decompiled/sources/com/mbridge/msdk/mbsignalcommon/windvane/g.java
Daniel Elliott f9d20bb3fc 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>
2026-02-18 14:52:23 -08:00

121 lines
4.0 KiB
Java

package com.mbridge.msdk.mbsignalcommon.windvane;
import android.text.TextUtils;
import android.util.Base64;
import android.webkit.WebView;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public final class g {
private static g a = new g();
public static g a() {
return a;
}
private g() {
}
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, j.c(str2));
}
WindVaneWebView windVaneWebView = aVar.b;
if (windVaneWebView == null || windVaneWebView.isDestoryed()) {
return;
}
try {
aVar.b.loadUrl(format);
} catch (Exception e) {
e.printStackTrace();
} catch (Throwable th) {
th.printStackTrace();
}
}
}
public final 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, j.c(str2));
}
if (webView != null) {
if ((webView instanceof WindVaneWebView) && ((WindVaneWebView) webView).isDestoryed()) {
return;
}
try {
webView.loadUrl(format);
} catch (Exception e) {
e.printStackTrace();
} catch (Throwable th) {
th.printStackTrace();
}
}
}
public final void a(Object obj, String str) {
String format;
if (obj instanceof a) {
a aVar = (a) obj;
if (TextUtils.isEmpty(str)) {
format = String.format("javascript:window.WindVane.onSuccess(%s,'');", aVar.g);
} else {
format = String.format("javascript:window.WindVane.onSuccess(%s,'%s');", aVar.g, j.c(str));
}
WindVaneWebView windVaneWebView = aVar.b;
if (windVaneWebView == null || windVaneWebView.isDestoryed()) {
return;
}
try {
aVar.b.loadUrl(format);
} catch (Exception e) {
e.printStackTrace();
} catch (Throwable th) {
th.printStackTrace();
}
}
}
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 = j.c(str);
}
String format = String.format("javascript:window.WindVane.onFailure(%s,'%s');", aVar.g, str);
WindVaneWebView windVaneWebView = aVar.b;
if (windVaneWebView == null || windVaneWebView.isDestoryed()) {
return;
}
try {
aVar.b.loadUrl(format);
} catch (Exception e) {
e.printStackTrace();
} catch (Throwable th) {
th.printStackTrace();
}
}
}
public final void a(WebView webView) {
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("api_version", "1.0.0");
a.a(webView, com.mbridge.msdk.mbsignalcommon.base.e.j, Base64.encodeToString(jSONObject.toString().getBytes(), 2));
} catch (Exception unused) {
a.a(webView, com.mbridge.msdk.mbsignalcommon.base.e.j, "");
} catch (Throwable unused2) {
a.a(webView, com.mbridge.msdk.mbsignalcommon.base.e.j, "");
}
}
}