导航菜单

页面标题

页面副标题

Uptodown App Store v6.80 - a.java 源代码

正在查看: Uptodown App Store v6.80 应用的 a.java JAVA 源代码文件

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


package com.mbridge.msdk.foundation.webview;

import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.webkit.WebView;
import com.mbridge.msdk.activity.MBCommonActivity;
import com.mbridge.msdk.c.g;
import com.mbridge.msdk.c.h;
import com.mbridge.msdk.c.i;
import com.mbridge.msdk.click.entity.JumpLoaderResult;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.aj;
import com.mbridge.msdk.foundation.webview.BrowserView;
import com.mbridge.msdk.out.BaseTrackingListener;
import com.mbridge.msdk.playercommon.exoplayer2.text.ttml.TtmlNode;
import java.util.ArrayList;

public class a implements BrowserView.a {
    private static String a = "a";
    private int b;
    private String d;
    private boolean e;
    private BaseTrackingListener f;
    private BrowserView g;
    private CampaignEx h;
    private com.mbridge.msdk.click.a i;
    private Context j;
    private JumpLoaderResult l;
    private long o;
    private boolean c = true;
    private boolean m = false;
    private final Runnable n = new Runnable() {
        @Override
        public final void run() {
            af.b(a.a, "webview js!超时上限:" + a.this.b + "ms");
            if (a.this.i != null && a.this.l != null) {
                a.this.l.setSuccess(false);
                a.this.l.setUrl(a.this.d);
                a.this.l.setType(2);
                a.this.l.setExceptionMsg("linktype 8 time out");
                a.this.i.a(a.this.l, a.this.h, 1, false);
            }
            a aVar = a.this;
            if (aVar.d(null, aVar.d) && !a.this.m) {
                a.this.m = true;
                a aVar2 = a.this;
                aVar2.a(aVar2.j, a.this.d, a.this.h);
            }
            if (a.this.f != null) {
                a.this.f.onFinishRedirection(a.this.h, a.this.d);
            }
        }
    };
    private Handler k = new Handler(Looper.getMainLooper());

    public a(Context context, CampaignEx campaignEx, com.mbridge.msdk.click.a aVar, BrowserView browserView, BaseTrackingListener baseTrackingListener) {
        this.b = 10000;
        this.l = null;
        this.j = context;
        this.h = campaignEx;
        this.g = browserView;
        this.f = baseTrackingListener;
        g b = h.a().b(com.mbridge.msdk.foundation.controller.c.m().k());
        if (b == null) {
            h.a();
            b = i.a();
        }
        this.i = aVar;
        this.l = new JumpLoaderResult();
        this.b = (int) b.ar();
    }

    @Override
    public final void a() {
    }

    public boolean d(WebView webView, String str) {
        try {
            if (TextUtils.isEmpty(str)) {
                return true;
            }
            Uri parse = Uri.parse(str);
            if (!parse.getScheme().equals("http") && !parse.getScheme().equals("https")) {
                if (parse.getScheme().equals("intent")) {
                    Intent parseUri = Intent.parseUri(str, 1);
                    try {
                        String str2 = parseUri.getPackage();
                        if (!TextUtils.isEmpty(str2)) {
                            if (this.j.getPackageManager().getLaunchIntentForPackage(str2) != null) {
                                return false;
                            }
                        }
                    } catch (Throwable th) {
                        af.b(a, th.getMessage());
                    }
                    try {
                        String stringExtra = parseUri.getStringExtra("browser_fallback_url");
                        if (!TextUtils.isEmpty(stringExtra)) {
                            Uri parse2 = Uri.parse(str);
                            if (!parse2.getScheme().equals("http")) {
                                if (!parse2.getScheme().equals("https")) {
                                    str = stringExtra;
                                }
                            }
                            return true;
                        }
                    } catch (Throwable th2) {
                        af.b(a, th2.getMessage());
                    }
                }
                if (com.mbridge.msdk.click.c.e(this.j, str)) {
                    af.b(a, "openDeepLink");
                    return false;
                }
            }
            return true;
        } catch (Throwable th3) {
            af.b(a, th3.getMessage());
            return true;
        }
    }

    private boolean e(WebView webView, String str) {
        try {
            if (TextUtils.isEmpty(str)) {
                return false;
            }
            Uri parse = Uri.parse(str);
            if (!parse.getScheme().equals("http") && !parse.getScheme().equals("https")) {
                if (parse.getScheme().equals("intent")) {
                    Intent parseUri = Intent.parseUri(str, 1);
                    try {
                        String str2 = parseUri.getPackage();
                        if (!TextUtils.isEmpty(str2) && this.j.getPackageManager().getLaunchIntentForPackage(str2) != null) {
                            parseUri.setFlags(268435456);
                            this.j.startActivity(parseUri);
                            this.m = true;
                            return true;
                        }
                    } catch (Throwable th) {
                        af.b(a, th.getMessage());
                    }
                    try {
                        String stringExtra = parseUri.getStringExtra("browser_fallback_url");
                        if (!TextUtils.isEmpty(stringExtra)) {
                            Uri parse2 = Uri.parse(str);
                            if (!parse2.getScheme().equals("http") && !parse2.getScheme().equals("https")) {
                                str = stringExtra;
                            }
                            webView.loadUrl(stringExtra);
                            return false;
                        }
                    } catch (Throwable th2) {
                        af.b(a, th2.getMessage());
                    }
                }
                if (com.mbridge.msdk.click.c.e(this.j, str)) {
                    af.b(a, "openDeepLink");
                    this.m = true;
                    return true;
                }
            }
            return false;
        } catch (Throwable th3) {
            af.b(a, th3.getMessage());
            return false;
        }
    }

