超媒网络 v3.0.0版本的 MD5 值为:e72248abb238993f421967424d9a9515
以下内容为反编译后的 xb2.java 源代码,内容仅作参考
package p.a.y.e.a.s.e.net;
import android.net.Uri;
import android.webkit.WebView;
import com.ehking.sdk.wepay.ui.activity.AuthenticationPhoneActivity;
import java.io.UnsupportedEncodingException;
import java.lang.ref.WeakReference;
import java.lang.reflect.Method;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
public class xb2 {
public HashMap<String, b> lite_do = new HashMap<>();
public static class a {
public WeakReference<WebView> lite_do;
public String lite_for;
public long lite_if;
public a(WebView webView, long j, String str) {
this.lite_do = new WeakReference<>(webView);
this.lite_if = j;
this.lite_for = str;
}
public void lite_do() {
WebView webView = this.lite_do.get();
if (webView == null) {
return;
}
StringBuilder b = r5.b("javascript:window.JsBridge&&JsBridge.callback(");
b.append(this.lite_if);
b.append(",{'r':1,'result':'no such method'})");
webView.loadUrl(b.toString());
}
public void lite_for(String str) {
WebView webView = this.lite_do.get();
if (webView != null) {
webView.loadUrl("javascript:" + str);
}
}
public void lite_if(Object obj) {
String obj2;
WebView webView = this.lite_do.get();
if (webView == null) {
return;
}
if (obj instanceof String) {
String replace = ((String) obj).replace("\\", "\\\\").replace("'", "\\'");
obj2 = "'" + ((Object) replace) + "'";
} else if (!(obj instanceof Number) && !(obj instanceof Long) && !(obj instanceof Integer) && !(obj instanceof Double) && !(obj instanceof Float)) {
obj2 = obj instanceof Boolean ? obj.toString() : "'undefined'";
} else {
obj2 = obj.toString();
}
StringBuilder b = r5.b("javascript:window.JsBridge&&JsBridge.callback(");
b.append(this.lite_if);
b.append(",{'r':0,'result':");
b.append(obj2);
b.append("});");
webView.loadUrl(b.toString());
}
}
public static class b {
public void lite_do(String str, List<String> list, a aVar) {
Method method;
Object invoke;
Method[] declaredMethods = getClass().getDeclaredMethods();
int length = declaredMethods.length;
int i = 0;
while (true) {
if (i >= length) {
method = null;
break;
}
method = declaredMethods[i];
if (method.getName().equals(str) && method.getParameterTypes().length == list.size()) {
break;
}
i++;
}
if (method == null) {
if (aVar != null) {
aVar.lite_do();
return;
}
return;
}
try {
int size = list.size();
if (size != 0) {
invoke = size != 1 ? size != 2 ? size != 3 ? size != 4 ? size != 5 ? method.invoke(this, list.get(0), list.get(1), list.get(2), list.get(3), list.get(4), list.get(5)) : method.invoke(this, list.get(0), list.get(1), list.get(2), list.get(3), list.get(4)) : method.invoke(this, list.get(0), list.get(1), list.get(2), list.get(3)) : method.invoke(this, list.get(0), list.get(1), list.get(2)) : method.invoke(this, list.get(0), list.get(1)) : method.invoke(this, list.get(0));
} else {
invoke = method.invoke(this, new Object[0]);
}
Class<?> returnType = method.getReturnType();
hc2.lite_try("openSDK_LOG.JsBridge", "-->call, result: " + invoke + " | ReturnType: " + returnType.getName());
if (!"void".equals(returnType.getName()) && returnType != Void.class) {
if (aVar == null || !lite_if()) {
return;
}
aVar.lite_for(invoke != null ? invoke.toString() : null);
}
} catch (Exception e) {
hc2.lite_char("openSDK_LOG.JsBridge", "-->handler call mehtod ex. targetMethod: " + method, e);
if (aVar != null) {
aVar.lite_do();
}
}
}
public boolean lite_if() {
return false;
}
}
public void lite_do(b bVar, String str) {
this.lite_do.put(str, bVar);
}
public boolean lite_for(WebView webView, String str) {
hc2.lite_const("openSDK_LOG.JsBridge", "-->canHandleUrl---url = " + str);
if (str != null && Uri.parse(str).getScheme().equals("jsbridge")) {
ArrayList arrayList = new ArrayList(Arrays.asList((str + "/#").split(AuthenticationPhoneActivity.WHITE_SPACE)));
if (arrayList.size() < 6) {
return false;
}
List<String> subList = arrayList.subList(4, arrayList.size() - 1);
a aVar = new a(webView, 4L, str);
webView.getUrl();
lite_if((String) arrayList.get(2), (String) arrayList.get(3), subList, aVar);
return true;
}
return false;
}
public void lite_if(String str, String str2, List<String> list, a aVar) {
hc2.lite_const("openSDK_LOG.JsBridge", "getResult---objName = " + str + " methodName = " + str2);
int size = list.size();
for (int i = 0; i < size; i++) {
try {
list.set(i, URLDecoder.decode(list.get(i), "UTF-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
b bVar = this.lite_do.get(str);
if (bVar != null) {
hc2.lite_try("openSDK_LOG.JsBridge", "call----");
bVar.lite_do(str2, list, aVar);
return;
}
hc2.lite_try("openSDK_LOG.JsBridge", "not call----objName NOT FIND");
if (aVar != null) {
aVar.lite_do();
}
}
}