导航菜单

页面标题

页面副标题

CallApp v2.226 - b.java 源代码

正在查看: CallApp v2.226 应用的 b.java JAVA 源代码文件

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


package com.applovin.impl.adview;

import android.content.Context;
import android.net.Uri;
import android.view.MotionEvent;
import android.view.View;
import android.webkit.WebSettings;
import com.amazonaws.services.s3.util.Mimetypes;
import com.applovin.impl.a7;
import com.applovin.impl.a8;
import com.applovin.impl.d7;
import com.applovin.impl.f0;
import com.applovin.impl.h4;
import com.applovin.impl.i7;
import com.applovin.impl.k0;
import com.applovin.impl.l4;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.z6;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.WeakHashMap;

public class b extends f0 {

    private static final Set f8451j = Collections.newSetFromMap(new WeakHashMap());

    private static final Object f8452k = new Object();

    private final com.applovin.impl.sdk.n f8453c;

    private final com.applovin.impl.sdk.j f8454d;

    private com.applovin.impl.sdk.ad.b f8455e;

    private boolean f8456f;

    private boolean f8457g;

    private final List f8458h;

    private final Object f8459i;

    public b(c cVar, com.applovin.impl.sdk.j jVar, Context context) {
        super(context);
        this.f8458h = new ArrayList();
        this.f8459i = new Object();
        if (jVar == null) {
            throw new IllegalArgumentException("No sdk specified.");
        }
        this.f8454d = jVar;
        this.f8453c = jVar.I();
        Integer num = (Integer) jVar.a(l4.U5);
        if (num.intValue() > 0) {
            synchronized (f8452k) {
                Set set = f8451j;
                set.add(this);
                z6.a("AdWebView", set.size(), num.intValue(), jVar.A());
            }
        }
        setBackgroundColor(0);
        WebSettings settings = getSettings();
        settings.setSupportMultipleWindows(false);
        settings.setJavaScriptEnabled(true);
        setWebViewClient(cVar != null ? cVar : new h4());
        setWebChromeClient(new com.applovin.impl.r(cVar != null ? cVar.c() : null, jVar));
        setVerticalScrollBarEnabled(false);
        setHorizontalScrollBarEnabled(false);
        setScrollBarStyle(33554432);
        if (k0.i() && ((Boolean) jVar.a(l4.f9252q5)).booleanValue()) {
            setWebViewRenderProcessClient(new d(jVar).a());
        }
        setOnTouchListener(new q(0));
        setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public final boolean onLongClick(View view) {
                boolean a8;
                a8 = b.this.a(view);
                return a8;
            }
        });
    }

    public static boolean a(View view, MotionEvent motionEvent) {
        if (view.hasFocus()) {
            return false;
        }
        view.requestFocus();
        return false;
    }

    @Override
    public void computeScroll() {
    }

    @Override
    public void destroy() {
        this.f8456f = true;
        this.f8457g = false;
        super.destroy();
    }

    public com.applovin.impl.sdk.ad.b getCurrentAd() {
        return this.f8455e;
    }

    @Override
    public void onScrollChanged(int i8, int i9, int i10, int i11) {
    }

    @Override
    public void scrollTo(int i8, int i9) {
    }

    public void setAdHtmlLoaded(boolean z8) {
        this.f8457g = z8;
        if (z8 && ((Boolean) this.f8454d.a(l4.M5)).booleanValue()) {
            b();
        }
    }

    private void b() {
        synchronized (this.f8459i) {
            try {
                Iterator it = this.f8458h.iterator();
                while (it.hasNext()) {
                    a8.a(this, (String) it.next(), "AdWebView", this.f8454d);
                }
                this.f8458h.clear();
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    public boolean a(View view) {
        if (!com.applovin.impl.sdk.n.a()) {
            return true;
        }
        this.f8453c.a("AdWebView", "Received a LongClick event.");
        return true;
    }

    public void a(com.applovin.impl.sdk.ad.b bVar) {
        String str;
        if (!this.f8456f) {
            this.f8455e = bVar;
            try {
                applySettings(bVar);
                if (z6.a(bVar.getSize())) {
                    setVisibility(0);
                }
                if (bVar instanceof com.applovin.impl.sdk.ad.a) {
                    loadDataWithBaseURL(bVar.h(), ((com.applovin.impl.sdk.ad.a) bVar).f1(), Mimetypes.MIMETYPE_HTML, null, "");
                    if (com.applovin.impl.sdk.n.a()) {
                        this.f8453c.a("AdWebView", "AppLovinAd rendered");
                        return;
                    }
                    return;
                }
                if (bVar instanceof a7) {
                    a7 a7Var = (a7) bVar;
                    d7 f12 = a7Var.f1();
                    if (f12 != null) {
                        i7 e6 = f12.e();
                        Uri c6 = e6.c();
                        if (c6 != null) {
                            str = c6.toString();
                        } else {
                            str = "";
                        }
                        String b6 = e6.b();
                        String h12 = a7Var.h1();
                        if (!StringUtils.isValidString(str) && !StringUtils.isValidString(b6)) {
                            if (com.applovin.impl.sdk.n.a()) {
                                this.f8453c.b("AdWebView", "Unable to load companion ad. No resources provided.");
                                return;
                            }
                            return;
                        }
                        if (e6.d() == i7.a.STATIC) {
                            if (com.applovin.impl.sdk.n.a()) {
                                this.f8453c.a("AdWebView", "Rendering WebView for static VAST ad");
                            }
                            String a8 = a((String) this.f8454d.a(l4.f9187i4), str);
                            if (a7Var.w1() && a7Var.isOpenMeasurementEnabled() && a7Var.x1()) {
                                a8 = this.f8454d.W().a(a8);
                            }
                            loadDataWithBaseURL(bVar.h(), a8, Mimetypes.MIMETYPE_HTML, null, "");
                            return;
                        }
                        if (e6.d() == i7.a.HTML) {
                            if (StringUtils.isValidString(b6)) {
                                String a9 = a(h12, b6);
                                String str2 = StringUtils.isValidString(a9) ? a9 : b6;
                                if (com.applovin.impl.sdk.n.a()) {
                                    this.f8453c.a("AdWebView", "Rendering WebView for HTML VAST ad with resourceContents: " + str2);
                                }
                                loadDataWithBaseURL(bVar.h(), str2, Mimetypes.MIMETYPE_HTML, null, "");
                                return;
                            }
                            if (StringUtils.isValidString(str)) {
                                if (com.applovin.impl.sdk.n.a()) {
                                    this.f8453c.a("AdWebView", "Preparing to load HTML VAST ad resourceUri");
                                }
                                a(str, bVar.h(), h12, this.f8454d, a7Var);
                                return;
                            }
                            return;
                        }
                        String str3 = str;
                        if (e6.d() == i7.a.IFRAME) {
                            if (StringUtils.isValidString(str3)) {
                                if (com.applovin.impl.sdk.n.a()) {
                                    this.f8453c.a("AdWebView", "Preparing to load iFrame VAST ad resourceUri");
                                }
                                a(str3, bVar.h(), h12, this.f8454d, a7Var);
                                return;
                            } else {
                                if (StringUtils.isValidString(b6)) {
                                    String a10 = a(h12, b6);
                                    String str4 = StringUtils.isValidString(a10) ? a10 : b6;
                                    if (com.applovin.impl.sdk.n.a()) {
                                        this.f8453c.a("AdWebView", "Rendering WebView for iFrame VAST ad with resourceContents: " + str4);
                                    }
                                    loadDataWithBaseURL(bVar.h(), str4, Mimetypes.MIMETYPE_HTML, null, "");
                                    return;
                                }
                                return;
                            }
                        }
                        if (com.applovin.impl.sdk.n.a()) {
                            this.f8453c.b("AdWebView", "Failed to render VAST companion ad of invalid type");
                            return;
                        }
                        return;
                    }
                    if (com.applovin.impl.sdk.n.a()) {
                        this.f8453c.a("AdWebView", "No companion ad provided.");
                        return;
                    }
                    return;
                }
                return;
            } catch (Throwable th) {
                throw new RuntimeException("Unable to render AppLovin ad (" + (bVar != null ? String.valueOf(bVar.getAdIdNumber()) : "null") + ") - " + th);
            }
        }
        com.applovin.impl.sdk.n.h("AdWebView", "Ad can not be loaded in a destroyed webview");
    }

    public void a(String str) {
        if (((Boolean) this.f8454d.a(l4.M5)).booleanValue()) {
            if (this.f8457g) {
                a8.a(this, str, "AdWebView", this.f8454d);
                return;
            }
            synchronized (this.f8458h) {
                this.f8458h.add(str);
            }
            return;
        }
        a8.a(this, str, "AdWebView", this.f8454d);
    }

    private void a(String str, String str2, String str3, com.applovin.impl.sdk.j jVar, a7 a7Var) {
        String a8 = a(str3, str);
        if (StringUtils.isValidString(a8)) {
            if (com.applovin.impl.sdk.n.a()) {
                com.amazon.device.ads.l.y("Rendering webview for VAST ad with resourceContents : ", a8, this.f8453c, "AdWebView");
            }
            loadDataWithBaseURL(str2, a8, Mimetypes.MIMETYPE_HTML, null, "");
            return;
        }
        String a9 = a((String) jVar.a(l4.f9195j4), str);
        if (StringUtils.isValidString(a9)) {
            if (a7Var.w1() && a7Var.isOpenMeasurementEnabled()) {
                a9 = jVar.W().a(a9);
            }
            if (com.applovin.impl.sdk.n.a()) {
                com.amazon.device.ads.l.y("Rendering webview for VAST ad with resourceContents : ", a9, this.f8453c, "AdWebView");
            }
            loadDataWithBaseURL(str2, a9, Mimetypes.MIMETYPE_HTML, null, "");
            return;
        }
        if (com.applovin.impl.sdk.n.a()) {
            com.amazon.device.ads.l.y("Rendering webview for VAST ad with resourceURL : ", str, this.f8453c, "AdWebView");
        }
        loadUrl(str);
    }

    private String a(String str, String str2) {
        if (StringUtils.isValidString(str)) {
            return str.replace("{SOURCE}", str2);
        }
        return null;
    }
}