Wolves Themes v1.0版本的 MD5 值为:cddc92b47f6b7c4a195c9625507eb51c

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


package io.presage.formats;

import android.content.Context;
import android.net.Uri;
import android.os.Handler;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.webkit.JavascriptInterface;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.RelativeLayout;
import com.flurry.android.AdCreative;
import com.ironsource.sdk.constants.Constants;
import io.presage.Presage;
import io.presage.ads.NewAd;
import io.presage.p037long.IoriYagami;
import io.presage.p037long.Shermie;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map;
@Deprecated
public class LuckyGlauber extends HeavyD {
    public boolean e;
    private Handler f;

    public LuckyGlauber(Context context, String str, String str2, io.presage.ads.ChangKoehan changKoehan, io.presage.p033for.GoroDaimon goroDaimon) {
        super(context, str, str2, changKoehan, goroDaimon);
        this.e = false;
        a(changKoehan);
        this.f = new Handler(context.getMainLooper());
    }

    public void k() {
        this.f.post(new Runnable() {
            @Override
            public void run() {
                if (LuckyGlauber.this.e() == null) {
                    return;
                }
                Iterator<io.presage.formats.BenimaruNikaido> it = LuckyGlauber.this.e().iterator();
                while (it.hasNext()) {
                    ((WebView) ((ViewGroup) it.next().b()).findViewWithTag(Constants.ParametersKeys.WEB_VIEW)).loadUrl("javascript:window.onPresageClose();");
                }
            }
        });
    }

    @Override
    public void b() {
        this.f.post(new Runnable() {
            @Override
            public void run() {
                if (LuckyGlauber.this.e() != null) {
                    Iterator<io.presage.formats.BenimaruNikaido> it = LuckyGlauber.this.e().iterator();
                    while (it.hasNext()) {
                        io.presage.formats.BenimaruNikaido next = it.next();
                        ViewGroup viewGroup = (ViewGroup) next.b();
                        WebView webView = (WebView) viewGroup.findViewWithTag(Constants.ParametersKeys.WEB_VIEW);
                        webView.loadUrl("about:blank");
                        webView.destroy();
                        next.c();
                        viewGroup.removeAllViews();
                        LuckyGlauber.this.b = null;
                    }
                    LuckyGlauber.this.b = null;
                }
            }
        });
        super.b();
    }

    @Override
    public void c() {
        this.b = new ArrayList<>();
        this.f.post(new Runnable() {
            @Override
            public void run() {
                if (LuckyGlauber.this.h() == null || LuckyGlauber.this.e() == null) {
                    return;
                }
                Iterator it = ((ArrayList) LuckyGlauber.this.a("zones")).iterator();
                while (it.hasNext()) {
                    Map map = (Map) it.next();
                    WebView webView = new WebView(LuckyGlauber.this.i().getApplicationContext());
                    webView.clearHistory();
                    webView.clearAnimation();
                    webView.getSettings().setJavaScriptEnabled(true);
                    webView.setWebViewClient(new KyoKusanagi((String) map.get("name"), this, LuckyGlauber.this.h()));
                    webView.setWebChromeClient(new BenimaruNikaido((String) map.get("name"), this, LuckyGlauber.this.h()));
                    webView.addJavascriptInterface(new GoroDaimon((String) map.get("name"), webView, this, LuckyGlauber.this.h()), Presage.a);
                    webView.setBackgroundColor(0);
                    webView.setTag(Constants.ParametersKeys.WEB_VIEW);
                    webView.setVerticalScrollBarEnabled(false);
                    webView.setHorizontalScrollBarEnabled(false);
                    IoriYagami.b("WebViews", String.format("%s [%s] load url: %s", "WebViews", map.get("name").toString(), map.get("url").toString()));
                    webView.loadUrl((String) map.get("url"));
                    WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams();
                    layoutParams.width = -1;
                    layoutParams.height = -1;
                    layoutParams.x = 0;
                    layoutParams.y = 0;
                    layoutParams.gravity = 51;
                    layoutParams.type = 2003;
                    layoutParams.format = -3;
                    layoutParams.flags = 262184;
                    layoutParams.setTitle("Load Average");
                    Map map2 = (Map) map.get("size");
                    if (map2 != null) {
                        Double d = (Double) map2.get("width");
                        if (d != null && d.doubleValue() > 0.0d) {
                            layoutParams.width = Shermie.a(LuckyGlauber.this.i(), (int) Math.round(d.doubleValue()));
                        }
                        Double d2 = (Double) map2.get("height");
                        if (d2 != null && d2.doubleValue() > 0.0d) {
                            layoutParams.height = Shermie.a(LuckyGlauber.this.i(), (int) Math.round(d2.doubleValue()));
                        }
                    }
                    Map map3 = (Map) map.get(Constants.ParametersKeys.POSITION);
                    if (map3 != null) {
                        Double d3 = (Double) map3.get("x");
                        if (d3 != null && d3.doubleValue() > 0.0d) {
                            layoutParams.x = Shermie.a(LuckyGlauber.this.i(), (int) Math.round(d3.doubleValue()));
                        }
                        Double d4 = (Double) map3.get("y");
                        if (d4 != null && d4.doubleValue() > 0.0d) {
                            layoutParams.y = Shermie.a(LuckyGlauber.this.i(), (int) Math.round(d4.doubleValue()));
                        }
                    }
                    ArrayList arrayList = (ArrayList) map.get("gravity");
                    if (arrayList != null) {
                        layoutParams.gravity = 0;
                        Iterator it2 = arrayList.iterator();
                        while (it2.hasNext()) {
                            String str = (String) it2.next();
                            if (str.equals(AdCreative.kAlignmentTop)) {
                                layoutParams.gravity |= 48;
                            } else if (str.equals(AdCreative.kAlignmentLeft)) {
                                layoutParams.gravity |= 3;
                            } else if (str.equals(AdCreative.kAlignmentBottom)) {
                                layoutParams.gravity |= 80;
                            } else if (str.equals(AdCreative.kAlignmentRight)) {
                                layoutParams.gravity |= 5;
                            }
                        }
                    }
                    RelativeLayout relativeLayout = new RelativeLayout(LuckyGlauber.this.i());
                    RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(-1, -1);
                    layoutParams2.bottomMargin = 0;
                    layoutParams2.leftMargin = 0;
                    layoutParams2.rightMargin = 0;
                    layoutParams2.topMargin = 0;
                    relativeLayout.setLayoutParams(layoutParams2);
                    relativeLayout.addView(webView, 0, new RelativeLayout.LayoutParams(-1, -1));
                    LuckyGlauber.this.e().add(new io.presage.formats.BenimaruNikaido(layoutParams, relativeLayout));
                }
                WindowManager windowManager = (WindowManager) LuckyGlauber.this.i().getSystemService("window");
                if (LuckyGlauber.this.e() != null) {
                    Iterator<io.presage.formats.BenimaruNikaido> it3 = LuckyGlauber.this.e().iterator();
                    while (it3.hasNext()) {
                        io.presage.formats.BenimaruNikaido next = it3.next();
                        windowManager.addView(next.b(), next.a());
                    }
                }
            }
        });
    }

