导航菜单

页面标题

页面副标题

小柿子 v1.3.8 - a.java 源代码

正在查看: 小柿子 v1.3.8 应用的 a.java JAVA 源代码文件

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


package com.mbridge.msdk.advanced.view;

import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.text.TextUtils;
import android.webkit.ValueCallback;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import com.mbridge.msdk.advanced.b.c;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.z;
import com.mbridge.msdk.mbsignalcommon.base.BaseWebView;
import com.mbridge.msdk.mbsignalcommon.base.b;
import com.mbridge.msdk.mbsignalcommon.windvane.WindVaneWebView;
import java.io.FileInputStream;
import java.net.URLDecoder;
import java.util.HashMap;

public final class a extends b {
    public String a;
    public com.mbridge.msdk.advanced.b.a b;
    private final String c = "NativeAdvancedWebViewClient";
    private final String d = z.a("YkRXhr5AWBPfNgzuH7JQ+2Ha");
    private final String e = z.a("Y+xgWkl2");
    private c f;

    public a(String str, com.mbridge.msdk.advanced.b.a aVar, c cVar) {
        this.a = str;
        this.b = aVar;
        this.f = cVar;
    }

    private WebResourceResponse a(WebView webView, String str) {
        Uri parse;
        String scheme;
        if (!TextUtils.isEmpty(str) && this.f != null) {
            try {
                String str2 = "";
                if (str.startsWith("file") && str.contains(this.d)) {
                    str2 = str.replace("file://", "");
                }
                boolean z2 = false;
                if (!TextUtils.isEmpty(str) && (parse = Uri.parse(str)) != null && (scheme = parse.getScheme()) != null && !TextUtils.isEmpty(scheme) && (scheme.equals(this.e) || scheme.equals("mb-h5"))) {
                    z2 = true;
                }
                if (z2) {
                    str2 = this.f.d(URLDecoder.decode(Uri.parse(str).getQueryParameter("uri")));
                }
                if (!TextUtils.isEmpty(str2)) {
                    af.a("NativeAdvancedWebViewClient", "replace url : " + str2);
                    if (!str2.contains("127.0.0.1") && !str2.startsWith("http")) {
                        HashMap hashMap = new HashMap();
                        hashMap.put("Access-Control-Allow-Origin", "*");
                        WebResourceResponse webResourceResponse = new WebResourceResponse("video/mp4", "utf-8", new FileInputStream(str2));
                        if (Build.VERSION.SDK_INT >= 21) {
                            webResourceResponse.setResponseHeaders(hashMap);
                        }
                        return webResourceResponse;
                    }
                    return null;
                }
            } catch (Throwable th) {
                af.b("NativeAdvancedWebViewClient", th.getMessage());
            }
        }
        return null;
    }

    public final void onPageStarted(WebView webView, String str, Bitmap bitmap) {
        super/*android.webkit.WebViewClient*/.onPageStarted(webView, str, bitmap);
        try {
            StringBuilder sb = new StringBuilder("javascript:");
            sb.append(com.mbridge.msdk.c.b.b.a().b());
            if (Build.VERSION.SDK_INT <= 19) {
                webView.loadUrl(sb.toString());
            } else {
                webView.evaluateJavascript(sb.toString(), new ValueCallback<String>() {
                    @Override
                    public final void onReceiveValue(String str2) {
                    }
                });
            }
        } catch (Throwable th) {
            af.b("NativeAdvancedWebViewClient", "onPageStarted", th);
        }
    }

    public final WebResourceResponse shouldInterceptRequest(WebView webView, String str) {
        return a(webView, str);
    }

    public final boolean shouldOverrideUrlLoading(WebView webView, String str) {
        try {
            try {
                WindVaneWebView windVaneWebView = (WindVaneWebView) webView;
                if (System.currentTimeMillis() - ((BaseWebView) windVaneWebView).lastTouchTime > com.mbridge.msdk.click.b.a.c) {
                    if (com.mbridge.msdk.click.b.a.a(((com.mbridge.msdk.advanced.signal.b) windVaneWebView.getObject()).a().get(0), windVaneWebView.getUrl(), com.mbridge.msdk.click.b.a.b)) {
                        return false;
                    }
                }
            } catch (Exception e) {
                af.b("NativeAdvancedWebViewClient", e.getMessage());
            }
            af.b("NativeAdvancedWebViewClient", "Use html to open url.");
            com.mbridge.msdk.advanced.b.a aVar = this.b;
            if (aVar == null) {
                return true;
            }
            aVar.a(false, str);
            return true;
        } catch (Throwable th) {
            af.b("NativeAdvancedWebViewClient", "shouldOverrideUrlLoading", th);
            return false;
        }
    }

    public final WebResourceResponse shouldInterceptRequest(WebView webView, WebResourceRequest webResourceRequest) {
        return a(webView, Build.VERSION.SDK_INT >= 21 ? webResourceRequest.getUrl().toString() : "");
    }

    public final void a() {
        if (this.f != null) {
            this.f = null;
        }
    }
}