笔 趣 阁 破 解 版2023 v4.18.00版本的 MD5 值为:35c48a89f5572ff5a659afd7c5a81cad

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


package com.anythink.expressad.mbbanner.a.d;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.util.Base64;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import androidx.appcompat.widget.TooltipCompatHandler;
import b.g.a.s0.f;
import com.anythink.core.common.b.m;
import com.anythink.expressad.atsignalcommon.bridge.CommonJSBridgeImpUtils;
import com.anythink.expressad.atsignalcommon.mraid.CallMraidJS;
import com.anythink.expressad.atsignalcommon.windvane.AbsFeedBackForH5;
import com.anythink.expressad.atsignalcommon.windvane.j;
import com.anythink.expressad.foundation.d.d;
import com.anythink.expressad.foundation.h.h;
import com.anythink.expressad.foundation.h.l;
import com.anythink.expressad.foundation.h.n;
import com.anythink.expressad.foundation.h.s;
import com.anythink.expressad.foundation.h.x;
import com.anythink.expressad.mbbanner.a.c.e;
import com.anythink.expressad.mbbanner.view.ATBannerWebView;
import com.anythink.expressad.out.TemplateBannerView;
import com.anythink.expressad.out.i;
import com.anythink.expressad.out.p;
import com.anythink.expressad.widget.FeedBackButton;
import com.bumptech.glide.load.engine.GlideException;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.json.JSONObject;
public final class c {
    public static String f5478c = "BannerShowManager";
    public float A;
    public com.anythink.expressad.a.a f5479a;
    public i f5480b;
    public com.anythink.expressad.mbbanner.a.c.c f5481d;
    public boolean e;
    public com.anythink.expressad.foundation.d.c f;
    public TemplateBannerView g;
    public ImageView h;
    public ATBannerWebView i;
    public ImageView j;
    public boolean k;
    public boolean l;
    public boolean m;
    public boolean n;
    public boolean o;
    public boolean p;
    public boolean q;
    public String r;
    public String s;
    public List<com.anythink.expressad.foundation.d.c> t;
    public int u;
    public com.anythink.expressad.mbbanner.a.a.c w;
    public float z;
    public long v = TooltipCompatHandler.D;
    public Handler x = new Handler(Looper.getMainLooper()) {
        @Override
        public final void handleMessage(Message message) {
            super.handleMessage(message);
            int i = message.what;
        }
    };
    public com.anythink.expressad.foundation.g.g.a y = new com.anythink.expressad.foundation.g.g.a() {
        @Override
        public final void a() {
            c.this.a(com.anythink.expressad.mbbanner.a.a.n);
        }

        @Override
        public final void b() {
        }

        @Override
        public final void c() {
        }
    };
    public View.OnClickListener B = new View.OnClickListener() {
        @Override
        public final void onClick(View view) {
            if (c.this.q) {
                c.b(c.this);
            }
        }
    };
    public com.anythink.expressad.mbbanner.a.c.a C = new com.anythink.expressad.mbbanner.a.c.a() {
        @Override
        public final void a(int i) {
            if (i == 2) {
                c.c(c.this);
            } else {
                c.this.l();
            }
        }

        @Override
        public final void b() {
            c.b(c.this);
        }

        @Override
        public final void b(int i) {
            if (i == 1) {
                c.this.h();
                c.b();
                return;
            }
            c.this.e();
        }

        @Override
        public final void a() {
            c.b(c.this);
        }

        @Override
        public final void a(com.anythink.expressad.foundation.d.c cVar) {
            c.this.a(cVar, false, "");
        }

        @Override
        public final void a(boolean z) {
            if (c.this.f5481d != null) {
                c.this.p = z;
                if (z) {
                    c.this.f5481d.b();
                } else {
                    c.this.f5481d.c();
                }
            }
        }

        @Override
        public final void a(boolean z, String str) {
            try {
                if (c.this.f5481d != null) {
                    if (TextUtils.isEmpty(str)) {
                        c.this.f5481d.a(c.this.f);
                        c.this.f5481d.a();
                        return;
                    }
                    com.anythink.expressad.foundation.d.c b2 = com.anythink.expressad.foundation.d.c.b(com.anythink.expressad.foundation.d.c.a(c.this.f));
                    b2.p(str);
                    c.this.a(b2, z, str);
                }
            } catch (Exception e) {
                n.d(c.f5478c, e.getMessage());
            }
        }
    };
    public com.anythink.expressad.atsignalcommon.a.b D = new com.anythink.expressad.atsignalcommon.a.b() {
        @Override
        public final void onPageFinished(WebView webView, String str) {
            c.l(c.this);
            n.d(com.anythink.expressad.atsignalcommon.a.b.f4846d, "BANNER onPageFinished");
            n.d(com.anythink.expressad.mbbanner.a.a.a.f5422a, "fireOnJSBridgeConnected");
            j.a();
            j.b(webView);
            c.n(c.this);
            if (c.this.f == null || c.this.f.r()) {
                return;
            }
            c.this.h();
            c.b();
        }

        @Override
        public final void onReceivedError(WebView webView, int i, String str, String str2) {
            c.this.a(str);
            c.b();
        }
    };

