导航菜单

页面标题

页面副标题

Clean Center v0.5.5 - c.java 源代码

正在查看: Clean Center v0.5.5 应用的 c.java JAVA 源代码文件

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


package sg.bigo.ads.ad.banner;

import android.app.Activity;
import android.content.Context;
import android.os.Handler;
import android.os.SystemClock;
import android.text.TextUtils;
import android.view.View;
import android.webkit.WebView;
import android.widget.FrameLayout;
import android.widget.TextView;
import java.lang.ref.WeakReference;
import java.util.concurrent.atomic.AtomicBoolean;
import okhttp3.HttpUrl;
import sg.bigo.ads.R;
import sg.bigo.ads.ad.banner.b;
import sg.bigo.ads.api.Ad;
import sg.bigo.ads.api.AdOptionsView;
import sg.bigo.ads.api.b.a;
import sg.bigo.ads.api.core.i;
import sg.bigo.ads.common.utils.q;
import sg.bigo.ads.common.utils.u;
import sg.bigo.ads.core.g.b;
import sg.bigo.ads.core.mraid.n;

public final class c<T extends Ad> implements b.InterfaceC0018b {
    WebView a;
    a c;
    Runnable g;
    sg.bigo.ads.core.b.b h;
    g i;
    final Context j;
    final T k;
    final i l;
    final boolean m;
    public WeakReference<Activity> o;
    AdOptionsView p;
    View q;
    boolean r;
    private sg.bigo.ads.core.mraid.e s;
    private View t;
    private final n u;
    public int b = 1;
    boolean d = false;
    boolean e = false;
    boolean f = false;
    private boolean v = false;
    private final View.OnAttachStateChangeListener w = new View.OnAttachStateChangeListener() {
        @Override
        public final void onViewAttachedToWindow(View view) {
            b.e(c.this);
        }

        @Override
        public final void onViewDetachedFromWindow(View view) {
            b.f(c.this);
            view.removeOnAttachStateChangeListener(this);
        }
    };
    final AtomicBoolean n = new AtomicBoolean(false);

    static class a implements a.InterfaceC0054a {
        private a.InterfaceC0054a c;
        private boolean b = false;
        Handler a = new Handler();

        a(a.InterfaceC0054a interfaceC0054a) {
            this.c = interfaceC0054a;
        }

        private boolean c() {
            if (this.b) {
                return true;
            }
            this.a.removeCallbacks(null);
            this.b = true;
            return false;
        }

        final void a() {
            a(new sg.bigo.ads.api.core.d(3001, 10102, "Adx media load error because of destroying before loaded"));
        }

        @Override
        public final void a(sg.bigo.ads.api.core.d dVar) {
            a.InterfaceC0054a interfaceC0054a;
            if (c() || (interfaceC0054a = this.c) == null) {
                return;
            }
            interfaceC0054a.a(dVar);
        }

        @Override
        public final void b() {
            a.InterfaceC0054a interfaceC0054a;
            if (c() || (interfaceC0054a = this.c) == null) {
                return;
            }
            interfaceC0054a.b();
        }
    }

    public c(Context context, T t, i iVar, n nVar, g gVar, boolean z) {
        this.j = context;
        this.k = t;
        this.l = iVar;
        this.u = nVar;
        this.i = gVar;
        this.m = z;
    }

    static TextView a(Context context, boolean z) {
        if (!z) {
            return null;
        }
        TextView textView = new TextView(context);
        textView.setText(sg.bigo.ads.common.utils.a.a(context, R.string.ad, new Object[0]));
        textView.setBackgroundResource(R.drawable.bigo_ad_bg_ad_tag_white_border);
        textView.setTextColor(q.b("#B2FFFFFF", -1));
        textView.setTextSize(9.0f);
        textView.setMaxLines(1);
        textView.setEllipsize(TextUtils.TruncateAt.END);
        textView.setPadding(sg.bigo.ads.common.utils.e.a(context, 3), sg.bigo.ads.common.utils.e.a(context, 1), sg.bigo.ads.common.utils.e.a(context, 3), sg.bigo.ads.common.utils.e.a(context, 1));
        return textView;
    }

    static TextView a(Context context, boolean z, String str) {
        if (!z || q.a((CharSequence) str)) {
            return null;
        }
        TextView textView = new TextView(context);
        textView.setText(str);
        textView.setBackgroundResource(R.drawable.bigo_ad_advertiser_background);
        textView.setTextColor(-1);
        textView.setTextSize(9.0f);
        textView.setMaxLines(1);
        textView.setEllipsize(TextUtils.TruncateAt.END);
        textView.setMaxWidth(sg.bigo.ads.common.utils.e.a(context, 240));
        textView.setBackgroundColor(q.b("#FFD6D9DB", -7829368));
        textView.setPadding(sg.bigo.ads.common.utils.e.a(context, 4), sg.bigo.ads.common.utils.e.a(context, 1), sg.bigo.ads.common.utils.e.a(context, 4), sg.bigo.ads.common.utils.e.a(context, 1));
        return textView;
    }

    private boolean c(final sg.bigo.ads.api.b.a.InterfaceC0054a r12) {
        throw new UnsupportedOperationException("Method not decompiled: sg.bigo.ads.ad.banner.c.c(sg.bigo.ads.api.b.a$a):boolean");
    }

