导航菜单

页面标题

页面副标题

Spermatid Pro v6.4.3 - c.java 源代码

正在查看: Spermatid Pro v6.4.3 应用的 c.java JAVA 源代码文件

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


package com.octopus.ad.internal.nativead;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Handler;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.VideoView;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatTextView;
import com.bytedance.sdk.openadsdk.downloadnew.core.TTDownloadField;
import com.octopus.ad.NativeAdResponse;
import com.octopus.ad.OnSensorListener;
import com.octopus.ad.R;
import com.octopus.ad.R$drawable;
import com.octopus.ad.internal.l;
import com.octopus.ad.internal.m;
import com.octopus.ad.internal.network.ServerResponse;
import com.octopus.ad.internal.t;
import com.octopus.ad.internal.utilities.ImageManager;
import com.octopus.ad.internal.utilities.JsonUtil;
import com.octopus.ad.internal.utilities.ViewUtil;
import com.octopus.ad.internal.view.AdViewImpl;
import com.octopus.ad.internal.view.i;
import com.octopus.ad.model.ComplianceInfo;
import com.octopus.ad.model.a;
import com.octopus.ad.model.c;
import com.octopus.ad.model.c$l;
import com.octopus.ad.model.c$p;
import com.octopus.ad.model.c$u;
import com.octopus.ad.model.d;
import com.octopus.ad.utils.b.g;
import com.octopus.ad.utils.h;
import com.octopus.ad.utils.k;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class c implements NativeAdResponse {
    private HashMap<String, Object> A;
    private ServerResponse.AdLogoInfo H;
    private ServerResponse.AdLogoInfo I;
    private ServerResponse J;

    private a f2474K;
    private Context L;
    private AppCompatTextView M;
    private c$u N;
    private k O;
    private View P;
    private VideoView Q;
    private WebView R;
    private ProgressBar S;
    private Handler T;
    private Runnable U;
    private a V;
    private String W;
    private boolean X;
    private boolean Y;
    private boolean Z;

    private NativeAdResponse.b f2475a;
    private boolean aa;

    private boolean f2476ab;

    private int f2477ac;

    private int f2478ad;

    private String f2479ae;

    private ViewGroup f2480af;
    private View ag;
    private List<View> ah;
    private List<View> ai;
    private NativeAdEventListener aj;
    private View.OnClickListener ak;
    private View.OnTouchListener al;
    private View.OnClickListener am;
    private t an;
    private ArrayList<com.octopus.ad.internal.k> ao;
    private List<? extends View> ap;
    private OnSensorListener aq;
    private c.b ar;
    private ComplianceInfo as;
    private String b;

    private String f2481c;
    private String d;

    private String f2482e;
    private Bitmap f;
    private Bitmap g;
    private String h;
    private String i;
    private double j;
    private String k;
    private int l;
    private int m;

    private boolean f2483n;

    private boolean f2484o;
    private boolean p;

    private boolean f2485q;

    private boolean f2487s;

    private boolean f2488t;

    private Boolean f2490w;
    private String z;

    private boolean f2486r = false;
    private int u = 0;

    private int f2489v = 0;

    private boolean f2491x = false;
    private boolean y = false;
    private boolean B = false;
    private final ArrayList<String> C = new ArrayList<>();
    private final ArrayList<String> D = new ArrayList<>();
    private final ArrayList<String> E = new ArrayList<>();
    private ArrayList<String> F = new ArrayList<>();
    private ArrayList<String> G = new ArrayList<>();

    public void addShakeView(final ViewGroup viewGroup, final int i, final float f) {
        if (viewGroup == null) {
            return;
        }
        viewGroup.post(new Runnable() {
            @Override
            public void run() {
                if (c.this.N == null || c.this.N.a() == 0) {
                    c.this.N = new c$u(1.5d, 0.0d, 0, "摇动或点击了解更多", 1, 0, 0);
                }
                c.this.a(viewGroup, i, f);
            }
        });
    }

    public void bindUnifiedView(ViewGroup viewGroup, List<View> list, NativeAdEventListener nativeAdEventListener) {
        bindUnifiedView(viewGroup, list, null, nativeAdEventListener);
    }

    public void bindView(ViewGroup viewGroup, NativeAdEventListener nativeAdEventListener) {
        this.aa = true;
        this.f2480af = viewGroup;
        this.aj = nativeAdEventListener;
        i();
    }

    public void destroy() {
        this.f2484o = true;
        this.B = true;
        k kVar = this.O;
        if (kVar != null) {
            kVar.a();
            this.O = null;
        }
        Handler handler = this.T;
        if (handler != null) {
            handler.removeCallbacksAndMessages(null);
            this.T = null;
        }
        t tVar = this.an;
        if (tVar != null) {
            tVar.c();
            this.an = null;
        }
        ServerResponse serverResponse = this.J;
        if (serverResponse != null) {
            serverResponse.ac();
            this.J = null;
        }
        Bitmap bitmap = this.g;
        if (bitmap != null) {
            bitmap.recycle();
            this.g = null;
        }
        Bitmap bitmap2 = this.f;
        if (bitmap2 != null) {
            bitmap2.recycle();
            this.f = null;
        }
        this.U = null;
        this.ag = null;
        this.ah = null;
        this.ai = null;
        this.f2480af = null;
        this.ao = null;
        this.aj = null;
    }

    public String getAdvertiser() {
        return this.z;
    }

    public View getBlurView(Context context) {
        return b(context);
    }

    public String getButtonText() {
        return TextUtils.isEmpty(this.i) ? "查看详情" : this.i;
    }

    public ComplianceInfo getComplianceInfo() {
        return this.as;
    }

    public View getComplianceView(Context context) {
        ComplianceInfo complianceInfo = this.as;
        if (complianceInfo != null) {
            return ViewUtil.createComplianceView(context, complianceInfo, 1.0f, true);
        }
        return null;
    }

    public String getDescription() {
        return this.f2481c;
    }

    public Bitmap getIcon() {
        return this.g;
    }

    public String getIconUrl() {
        return this.f2482e;
    }

    public Bitmap getImage() {
        return this.f;
    }

    public String getImageUrl() {
        return this.d;
    }

    public ArrayList<String> getImageUrls() {
        return this.C;
    }

    public int getInteractionType() {
        c.b bVar = this.ar;
        if (bVar != null) {
            return bVar.d();
        }
        return 4;
    }

    public String getLandingPageUrl() {
        return this.h;
    }

    @NonNull
    public Bitmap getLogo(@NonNull Context context) {
        return BitmapFactory.decodeResource(context.getResources(), R$drawable.oct_logo);
    }

    public ServerResponse.AdLogoInfo getLogoInfo() {
        return this.I;
    }

    public String getLogoUrl() {
        ServerResponse.AdLogoInfo adLogoInfo = this.I;
        if (adLogoInfo == null || adLogoInfo.getType() != ServerResponse.AdLogoInfo.TYPE_PIC) {
            return null;
        }
        return this.I.getAdurl();
    }

    public int getMaterialType() {
        return isVideo() ? 2 : 1;
    }

    public Map<String, Object> getMediaExtraInfo() {
        ServerResponse serverResponse = this.J;
        return serverResponse != null ? serverResponse.T() : Collections.emptyMap();
    }

    public NativeAdResponse.b getNativeAdType() {
        return this.f2475a;
    }

    public HashMap<String, Object> getNativeElements() {
        return this.A;
    }

    public List<? extends View> getNativeInfoListView() {
        return this.ap;
    }

    public View getNativeView() {
        return this.f2480af;
    }

    public NativeAdResponse.a getNetworkIdentifier() {
        return NativeAdResponse.a.a;
    }

    public int getPictureHeight() {
        ServerResponse serverResponse = this.J;
        if (serverResponse != null) {
            return serverResponse.j();
        }
        return 0;
    }

    public int getPictureWidth() {
        ServerResponse serverResponse = this.J;
        if (serverResponse != null) {
            return serverResponse.k();
        }
        return 0;
    }

    public int getPrice() {
        return this.l;
    }

    public double getStarRating() {
        return this.j;
    }

    public String getStore() {
        return this.k;
    }

    public ArrayList<String> getTextList() {
        return this.E;
    }

    @NonNull
    public Bitmap getTextLogo(@NonNull Context context) {
        return BitmapFactory.decodeResource(context.getResources(), R$drawable.oct_logo_text);
    }

    public ServerResponse.AdLogoInfo getTextLogoInfo() {
        return this.H;
    }

    public String getTextLogoUrl() {
        ServerResponse.AdLogoInfo adLogoInfo = this.H;
        if (adLogoInfo == null || adLogoInfo.getType() != ServerResponse.AdLogoInfo.TYPE_PIC) {
            return null;
        }
        return this.H.getAdurl();
    }

    public String getTitle() {
        return this.b;
    }

    public ArrayList<String> getVideoUrls() {
        return this.D;
    }

    public View getVideoView(Context context) {
        if (context == null || !isVideo() || getVideoUrls().isEmpty()) {
            return null;
        }
        if (this.Q == null) {
            this.Q = new VideoView(context);
            m();
        }
        return this.Q;
    }

    public boolean hasExpired() {
        return this.B;
    }

    public boolean isShakeAd() {
        return this.Z;
    }

    public boolean isVideo() {
        return this.Y;
    }

    public void setAdWidth(int i) {
        this.f2477ac = i;
    }

    public void setIcon(Bitmap bitmap) {
        this.g = bitmap;
    }

    public void setImage(Bitmap bitmap) {
        this.f = bitmap;
    }

    public void setNativeAdEventListener(NativeAdEventListener nativeAdEventListener) {
        if (this.L == null) {
            this.L = m.a().k();
        }
        this.aa = false;
        FrameLayout frameLayout = new FrameLayout(this.L);
        this.f2480af = frameLayout;
        frameLayout.setLayoutParams(new ViewGroup.LayoutParams(-1, -1));
        this.aj = nativeAdEventListener;
        ServerResponse serverResponse = this.J;
        if (serverResponse != null) {
            if (serverResponse.h() == l.g) {
                k();
            } else if (this.J.h() == l.b) {
                l();
            } else {
                i();
            }
        }
    }

    public void setNativeInfoListView(List<? extends View> list) {
        this.ap = list;
    }

    public void setOnSensorListener(OnSensorListener onSensorListener) {
        this.aq = onSensorListener;
    }

    public void unregisterViews() {
        View view = this.ag;
        if (view != null) {
            view.setOnClickListener(null);
        }
        List<View> list = this.ah;
        if (list != null && !list.isEmpty()) {
            for (View view2 : this.ah) {
                if (view2 != null) {
                    view2.setOnClickListener(null);
                }
            }
        }
        List<View> list2 = this.ai;
        if (list2 != null && !list2.isEmpty()) {
            for (View view3 : this.ai) {
                if (view3 != null) {
                    view3.setOnClickListener(null);
                }
            }
        }
        destroy();
    }

    public void f(boolean z) {
        NativeAdEventListener nativeAdEventListener;
        ServerResponse serverResponse;
        if (this.X) {
            return;
        }
        this.X = true;
        if (z && (serverResponse = this.J) != null) {
            z = serverResponse.M();
        }
        if (z && (nativeAdEventListener = this.aj) != null) {
            nativeAdEventListener.onADExposed();
        }
        if (this.V == null || !e().equals(this.V.a())) {
            return;
        }
        m.a().g.remove(this.V.b());
    }

    private void i() {
        if (this.f2480af == null) {
            NativeAdEventListener nativeAdEventListener = this.aj;
            if (nativeAdEventListener != null) {
                nativeAdEventListener.onAdRenderFailed(80101);
                return;
            }
            return;
        }
        o();
        int i = this.u;
        if (i == 1) {
            a(R.layout.oct_native_text_above_img, 1.4f);
            return;
        }
        if (i == 2) {
            a(R.layout.oct_native_text_below_img, 1.4f);
            return;
        }
        if (i == 3) {
            a(R.layout.oct_native_text_right_img, 4.74f);
        } else if (i != 4) {
            a(R.layout.oct_native_one_img, 1.78f);
        } else {
            a(R.layout.oct_native_text_left_img, 4.74f);
        }
    }

    private void j() {
        if (this.f2480af != null) {
            d();
            o();
        } else {
            NativeAdEventListener nativeAdEventListener = this.aj;
            if (nativeAdEventListener != null) {
                nativeAdEventListener.onAdRenderFailed(80101);
            }
        }
    }

    private void k() {
        if (this.f2480af == null) {
            NativeAdEventListener nativeAdEventListener = this.aj;
            if (nativeAdEventListener != null) {
                nativeAdEventListener.onAdRenderFailed(80101);
                return;
            }
            return;
        }
        o();
        View inflate = LayoutInflater.from(this.f2480af.getContext()).inflate(R.layout.oct_layout_draw, this.f2480af);
        this.f2477ac = ViewUtil.getScreenWidth(inflate.getContext());
        this.f2487s = false;
        a(inflate, 1.0f);
    }

    private void l() {
        if (this.f2480af != null) {
            o();
            a(isVideo() ? R.layout.oct_layout_banner_video : R.layout.oct_layout_banner, 6.4f);
        } else {
            NativeAdEventListener nativeAdEventListener = this.aj;
            if (nativeAdEventListener != null) {
                nativeAdEventListener.onAdRenderFailed(80101);
            }
        }
    }

    public void m() {
        if (this.Q == null) {
            return;
        }
        this.T = new Handler();
        this.U = new 13(this);
        this.Q.setOnCompletionListener(new 14(this));
        this.Q.setOnErrorListener(new 15(this));
        this.Q.setOnPreparedListener(new 16(this));
        this.Q.getHolder().addCallback(new 17(this));
        c();
    }

    public void n() {
        Handler handler = this.T;
        if (handler == null || this.U == null) {
            return;
        }
        handler.removeCallbacksAndMessages(null);
        this.T.postDelayed(this.U, 1000L);
    }

    private void o() {
        ServerResponse serverResponse;
        c.o I;
        if (this.f2480af == null || (serverResponse = this.J) == null || this.N != null || (I = serverResponse.I()) == null) {
            return;
        }
        c$u c2 = I.c();
        this.N = c2;
        if (c2 == null || c2.a() != 1) {
            return;
        }
        b(this.f2480af);
    }

    public d p() {
        int screenWidth;
        float f;
        int i;
        try {
            float f6 = 1.4f;
            if (!this.f2486r && !this.f2483n) {
                ViewGroup viewGroup = this.f2480af;
                screenWidth = 0;
                if (viewGroup != null) {
                    screenWidth = viewGroup.getWidth();
                    i = this.f2480af.getHeight();
                } else {
                    i = 0;
                }
                if (screenWidth == 0 || i == 0) {
                    screenWidth = ViewUtil.getScreenWidth(m.a().k());
                    f = screenWidth;
                    i = (int) (f / f6);
                }
                int a4 = h.a(screenWidth);
                int a6 = h.a(i);
                int a7 = h.a(TTDownloadField.CALL_DOWNLOAD_MODEL_SET_VERSION_NAME) + 50;
                d dVar = new d(1);
                float f7 = a4;
                dVar.a(f7);
                float f8 = a6;
                dVar.b(f8);
                dVar.a(String.valueOf(System.currentTimeMillis()));
                dVar.c(f7);
                dVar.d(f8);
                dVar.b(String.valueOf(System.currentTimeMillis() + a7));
                dVar.a(screenWidth);
                dVar.b(i);
                return dVar;
            }
            screenWidth = ViewUtil.getScreenWidth(m.a().k());
            f = screenWidth;
            int i7 = (int) (f / 1.4f);
            ServerResponse serverResponse = this.J;
            if (serverResponse != null) {
                if (serverResponse.h() == l.g) {
                    i = ViewUtil.getScreenHeight(m.a().k());
                    int a42 = h.a(screenWidth);
                    int a62 = h.a(i);
                    int a72 = h.a(TTDownloadField.CALL_DOWNLOAD_MODEL_SET_VERSION_NAME) + 50;
                    d dVar2 = new d(1);
                    float f72 = a42;
                    dVar2.a(f72);
                    float f82 = a62;
                    dVar2.b(f82);
                    dVar2.a(String.valueOf(System.currentTimeMillis()));
                    dVar2.c(f72);
                    dVar2.d(f82);
                    dVar2.b(String.valueOf(System.currentTimeMillis() + a72));
                    dVar2.a(screenWidth);
                    dVar2.b(i);
                    return dVar2;
                }
                if (this.J.h() == l.b) {
                    f6 = 6.4f;
                    i = (int) (f / f6);
                    int a422 = h.a(screenWidth);
                    int a622 = h.a(i);
                    int a722 = h.a(TTDownloadField.CALL_DOWNLOAD_MODEL_SET_VERSION_NAME) + 50;
                    d dVar22 = new d(1);
                    float f722 = a422;
                    dVar22.a(f722);
                    float f822 = a622;
                    dVar22.b(f822);
                    dVar22.a(String.valueOf(System.currentTimeMillis()));
                    dVar22.c(f722);
                    dVar22.d(f822);
                    dVar22.b(String.valueOf(System.currentTimeMillis() + a722));
                    dVar22.a(screenWidth);
                    dVar22.b(i);
                    return dVar22;
                }
            }
            i = i7;
            int a4222 = h.a(screenWidth);
            int a6222 = h.a(i);
            int a7222 = h.a(TTDownloadField.CALL_DOWNLOAD_MODEL_SET_VERSION_NAME) + 50;
            d dVar222 = new d(1);
            float f7222 = a4222;
            dVar222.a(f7222);
            float f8222 = a6222;
            dVar222.b(f8222);
            dVar222.a(String.valueOf(System.currentTimeMillis()));
            dVar222.c(f7222);
            dVar222.d(f8222);
            dVar222.b(String.valueOf(System.currentTimeMillis() + a7222));
            dVar222.a(screenWidth);
            dVar222.b(i);
            return dVar222;
        } catch (Exception e2) {
            g.a("OctopusAd", "An Exception Caught", e2);
            return null;
        }
    }

    public void q() {
        ArrayList<String> arrayList = this.F;
        if (arrayList == null) {
            return;
        }
        Iterator<String> it = arrayList.iterator();
        while (it.hasNext()) {
            String next = it.next();
            if (next.contains("?rv=1")) {
                ViewUtil.openLocalBrowser(next, 0);
            } else {
                if (next.contains("track=oct")) {
                    if (this.f2483n) {
                        next = next + "&opt=10";
                    } else if (this.f2486r) {
                        next = next + "&opt=1";
                    }
                }
                new com.octopus.ad.internal.h(next).execute();
            }
        }
    }

    private void r() {
        ServerResponse serverResponse = this.J;
        if (serverResponse != null) {
            this.f2491x = serverResponse.O();
        }
        s();
        t();
        u();
        List<View> list = this.ah;
        if (list == null || list.isEmpty()) {
            ViewGroup viewGroup = this.f2480af;
            if (viewGroup != null) {
                viewGroup.setOnClickListener(this.ak);
                this.f2480af.setOnTouchListener(this.al);
            }
        } else {
            for (View view : this.ah) {
                if (view != null) {
                    view.setOnClickListener(this.ak);
                    view.setOnTouchListener(this.al);
                }
            }
        }
        List<View> list2 = this.ai;
        if (list2 == null || list2.isEmpty()) {
            return;
        }
        for (View view2 : this.ai) {
            if (view2 != null) {
                view2.setOnClickListener(this.am);
            }
        }
    }

    private void s() {
        this.ak = new 9(this);
    }

    private void t() {
        this.al = new i(this.f2480af, this.f2491x, new 10(this));
    }

    private void u() {
        this.am = new 11(this);
    }

    public void bindUnifiedView(ViewGroup viewGroup, List<View> list, List<View> list2, NativeAdEventListener nativeAdEventListener) {
        this.aa = true;
        this.f2480af = viewGroup;
        this.aj = nativeAdEventListener;
        this.ah = list;
        this.ai = list2;
        j();
    }

    public String e() {
        if (this.W == null) {
            this.W = "";
        }
        return this.W;
    }

    public void g() {
        c.w J;
        c$p c2;
        ServerResponse serverResponse = this.J;
        if (serverResponse == null || (J = serverResponse.J()) == null || (c2 = J.c()) == null) {
            return;
        }
        if (c2.a() == 1) {
            d(true);
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    c.this.q();
                }
            }, c2.c());
            if (c2.b() == 1) {
                this.f2485q = true;
                new Handler().postDelayed(new 8(this), c2.d());
            }
        }
    }

    public boolean h() {
        return this.f2486r;
    }

    public void d() {
        r();
        a(new NativeAdShownListener() {
            public void onAdShown(boolean z) {
                c.this.f(z);
            }
        });
    }

    public View getComplianceView(Context context, int i) {
        if (this.as == null) {
            return null;
        }
        float screenWidthDp = ViewUtil.getScreenWidthDp(context);
        float f = 1.0f;
        if (screenWidthDp > 0.0f && i > 0) {
            float f6 = i;
            if (screenWidthDp > f6) {
                f = f6 / screenWidthDp;
            }
        }
        return ViewUtil.createComplianceView(context, this.as, f, true);
    }

    public void b(ServerResponse.AdLogoInfo adLogoInfo) {
        this.I = adLogoInfo;
    }

    public void c() {
        String str = getVideoUrls().get(0);
        if (this.Q == null || TextUtils.isEmpty(str)) {
            return;
        }
        try {
            com.octopus.ad.internal.a.h b = m.a().b();
            if (b != null) {
                String a4 = b.a(str);
                if (b.b(str)) {
                    this.Q.setVideoPath(a4);
                } else {
                    this.Q.setVideoPath(str);
                }
            } else {
                this.Q.setVideoPath(str);
            }
        } catch (Exception e2) {
            g.a("OctopusAd", "An Exception Caught", e2);
            NativeAdEventListener nativeAdEventListener = this.aj;
            if (nativeAdEventListener != null) {
                nativeAdEventListener.onAdRenderFailed(80202);
            }
        }
    }

    public String b() {
        ServerResponse serverResponse = this.J;
        return serverResponse != null ? serverResponse.c() : "";
    }

    public void d(boolean z) {
        this.f2483n = z;
    }

    public void e(String str) {
        this.G.add(str);
    }

    public void d(String str) {
        this.F.add(str);
    }

    public void e(boolean z) {
        ServerResponse serverResponse = this.J;
        if (serverResponse != null) {
            serverResponse.a(z);
        }
    }

    private void b(ViewGroup viewGroup) {
        if (viewGroup == null) {
            return;
        }
        if (this.O == null) {
            k kVar = new k(viewGroup.getContext());
            this.O = kVar;
            kVar.a(this.N);
            this.O.a(viewGroup);
            this.O.a((k.a) new 19(this));
        }
        this.O.b();
    }

    public void f() {
        ServerResponse serverResponse;
        c.w J;
        c$p c2;
        if (this.f2486r || (serverResponse = this.J) == null || (J = serverResponse.J()) == null || (c2 = J.c()) == null) {
            return;
        }
        if (c2.a() == 1) {
            c(true);
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    c.this.q();
                }
            }, c2.c());
            if (c2.b() == 1) {
                this.f2485q = true;
                new Handler().postDelayed(new 6(this), c2.d());
            }
        }
    }

    public void a(Context context) {
        this.L = context;
        if (context == null) {
            this.L = m.a().k();
        }
    }

    public void a(ServerResponse.AdLogoInfo adLogoInfo) {
        this.H = adLogoInfo;
    }

    public void b(boolean z) {
        this.Z = z;
    }

    private View b(Context context) {
        if (this.R == null) {
            this.R = new WebView(context);
            this.R.loadDataWithBaseURL(m.a().m(), "<!DOCTYPE html><html lang='en'>  <head>    <meta charset='UTF-8'>    <meta name='viewport' content='width=device-width, initial-scale=1.0'>    <style>      html, body { width: 100%; height: 100%; margin: 0; padding: 0 }      .material-wrap        { overflow: hidden; position: relative; height: 100%; background-repeat:          no-repeat; background-position: center center; background-size: cover }          .filter-shadow { content: ''; position: absolute; z-index: 2; top: -3%;          left: -3%; right: -3%; bottom: -3%; background: inherit; filter: blur(3px)        }      .material-wrap .black-shadow { position: absolute; z-index: 3; top:        0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, .05) }      .material-wrap      .material { position: absolute; z-index: 3; top: 0; left: 0; width: 100%;        height: 100%; background-repeat: no-repeat; background-position: center        center; background-size: contain }    </style>  </head>  <body>    <div class='material-wrap' style=\"background-image: url('__IMAGE_SRC_PATH__')\">      <div class='filter-shadow'>      </div>      <div class='black-shadow'>      </div>      <div class='material' style=\"background-image: url('__IMAGE_SRC_PATH__')\">      </div>    </div>  </body></html>".replace("__IMAGE_SRC_PATH__", ImageManager.with(context).load(getImageUrl()).getImagePath()), "text/html", "UTF-8", null);
        }
        return this.R;
    }

    public void a(int i) {
        this.m = i;
    }

    private void c(ViewGroup viewGroup) {
        View view;
        if (viewGroup == null || (view = this.P) == null) {
            return;
        }
        ViewUtil.removeChildFromParent(view);
        if (viewGroup instanceof RelativeLayout) {
            RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-2, -2);
            layoutParams.addRule(13, -1);
            viewGroup.addView(this.P, layoutParams);
            return;
        }
        viewGroup.addView(this.P);
    }

    public int a() {
        return this.m;
    }

    public static c a(JSONObject jSONObject) throws JSONException {
        if (jSONObject == null) {
            return null;
        }
        ArrayList<String> stringArrayList = JsonUtil.getStringArrayList(JsonUtil.getJSONArray(jSONObject, "ImpressionTrackers"));
        c cVar = new c();
        if (stringArrayList != null) {
            cVar.F = stringArrayList;
        }
        cVar.b = JsonUtil.getJSONString(jSONObject, "Headline");
        cVar.f2481c = JsonUtil.getJSONString(jSONObject, "Body");
        cVar.d = JsonUtil.getJSONString(jSONObject, "Image");
        cVar.u = JsonUtil.getJSONInt(jSONObject, "LayoutType");
        cVar.f2487s = JsonUtil.getJSONBoolean(jSONObject, "IsShowClose");
        JSONArray jSONArray = JsonUtil.getJSONArray(jSONObject, "Images");
        JSONArray jSONArray2 = JsonUtil.getJSONArray(jSONObject, "Videos");
        JSONArray jSONArray3 = JsonUtil.getJSONArray(jSONObject, "Texts");
        if (jSONArray != null) {
            for (int i = 0; i < jSONArray.length(); i++) {
                cVar.C.add((String) jSONArray.get(i));
            }
        }
        if (jSONArray2 != null) {
            for (int i7 = 0; i7 < jSONArray2.length(); i7++) {
                cVar.D.add((String) jSONArray2.get(i7));
            }
        }
        if (jSONArray3 != null) {
            for (int i8 = 0; i8 < jSONArray3.length(); i8++) {
                cVar.E.add((String) jSONArray3.get(i8));
            }
        }
        if (jSONObject.has("AppIcon")) {
            cVar.f2475a = NativeAdResponse.b.b;
            cVar.f2482e = JsonUtil.getJSONString(jSONObject, "AppIcon");
            cVar.i = JsonUtil.getJSONString(jSONObject, "Action");
            cVar.j = JsonUtil.getJSONDouble(jSONObject, "Star");
            cVar.k = JsonUtil.getJSONString(jSONObject, "Store");
            cVar.l = JsonUtil.getJSONInt(jSONObject, "Price");
        } else {
            cVar.f2475a = NativeAdResponse.b.a;
            cVar.f2482e = JsonUtil.getJSONString(jSONObject, "Logo");
            cVar.i = JsonUtil.getJSONString(jSONObject, "Action");
            cVar.z = JsonUtil.getJSONString(jSONObject, "Advertiser");
        }
        ArrayList<String> stringArrayList2 = JsonUtil.getStringArrayList(JsonUtil.getJSONArray(jSONObject, "ClickTrackers"));
        if (stringArrayList2 != null) {
            cVar.G = stringArrayList2;
        }
        cVar.A = JsonUtil.getStringObjectHashMap(JsonUtil.getJSONObject(jSONObject, "Custom"));
        return cVar;
    }

    public void b(String str) {
        this.W = str;
    }

    public void b(int i) {
        ServerResponse serverResponse = this.J;
        if (serverResponse != null) {
            serverResponse.a(i);
        }
    }

    public void c(boolean z) {
        this.f2486r = z;
    }

    public void c(String str) {
        this.h = str;
    }

    private void a(int i, float f) {
        ViewGroup viewGroup = this.f2480af;
        if (viewGroup != null) {
            View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(i, (ViewGroup) null);
            if (this.f2477ac > 0) {
                int i7 = this.f2477ac;
                this.f2480af.addView(inflate, new ViewGroup.LayoutParams(i7, (int) (i7 / f)));
            } else {
                this.f2480af.addView(inflate);
            }
            a(inflate, f);
            return;
        }
        NativeAdEventListener nativeAdEventListener = this.aj;
        if (nativeAdEventListener != null) {
            nativeAdEventListener.onAdRenderFailed(80101);
        }
    }

    private void a(View view, float f) {
        if (this.f2480af == null) {
            return;
        }
        FrameLayout frameLayout = (FrameLayout) view.findViewById(R.id.fl_container);
        ImageView imageView = (ImageView) view.findViewById(R.id.ad_image);
        WebView webView = (WebView) view.findViewById(R.id.ad_web_view);
        TextView textView = (TextView) view.findViewById(R.id.ad_feedback);
        FrameLayout frameLayout2 = (FrameLayout) view.findViewById(R.id.ad_compliance);
        ImageView imageView2 = (ImageView) view.findViewById(R.id.ad_logo);
        ImageView imageView3 = (ImageView) view.findViewById(R.id.ad_logo_text);
        ImageView imageView4 = (ImageView) view.findViewById(R.id.ad_close);
        TextView textView2 = (TextView) view.findViewById(R.id.ad_title);
        TextView textView3 = (TextView) view.findViewById(R.id.ad_action);
        this.Q = (VideoView) view.findViewById(R.id.ad_video);
        this.S = (ProgressBar) view.findViewById(R.id.ad_loading);
        if (!TextUtils.isEmpty(getTitle())) {
            textView2.setText(getTitle());
        }
        if (!TextUtils.isEmpty(getButtonText())) {
            textView3.setText(getButtonText());
        }
        if (!TextUtils.isEmpty(getLogoUrl()) && !"https://oc-adpict.oss-cn-shanghai.aliyuncs.com/static/img/octlogo.png".equals(getLogoUrl())) {
            ImageManager.with((Context) null).load(getLogoUrl()).into(imageView2);
        } else {
            imageView2.setImageResource(R$drawable.oct_logo);
        }
        if (!TextUtils.isEmpty(getTextLogoUrl()) && !"https://oc-adpict.oss-cn-shanghai.aliyuncs.com/static/img/remdad.png".equals(getTextLogoUrl())) {
            ImageManager.with((Context) null).load(getTextLogoUrl()).into(imageView3);
        } else {
            imageView3.setImageResource(R$drawable.oct_logo_text);
        }
        ArrayList arrayList = new ArrayList();
        this.ah = arrayList;
        arrayList.add(view);
        if (this.f2487s) {
            imageView4.setVisibility(0);
            ArrayList arrayList2 = new ArrayList();
            this.ai = arrayList2;
            arrayList2.add(imageView4);
        } else {
            imageView4.setVisibility(8);
        }
        this.f2480af.post(new 1(this, view, f, imageView2, imageView3, textView2, imageView4, textView3, textView, frameLayout, webView, imageView, frameLayout2));
    }

    public void a(FrameLayout frameLayout) {
        AppCompatTextView appCompatTextView;
        if (frameLayout == null || (appCompatTextView = this.M) == null) {
            return;
        }
        ViewUtil.removeChildFromParent(appCompatTextView);
        frameLayout.addView((View) this.M, (ViewGroup.LayoutParams) new FrameLayout.LayoutParams(-1, -2));
    }

    public void a(ViewGroup viewGroup) {
        c$u c_u;
        if (viewGroup == null || (c_u = this.N) == null || c_u.a() != 1) {
            return;
        }
        int i = this.u;
        if (i != 3 && i != 4) {
            addShakeView(viewGroup, 100, 10.0f);
        } else {
            addShakeView(viewGroup, TTDownloadField.CALL_DOWNLOAD_MODEL_SET_START_TOAST, 13.0f);
        }
    }

    public void a(ArrayList<View> arrayList, float f) {
        View next;
        if (arrayList == null || arrayList.isEmpty()) {
            return;
        }
        Iterator<View> it = arrayList.iterator();
        while (it.hasNext() && (next = it.next()) != null) {
            if (next instanceof TextView) {
                TextView textView = (TextView) next;
                textView.setTextSize(0, textView.getTextSize() * f);
            } else {
                next.post(new 12(this, next, f));
            }
        }
    }

    public void a(String str) {
        this.f2479ae = str;
    }

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

    public void a(ViewGroup viewGroup, int i, float f) {
        if (viewGroup != null) {
            try {
                c$u c_u = this.N;
                if (c_u == null) {
                    return;
                }
                if (TextUtils.isEmpty(c_u.e())) {
                    if (this.N.h() == 0) {
                        this.N.a("摇动或点击了解更多");
                    } else {
                        this.N.a("转动或点击了解更多");
                    }
                }
                if (this.O == null) {
                    b(viewGroup);
                }
                this.O.a("50%", "50%", i + "", i + "");
                if (this.J != null) {
                    this.P = this.O.a(this.f2480af, viewGroup, f, this.N.e(), this.J.h());
                }
                if (this.P != null) {
                    if (this.N.b() == 1) {
                        this.f2489v = 7;
                    }
                    if (this.N.g() == 1) {
                        c(viewGroup);
                    }
                }
            } catch (Exception e2) {
                g.a("OctopusAd", "An Exception Caught", e2);
            }
        }
    }

    public void a(d dVar) {
        if (this.X || this.f2483n || this.f2486r) {
            if (System.currentTimeMillis() - k.f2530a > 2000) {
                this.p = true;
                a aVar = this.f2474K;
                boolean z = aVar != null && aVar.g();
                NativeAdEventListener nativeAdEventListener = this.aj;
                if (nativeAdEventListener != null && z) {
                    Boolean bool = Boolean.TRUE;
                    Boolean bool2 = this.f2490w;
                    if (bool == bool2 || (Boolean.FALSE != bool2 && !this.f2485q && !this.f2491x && !this.y)) {
                        nativeAdEventListener.onAdClick();
                    }
                }
                ServerResponse serverResponse = this.J;
                if (serverResponse != null) {
                    serverResponse.a(this.L, this.f2489v, this.f2483n, this.f2486r, z, dVar);
                }
                k.f2530a = System.currentTimeMillis();
                return;
            }
            this.f2485q = false;
            this.f2489v = 0;
        }
    }

    private void a(NativeAdShownListener nativeAdShownListener) {
        if (this.B || this.f2480af == null) {
            return;
        }
        t tVar = this.an;
        if (tVar != null) {
            tVar.c();
        }
        Object tag = this.f2480af.getTag(55665918);
        if (tag instanceof t) {
            ((t) tag).c();
        }
        t a4 = t.a(this.f2480af);
        this.an = a4;
        this.f2480af.setTag(55665918, a4);
        if (this.an == null) {
            return;
        }
        if (this.f2474K != null) {
            com.octopus.ad.internal.g.a(this.f2480af, (NativeAdShownListener) null);
            this.ao = new ArrayList<>();
            Iterator<String> it = this.F.iterator();
            while (it.hasNext()) {
                String next = it.next();
                if (next.contains("?rv=1")) {
                    ViewUtil.openLocalBrowser(next, 0);
                } else {
                    if (next.contains("track=oct")) {
                        if (!this.f2474K.g()) {
                            next = next + "&opt=4";
                        } else {
                            ServerResponse serverResponse = this.J;
                            if (serverResponse != null && !serverResponse.M()) {
                                next = next + "&opt=11";
                            }
                        }
                    }
                    com.octopus.ad.internal.k a6 = com.octopus.ad.internal.k.a(e(), this.f2474K.c(), "imp", next, this.an, this.f2480af.getContext(), this.F);
                    if (a6 != null && next.contains("track=octimp")) {
                        a6.a(new 3(this, nativeAdShownListener));
                    }
                    if (a6 != null) {
                        this.ao.add(a6);
                    }
                }
            }
        } else {
            this.X = true;
        }
        this.ag = this.f2480af;
        ServerResponse serverResponse2 = this.J;
        if (serverResponse2 == null || this.f2488t) {
            return;
        }
        this.f2488t = true;
        AdViewImpl.a(serverResponse2, new 4(this));
        this.f2490w = this.J.N();
    }

    public void a(ServerResponse serverResponse) {
        this.J = serverResponse;
    }

    public void a(a aVar) {
        this.f2474K = aVar;
    }

    public void a(long j, long j2) {
        c$l f;
        if (this.J == null || !m.a().e() || (f = this.J.f()) == null || TextUtils.isEmpty(f.c())) {
            return;
        }
        m.a().d();
        if (f.b() == 1) {
            this.V = (a) m.a().g.get(f.c());
        }
        a aVar = this.V;
        if (aVar == null || !aVar.j() || this.V.g() < getPrice()) {
            a aVar2 = new a();
            this.V = aVar2;
            aVar2.a(getPrice());
            this.V.a(j);
            this.V.b(j2);
            this.V.a(e());
            this.V.b(f.a());
            this.V.b(f.c());
            this.V.c(f.d());
            this.V.a(this.J.Q());
            this.V.e(this.J.S());
            if (this.J.a() != null) {
                this.V.d(this.J.R());
                this.V.a(this.J.a().s());
            }
            m.a().g.put(f.c(), this.V);
        }
    }

    public void a(c.b bVar) {
        this.ar = bVar;
        if (bVar != null) {
            this.as = bVar.i();
        }
    }

    public void a(int i, String str, String str2) {
        ServerResponse serverResponse = this.J;
        if (serverResponse != null) {
            serverResponse.a(i, str, str2);
        }
    }
}