    public c(TemplateBannerView templateBannerView, com.anythink.expressad.mbbanner.a.c.c cVar, String str, String str2, boolean z, com.anythink.expressad.d.c cVar2) {
        this.e = z;
        this.g = templateBannerView;
        this.r = str2;
        this.s = str;
        this.f5481d = new e(cVar, cVar2);
    }

    public static void b() {
    }

    public static boolean l(c cVar) {
        cVar.m = true;
        return true;
    }

    private void m() {
        ImageView imageView;
        if (this.e && (imageView = this.j) != null && imageView.getVisibility() == 0) {
            this.j.setVisibility(8);
            this.j.setOnClickListener(null);
            if (this.g == null || this.j.getParent() == null) {
                return;
            }
            this.g.removeView(this.j);
        }
    }

    public static void n() {
    }

    public static boolean n(c cVar) {
        cVar.o = true;
        return true;
    }

    private boolean d() {
        String a2 = a(this.f);
        if (TextUtils.isEmpty(a2)) {
            return false;
        }
        if (this.g != null) {
            if (this.i == null) {
                ATBannerWebView aTBannerWebView = new ATBannerWebView(m.a().e());
                this.i = aTBannerWebView;
                aTBannerWebView.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
                this.i.setWebViewClient(new com.anythink.expressad.mbbanner.view.a(this.r, this.t, this.C));
            }
            ImageView imageView = this.h;
            if (imageView != null) {
                imageView.setVisibility(8);
            }
            if (this.i.getVisibility() != 0) {
                this.i.setVisibility(0);
            }
            if (this.i.getParent() == null) {
                this.g.addView(this.i);
                d(this.f.F());
            }
            l();
            com.anythink.expressad.mbbanner.a.a.c cVar = new com.anythink.expressad.mbbanner.a.a.c(this.g.getContext(), this.s, this.r);
            this.w = cVar;
            cVar.a(this.t);
            this.w.a(this.C);
            this.w.a(this.u);
            this.i.setWebViewListener(this.D);
            this.i.setObject(this.w);
            if (!a2.startsWith("file")) {
                this.i.loadDataWithBaseURL(this.f.o(), a2, "text/html", com.anythink.expressad.foundation.g.a.bN, null);
                return true;
            }
            this.i.loadUrl(a2);
            return true;
        }
        a(com.anythink.expressad.mbbanner.a.a.i);
        return true;
    }