    @Override
    public final void c(WebView webView, final String str) {
        af.b(a, "onPageFinished1  " + str);
        if (this.c) {
            this.o = 0L;
            this.c = false;
            com.mbridge.msdk.foundation.same.f.a.e().execute(new Runnable() {
                @Override
                public final void run() {
                    if (a.this.f != null) {
                        a.this.f.onFinishRedirection(a.this.h, str);
                    }
                    if (a.this.i == null || a.this.l == null) {
                        return;
                    }
                    a.this.l.setSuccess(true);
                    a.this.l.setUrl(str);
                    a.this.l.setType(2);
                    a.this.i.a(a.this.l, a.this.h, 1, true);
                }
            });
            if (TextUtils.isEmpty(str)) {
                return;
            }
            c();
            Uri parse = Uri.parse(str);
            if ((parse.getScheme().equals("http") || parse.getScheme().equals("https")) && !this.m) {
                this.m = true;
                a(this.j, str, this.h);
            }
        }
    }

    @Override
    public final boolean b(WebView webView, final String str) {
        af.b(a, "shouldOverrideUrlLoading1  " + str);
        this.c = false;
        if (aj.a.b(str) && aj.a.a(this.j, str, null)) {
            this.m = true;
        }
        boolean e = e(webView, str);
        if (e) {
            this.o = 0L;
            this.c = false;
            c();
            com.mbridge.msdk.foundation.same.f.a.e().execute(new Runnable() {
                @Override
                public final void run() {
                    if (a.this.i != null && a.this.l != null) {
                        a.this.l.setSuccess(true);
                        a.this.l.setUrl(str);
                        a.this.l.setType(2);
                        a.this.i.a(a.this.l, a.this.h, 1, true);
                    }
                    if (a.this.f != null) {
                        a.this.f.onFinishRedirection(a.this.h, str);
                    }
                }
            });
        }
        return e;
    }

    @Override
    public final void a(WebView webView, String str) {
        if (this.o == 0) {
            this.o = System.currentTimeMillis();
            if (!this.e) {
                this.e = true;
                d();
            }
        }
        this.d = str;
        this.c = true;
    }

    @Override
    public final void a(WebView webView, String str, Bitmap bitmap) {
        if (this.o == 0) {
            this.o = System.currentTimeMillis();
            if (!this.e) {
                this.e = true;
                d();
            }
            this.m = false;
        }
        this.d = str;
        this.c = true;
    }

    private void c() {
        this.k.removeCallbacks(this.n);
    }

    private void d() {
        this.k.postDelayed(this.n, this.b);
    }

    @Override
    public final void a(WebView webView, int i, final String str, final String str2) {
        af.d(a, str);
        c();
        com.mbridge.msdk.foundation.same.f.a.e().execute(new Runnable() {
            @Override
            public final void run() {
                if (a.this.f != null) {
                    a.this.f.onFinishRedirection(a.this.h, str2);
                }
                if (a.this.i == null || a.this.l == null) {
                    return;
                }
                a.this.l.setSuccess(false);
                a.this.l.setUrl(str2);
                a.this.l.setType(2);
                a.this.l.setExceptionMsg(str);
                a.this.i.a(a.this.l, a.this.h, 1, true);
            }
        });
        if (!d(webView, str2) || this.m) {
            return;
        }
        this.m = true;
        a(this.j, str2, this.h);
    }

    public void a(Context context, String str, CampaignEx campaignEx) {
        if (context == null) {
            return;
        }
        if (campaignEx != null) {
            campaignEx.getCurrentLocalRid();
        }
        try {
            int i = MBCommonActivity.d;
            Intent intent = new Intent(context, (Class<?>) MBCommonActivity.class);
            if (TextUtils.isEmpty(str)) {
                return;
            }
            b.a.put(str, this.g);
            if (aj.a.a(str)) {
                str = "https://play.google.com/store/apps/details?id=" + str.replace("market://details?id=", TtmlNode.ANONYMOUS_REGION_ID);
            }
            intent.putExtra("url", str);
            af.c("url", "webview url = " + str);
            intent.setFlags(805306368);
            intent.putExtra("mvcommon", campaignEx);
            context.startActivity(intent);
        } catch (Exception unused) {
            aj.a(context, str, this.f, campaignEx, new ArrayList());
        }
    }
}