61 lines
1.9 KiB
Java
61 lines
1.9 KiB
Java
package com.tencent.open.web.security;
|
|
|
|
import android.webkit.WebView;
|
|
import com.tencent.open.a;
|
|
import com.tencent.open.a.f;
|
|
import com.ubt.jimu.unity.bluetooth.UnityActivity;
|
|
import org.json.JSONException;
|
|
import org.json.JSONObject;
|
|
|
|
/* compiled from: ProGuard */
|
|
/* loaded from: classes.dex */
|
|
public class c extends a.C0016a {
|
|
private String d;
|
|
|
|
public c(WebView webView, long j, String str, String str2) {
|
|
super(webView, j, str);
|
|
this.d = str2;
|
|
}
|
|
|
|
private void b(String str) {
|
|
WebView webView = this.a.get();
|
|
if (webView != null) {
|
|
StringBuffer stringBuffer = new StringBuffer("javascript:");
|
|
stringBuffer.append("if(!!");
|
|
stringBuffer.append(this.d);
|
|
stringBuffer.append("){");
|
|
stringBuffer.append(this.d);
|
|
stringBuffer.append("(");
|
|
stringBuffer.append(str);
|
|
stringBuffer.append(")}");
|
|
String stringBuffer2 = stringBuffer.toString();
|
|
f.a("openSDK_LOG.SecureJsListener", "-->callback, callback: " + stringBuffer2);
|
|
webView.loadUrl(stringBuffer2);
|
|
}
|
|
}
|
|
|
|
@Override // com.tencent.open.a.C0016a
|
|
public void a(Object obj) {
|
|
f.a("openSDK_LOG.SecureJsListener", "-->onComplete, result: " + obj);
|
|
}
|
|
|
|
@Override // com.tencent.open.a.C0016a
|
|
public void a() {
|
|
f.b("openSDK_LOG.SecureJsListener", "-->onNoMatchMethod...");
|
|
}
|
|
|
|
@Override // com.tencent.open.a.C0016a
|
|
public void a(String str) {
|
|
f.a("openSDK_LOG.SecureJsListener", "-->onCustomCallback, js: " + str);
|
|
JSONObject jSONObject = new JSONObject();
|
|
try {
|
|
jSONObject.put(UnityActivity.RESULT, !com.tencent.open.c.c.a ? -4 : 0);
|
|
jSONObject.put("sn", this.b);
|
|
jSONObject.put("data", str);
|
|
} catch (JSONException e) {
|
|
e.printStackTrace();
|
|
}
|
|
b(jSONObject.toString());
|
|
}
|
|
}
|