恐 怖 老 奶 奶1破 解 版 中 文 版 无 敌 版 v4.15.00版本的 MD5 值为:2c4218ea002b12a6cce81f33a9f0144d

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


package com.anythink.expressad.a;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Bitmap;
import android.net.http.SslError;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.webkit.JsPromptResult;
import android.webkit.JsResult;
import android.webkit.SslErrorHandler;
import android.webkit.URLUtil;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.anythink.expressad.foundation.h.o;
import java.util.HashMap;
public class g {
    public static long f3728a = 0;
    public static final String f3729d = "g";
    public static final int p = 1;
    public static final int q = 2;
    public static final int r = 0;
    public boolean f3730b;
    public boolean f3731c;
    public int f3732e;
    public int f3733f;
    public com.anythink.expressad.d.a f3735h;
    public a f3736i;
    public String j;
    public String k;
    public WebView l;
    public boolean m;
    public String n;
    public int o;
    public boolean t;
    public boolean s = false;
    public final Runnable u = new Runnable() {
        @Override
        public final void run() {
            g.n(g.this);
            g.this.o = 1;
            String str = g.f3729d;
            o.d(str, "js超时!超时上限:" + g.this.f3733f + "ms");
            g.p(g.this);
        }
    };
    public final Runnable v = new Runnable() {
        @Override
        public final void run() {
            g.n(g.this);
            g.this.o = 2;
            String str = g.f3729d;
            o.d(str, "http超时!超时上限:" + g.this.f3732e + "ms");
            g.p(g.this);
        }
    };
    public Handler f3734g = new Handler(Looper.getMainLooper());

    public interface a {
        void a(String str, String str2);

        void a(String str, String str2, String str3);

        boolean a();

        boolean a(String str);

        boolean b(String str);
    }

    public g(boolean z) {
        this.f3732e = com.anythink.expressad.exoplayer.d.f4393a;
        this.f3733f = 3000;
        com.anythink.expressad.d.b.a();
        com.anythink.expressad.foundation.b.a.b().e();
        com.anythink.expressad.d.a b2 = com.anythink.expressad.d.b.b();
        this.f3735h = b2;
        if (b2 == null) {
            com.anythink.expressad.d.b.a();
            this.f3735h = com.anythink.expressad.d.b.c();
        }
        this.m = this.f3735h.v();
        if (z) {
            this.f3732e = (int) this.f3735h.q();
            this.f3733f = (int) this.f3735h.q();
            return;
        }
        this.f3732e = (int) this.f3735h.r();
        this.f3733f = (int) this.f3735h.r();
    }

    private void c() {
        synchronized (f3729d) {
            try {
                f();
                this.l.destroy();
                if (this.f3736i != null) {
                    this.f3736i.a(this.j, this.n);
                }
            } catch (Exception unused) {
                o.d(f3729d, "webview colse to failed");
            } catch (Throwable unused2) {
                o.d(f3729d, "webview colse to failed");
            }
        }
    }

    public static boolean e(g gVar) {
        gVar.t = true;
        return true;
    }

    public void f() {
        j();
        h();
    }

    public static void m(g gVar) {
        gVar.j();
        gVar.f3734g.postDelayed(gVar.u, gVar.f3733f);
    }

    public static boolean n(g gVar) {
        gVar.s = true;
        return true;
    }

    public static void p(g gVar) {
        synchronized (f3729d) {
            try {
                gVar.f();
                gVar.l.destroy();
                if (gVar.f3736i != null) {
                    gVar.f3736i.a(gVar.j, gVar.n);
                }
            } catch (Exception unused) {
                o.d(f3729d, "webview colse to failed");
            } catch (Throwable unused2) {
                o.d(f3729d, "webview colse to failed");
            }
        }
    }

    private void b() {
        synchronized (f3729d) {
            try {
                f();
                if (this.f3736i != null) {
                    this.f3736i.a(this.j, this.n);
                }
            } catch (Exception unused) {
                o.d(f3729d, "webview colse to failed");
            } catch (Throwable unused2) {
                o.d(f3729d, "webview colse to failed");
            }
        }
    }

    private void d() {
        h();
        this.f3734g.postDelayed(this.v, this.f3732e);
    }

