afun 2020238 v1.0版本的 MD5 值为:0e5438925c609ea263d060e5259b230d
以下内容为反编译后的 FBEventHelp.java 源代码,内容仅作参考
package com.xtigr.gtoqt.gppki.helper;
import android.app.Activity;
import android.util.Log;
import android.view.ViewGroup;
import android.webkit.ConsoleMessage;
import android.webkit.ValueCallback;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.xtigr.gtoqt.gppki.tool.WebViewUtil;
public class FBEventHelp {
public static FBEventHelp instance;
public WebView mWb;
public static synchronized FBEventHelp getInstance() {
FBEventHelp fBEventHelp;
synchronized (FBEventHelp.class) {
if (instance == null) {
instance = new FBEventHelp();
}
fBEventHelp = instance;
}
return fBEventHelp;
}
public void bindWeb(WebView webView) {
this.mWb = webView;
}
public void fb_AddToCart() {
this.mWb.post(new Runnable() {
@Override
public final void run() {
FBEventHelp.this.lambda$fb_AddToCart$0();
}
});
}
public void lambda$fb_AddToCart$0() {
this.mWb.loadUrl("javascript:fb_AddToCart()");
}
public void fb_CompleteRegistration() {
this.mWb.post(new Runnable() {
@Override
public final void run() {
FBEventHelp.this.lambda$fb_CompleteRegistration$1();
}
});
}
public void lambda$fb_CompleteRegistration$1() {
this.mWb.loadUrl("javascript:fb_CompleteRegistration()");
}
public void fb_Subscribe() {
this.mWb.post(new Runnable() {
@Override
public final void run() {
FBEventHelp.this.lambda$fb_Subscribe$2();
}
});
}
public void lambda$fb_Subscribe$2() {
this.mWb.loadUrl("javascript:fb_Subscribe()");
}
public void fb_Purchase() {
this.mWb.post(new Runnable() {
@Override
public final void run() {
FBEventHelp.this.lambda$fb_Purchase$3();
}
});
}
public void lambda$fb_Purchase$3() {
this.mWb.loadUrl("javascript:fb_Purchase()");
}
public void fb_event(final String name) {
this.mWb.post(new Runnable() {
@Override
public final void run() {
FBEventHelp.this.lambda$fb_event$4(name);
}
});
}
public void lambda$fb_event$4(String name) {
String javascriptCode = "fb_event('" + name + "');";
this.mWb.evaluateJavascript(javascriptCode, new ValueCallback<String>() {
@Override
public void onReceiveValue(String value) {
}
});
}
public void initFb(String url, Activity context) {
ViewGroup viewById = (ViewGroup) context.findViewById(16908290);
WebView webView = new WebView(context);
this.mWb = webView;
WebViewUtil.setSettings(webView);
this.mWb.loadUrl(url);
this.mWb.setWebChromeClient(new MyWebChromeClient());
this.mWb.setWebViewClient(new MyWebViewClient());
ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(-2, -2);
this.mWb.setLayoutParams(params);
this.mWb.setVisibility(8);
viewById.addView(this.mWb);
}
public class MyWebChromeClient extends WebChromeClient {
public MyWebChromeClient() {
}
@Override
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
Log.e("webview日志:", consoleMessage.message());
return super.onConsoleMessage(consoleMessage);
}
}
public class MyWebViewClient extends WebViewClient {
public MyWebViewClient() {
}
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
super.onReceivedError(view, request, error);
Log.e("onReceivedError:", ((Object) error.getDescription()) + " url:" + request.getUrl());
}
}
}