    @SuppressLint({"ClickableViewAccessibility"})
    public void e() {
        if (this.g != null) {
            ATBannerWebView aTBannerWebView = this.i;
            if (aTBannerWebView != null && aTBannerWebView.getParent() != null) {
                this.g.removeView(this.i);
            }
            if (this.h == null) {
                ImageView imageView = new ImageView(m.a().e());
                this.h = imageView;
                imageView.setOnTouchListener(new View.OnTouchListener() {
                    @Override
                    public final boolean onTouch(View view, MotionEvent motionEvent) {
                        c.this.z = motionEvent.getRawX();
                        c.this.A = motionEvent.getRawY();
                        String str = c.f5478c;
                        n.d(str, c.this.z + GlideException.a.v + c.this.A);
                        return false;
                    }
                });
                this.h.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public final void onClick(View view) {
                        c.this.a(com.anythink.expressad.mbbanner.a.e.b.a(CommonJSBridgeImpUtils.buildClickJsonObject(c.this.z, c.this.A), c.this.f), false, "");
                    }
                });
            }
            String bf = this.f.bf();
            if (!TextUtils.isEmpty(bf)) {
                com.anythink.expressad.foundation.g.d.b.a(m.a().e()).a(bf, new com.anythink.expressad.foundation.g.d.c() {
                    @Override
                    public final void a(Bitmap bitmap, String str) {
                        if (c.this.h != null) {
                            c.this.h.setImageBitmap(bitmap);
                        }
                        c.l(c.this);
                        c.m(c.this);
                        c.this.l();
                        c.this.h();
                    }

                    @Override
                    public final void a(String str, String str2) {
                        c.this.a(com.anythink.expressad.mbbanner.a.a.j);
                    }
                });
                return;
            } else {
                a(com.anythink.expressad.mbbanner.a.a.h);
                return;
            }
        }
        a(com.anythink.expressad.mbbanner.a.a.i);
    }

    private void f() {
        if (this.e && this.j == null) {
            ImageView imageView = new ImageView(m.a().e());
            this.j = imageView;
            imageView.setBackgroundResource(h.a(m.a().e(), "anythink_banner_close", h.f5349c));
            this.j.setVisibility(8);
            this.j.setContentDescription("closeButton");
        }
    }

    private boolean g() {
        TemplateBannerView templateBannerView = this.g;
        return (templateBannerView == null || x.a(templateBannerView) || this.p) ? false : true;
    }

    public void h() {
        boolean z;
        TemplateBannerView templateBannerView;
        c cVar = this;
        if (cVar.m && !cVar.n && cVar.f5481d != null) {
            cVar.n = true;
            cVar.x.removeCallbacks(cVar.y);
            com.anythink.expressad.foundation.d.c cVar2 = cVar.f;
            if (cVar2 != null && !cVar2.aq()) {
                cVar.f.ar();
                cVar.f5481d.a(cVar.t);
            }
        }
        if (cVar.m && cVar.k && cVar.l && cVar.n && cVar.f != null && !i()) {
            TemplateBannerView templateBannerView2 = cVar.g;
            boolean z2 = (templateBannerView2 == null || x.a(templateBannerView2) || cVar.p) ? false : true;
            if (!z2 && (templateBannerView = cVar.g) != null) {
                templateBannerView.postDelayed(new Runnable() {
                    @Override
                    public final void run() {
                        c.this.h();
                    }
                }, 1000L);
            }
            if (cVar.o && z2) {
                n.d(f5478c, "onBannerWebViewShow && transInfoToMraid");
                int[] iArr = new int[2];
                cVar.g.getLocationInWindow(iArr);
                ATBannerWebView aTBannerWebView = cVar.i;
                float f = iArr[0];
                float f2 = iArr[1];
                n.d(com.anythink.expressad.mbbanner.a.a.a.f5422a, "fireOnBannerWebViewShow");
                try {
                    JSONObject jSONObject = new JSONObject();
                    jSONObject.put("startX", f);
                    jSONObject.put("startY", f2);
                    jSONObject.put("scale", s.c(m.a().e()));
                    String encodeToString = Base64.encodeToString(jSONObject.toString().getBytes(), 2);
                    j.a();
                    j.a((WebView) aTBannerWebView, "webviewshow", encodeToString);
                } catch (Throwable th) {
                    n.b(com.anythink.expressad.mbbanner.a.a.a.f5422a, "fireOnBannerWebViewShow", th);
                }
                ATBannerWebView aTBannerWebView2 = cVar.i;
                int i = iArr[0];
                int i2 = iArr[1];
                int width = cVar.g.getWidth();
                int height = cVar.g.getHeight();
                n.d(com.anythink.expressad.mbbanner.a.a.a.f5422a, "transInfoForMraid");
                try {
                    int i3 = m.a().e().getResources().getConfiguration().orientation;
                    JSONObject jSONObject2 = new JSONObject();
                    jSONObject2.put("orientation", i3 == 2 ? "landscape" : i3 == 1 ? "portrait" : "undefined");
                    jSONObject2.put("locked", f.q);
                    float e = com.anythink.expressad.foundation.h.j.e(m.a().e());
                    float f3 = com.anythink.expressad.foundation.h.j.f(m.a().e());
                    HashMap g = com.anythink.expressad.foundation.h.j.g(m.a().e());
                    int intValue = ((Integer) g.get("width")).intValue();
                    int intValue2 = ((Integer) g.get("height")).intValue();
                    HashMap hashMap = new HashMap();
                    z = z2;
                    try {
                        hashMap.put(CallMraidJS.f4888a, CallMraidJS.k);
                        hashMap.put(CallMraidJS.f4889b, CallMraidJS.f);
                        hashMap.put(CallMraidJS.f4890c, f.q);
                        hashMap.put(CallMraidJS.f4891d, jSONObject2);
                        float f4 = i;
                        float f5 = i2;
                        float f6 = width;
                        float f7 = height;
                        CallMraidJS.getInstance().fireSetDefaultPosition(aTBannerWebView2, f4, f5, f6, f7);
                        CallMraidJS.getInstance().fireSetCurrentPosition(aTBannerWebView2, f4, f5, f6, f7);
                        CallMraidJS.getInstance().fireSetScreenSize(aTBannerWebView2, e, f3);
                        CallMraidJS.getInstance().fireSetMaxSize(aTBannerWebView2, intValue, intValue2);
                        CallMraidJS.getInstance().fireChangeEventForPropertys(aTBannerWebView2, hashMap);
                        CallMraidJS.getInstance().fireReadyEvent(aTBannerWebView2);
                    } catch (Throwable th2) {
                        th = th2;
                        n.b(com.anythink.expressad.mbbanner.a.a.a.f5422a, "transInfoForMraid", th);
                        cVar = this;
                        cVar.o = false;
                        if (!TextUtils.isEmpty(cVar.f.bf())) {
                        }
                        n.d(f5478c, "showSuccessed:" + cVar.f.ba());
                        if (!z) {
                        }
                    }
                } catch (Throwable th3) {
                    th = th3;
                    z = z2;
                }
                cVar = this;
                cVar.o = false;
                if (!TextUtils.isEmpty(cVar.f.bf())) {
                    com.anythink.expressad.foundation.g.d.b.a(m.a().e()).c(cVar.f.bf());
                }
            } else {
                z = z2;
            }
            n.d(f5478c, "showSuccessed:" + cVar.f.ba());
            if (!z) {
                ImageView imageView = cVar.h;
                if (imageView != null && imageView.getVisibility() == 0) {
                    com.anythink.expressad.foundation.d.c cVar3 = cVar.f;
                    if (cVar3 != null) {
                        if (cVar3 != null) {
                            c(cVar3, m.a().e(), cVar.r);
                            b(cVar3, m.a().e(), cVar.r);
                            a(cVar3, m.a().e(), cVar.r);
                        }
                        cVar.f.c(true);
                        com.anythink.expressad.foundation.g.a.f.a(cVar.r, cVar.f, com.anythink.expressad.foundation.g.a.f.e);
                    }
                } else {
                    List<com.anythink.expressad.foundation.d.c> list = cVar.t;
                    if (list != null && list.size() > 0) {
                        boolean z3 = false;
                        int i4 = 0;
                        for (int i5 = 0; i5 < cVar.t.size(); i5++) {
                            if (!cVar.t.get(i5).r() && (i5 == 0 || !cVar.t.get(i5).V())) {
                                c(cVar.t.get(i5), m.a().e(), cVar.r);
                                cVar.t.get(i5).c(true);
                                com.anythink.expressad.foundation.g.a.f.a(cVar.r, cVar.t.get(i5), com.anythink.expressad.foundation.g.a.f.e);
                                i4 = i5;
                                z3 = true;
                            }
                        }
                        if (z3) {
                            b(cVar.t.get(i4), m.a().e(), cVar.r);
                            a(cVar.t.get(i4), m.a().e(), cVar.r);
                        }
                    }
                }
                cVar.q = true;
                com.anythink.expressad.mbbanner.a.c.c cVar4 = cVar.f5481d;
                if (cVar4 != null) {
                    cVar4.a(cVar.f, false);
                }
                cVar.x.sendEmptyMessageDelayed(1, 1000L);
                return;
            }
            cVar.f.c(false);
        }
    }

    private synchronized boolean i() {
        boolean V;
        V = this.f.V();
        if (!V) {
            this.f.c(true);
        }
        return V;
    }

    private void j() {
        com.anythink.expressad.mbbanner.a.c.c cVar = this.f5481d;
        if (cVar != null) {
            cVar.d();
        }
    }

    private void k() {
        if (this.h != null) {
            ATBannerWebView aTBannerWebView = this.i;
            if (aTBannerWebView != null) {
                aTBannerWebView.setVisibility(8);
            }
            if (this.h.getVisibility() != 0) {
                this.h.setVisibility(0);
            }
            if (this.g != null) {
                RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
                layoutParams.addRule(10);
                this.h.setScaleType(ImageView.ScaleType.FIT_XY);
                if (this.h.getParent() == null) {
                    this.g.addView(this.h, layoutParams);
                }
                d(true);
            }
        }
    }

    public void l() {
        ImageView imageView;
        if (!this.e || (imageView = this.j) == null) {
            return;
        }
        if (imageView.getVisibility() != 0) {
            this.j.setVisibility(0);
            this.j.setOnClickListener(this.B);
        }
        if (this.j.getParent() != null || this.g == null) {
            return;
        }
        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(s.b(m.a().e(), 12.0f), s.b(m.a().e(), 12.0f));
        layoutParams.addRule(11);
        layoutParams.addRule(10);
        this.g.addView(this.j, layoutParams);
    }

    public final void b(boolean z) {
        this.k = z;
        h();
    }

    public final void c(boolean z) {
        this.l = z;
        h();
    }

    private void b(com.anythink.expressad.foundation.d.c cVar) {
        if (cVar != null) {
            c(cVar, m.a().e(), this.r);
            b(cVar, m.a().e(), this.r);
            a(cVar, m.a().e(), this.r);
        }
    }

    public static void c(com.anythink.expressad.foundation.d.c cVar, Context context, String str) {
        if (!TextUtils.isEmpty(cVar.ai())) {
            com.anythink.expressad.a.a.a(context, cVar, str, cVar.ai(), false, true, com.anythink.expressad.a.a.a.i);
        }
        if (TextUtils.isEmpty(str) || cVar.J() == null || cVar.J().o() == null) {
            return;
        }
        com.anythink.expressad.a.a.a(context, cVar, str, cVar.J().o(), false);
    }

    public final void a(i iVar) {
        this.f5480b = iVar;
    }

    public static void m(c cVar) {
        if (cVar.h != null) {
            ATBannerWebView aTBannerWebView = cVar.i;
            if (aTBannerWebView != null) {
                aTBannerWebView.setVisibility(8);
            }
            if (cVar.h.getVisibility() != 0) {
                cVar.h.setVisibility(0);
            }
            if (cVar.g != null) {
                RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
                layoutParams.addRule(10);
                cVar.h.setScaleType(ImageView.ScaleType.FIT_XY);
                if (cVar.h.getParent() == null) {
                    cVar.g.addView(cVar.h, layoutParams);
                }
                cVar.d(true);
            }
        }
    }

    public final void a(boolean z, int i) {
        this.u = i;
        if (i == 0) {
            com.anythink.expressad.d.b.a();
            com.anythink.expressad.d.c c2 = com.anythink.expressad.d.b.c(com.anythink.expressad.foundation.b.a.b().e(), this.r);
            if (c2 == null) {
                return;
            }
            z = c2.d() == 1;
        }
        this.e = z;
    }

    public static void b(com.anythink.expressad.foundation.d.c cVar, Context context, String str) {
        if (cVar != null) {
            try {
                if (TextUtils.isEmpty(cVar.ak())) {
                    return;
                }
                com.anythink.expressad.a.a.a(context, cVar, str, cVar.ak(), false, true, com.anythink.expressad.a.a.a.j);
            } catch (Throwable th) {
                n.d(f5478c, th.getMessage());
            }
        }
    }

    public static void c(c cVar) {
        ImageView imageView;
        if (cVar.e && (imageView = cVar.j) != null && imageView.getVisibility() == 0) {
            cVar.j.setVisibility(8);
            cVar.j.setOnClickListener(null);
            if (cVar.g == null || cVar.j.getParent() == null) {
                return;
            }
            cVar.g.removeView(cVar.j);
        }
    }

    private com.anythink.expressad.foundation.d.c b(d dVar) {
        if (dVar != null) {
            ArrayList<com.anythink.expressad.foundation.d.c> arrayList = dVar.J;
            this.t = arrayList;
            if (arrayList != null && arrayList.size() > 0) {
                return this.t.get(0);
            }
        }
        return null;
    }

    public final void a(boolean z) {
        this.e = z;
    }

    public static String a(com.anythink.expressad.foundation.d.c cVar) {
        String concat;
        File file;
        if (cVar != null) {
            String b2 = com.anythink.expressad.videocommon.b.h.a().b(cVar.o());
            if (TextUtils.isEmpty(b2)) {
                b2 = cVar.p();
                if (cVar.aA()) {
                    try {
                        file = new File(b2);
                    } catch (Exception unused) {
                        File file2 = new File(b2);
                        if (file2.exists() && file2.isFile() && file2.canRead()) {
                            concat = "file:////".concat(String.valueOf(b2));
                        }
                    }
                    if (file.exists()) {
                        concat = l.a(file);
                        return concat;
                    }
                    return "";
                }
                File file3 = new File(b2);
                if (file3.exists() && file3.isFile() && file3.canRead()) {
                    return "file:////".concat(String.valueOf(b2));
                }
            }
            return b2;
        }
        return "";
    }

    public static void b(c cVar) {
        com.anythink.expressad.mbbanner.a.c.c cVar2 = cVar.f5481d;
        if (cVar2 != null) {
            cVar2.d();
        }
    }

    public void a(String str) {
        if (this.f == null || i()) {
            return;
        }
        this.x.removeCallbacks(this.y);
        com.anythink.expressad.mbbanner.a.c.c cVar = this.f5481d;
        if (cVar != null) {
            cVar.a(str);
        }
    }

    private void d(boolean z) {
        if (this.g != null) {
            FeedBackButton b2 = com.anythink.expressad.foundation.f.b.a().b(this.r);
            if (com.anythink.expressad.foundation.f.b.a().b() && z && b2 != null) {
                ViewGroup viewGroup = (ViewGroup) b2.getParent();
                if (viewGroup != null) {
                    viewGroup.removeView(b2);
                }
                b2.setVisibility(0);
                RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) b2.getLayoutParams();
                if (layoutParams == null) {
                    layoutParams = new RelativeLayout.LayoutParams(com.anythink.expressad.foundation.f.b.f5116a, com.anythink.expressad.foundation.f.b.f5117b);
                }
                layoutParams.addRule(12);
                b2.setLayoutParams(layoutParams);
                this.g.addView(b2);
            }
            com.anythink.expressad.foundation.f.b.a().a(this.r, new com.anythink.expressad.foundation.f.a() {
                @Override
                public final void a() {
                    String str;
                    c.this.g.onPause();
                    try {
                        JSONObject jSONObject = new JSONObject();
                        if (m.a().e() != null) {
                            jSONObject.put("status", 1);
                        }
                        str = jSONObject.toString();
                    } catch (Throwable th) {
                        n.b(c.f5478c, th.getMessage(), th);
                        str = "";
                    }
                    String encodeToString = Base64.encodeToString(str.getBytes(), 2);
                    j.a();
                    j.a((WebView) c.this.i, AbsFeedBackForH5.m_, encodeToString);
                }

                @Override
                public final void b() {
                    String str;
                    c.this.g.onResume();
                    try {
                        JSONObject jSONObject = new JSONObject();
                        if (m.a().e() != null) {
                            jSONObject.put("status", 2);
                        }
                        str = jSONObject.toString();
                    } catch (Throwable th) {
                        n.b(c.f5478c, th.getMessage(), th);
                        str = "";
                    }
                    String encodeToString = Base64.encodeToString(str.getBytes(), 2);
                    j.a();
                    j.a((WebView) c.this.i, AbsFeedBackForH5.m_, encodeToString);
                }

                @Override
                public final void c() {
                    String str;
                    c.this.g.onResume();
                    try {
                        JSONObject jSONObject = new JSONObject();
                        if (m.a().e() != null) {
                            jSONObject.put("status", 2);
                        }
                        str = jSONObject.toString();
                    } catch (Throwable th) {
                        n.b(c.f5478c, th.getMessage(), th);
                        str = "";
                    }
                    String encodeToString = Base64.encodeToString(str.getBytes(), 2);
                    j.a();
                    j.a((WebView) c.this.i, AbsFeedBackForH5.m_, encodeToString);
                }
            });
            this.f.l(this.r);
            com.anythink.expressad.foundation.f.b.a().a(this.r, this.f);
        }
    }

    public final void a() {
        if (this.f5481d != null) {
            this.f5481d = null;
        }
        ATBannerWebView aTBannerWebView = this.i;
        if (aTBannerWebView != null) {
            aTBannerWebView.setWebViewListener(null);
        }
        if (this.D != null) {
            this.D = null;
        }
        ImageView imageView = this.j;
        if (imageView != null) {
            imageView.setOnClickListener(null);
        }
        ImageView imageView2 = this.h;
        if (imageView2 != null) {
            imageView2.setOnClickListener(null);
        }
        TemplateBannerView templateBannerView = this.g;
        if (templateBannerView != null) {
            templateBannerView.removeAllViews();
        }
        ATBannerWebView aTBannerWebView2 = this.i;
        if (aTBannerWebView2 != null) {
            aTBannerWebView2.release();
        }
        com.anythink.expressad.mbbanner.a.a.c cVar = this.w;
        if (cVar != null) {
            cVar.a();
        }
        if (this.C != null) {
            this.C = null;
        }
        com.anythink.expressad.foundation.f.b.a().c(this.r);
    }

    public static void a(com.anythink.expressad.foundation.d.c cVar, Context context, String str) {
        if (cVar != null) {
            try {
                List<String> e = cVar.e();
                if (e == null || e.size() <= 0) {
                    return;
                }
                for (String str2 : e) {
                    com.anythink.expressad.a.a.a(context, cVar, str, str2, true);
                }
            } catch (Throwable th) {
                n.d(f5478c, th.getMessage());
            }
        }
    }

    public final void a(com.anythink.expressad.foundation.d.c cVar, boolean z, String str) {
        if (this.q) {
            if (this.f5479a == null) {
                this.f5479a = new com.anythink.expressad.a.a(m.a().e(), this.r);
            }
            this.f5479a.a(new p.e() {
                @Override
                public final void a(int i) {
                }

                @Override
                public final void a(com.anythink.expressad.foundation.d.c cVar2, String str2) {
                }

                @Override
                public final void a(com.anythink.expressad.out.j jVar) {
                }

                @Override
                public final void a(com.anythink.expressad.out.j jVar, String str2) {
                }

                @Override
                public final boolean a() {
                    return false;
                }

                @Override
                public final void b() {
                    if (c.this.f5481d != null) {
                        c.this.f5481d.a();
                    }
                }

                @Override
                public final void b(com.anythink.expressad.out.j jVar) {
                }

                @Override
                public final void b(com.anythink.expressad.out.j jVar, String str2) {
                }

                @Override
                public final void c(com.anythink.expressad.out.j jVar) {
                }

                @Override
                public final void d(com.anythink.expressad.out.j jVar) {
                }
            });
            cVar.l(this.r);
            if (!this.f.W()) {
                this.f.X();
            }
            com.anythink.expressad.mbbanner.a.c.c cVar2 = this.f5481d;
            if (cVar2 != null) {
                cVar2.a(cVar);
            }
            if (z) {
                TextUtils.isEmpty(str);
            }
        }
    }

    public final void a(int i, int i2, int i3, int i4) {
        if (i == i3 && i2 == i4) {
            return;
        }
        ATBannerWebView aTBannerWebView = this.i;
        n.d(com.anythink.expressad.mbbanner.a.a.a.f5422a, "fireOnBannerViewSizeChange");
        try {
            CallMraidJS.getInstance().fireSizeChangeEvent(aTBannerWebView, i, i2);
        } catch (Throwable th) {
            n.b(com.anythink.expressad.mbbanner.a.a.a.f5422a, "fireOnBannerViewSizeChange", th);
        }
    }

    public final void a(d dVar) {
        com.anythink.expressad.foundation.d.c cVar;
        boolean z = false;
        if (dVar != null) {
            ArrayList<com.anythink.expressad.foundation.d.c> arrayList = dVar.J;
            this.t = arrayList;
            if (arrayList != null && arrayList.size() > 0) {
                cVar = this.t.get(0);
                this.f = cVar;
                if (cVar != null) {
                    a(com.anythink.expressad.mbbanner.a.a.h);
                    return;
                }
                this.x.removeCallbacks(this.y);
                if (this.e && this.j == null) {
                    ImageView imageView = new ImageView(m.a().e());
                    this.j = imageView;
                    imageView.setBackgroundResource(h.a(m.a().e(), "anythink_banner_close", h.f5349c));
                    this.j.setVisibility(8);
                    this.j.setContentDescription("closeButton");
                }
                this.m = false;
                this.n = false;
                this.q = false;
                if (TextUtils.isEmpty(this.f.p())) {
                    TextUtils.isEmpty(this.f.o());
                }
                this.x.postDelayed(this.y, this.v);
                String a2 = a(this.f);
                if (!TextUtils.isEmpty(a2)) {
                    if (this.g != null) {
                        if (this.i == null) {
                            ATBannerWebView aTBannerWebView = new ATBannerWebView(m.a().e());
                            this.i = aTBannerWebView;
                            aTBannerWebView.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
                            this.i.setWebViewClient(new com.anythink.expressad.mbbanner.view.a(this.r, this.t, this.C));
                        }
                        ImageView imageView2 = this.h;
                        if (imageView2 != null) {
                            imageView2.setVisibility(8);
                        }
                        if (this.i.getVisibility() != 0) {
                            this.i.setVisibility(0);
                        }
                        if (this.i.getParent() == null) {
                            this.g.addView(this.i);
                            d(this.f.F());
                        }
                        l();
                        com.anythink.expressad.mbbanner.a.a.c cVar2 = new com.anythink.expressad.mbbanner.a.a.c(this.g.getContext(), this.s, this.r);
                        this.w = cVar2;
                        cVar2.a(this.t);
                        this.w.a(this.C);
                        this.w.a(this.u);
                        this.i.setWebViewListener(this.D);
                        this.i.setObject(this.w);
                        if (!a2.startsWith("file")) {
                            this.i.loadDataWithBaseURL(this.f.o(), a2, "text/html", com.anythink.expressad.foundation.g.a.bN, null);
                        } else {
                            this.i.loadUrl(a2);
                        }
                    } else {
                        a(com.anythink.expressad.mbbanner.a.a.i);
                    }
                    z = true;
                }
                if (z) {
                    return;
                }
                if (TextUtils.isEmpty(this.f.p())) {
                    TextUtils.isEmpty(this.f.o());
                }
                e();
                return;
            }
        }
        cVar = null;
        this.f = cVar;
        if (cVar != null) {
        }
    }
}