    @Override
    public void d() {
        this.f.post(new Runnable() {
            @Override
            public void run() {
                if (LuckyGlauber.this.i() == null) {
                    return;
                }
                WindowManager windowManager = (WindowManager) LuckyGlauber.this.i().getSystemService("window");
                if (LuckyGlauber.this.e() != null) {
                    try {
                        Iterator<io.presage.formats.BenimaruNikaido> it = LuckyGlauber.this.e().iterator();
                        while (it.hasNext()) {
                            windowManager.removeView(it.next().b());
                        }
                    } catch (IllegalArgumentException e) {
                        IoriYagami.c("WebViews", String.format("%s hideAd error: %s", "Ad", e.toString()));
                    }
                }
            }
        });
    }

    class GoroDaimon {
        private LuckyGlauber b;
        private String c;
        private WebView d;
        private io.presage.p033for.GoroDaimon e;

        public GoroDaimon(String str, WebView webView, LuckyGlauber luckyGlauber, io.presage.p033for.GoroDaimon goroDaimon) {
            this.c = str;
            this.d = webView;
            this.b = luckyGlauber;
            this.e = goroDaimon;
        }

        @JavascriptInterface
        public void loadComplete() {
            IoriYagami.b("WebViews", String.format("%s [%s] loadComplete", "WebViews", this.c));
            this.b.j();
        }

        @JavascriptInterface
        public void sendAction(String str) {
            IoriYagami.b("WebViews", String.format("%s [%s] sendAction: %s", "WebViews", this.c, str));
            if (str.equals("close")) {
                this.b.e = false;
                this.b.k();
            } else if (str.equals(NewAd.EVENT_CANCEL)) {
                this.b.e = true;
                this.b.k();
            } else {
                this.b.a().b(str);
            }
        }

        @JavascriptInterface
        public String param(String str) {
            return new p015if.p016do.p017do.ChoiBounge().b(this.e.a(str)).toString();
        }

        @JavascriptInterface
        public String stringParam(String str) {
            return this.e.a(str).toString();
        }

        @JavascriptInterface
        public void close(int i) {
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    if (GoroDaimon.this.b.e) {
                        GoroDaimon.this.b.a().b(NewAd.EVENT_CANCEL);
                    } else {
                        GoroDaimon.this.b.a().b("close");
                    }
                }
            }, i);
        }

        @JavascriptInterface
        public void setTimeout(final String str, int i) {
            IoriYagami.b("WebViews", String.format("%s [%s] setTimeout: %s - %s", "WebViews", this.c, str, Integer.toString(i)));
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    IoriYagami.b("WebViews", String.format("%s [%s] setTimout call: %s", "WebViews", GoroDaimon.this.c, str));
                    GoroDaimon.this.d.loadUrl("javascript:window." + str + "();");
                }
            }, i);
        }
    }

    class BenimaruNikaido extends WebChromeClient {
        private LuckyGlauber b;
        private String c;
        private io.presage.p033for.GoroDaimon d;

        public BenimaruNikaido(String str, LuckyGlauber luckyGlauber, io.presage.p033for.GoroDaimon goroDaimon) {
            this.c = str;
            this.b = luckyGlauber;
            this.d = goroDaimon;
        }

        @Override
        public void onConsoleMessage(String str, int i, String str2) {
            IoriYagami.a("WebViews", String.format("%s [%s] %s -- From line %s of %s", "WebViews", this.c, str, Integer.toString(i), str2));
        }
    }

    class KyoKusanagi extends WebViewClient {
        public KyoKusanagi(String str, LuckyGlauber luckyGlauber, io.presage.p033for.GoroDaimon goroDaimon) {
        }

        @Override
        public boolean shouldOverrideUrlLoading(WebView webView, String str) {
            String scheme = Uri.parse(str).getScheme();
            return (scheme == null || scheme.equals(com.mopub.common.Constants.HTTP) || scheme.equals(com.mopub.common.Constants.HTTPS)) ? false : true;
        }
    }
}