    private void e() {
        j();
        this.f3734g.postDelayed(this.u, this.f3733f);
    }

    private void g() {
        this.f3734g.postDelayed(this.v, this.f3732e);
    }

    public void h() {
        this.f3734g.removeCallbacks(this.v);
    }

    private void i() {
        this.f3734g.postDelayed(this.u, this.f3733f);
    }

    public void j() {
        this.f3734g.removeCallbacks(this.u);
    }

    public static void f(g gVar) {
        gVar.h();
        gVar.f3734g.postDelayed(gVar.v, gVar.f3732e);
    }

    public final void a(String str, String str2, String str3, Context context, String str4, String str5, a aVar) {
        if (aVar != null) {
            this.k = str5;
            this.j = str4;
            this.f3736i = aVar;
            a(str, str2, str3, context);
            return;
        }
        throw new NullPointerException("OverrideUrlLoadingListener can not be null");
    }

    public static void c(g gVar) {
        synchronized (f3729d) {
            try {
                gVar.f();
                if (gVar.f3736i != null) {
                    gVar.f3736i.a(gVar.j, gVar.n);
                }
            } catch (Exception unused) {
                o.d(f3729d, "webview colse to failed");
            } catch (Throwable unused2) {
                o.d(f3729d, "webview colse to failed");
            }
        }
    }

    public final void a(String str, String str2, String str3, Context context, String str4, a aVar) {
        if (aVar != null) {
            this.j = str4;
            this.f3736i = aVar;
            a(str, str2, str3, context);
            return;
        }
        throw new NullPointerException("OverrideUrlLoadingListener can not be null");
    }

    private void a(final String str, final String str2, final String str3, final Context context) {
        if (Thread.currentThread() == Looper.getMainLooper().getThread()) {
            a(str2, str3, context, this.j);
        } else {
            this.f3734g.post(new Runnable() {
                @Override
                public final void run() {
                    g gVar = g.this;
                    gVar.a(str2, str3, context, gVar.j);
                }
            });
        }
    }

    public void a(String str, String str2, Context context, String str3) {
        try {
            a(context, str, str2);
            if (!TextUtils.isEmpty(this.k)) {
                this.l.getSettings().setDefaultTextEncodingName(com.anythink.expressad.foundation.g.a.bN);
                this.f3733f = 2000;
                this.f3732e = 2000;
                o.b(f3729d, this.k);
                this.l.loadDataWithBaseURL(str3, this.k, "*/*", com.anythink.expressad.foundation.g.a.bN, str3);
            } else if (this.m) {
                HashMap hashMap = new HashMap();
                if (this.l.getUrl() != null) {
                    hashMap.put("Referer", this.l.getUrl());
                }
                this.l.loadUrl(str3, hashMap);
            } else {
                this.l.loadUrl(str3);
            }
        } catch (Throwable th) {
            try {
                if (this.f3736i != null) {
                    this.f3736i.a(this.j, th.getMessage(), this.n);
                }
            } catch (Exception unused) {
            }
        }
    }