    public final void a() {
        b.h(this);
        sg.bigo.ads.core.b.b bVar = this.h;
        if (bVar != null) {
            bVar.b();
        }
        a aVar = this.c;
        if (aVar != null) {
            aVar.a();
        }
        if (this.g != null) {
            this.g = null;
        }
        sg.bigo.ads.core.mraid.e eVar = this.s;
        if (eVar != null) {
            eVar.d();
            this.s = null;
        }
        View view = this.t;
        if (view != null) {
            view.removeOnAttachStateChangeListener(this.w);
            this.t = null;
        }
        WebView webView = this.a;
        if (webView != null) {
            u.b(webView);
            this.a = null;
        }
    }

    public final void a(final a.InterfaceC0054a interfaceC0054a) {
        sg.bigo.ads.common.n.d.a(2, new Runnable() {
            @Override
            public final void run() {
                if (c.this.b != 0) {
                    if (c.this.b(interfaceC0054a)) {
                        return;
                    }
                    interfaceC0054a.a(new sg.bigo.ads.api.core.d(3001, 10102, "Adx media load error when preload"));
                    return;
                }
                if (c.this.c != null) {
                    c.this.c.a();
                }
                c.this.c = new a(interfaceC0054a);
                final a aVar = c.this.c;
                aVar.a.postDelayed(new Runnable() {
                    @Override
                    public final void run() {
                        a.this.b();
                    }
                }, 15000L);
                c cVar = c.this;
                if (cVar.b(cVar.c)) {
                    return;
                }
                c.this.c.a(new sg.bigo.ads.api.core.d(3001, 10102, "Adx media load error when preload"));
            }
        });
    }

    public final View b() {
        if (this.t == null) {
            sg.bigo.ads.common.t.a.a(2, "BannerAd", "The banner ad is not ready, an empty view will be retrieved.");
            this.t = new FrameLayout(this.j);
        }
        b.d(this);
        this.t.addOnAttachStateChangeListener(this.w);
        return this.t;
    }

    public final boolean b(a.InterfaceC0054a interfaceC0054a) {
        if (this.r) {
            return true;
        }
        boolean c = c(interfaceC0054a);
        this.r = c;
        return c;
    }

    public final String c() {
        i iVar = this.l;
        return iVar != null ? iVar.z() : HttpUrl.FRAGMENT_ENCODE_SET;
    }

    final android.content.Context d() {
        throw new UnsupportedOperationException("Method not decompiled: sg.bigo.ads.ad.banner.c.d():android.content.Context");
    }

    public final void e() {
        sg.bigo.ads.common.t.a.a(0, 3, "BannerAd", "performImpression");
        b.g(this);
        T t = this.k;
        if (t instanceof e) {
            ((e) t).a(b.i(this));
        }
        if (this.d) {
            return;
        }
        this.d = true;
        if (this.e) {
            g();
            f();
            sg.bigo.ads.core.b.b bVar = this.h;
            if (bVar != null) {
                bVar.a();
            }
        }
    }

    final void f() {
        if (this.a != null) {
            sg.bigo.ads.common.t.a.a(0, 3, "BannerAd", "javascript:onViewImpression()");
            this.a.loadUrl("javascript:onViewImpression()");
        }
    }

    final void g() {
        final WebView webView = this.a;
        if (this.v || !(webView instanceof sg.bigo.ads.core.g.b)) {
            return;
        }
        this.v = true;
        sg.bigo.ads.common.n.d.a(1, new Runnable() {
            @Override
            public final void run() {
                b.C0090b c0090b;
                long j;
                long j2;
                long j3;
                long j4;
                long j5;
                byte b = 0;
                sg.bigo.ads.common.t.a.a(0, 3, "BannerAd", "Notify webView performance stat.");
                sg.bigo.ads.core.g.b bVar = (sg.bigo.ads.core.g.b) webView;
                if (sg.bigo.ads.api.a.i.a.m().a(0) || sg.bigo.ads.api.a.i.a.m().a(1)) {
                    b.C0090b c0090b2 = bVar.c;
                    sg.bigo.ads.core.g.b.a(c0090b2);
                    if (sg.bigo.ads.api.a.i.a.m().a(1)) {
                        if (bVar.d == null) {
                            bVar.d = new b.c(bVar, b);
                        }
                        long elapsedRealtime = SystemClock.elapsedRealtime();
                        c0090b2.d = bVar.d.a();
                        c0090b2.g = SystemClock.elapsedRealtime() - elapsedRealtime;
                        c0090b2.f = SystemClock.elapsedRealtime();
                    }
                    c0090b = c0090b2;
                } else {
                    c0090b = null;
                }
                if (c0090b != null) {
                    if (c0090b.c == null && c0090b.d == null) {
                        return;
                    }
                    Boolean bool = c0090b.c;
                    Boolean bool2 = c0090b.d;
                    if (bool != null) {
                        long j6 = bool.booleanValue() ? 1L : 0L;
                        j2 = b.a(c.this, c0090b.e);
                        j = j6;
                    } else {
                        j = -1;
                        j2 = -1;
                    }
                    if (bool2 != null) {
                        long j7 = bool2.booleanValue() ? 1L : 0L;
                        long j8 = c0090b.g;
                        j4 = b.a(c.this, c0090b.f);
                        j3 = j7;
                        j5 = j8;
                    } else {
                        j3 = -1;
                        j4 = -1;
                        j5 = -1;
                    }
                    sg.bigo.ads.common.t.a.a(0, 3, "BannerAd", "Stat check blank resutl.");
                    sg.bigo.ads.core.c.a.a(c.this.l, j, j2, j3, j4, j5);
                }
            }
        });
    }
}