导航菜单

页面标题

页面副标题

jsgt v4.8.1 - b.java 源代码

正在查看: jsgt v4.8.1 应用的 b.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package ae;

import android.net.Uri;
import android.webkit.WebView;
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, C0000b> a = new HashMap<>();

    public static class a {
        public final WeakReference<WebView> a;
        public final long b;

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

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

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

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

    public static class C0000b {
        public final void a(String str, List<String> list, a aVar) {
            Method method;
            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;
                } else {
                    i++;
                }
            }
            if (method == null) {
                aVar.c();
                return;
            }
            try {
                int size = list.size();
                Object invoke = size != 0 ? 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)) : method.invoke(this, new Object[0]);
                Class<?> returnType = method.getReturnType();
                de.a.b("openSDK_LOG.JsBridge", "-->call, result: " + invoke + " | ReturnType: " + returnType.getName());
                if (!"void".equals(returnType.getName()) && returnType != Void.class) {
                    if (this instanceof fe.a) {
                        aVar.b(invoke != null ? invoke.toString() : null);
                        return;
                    }
                    return;
                }
                aVar.a();
            } catch (Exception e) {
                de.a.d("openSDK_LOG.JsBridge", "-->handler call mehtod ex. targetMethod: " + method, e);
                aVar.c();
            }
        }
    }

    public void a(String str, String str2, List<String> list, a aVar) {
        de.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), "UTF-8"));
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
            }
        }
        C0000b c0000b = this.a.get(str);
        if (c0000b != null) {
            de.a.b("openSDK_LOG.JsBridge", "call----");
            c0000b.a(str2, list, aVar);
        } else {
            de.a.b("openSDK_LOG.JsBridge", "not call----objName NOT FIND");
            aVar.c();
        }
    }

    public boolean b(WebView webView, String str) {
        de.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;
    }
}