小源钱包 v1.0.0版本的 MD5 值为:2fddb51fa9867693f901004082511bea
以下内容为反编译后的 CtAccountJsBridge.java 源代码,内容仅作参考
package cn.com.chinatelecom.account.api;
import android.os.Handler;
import android.os.Looper;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
public class CtAccountJsBridge implements cn.com.chinatelecom.account.api.b.a {
private static final String TAG = "CtAccountJsBridge";
public static Handler mHandler = new Handler(Looper.getMainLooper());
private a callback;
private WebView mWebView;
public interface a {
void a(String str);
}
public CtAccountJsBridge(WebView webView) {
this.mWebView = webView;
}
public CtAccountJsBridge(a aVar) {
this.callback = aVar;
}
@Override
public void callbackPreCode(final String str) {
String str2 = TAG;
CtAuth.info(str2, "callbackPreCode:" + str);
mHandler.post(new Runnable() {
@Override
public void run() {
if (CtAccountJsBridge.this.mWebView != null) {
WebView webView = CtAccountJsBridge.this.mWebView;
webView.loadUrl("javascript:ejsBridge.callbackPreCode('" + str + "')");
} else if (CtAccountJsBridge.this.callback != null) {
a aVar = CtAccountJsBridge.this.callback;
aVar.a("javascript:ejsBridge.callbackPreCode('" + str + "')");
}
}
});
}
@Override
public void callbackPreCodeParams(final String str) {
String str2 = TAG;
CtAuth.info(str2, "callbackPreCodeParams:" + str);
mHandler.post(new Runnable() {
@Override
public void run() {
if (CtAccountJsBridge.this.mWebView != null) {
WebView webView = CtAccountJsBridge.this.mWebView;
webView.loadUrl("javascript:ejsBridge.callbackPreCodeParams('" + str + "')");
} else if (CtAccountJsBridge.this.callback != null) {
a aVar = CtAccountJsBridge.this.callback;
aVar.a("javascript:ejsBridge.callbackPreCodeParams('" + str + "')");
}
}
});
}
@JavascriptInterface
public void getPreCodeParams(String str) {
String str2 = TAG;
CtAuth.info(str2, "getPreCodeParams:" + str);
CtAuth.getInstance().getPreCodeParamsByJs(str, this);
}
@JavascriptInterface
public void requestPreCode(String str) {
String str2 = TAG;
CtAuth.info(str2, "requestPreCode:" + str);
CtAuth.getInstance().requestPreCodeByJs(str, this);
}
}