Amour v4.6.9版本的 MD5 值为:60db0759ce21a7c5858136dd0821206f
以下内容为反编译后的 b.java 源代码,内容仅作参考
package xd;
import android.net.Uri;
import android.webkit.WebView;
import com.bumptech.glide.load.Key;
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 b {
public final HashMap<String, C0239b> f15363a = new HashMap<>();
public static class a {
public final WeakReference<WebView> f15364a;
public final long f15365b;
public a(com.tencent.open.c.b bVar, long j10) {
this.f15364a = new WeakReference<>(bVar);
this.f15365b = j10;
}
public void a() {
WebView webView = this.f15364a.get();
if (webView == null) {
return;
}
webView.loadUrl("javascript:window.JsBridge&&JsBridge.callback(" + this.f15365b + ",{'r':0,'result':'undefined'});");
}
public void b(String str) {
WebView webView = this.f15364a.get();
if (webView != null) {
webView.loadUrl("javascript:" + str);
}
}
public void c() {
WebView webView = this.f15364a.get();
if (webView == null) {
return;
}
webView.loadUrl("javascript:window.JsBridge&&JsBridge.callback(" + this.f15365b + ",{'r':1,'result':'no such method'})");
}
}
public static class C0239b {
public final void a(String str, List<String> list, a aVar) {
String str2;
Method method;
Object invoke;
Method[] declaredMethods = getClass().getDeclaredMethods();
int length = declaredMethods.length;
int i = 0;
while (true) {
str2 = null;
if (i < length) {
method = declaredMethods[i];
if (method.getName().equals(str) && method.getParameterTypes().length == list.size()) {
break;
}
i++;
} else {
method = null;
break;
}
}
if (method != null) {
try {
int size = list.size();
if (size != 0) {
if (size != 1) {
if (size != 2) {
if (size != 3) {
if (size != 4) {
if (size != 5) {
invoke = method.invoke(this, list.get(0), list.get(1), list.get(2), list.get(3), list.get(4), list.get(5));
} else {
invoke = method.invoke(this, list.get(0), list.get(1), list.get(2), list.get(3), list.get(4));
}
} else {
invoke = method.invoke(this, list.get(0), list.get(1), list.get(2), list.get(3));
}
} else {
invoke = method.invoke(this, list.get(0), list.get(1), list.get(2));
}
} else {
invoke = method.invoke(this, list.get(0), list.get(1));
}
} else {
invoke = method.invoke(this, list.get(0));
}
} else {
invoke = method.invoke(this, new Object[0]);
}
Class<?> returnType = method.getReturnType();
ae.a.b("openSDK_LOG.JsBridge", "-->call, result: " + invoke + " | ReturnType: " + returnType.getName());
if (!"void".equals(returnType.getName()) && returnType != Void.class) {
if (this instanceof ce.a) {
if (invoke != null) {
str2 = invoke.toString();
}
aVar.b(str2);
return;
}
return;
}
aVar.a();
return;
} catch (Exception e10) {
ae.a.d("openSDK_LOG.JsBridge", "-->handler call mehtod ex. targetMethod: " + method, e10);
aVar.c();
return;
}
}
aVar.c();
}
}
public void a(String str, String str2, List<String> list, a aVar) {
ae.a.h("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), Key.STRING_CHARSET_NAME));
} catch (UnsupportedEncodingException e10) {
e10.printStackTrace();
}
}
C0239b c0239b = this.f15363a.get(str);
if (c0239b != null) {
ae.a.b("openSDK_LOG.JsBridge", "call----");
c0239b.a(str2, list, aVar);
return;
}
ae.a.b("openSDK_LOG.JsBridge", "not call----objName NOT FIND");
aVar.c();
}
public boolean b(WebView webView, String str) {
ae.a.h("openSDK_LOG.JsBridge", "-->canHandleUrl---url = " + str);
if (str == null || !Uri.parse(str).getScheme().equals("jsbridge")) {
return false;
}
ArrayList arrayList = new ArrayList(Arrays.asList(str.concat("/#").split("/")));
if (arrayList.size() < 6) {
return false;
}
List<String> subList = arrayList.subList(4, arrayList.size() - 1);
a aVar = new a((com.tencent.open.c.b) webView, 4L);
webView.getUrl();
a((String) arrayList.get(2), (String) arrayList.get(3), subList, aVar);
return true;
}
}