BuzzCast Porno v1.0.0.0版本的 MD5 值为:74d6ef6b6062f3b4dab5598ca2751841

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


package com.amazon.device.ads;

import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.google.android.gms.common.internal.ImagesContract;
import java.io.IOException;
import java.util.Locale;
public class DTBAdViewSupportClient extends WebViewClient {
    public static final String AMAZON_APP_STORE_LINK = "https://www.amazon.com/gp/mas/dl/android?";
    public static final String AMAZON_SCHEME = "amzn";
    public static final String GOOGLE_PLAY_STORE_LINK = "https://play.google.com/store/apps/";
    public static final String LOG_TAG = "DTBAdViewSupportClient";
    public static final String MARKET_SCHEME = "market";
    public static final String MOBILE_SHOPPING_SCHEME = "com.amazon.mobile.shopping";
    public static final String MOBILE_SHOPPING_WEB_SCHEME = "com.amazon.mobile.shopping.web";
    public Context context;
    public DTBAdMRAIDController controller;

    public DTBAdViewSupportClient(Context context, DTBAdMRAIDController dTBAdMRAIDController) {
        this.context = context;
        this.controller = dTBAdMRAIDController;
    }

    private WebResourceResponse b(String str) {
        try {
            return new WebResourceResponse("image/png", "UTF-8", this.context.getAssets().open(str));
        } catch (IOException unused) {
            DtbLog.error(LOG_TAG, c.e("Failed to get injection response: ", str));
            return null;
        }
    }

    private WebResourceResponse c(String str) {
        try {
            return new WebResourceResponse("text/javascript", "UTF-8", this.context.getAssets().open(str));
        } catch (IOException unused) {
            DtbLog.error(LOG_TAG, c.e("Failed to get injection response: ", str));
            return null;
        }
    }

    private boolean d(String str) {
        return ImagesContract.LOCAL.equals(Uri.parse(str.toLowerCase(Locale.US)).getScheme());
    }

    private boolean openUrl(String str) {
        Intent intent;
        int i;
        Uri parse = Uri.parse(str);
        PackageManager packageManager = this.context.getPackageManager();
        try {
            try {
                if (MOBILE_SHOPPING_WEB_SCHEME.equals(parse.getScheme())) {
                    int indexOf = str.indexOf("//");
                    if (indexOf < 0 || (i = indexOf + 2) >= str.length()) {
                        return false;
                    }
                    String substring = str.substring(i);
                    AdRegistration.getCurrentActivity().startActivity(new Intent("android.intent.action.VIEW", Uri.parse(DtbConstants.HTTPS + substring)));
                    this.controller.onAdLeftApplication();
                    return true;
                } else if (MOBILE_SHOPPING_SCHEME.equals(parse.getScheme())) {
                    if (packageManager.getLaunchIntentForPackage("com.amazon.mShop.android.shopping") != null) {
                        intent = new Intent("android.intent.action.VIEW");
                        intent.setData(parse);
                    } else {
                        Intent intent2 = new Intent("android.intent.action.VIEW");
                        intent2.setData(parse);
                        int indexOf2 = str.indexOf("products/");
                        if (indexOf2 > 0) {
                            intent2.setData(Uri.parse("https://www.amazon.com/dp/" + str.substring(indexOf2 + 9)));
                        }
                        intent = intent2;
                    }
                    AdRegistration.getCurrentActivity().startActivity(intent);
                    this.controller.onAdLeftApplication();
                    return true;
                } else {
                    if (!MARKET_SCHEME.equals(parse.getScheme()) && !AMAZON_SCHEME.equals(parse.getScheme())) {
                        Intent intent3 = new Intent("android.intent.action.VIEW");
                        intent3.setData(parse);
                        AdRegistration.getCurrentActivity().startActivity(intent3);
                        this.controller.onAdLeftApplication();
                        return true;
                    }
                    try {
                        try {
                            Intent intent4 = new Intent("android.intent.action.VIEW");
                            intent4.setData(parse);
                            AdRegistration.getCurrentActivity().startActivity(intent4);
                            this.controller.onAdLeftApplication();
                            return true;
                        } catch (ActivityNotFoundException unused) {
                            DtbLog.debug(LOG_TAG, "App stores and browsers not found");
                            return false;
                        }
                    } catch (ActivityNotFoundException unused2) {
                        DTBAdUtil.directAppStoreLinkToBrowser(this.controller, parse);
                        return true;
                    }
                }
            } catch (NullPointerException unused3) {
                DtbLog.debug(LOG_TAG, "Current activity from AdRegistration not found");
                return false;
            }
        } catch (ActivityNotFoundException unused4) {
            DtbLog.error(LOG_TAG, "Activity not found com.amazon.mobile.shopping");
            return false;
        }
    }

    public boolean a(WebView webView, String str) {
        if (this.controller.isTwoPartExpand()) {
            return false;
        }
        return openUrl(str);
    }

    @Override
    public void onLoadResource(WebView webView, String str) {
        DtbLog.debug(LOG_TAG, c.e("Load Resource:", str));
    }

    @Override
    public void onPageFinished(WebView webView, String str) {
        DtbLog.debug(LOG_TAG, c.e("Page finished:", str));
        if (webView instanceof DTBAdView) {
            if (str.contains(DTBAdView.MRAID_IDENTIFIER)) {
                this.controller.onPageLoad();
            } else if (str.equals("https://c.amazon-adsystem.com/")) {
                this.controller.onPageLoad();
            }
        }
    }

    @Override
    public void onReceivedError(WebView webView, WebResourceRequest webResourceRequest, WebResourceError webResourceError) {
        super.onReceivedError(webView, webResourceRequest, webResourceError);
        if (Build.VERSION.SDK_INT >= 23) {
            this.controller.onLoadError(webResourceError.getDescription().toString(), webResourceError.getErrorCode());
        } else {
            this.controller.onLoadError();
        }
    }

    @Override
    public WebResourceResponse shouldInterceptRequest(WebView webView, String str) {
        DtbLog.debug(LOG_TAG, c.e("Should intercept Resource url: ", str));
        if (d(str)) {
            return b(str.substring(str.lastIndexOf(47) + 1));
        }
        return super.shouldInterceptRequest(webView, str);
    }
}