せい v4.7.3版本的 MD5 值为:203275d28cdb30ff42801fbf3f03f780

以下内容为反编译后的 b.java 源代码,内容仅作参考


package yd;

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, C0250b> f18384a = new HashMap<>();

    public static class a {

        public final WeakReference<WebView> f18385a;

        public final long f18386b;

        public a(com.tencent.open.c.b bVar, long j10) {
            this.f18385a = new WeakReference<>(bVar);
            this.f18386b = j10;
        }

        public void a() {
            WebView webView = this.f18385a.get();
            if (webView == null) {
                return;
            }
            webView.loadUrl("javascript:window.JsBridge&&JsBridge.callback(" + this.f18386b + ",{'r':0,'result':'undefined'});");
        }

        public void b(String str) {
            WebView webView = this.f18385a.get();
            if (webView != null) {
                webView.loadUrl("javascript:" + str);
            }
        }

        public void c() {
            WebView webView = this.f18385a.get();
            if (webView == null) {
                return;
            }
            webView.loadUrl("javascript:window.JsBridge&&JsBridge.callback(" + this.f18386b + ",{'r':1,'result':'no such method'})");
        }
    }

    public static class C0250b {
        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;
                    } else {
                        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();
                    be.a.b("openSDK_LOG.JsBridge", "-->call, result: " + invoke + " | ReturnType: " + returnType.getName());
                    if (!"void".equals(returnType.getName()) && returnType != Void.class) {
                        if (this instanceof de.a) {
                            if (invoke != null) {
                                str2 = invoke.toString();
                            }
                            aVar.b(str2);
                            return;
                        }
                        return;
                    }
                    aVar.a();
                    return;
                } catch (Exception e10) {
                    be.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) {
        be.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();
            }
        }
        C0250b c0250b = this.f18384a.get(str);
        if (c0250b != null) {
            be.a.b("openSDK_LOG.JsBridge", "call----");
            c0250b.a(str2, list, aVar);
        } else {
            be.a.b("openSDK_LOG.JsBridge", "not call----objName NOT FIND");
            aVar.c();
        }
    }

    public boolean b(WebView webView, String str) {
        be.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;
        }
        String str2 = (String) arrayList.get(2);
        String str3 = (String) arrayList.get(3);
        List<String> subList = arrayList.subList(4, arrayList.size() - 1);
        a aVar = new a((com.tencent.open.c.b) webView, 4L);
        webView.getUrl();
        a(str2, str3, subList, aVar);
        return true;
    }
}