GoooBet v1.0版本的 MD5 值为:ff9748f16167bfd7735b669c0a9931c5

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


package com.applovin.impl.adview;

import android.R;
import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.widget.RelativeLayout;
import com.applovin.impl.adview.j;
import com.applovin.sdk.AppLovinSdkUtils;

public class m extends Dialog implements l {

    private final Activity f478a;
    private final com.applovin.impl.sdk.k b;
    private final com.applovin.impl.sdk.r c;
    private final d d;
    private final com.applovin.impl.sdk.a.a e;
    private RelativeLayout f;
    private j g;

    public m(com.applovin.impl.sdk.a.a aVar, d dVar, Activity activity, com.applovin.impl.sdk.k kVar) {
        super(activity, R.style.Theme.Translucent.NoTitleBar);
        if (aVar == null) {
            throw new IllegalArgumentException("No ad specified");
        }
        if (dVar == null) {
            throw new IllegalArgumentException("No main view specified");
        }
        if (kVar == null) {
            throw new IllegalArgumentException("No sdk specified");
        }
        if (activity == null) {
            throw new IllegalArgumentException("No activity specified");
        }
        this.b = kVar;
        this.c = kVar.z();
        this.f478a = activity;
        this.d = dVar;
        this.e = aVar;
        requestWindowFeature(1);
        setCancelable(false);
    }

    private int a(int i) {
        return AppLovinSdkUtils.dpToPx(this.f478a, i);
    }

    private void a(j.a aVar) {
        if (this.g != null) {
            this.c.d("ExpandedAdDialog", "Attempting to create duplicate close button");
            return;
        }
        j a2 = j.a(aVar, this.f478a);
        this.g = a2;
        a2.setVisibility(8);
        this.g.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                m.this.c();
            }
        });
        this.g.setClickable(false);
        int a3 = a(((Integer) this.b.a(com.applovin.impl.sdk.c.b.bO)).intValue());
        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(a3, a3);
        layoutParams.addRule(10);
        layoutParams.addRule(((Boolean) this.b.a(com.applovin.impl.sdk.c.b.bR)).booleanValue() ? 9 : 11);
        this.g.a(a3);
        int a4 = a(((Integer) this.b.a(com.applovin.impl.sdk.c.b.bQ)).intValue());
        int a5 = a(((Integer) this.b.a(com.applovin.impl.sdk.c.b.bP)).intValue());
        layoutParams.setMargins(a5, a4, a5, 0);
        this.f.addView(this.g, layoutParams);
        this.g.bringToFront();
        int a6 = a(((Integer) this.b.a(com.applovin.impl.sdk.c.b.bS)).intValue());
        View view = new View(this.f478a);
        view.setBackgroundColor(0);
        int i = a3 + a6;
        RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(i, i);
        layoutParams2.addRule(10);
        layoutParams2.addRule(((Boolean) this.b.a(com.applovin.impl.sdk.c.b.bR)).booleanValue() ? 9 : 11);
        layoutParams2.setMargins(a5 - a(5), a4 - a(5), a5 - a(5), 0);
        view.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view2) {
                if (m.this.g.isClickable()) {
                    m.this.g.performClick();
                }
            }
        });
        this.f.addView(view, layoutParams2);
        view.bringToFront();
    }

    private void b() {
        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
        layoutParams.addRule(13);
        this.d.setLayoutParams(layoutParams);
        RelativeLayout relativeLayout = new RelativeLayout(this.f478a);
        this.f = relativeLayout;
        relativeLayout.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
        this.f.setBackgroundColor(-1157627904);
        this.f.addView(this.d);
        if (!this.e.n()) {
            a(this.e.o());
            d();
        }
        setContentView(this.f);
    }

    public void c() {
        this.d.a("javascript:al_onCloseTapped();", new Runnable() {
            @Override
            public void run() {
                m.this.dismiss();
            }
        });
    }

    private void d() {
        this.f478a.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                try {
                    if (m.this.g == null) {
                        m.this.c();
                    }
                    m.this.g.setVisibility(0);
                    m.this.g.bringToFront();
                    AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, 1.0f);
                    alphaAnimation.setDuration(300L);
                    alphaAnimation.setAnimationListener(new Animation.AnimationListener() {
                        @Override
                        public void onAnimationEnd(Animation animation) {
                            m.this.g.setClickable(true);
                        }

                        @Override
                        public void onAnimationRepeat(Animation animation) {
                        }

                        @Override
                        public void onAnimationStart(Animation animation) {
                        }
                    });
                    m.this.g.startAnimation(alphaAnimation);
                } catch (Throwable th) {
                    m.this.c.b("ExpandedAdDialog", "Unable to fade in close button", th);
                    m.this.c();
                }
            }
        });
    }

    public com.applovin.impl.sdk.a.a a() {
        return this.e;
    }

    @Override
    public void dismiss() {
        com.applovin.impl.sdk.d.d statsManagerHelper = this.d.getStatsManagerHelper();
        if (statsManagerHelper != null) {
            statsManagerHelper.e();
        }
        this.f478a.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                m.this.f.removeView(m.this.d);
                m.super.dismiss();
            }
        });
    }

    @Override
    public void onBackPressed() {
        this.d.a("javascript:al_onBackPressed();", new Runnable() {
            @Override
            public void run() {
                m.this.dismiss();
            }
        });
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        b();
    }

    @Override
    protected void onStart() {
        super.onStart();
        try {
            Window window = getWindow();
            if (window != null) {
                window.setFlags(this.f478a.getWindow().getAttributes().flags, this.f478a.getWindow().getAttributes().flags);
                window.addFlags(16777216);
            } else {
                this.c.e("ExpandedAdDialog", "Unable to turn on hardware acceleration - window is null");
            }
        } catch (Throwable th) {
            this.c.b("ExpandedAdDialog", "Setting window flags failed.", th);
        }
    }
}