PicWish v1.6.8版本的 MD5 值为:7e8bab240f03cf6dad8952f8374c4ed1

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


package ab;

import android.net.Uri;
import android.webkit.WebView;
import com.apowersoft.common.storage.FileUtil;
import com.apowersoft.plugin.asm.privacy.AsmPrivacyHookHelper;
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 HashMap<String, C0010b> f106a = new HashMap<>();

    public static class a {
        public WeakReference<WebView> f107a;
        public long f108b;

        public a(WebView webView, long j10) {
            this.f107a = new WeakReference<>(webView);
            this.f108b = j10;
        }

        public void a() {
            WebView webView = this.f107a.get();
            if (webView == null) {
                return;
            }
            StringBuilder b10 = androidx.core.graphics.a.b("javascript:window.JsBridge&&JsBridge.callback(");
            b10.append(this.f108b);
            b10.append(",{'r':0,'result':");
            b10.append("'undefined'");
            b10.append("});");
            webView.loadUrl(b10.toString());
        }

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

        public void c() {
            WebView webView = this.f107a.get();
            if (webView == null) {
                return;
            }
            StringBuilder b10 = androidx.core.graphics.a.b("javascript:window.JsBridge&&JsBridge.callback(");
            b10.append(this.f108b);
            b10.append(",{'r':1,'result':'no such method'})");
            webView.loadUrl(b10.toString());
        }
    }

    public static class C0010b {
        public final void a(String str, List<String> list, a aVar) {
            Method method;
            Method[] declaredMethods = getClass().getDeclaredMethods();
            int length = declaredMethods.length;
            int i10 = 0;
            while (true) {
                if (i10 >= length) {
                    method = null;
                    break;
                }
                method = declaredMethods[i10];
                if (method.getName().equals(str) && method.getParameterTypes().length == list.size()) {
                    break;
                }
                i10++;
            }
            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 ? AsmPrivacyHookHelper.invoke(method, this, new Object[]{list.get(0), list.get(1), list.get(2), list.get(3), list.get(4), list.get(5)}) : AsmPrivacyHookHelper.invoke(method, this, new Object[]{list.get(0), list.get(1), list.get(2), list.get(3), list.get(4)}) : AsmPrivacyHookHelper.invoke(method, this, new Object[]{list.get(0), list.get(1), list.get(2), list.get(3)}) : AsmPrivacyHookHelper.invoke(method, this, new Object[]{list.get(0), list.get(1), list.get(2)}) : AsmPrivacyHookHelper.invoke(method, this, new Object[]{list.get(0), list.get(1)}) : AsmPrivacyHookHelper.invoke(method, this, new Object[]{list.get(0)}) : AsmPrivacyHookHelper.invoke(method, this, new Object[0]);
                Class<?> returnType = method.getReturnType();
                db.a.c("openSDK_LOG.JsBridge", "-->call, result: " + invoke + " | ReturnType: " + returnType.getName());
                if (!"void".equals(returnType.getName()) && returnType != Void.class) {
                    if (this instanceof fb.a) {
                        aVar.b(invoke != null ? invoke.toString() : null);
                        return;
                    }
                    return;
                }
                aVar.a();
            } catch (Exception e10) {
                db.a.e("openSDK_LOG.JsBridge", "-->handler call mehtod ex. targetMethod: " + method, e10);
                aVar.c();
            }
        }
    }

    public void a(String str, String str2, List<String> list, a aVar) {
        db.a.i("openSDK_LOG.JsBridge", "getResult---objName = " + str + " methodName = " + str2);
        int size = list.size();
        for (int i10 = 0; i10 < size; i10++) {
            try {
                list.set(i10, URLDecoder.decode(list.get(i10), "UTF-8"));
            } catch (UnsupportedEncodingException e10) {
                e10.printStackTrace();
            }
        }
        C0010b c0010b = this.f106a.get(str);
        if (c0010b != null) {
            db.a.c("openSDK_LOG.JsBridge", "call----");
            c0010b.a(str2, list, aVar);
            return;
        }
        db.a.c("openSDK_LOG.JsBridge", "not call----objName NOT FIND");
        aVar.c();
    }

    public boolean b(WebView webView, String str) {
        db.a.i("openSDK_LOG.JsBridge", "-->canHandleUrl---url = " + str);
        if (str != null && Uri.parse(str).getScheme().equals("jsbridge")) {
            ArrayList arrayList = new ArrayList(Arrays.asList((str + "/#").split(FileUtil.ROOT_PATH)));
            if (arrayList.size() < 6) {
                return false;
            }
            List<String> subList = arrayList.subList(4, arrayList.size() - 1);
            a aVar = new a(webView, 4L);
            webView.getUrl();
            a((String) arrayList.get(2), (String) arrayList.get(3), subList, aVar);
            return true;
        }
        return false;
    }
}