Cyber Surfer v5.2.5版本的 MD5 值为:db13c5fce988de393e52d2679f934b22

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


package com.bytedance.sdk.component.a;

import android.content.Context;
import android.os.Looper;
import android.text.TextUtils;
import android.util.Base64;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
import com.safedk.android.internal.SafeDKWebAppInterface;
public class z extends a {
    static final boolean j = true;
    protected String h;
    protected WebView i;

    private void a(String str, final String str2) {
        if (this.f || TextUtils.isEmpty(str2)) {
            return;
        }
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                if (z.this.f) {
                    return;
                }
                try {
                    i.a("Invoking Jsb using evaluateJavascript: " + str2);
                    z.this.i.evaluateJavascript(str2, null);
                } catch (Throwable th) {
                    th.printStackTrace();
                }
            }
        };
        if (Looper.myLooper() == Looper.getMainLooper()) {
            runnable.run();
            return;
        }
        i.a("Received call on sub-thread, posting to main thread: " + str2);
        this.d.post(runnable);
    }

    @Override
    protected Context a(j jVar) {
        if (jVar.e != null) {
            return jVar.e;
        }
        if (jVar.f832a != null) {
            return jVar.f832a.getContext();
        }
        throw new IllegalStateException("WebView cannot be null!");
    }

    @Override
    protected String a() {
        return this.i.getUrl();
    }

    @Override
    protected void a(String str) {
        a(str, SafeDKWebAppInterface.f + this.h + "._handleMessageFromToutiao(" + str + ")");
    }

    @Override
    public void a(String str, q qVar) {
        if (qVar == null || TextUtils.isEmpty(qVar.h)) {
            super.a(str, qVar);
            return;
        }
        String str2 = qVar.h;
        a(str, String.format("javascript:(function(){   const iframe = document.querySelector(atob('%s'));   if (iframe && iframe.contentWindow) {        iframe.contentWindow.postMessage(%s, atob('%s'));   }})()", Base64.encodeToString(String.format("iframe[src=\"%s\"", str2).getBytes(), 2), str, Base64.encodeToString(str2.getBytes(), 2)));
    }

    @Override
    public void b() {
        super.b();
        d();
    }

    @Override
    protected void b(j jVar) {
        this.i = jVar.f832a;
        this.h = jVar.c;
        if (jVar.n) {
            return;
        }
        c();
    }

    protected void c() {
        if (!j && this.i == null) {
            throw new AssertionError();
        }
        this.i.addJavascriptInterface(this, this.h);
    }

    protected void d() {
        this.i.removeJavascriptInterface(this.h);
    }

    @Override
    @JavascriptInterface
    public void invokeMethod(String str) {
        super.invokeMethod(str);
    }
}