    @SuppressLint({"SetJavaScriptEnabled"})
    private void a(Context context, final String str, final String str2) {
        WebView webView = new WebView(context);
        this.l = webView;
        webView.getSettings().setJavaScriptEnabled(true);
        this.l.getSettings().setCacheMode(2);
        this.l.getSettings().setLoadsImagesAutomatically(false);
        this.l.setWebViewClient(new WebViewClient() {
            private boolean a() {
                g gVar = g.this;
                return gVar.f3730b || gVar.f3731c;
            }

            @Override
            public final void onPageFinished(WebView webView2, String str3) {
                super.onPageFinished(webView2, str3);
                try {
                    webView2.loadUrl("javascript:window.navigator.vibrate([]);");
                } catch (Exception e2) {
                    e2.printStackTrace();
                }
            }

            @Override
            public final void onPageStarted(WebView webView2, String str3, Bitmap bitmap) {
                try {
                    webView2.loadUrl("javascript:window.navigator.vibrate([]);");
                    boolean z = false;
                    if (g.this.t) {
                        g.this.o = 0;
                        g.c(g.this);
                        return;
                    }
                    g.this.f3731c = false;
                    if (webView2.getTag() == null) {
                        webView2.setTag("has_first_started");
                    } else {
                        g.this.f3730b = true;
                    }
                    synchronized (g.f3729d) {
                        String str4 = "加载页面-开始:";
                        if ((g.this.f3730b || g.this.f3731c) ? true : true) {
                            str4 = "加载页面-开始:(重定向)";
                        }
                        if (URLUtil.isHttpsUrl(str3)) {
                            o.d(g.f3729d, str4 + str3);
                        } else {
                            o.b(g.f3729d, str4 + str3);
                        }
                        g.this.j = str3;
                        if (g.this.f3736i != null && g.this.f3736i.a(str3)) {
                            g.e(g.this);
                            g.c(g.this);
                        } else {
                            g.f(g.this);
                        }
                    }
                } catch (Exception e2) {
                    e2.printStackTrace();
                }
            }

            @Override
            public final void onReceivedError(WebView webView2, int i2, String str3, String str4) {
                String str5 = g.f3729d;
                o.b(str5, "onReceivedError: errno = " + i2 + ", url: " + webView2.getUrl() + ",\n onReceivedError:, description: " + str3 + ", failingUrl: " + str4);
                synchronized (g.f3729d) {
                    g.e(g.this);
                    g.this.f();
                    g.c(g.this);
                }
                if (g.this.f3736i != null) {
                    g.this.f3736i.a(webView2.getUrl(), str3, g.this.n);
                }
            }

            @Override
            public final void onReceivedSslError(WebView webView2, SslErrorHandler sslErrorHandler, SslError sslError) {
                try {
                    String str3 = g.f3729d;
                    o.a(str3, "onReceivedSslError IS_SP_CBT_CF:" + com.anythink.expressad.a.q);
                    if (com.anythink.expressad.a.q && sslErrorHandler != null) {
                        sslErrorHandler.cancel();
                    }
                    if (TextUtils.isEmpty(str2)) {
                        return;
                    }
                    TextUtils.isEmpty(str);
                } catch (Exception e2) {
                    e2.printStackTrace();
                }
            }

            @Override
            public final boolean shouldOverrideUrlLoading(WebView webView2, String str3) {
                synchronized (g.f3729d) {
                    o.a(g.f3729d, "override js跳转:".concat(String.valueOf(str3)));
                    g.this.f3731c = true;
                    g.this.j();
                    if (g.this.t) {
                        g.this.h();
                        g.c(g.this);
                        return true;
                    }
                    g.this.j = str3;
                    if (g.this.f3736i == null || !g.this.f3736i.b(str3)) {
                        if (!g.this.m) {
                            g.this.l.loadUrl(str3);
                        } else {
                            HashMap hashMap = new HashMap();
                            if (g.this.l.getUrl() != null) {
                                hashMap.put("Referer", g.this.l.getUrl());
                            }
                            g.this.l.loadUrl(str3, hashMap);
                        }
                        return true;
                    }
                    g.e(g.this);
                    g.this.h();
                    g.c(g.this);
                    return true;
                }
            }
        });
        this.l.setWebChromeClient(new WebChromeClient() {
            @Override
            public final boolean onJsAlert(WebView webView2, String str3, String str4, JsResult jsResult) {
                return true;
            }

            @Override
            public final boolean onJsConfirm(WebView webView2, String str3, String str4, JsResult jsResult) {
                return true;
            }

            @Override
            public final boolean onJsPrompt(WebView webView2, String str3, String str4, String str5, JsPromptResult jsPromptResult) {
                return true;
            }

            @Override
            public final void onProgressChanged(WebView webView2, int i2) {
                if (i2 == 100) {
                    try {
                        String str3 = g.f3729d;
                        o.b(str3, "加载页面-进度完成:" + webView2.getUrl());
                        webView2.loadUrl("javascript:window.navigator.vibrate([]);");
                        if (!g.this.t && !g.this.f3731c) {
                            g.m(g.this);
                        }
                        if (g.this.f3736i != null) {
                            a aVar = g.this.f3736i;
                            webView2.getUrl();
                            aVar.a();
                        }
                    } catch (Exception e2) {
                        e2.printStackTrace();
                    }
                }
            }
        });
    }
}