Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
package com.applovin.impl.adview;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.applovin.adview.AppLovinInterstitialAd;
import com.applovin.adview.AppLovinInterstitialAdDialog;
import com.applovin.sdk.AppLovinAd;
import com.applovin.sdk.AppLovinAdClickListener;
import com.applovin.sdk.AppLovinAdDisplayListener;
import com.applovin.sdk.AppLovinAdVideoPlaybackListener;
import com.applovin.sdk.AppLovinSdk;
/* loaded from: classes.dex */
public class AppLovinAppOpenAd {
private final AppLovinInterstitialAdDialog a;
public AppLovinAppOpenAd(@NonNull AppLovinSdk appLovinSdk) {
this.a = AppLovinInterstitialAd.create(appLovinSdk, com.applovin.impl.sdk.j.l());
}
public void setAdClickListener(@Nullable AppLovinAdClickListener appLovinAdClickListener) {
this.a.setAdClickListener(appLovinAdClickListener);
}
public void setAdDisplayListener(@Nullable AppLovinAdDisplayListener appLovinAdDisplayListener) {
this.a.setAdDisplayListener(appLovinAdDisplayListener);
}
public void setAdVideoPlaybackListener(@Nullable AppLovinAdVideoPlaybackListener appLovinAdVideoPlaybackListener) {
this.a.setAdVideoPlaybackListener(appLovinAdVideoPlaybackListener);
}
public void show(@NonNull AppLovinAd appLovinAd) {
this.a.showAndRender(appLovinAd);
}
@NonNull
public String toString() {
return "AppLovinAppOpenAd{}";
}
}

View File

@@ -0,0 +1,42 @@
package com.applovin.impl.adview;
import android.content.Context;
import com.applovin.adview.AppLovinIncentivizedInterstitial;
import com.applovin.sdk.AppLovinAd;
import com.applovin.sdk.AppLovinAdClickListener;
import com.applovin.sdk.AppLovinAdDisplayListener;
import com.applovin.sdk.AppLovinAdRewardListener;
import com.applovin.sdk.AppLovinAdVideoPlaybackListener;
import com.applovin.sdk.AppLovinSdk;
/* loaded from: classes.dex */
public class AppLovinRewardedInterstitialAd {
private final AppLovinIncentivizedInterstitial a;
private AppLovinAdDisplayListener b;
private AppLovinAdClickListener c;
private AppLovinAdVideoPlaybackListener d;
public AppLovinRewardedInterstitialAd(AppLovinSdk appLovinSdk) {
this.a = new AppLovinIncentivizedInterstitial(appLovinSdk);
}
public void setAdClickListener(AppLovinAdClickListener appLovinAdClickListener) {
this.c = appLovinAdClickListener;
}
public void setAdDisplayListener(AppLovinAdDisplayListener appLovinAdDisplayListener) {
this.b = appLovinAdDisplayListener;
}
public void setAdVideoPlaybackListener(AppLovinAdVideoPlaybackListener appLovinAdVideoPlaybackListener) {
this.d = appLovinAdVideoPlaybackListener;
}
public void show(AppLovinAd appLovinAd, Context context, AppLovinAdRewardListener appLovinAdRewardListener) {
this.a.show(appLovinAd, context, appLovinAdRewardListener, this.d, this.b, this.c);
}
public String toString() {
return "AppLovinRewardedInterstitialAd{}";
}
}

View File

@@ -0,0 +1,104 @@
package com.applovin.impl.adview;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Point;
import android.graphics.PointF;
import android.os.SystemClock;
import android.view.MotionEvent;
import android.view.View;
import com.applovin.impl.sj;
import com.applovin.impl.z3;
import com.applovin.sdk.AppLovinSdkUtils;
/* loaded from: classes.dex */
public class AppLovinTouchToClickListener implements View.OnTouchListener {
private final long a;
private final int b;
private final int c;
private final ClickRecognitionState d;
private long e;
private PointF f;
private boolean g;
private final Context h;
private final OnClickListener i;
public enum ClickRecognitionState {
DISABLED,
ACTION_DOWN,
ACTION_POINTER_UP,
ACTION_UP
}
public interface OnClickListener {
void onClick(View view, MotionEvent motionEvent);
}
private void a(View view, MotionEvent motionEvent) {
this.i.onClick(view, motionEvent);
this.g = true;
}
@Override // android.view.View.OnTouchListener
@SuppressLint({"ClickableViewAccessibility"})
public boolean onTouch(View view, MotionEvent motionEvent) {
int i;
int actionMasked = motionEvent.getActionMasked();
if (actionMasked != 0) {
if (actionMasked != 1) {
if (actionMasked == 6 && !this.g && this.d == ClickRecognitionState.ACTION_POINTER_UP) {
a(view, motionEvent);
}
} else if (!this.g && this.d == ClickRecognitionState.ACTION_UP) {
a(view, motionEvent);
} else if (this.d == ClickRecognitionState.DISABLED) {
long elapsedRealtime = SystemClock.elapsedRealtime() - this.e;
float a = a(this.f, new PointF(motionEvent.getX(), motionEvent.getY()));
if (!this.g) {
long j = this.a;
if ((j < 0 || elapsedRealtime < j) && ((i = this.b) < 0 || a < i)) {
a(view, motionEvent);
}
}
}
} else if (this.d != ClickRecognitionState.ACTION_DOWN) {
this.e = SystemClock.elapsedRealtime();
this.f = new PointF(motionEvent.getX(), motionEvent.getY());
this.g = false;
} else if (a(motionEvent)) {
a(view, motionEvent);
}
return true;
}
private float a(PointF pointF, PointF pointF2) {
float f = pointF.x - pointF2.x;
float f2 = pointF.y - pointF2.y;
return a((float) Math.sqrt((f * f) + (f2 * f2)));
}
private float a(float f) {
return f / this.h.getResources().getDisplayMetrics().density;
}
private boolean a(MotionEvent motionEvent) {
if (this.c <= 0) {
return true;
}
Point b = z3.b(this.h);
float rawX = motionEvent.getRawX();
float rawY = motionEvent.getRawY();
int i = this.c;
float f = i;
return rawX >= f && rawY >= f && rawX <= ((float) (b.x - i)) && rawY <= ((float) (b.y - i));
}
public AppLovinTouchToClickListener(com.applovin.impl.sdk.j jVar, sj sjVar, Context context, OnClickListener onClickListener) {
this.a = ((Long) jVar.a(sj.B0)).longValue();
this.b = ((Integer) jVar.a(sj.C0)).intValue();
this.c = AppLovinSdkUtils.dpToPx(context, ((Integer) jVar.a(sj.H0)).intValue());
this.d = ClickRecognitionState.values()[((Integer) jVar.a(sjVar)).intValue()];
this.h = context;
this.i = onClickListener;
}
}

View File

@@ -0,0 +1,17 @@
package com.applovin.impl.adview;
import android.content.Context;
import android.widget.VideoView;
/* loaded from: classes.dex */
public class AppLovinVideoView extends VideoView {
public AppLovinVideoView(Context context) {
super(context, null, 0);
}
public void setVideoSize(int i, int i2) {
getHolder().setFixedSize(i, i2);
requestLayout();
invalidate();
}
}

View File

@@ -0,0 +1,5 @@
package com.applovin.impl.adview;
/* loaded from: classes.dex */
public abstract /* synthetic */ class AppLovinWebViewBase$$ExternalSyntheticApiModelOutline0 {
}

View File

@@ -0,0 +1,105 @@
package com.applovin.impl.adview;
import android.content.Context;
import android.webkit.WebSettings;
import android.webkit.WebView;
import com.applovin.impl.z3;
import com.unity3d.ads.adplayer.AndroidWebViewClient;
/* loaded from: classes.dex */
public class AppLovinWebViewBase extends WebView {
public AppLovinWebViewBase(Context context) {
super(context);
}
public void applySettings(com.applovin.impl.sdk.ad.b bVar) {
Boolean m;
loadUrl(AndroidWebViewClient.BLANK_PAGE);
int u0 = bVar.u0();
if (u0 >= 0) {
setLayerType(u0, null);
}
if (z3.d()) {
getSettings().setMediaPlaybackRequiresUserGesture(bVar.G());
}
if (z3.e() && bVar.J0()) {
WebView.setWebContentsDebuggingEnabled(true);
}
m v0 = bVar.v0();
if (v0 != null) {
WebSettings settings = getSettings();
WebSettings.PluginState b = v0.b();
if (b != null) {
settings.setPluginState(b);
}
Boolean e = v0.e();
if (e != null) {
settings.setAllowFileAccess(e.booleanValue());
}
Boolean i = v0.i();
if (i != null) {
settings.setLoadWithOverviewMode(i.booleanValue());
}
Boolean q = v0.q();
if (q != null) {
settings.setUseWideViewPort(q.booleanValue());
}
Boolean d = v0.d();
if (d != null) {
settings.setAllowContentAccess(d.booleanValue());
}
Boolean p = v0.p();
if (p != null) {
settings.setBuiltInZoomControls(p.booleanValue());
}
Boolean h = v0.h();
if (h != null) {
settings.setDisplayZoomControls(h.booleanValue());
}
Boolean l = v0.l();
if (l != null) {
settings.setSaveFormData(l.booleanValue());
}
Boolean c = v0.c();
if (c != null) {
settings.setGeolocationEnabled(c.booleanValue());
}
Boolean j = v0.j();
if (j != null) {
settings.setNeedInitialFocus(j.booleanValue());
}
Boolean f = v0.f();
if (f != null) {
settings.setAllowFileAccessFromFileURLs(f.booleanValue());
}
Boolean g = v0.g();
if (g != null) {
settings.setAllowUniversalAccessFromFileURLs(g.booleanValue());
}
Boolean o = v0.o();
if (o != null) {
settings.setLoadsImagesAutomatically(o.booleanValue());
}
Boolean n = v0.n();
if (n != null) {
settings.setBlockNetworkImage(n.booleanValue());
}
if (z3.f()) {
Integer a = v0.a();
if (a != null) {
settings.setMixedContentMode(a.intValue());
}
if (z3.g()) {
Boolean k = v0.k();
if (k != null) {
settings.setOffscreenPreRaster(k.booleanValue());
}
if (!z3.l() || (m = v0.m()) == null) {
return;
}
settings.setAlgorithmicDarkeningAllowed(m.booleanValue());
}
}
}
}
}

View File

@@ -0,0 +1,969 @@
package com.applovin.impl.adview;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.RelativeLayout;
import androidx.browser.customtabs.CustomTabsSession;
import com.applovin.adview.AppLovinAdView;
import com.applovin.adview.AppLovinAdViewDisplayErrorCode;
import com.applovin.adview.AppLovinAdViewEventListener;
import com.applovin.adview.AppLovinFullscreenActivity;
import com.applovin.communicator.AppLovinCommunicator;
import com.applovin.communicator.AppLovinCommunicatorMessage;
import com.applovin.communicator.AppLovinCommunicatorSubscriber;
import com.applovin.impl.adview.k;
import com.applovin.impl.ca;
import com.applovin.impl.e0;
import com.applovin.impl.ea;
import com.applovin.impl.g0;
import com.applovin.impl.gc;
import com.applovin.impl.jn;
import com.applovin.impl.la;
import com.applovin.impl.mg;
import com.applovin.impl.og;
import com.applovin.impl.pi;
import com.applovin.impl.qb;
import com.applovin.impl.qc;
import com.applovin.impl.sdk.AppLovinAdServiceImpl;
import com.applovin.impl.sdk.ad.b;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.sj;
import com.applovin.impl.t6;
import com.applovin.impl.tm;
import com.applovin.impl.tr;
import com.applovin.impl.vb;
import com.applovin.impl.yp;
import com.applovin.impl.zq;
import com.applovin.sdk.AppLovinAd;
import com.applovin.sdk.AppLovinAdClickListener;
import com.applovin.sdk.AppLovinAdDisplayListener;
import com.applovin.sdk.AppLovinAdLoadListener;
import com.applovin.sdk.AppLovinAdSize;
import com.applovin.sdk.AppLovinSdk;
import com.applovin.sdk.AppLovinSdkUtils;
import com.iab.omid.library.applovin.adsession.FriendlyObstructionPurpose;
import com.tapjoy.TJAdUnitConstants;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
/* loaded from: classes.dex */
public class a implements AppLovinCommunicatorSubscriber {
private static final AtomicReference H = new AtomicReference();
private volatile AppLovinAdLoadListener C;
private volatile AppLovinAdDisplayListener D;
private volatile AppLovinAdViewEventListener E;
private volatile AppLovinAdClickListener F;
private Context a;
private ViewGroup b;
private com.applovin.impl.sdk.j c;
private AppLovinAdServiceImpl d;
private com.applovin.impl.sdk.n f;
private AppLovinCommunicator g;
private b h;
private AppLovinAdSize j;
private String k;
private CustomTabsSession l;
private com.applovin.impl.adview.c m;
private e n;
private com.applovin.impl.adview.b o;
private WebView p;
private k q;
private Runnable r;
private Runnable s;
private final Map i = Collections.synchronizedMap(new HashMap());
private volatile com.applovin.impl.sdk.ad.b t = null;
private volatile AppLovinAd u = null;
private f v = null;
private f w = null;
private final AtomicReference x = new AtomicReference();
private final AtomicBoolean y = new AtomicBoolean();
private volatile boolean z = false;
private volatile boolean A = false;
private volatile boolean B = false;
private volatile g0 G = null;
public interface b {
void a(a aVar);
}
public class c implements Runnable {
private c() {
}
@Override // java.lang.Runnable
public void run() {
if (a.this.o != null) {
a.this.o.setVisibility(8);
}
}
}
public class d implements Runnable {
/* renamed from: com.applovin.impl.adview.a$d$a, reason: collision with other inner class name */
public class C0015a implements k.a {
public C0015a() {
}
@Override // com.applovin.impl.adview.k.a
public void a() {
a.this.o.addView(a.this.q, new ViewGroup.LayoutParams(-1, -1));
}
@Override // com.applovin.impl.adview.k.a
public void onFailure() {
com.applovin.impl.sdk.n unused = a.this.f;
if (com.applovin.impl.sdk.n.a()) {
a.this.f.b("AppLovinAdView", "Watermark failed to render.");
}
}
}
private d() {
}
@Override // java.lang.Runnable
public void run() {
if (a.this.t != null) {
if (a.this.o == null) {
com.applovin.impl.sdk.n.h("AppLovinAdView", "Unable to render advertisement for ad #" + a.this.t.getAdIdNumber() + ". Please make sure you are not calling AppLovinAdView.destroy() prematurely.");
gc.a(a.this.E, a.this.t, (AppLovinAdView) null, AppLovinAdViewDisplayErrorCode.WEBVIEW_NOT_FOUND);
return;
}
a.this.w();
com.applovin.impl.sdk.n unused = a.this.f;
if (com.applovin.impl.sdk.n.a()) {
a.this.f.a("AppLovinAdView", "Rendering advertisement ad for #" + a.this.t.getAdIdNumber() + "...");
}
a.b(a.this.o, a.this.t.getSize());
if (a.this.q != null) {
zq.c(a.this.q);
a.this.q = null;
}
ea eaVar = new ea(a.this.i, a.this.c);
if (eaVar.c()) {
a.this.q = new k(eaVar, a.this.a);
a.this.q.a(new C0015a());
}
a.this.o.setAdHtmlLoaded(false);
a.this.o.a(a.this.t);
if (a.this.t.getSize() == AppLovinAdSize.INTERSTITIAL || a.this.A) {
return;
}
a.this.t.setHasShown(true);
}
}
}
public static class e implements AppLovinAdLoadListener {
private final a a;
public e(a aVar, com.applovin.impl.sdk.j jVar) {
if (aVar == null) {
throw new IllegalArgumentException("No view specified");
}
if (jVar == null) {
throw new IllegalArgumentException("No sdk specified");
}
this.a = aVar;
}
private a a() {
return this.a;
}
@Override // com.applovin.sdk.AppLovinAdLoadListener
public void adReceived(AppLovinAd appLovinAd) {
a a = a();
if (a != null) {
a.b(appLovinAd);
} else {
com.applovin.impl.sdk.n.h("AppLovinAdView", "Ad view has been garbage collected by the time an ad was received");
}
}
@Override // com.applovin.sdk.AppLovinAdLoadListener
public void failedToReceiveAd(int i) {
a a = a();
if (a != null) {
a.b(i);
}
}
}
private void G() {
com.applovin.impl.adview.b bVar;
if (this.f != null && com.applovin.impl.sdk.n.a() && com.applovin.impl.sdk.n.a()) {
this.f.a("AppLovinAdView", "Destroying...");
}
if (!((Boolean) this.c.a(sj.I1)).booleanValue() || (bVar = this.o) == null) {
tr.d(this.o);
} else {
tr.a(bVar);
f().a(this.o, new vb.b() { // from class: com.applovin.impl.adview.a$$ExternalSyntheticLambda1
@Override // com.applovin.impl.vb.b
public final void a(Object obj) {
tr.d((b) obj);
}
});
}
this.o = null;
tr.d(this.p);
this.p = null;
this.l = null;
this.C = null;
this.D = null;
this.F = null;
this.E = null;
this.A = true;
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ com.applovin.impl.adview.b o() {
return new com.applovin.impl.adview.b(this.c, this.a.getApplicationContext());
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void p() {
this.o.loadDataWithBaseURL("/", "<html></html>", "text/html", null, "");
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void q() {
com.applovin.impl.adview.b bVar;
d();
if (this.b == null || (bVar = this.o) == null || bVar.getParent() != null) {
return;
}
this.b.addView(this.o);
b(this.o, this.t.getSize());
if (this.t.isOpenMeasurementEnabled()) {
this.t.getAdEventTracker().a((View) this.o);
}
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void u() {
g().loadUrl("chrome://crash");
}
private void y() {
if (this.t.V0()) {
int a = this.c.n().a();
if (com.applovin.impl.sdk.f.a(a)) {
this.o.a("javascript:al_muteSwitchOn();");
} else if (a == 2) {
this.o.a("javascript:al_muteSwitchOff();");
}
}
}
public void A() {
if (com.applovin.impl.sdk.n.a()) {
this.f.a("AppLovinAdView", "AdView fully watched...");
}
b bVar = this.h;
if (bVar != null) {
bVar.a(this);
}
}
public void B() {
if (e0.a(this.o)) {
this.c.D().c(ca.r);
}
}
public void D() {
this.B = true;
}
public void E() {
this.B = false;
}
public void F() {
if (!this.z || this.A) {
return;
}
this.A = true;
}
public void a(AppLovinAdViewEventListener appLovinAdViewEventListener) {
this.E = appLovinAdViewEventListener;
}
public void a(b bVar) {
this.h = bVar;
}
public void a(g0 g0Var) {
this.G = g0Var;
}
public void a(AppLovinAdClickListener appLovinAdClickListener) {
this.F = appLovinAdClickListener;
}
public void a(AppLovinAdDisplayListener appLovinAdDisplayListener) {
this.D = appLovinAdDisplayListener;
}
public void a(AppLovinAdLoadListener appLovinAdLoadListener) {
this.C = appLovinAdLoadListener;
}
public AppLovinAdViewEventListener e() {
return this.E;
}
public com.applovin.impl.adview.b g() {
return this.o;
}
@Override // com.applovin.communicator.AppLovinCommunicatorEntity
public String getCommunicatorId() {
return a.class.getSimpleName();
}
public g0 h() {
return this.G;
}
public com.applovin.impl.sdk.ad.b i() {
return this.t;
}
public CustomTabsSession j() {
return this.l;
}
public AppLovinAdView k() {
return (AppLovinAdView) this.b;
}
public com.applovin.impl.sdk.j l() {
return this.c;
}
public AppLovinAdSize m() {
return this.j;
}
public String n() {
return this.k;
}
@Override // com.applovin.communicator.AppLovinCommunicatorSubscriber
public void onMessageReceived(AppLovinCommunicatorMessage appLovinCommunicatorMessage) {
if ("crash_applovin_ad_webview".equals(appLovinCommunicatorMessage.getTopic())) {
a(new Runnable() { // from class: com.applovin.impl.adview.a$$ExternalSyntheticLambda8
@Override // java.lang.Runnable
public final void run() {
a.this.u();
}
});
}
}
public void x() {
if ((this.a instanceof t6) && this.t != null && this.t.R() == b.EnumC0038b.DISMISS) {
((t6) this.a).dismiss();
}
}
/* JADX INFO: Access modifiers changed from: private */
public static void b(View view, AppLovinAdSize appLovinAdSize) {
if (view == null) {
return;
}
DisplayMetrics displayMetrics = view.getResources().getDisplayMetrics();
String label = appLovinAdSize.getLabel();
AppLovinAdSize appLovinAdSize2 = AppLovinAdSize.INTERSTITIAL;
int applyDimension = label.equals(appLovinAdSize2.getLabel()) ? -1 : appLovinAdSize.getWidth() == -1 ? displayMetrics.widthPixels : (int) TypedValue.applyDimension(1, appLovinAdSize.getWidth(), displayMetrics);
int applyDimension2 = appLovinAdSize.getLabel().equals(appLovinAdSize2.getLabel()) ? -1 : appLovinAdSize.getHeight() == -1 ? displayMetrics.heightPixels : (int) TypedValue.applyDimension(1, appLovinAdSize.getHeight(), displayMetrics);
ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
if (layoutParams == null) {
layoutParams = new RelativeLayout.LayoutParams(-2, -2);
}
layoutParams.width = applyDimension;
layoutParams.height = applyDimension2;
if (layoutParams instanceof RelativeLayout.LayoutParams) {
((RelativeLayout.LayoutParams) layoutParams).addRule(13);
}
view.setLayoutParams(layoutParams);
}
private void c() {
a(new Runnable() { // from class: com.applovin.impl.adview.a$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
a.this.s();
}
});
}
private void d() {
a(new Runnable() { // from class: com.applovin.impl.adview.a$$ExternalSyntheticLambda10
@Override // java.lang.Runnable
public final void run() {
a.this.t();
}
});
}
public static vb f() {
AtomicReference atomicReference = H;
Object obj = atomicReference.get();
if (obj == null) {
synchronized (atomicReference) {
try {
obj = atomicReference.get();
if (obj == null) {
obj = new vb.d();
atomicReference.set(obj);
}
} finally {
}
}
}
if (obj == atomicReference) {
obj = null;
}
return (vb) obj;
}
/* JADX INFO: Access modifiers changed from: private */
public void w() {
com.applovin.impl.sdk.ad.b bVar = this.t;
qc qcVar = new qc();
qcVar.a().a(bVar).a(k());
if (!yp.a(bVar.getSize())) {
qcVar.a().a("Fullscreen Ad Properties").b(bVar);
}
qcVar.a(this.c);
qcVar.a();
if (com.applovin.impl.sdk.n.a()) {
this.f.a("AppLovinAdView", qcVar.toString());
}
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void r() {
if (this.o != null && this.v != null) {
a();
}
G();
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void s() {
if (this.v != null) {
if (com.applovin.impl.sdk.n.a()) {
this.f.a("AppLovinAdView", "Detaching expanded ad: " + this.v.b());
}
this.w = this.v;
this.v = null;
a(this.j);
}
}
public void C() {
if (this.z) {
gc.b(this.D, this.t);
if (this.t != null && this.t.isOpenMeasurementEnabled() && yp.a(this.t.getSize())) {
this.t.getAdEventTracker().f();
}
if (this.o != null && this.v != null) {
if (com.applovin.impl.sdk.n.a()) {
this.f.a("AppLovinAdView", "onDetachedFromWindowCalled with expanded ad present");
}
c();
} else if (com.applovin.impl.sdk.n.a()) {
this.f.a("AppLovinAdView", "onDetachedFromWindowCalled without an expanded ad present");
}
}
}
public void H() {
if (this.z) {
AppLovinAd appLovinAd = (AppLovinAd) this.x.getAndSet(null);
if (appLovinAd != null) {
c(appLovinAd);
}
this.A = false;
}
}
public void c(AppLovinAd appLovinAd) {
a(appLovinAd, (String) null);
}
public void v() {
if (this.c != null && this.n != null && this.a != null && this.z) {
this.d.loadNextAd(this.k, this.j, this.n);
} else {
com.applovin.impl.sdk.n.i("AppLovinAdView", "Unable to load next ad: AppLovinAdView is not initialized.");
}
}
public void c(WebView webView) {
a(webView, (String) null);
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void t() {
com.applovin.impl.sdk.ad.a b2;
f fVar = this.w;
if (fVar == null && this.v == null) {
return;
}
if (fVar != null) {
b2 = fVar.b();
this.w.dismiss();
this.w = null;
} else {
b2 = this.v.b();
this.v.dismiss();
this.v = null;
}
gc.a(this.E, b2, (AppLovinAdView) this.b);
}
public void z() {
if (this.v == null && this.w == null) {
if (com.applovin.impl.sdk.n.a()) {
this.f.a("AppLovinAdView", "Ad: " + this.t + " closed.");
}
a(this.s);
gc.b(this.D, this.t);
this.t = null;
return;
}
a();
}
public void b() {
a(new Runnable() { // from class: com.applovin.impl.adview.a$$ExternalSyntheticLambda7
@Override // java.lang.Runnable
public final void run() {
a.this.r();
}
});
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void b(WebView webView) {
this.t.getAdEventTracker().c(webView);
k kVar = this.q;
if (kVar != null && kVar.a()) {
mg adEventTracker = this.t.getAdEventTracker();
k kVar2 = this.q;
adEventTracker.b(webView, Collections.singletonList(new og(kVar2, FriendlyObstructionPurpose.NOT_VISIBLE, kVar2.getIdentifier())));
} else {
this.t.getAdEventTracker().a((View) webView);
}
this.t.getAdEventTracker().h();
this.t.getAdEventTracker().g();
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void b(MotionEvent motionEvent) {
if (this.v == null && (this.t instanceof com.applovin.impl.sdk.ad.a) && this.o != null) {
com.applovin.impl.sdk.ad.a aVar = (com.applovin.impl.sdk.ad.a) this.t;
Context context = this.a;
Activity a = context instanceof Activity ? (Activity) context : zq.a(this.o, this.c);
if (a != null && !a.isFinishing()) {
ViewGroup viewGroup = this.b;
if (viewGroup != null) {
viewGroup.removeView(this.o);
}
f fVar = new f(aVar, this.o, a, this.c);
this.v = fVar;
fVar.setOnDismissListener(new DialogInterface.OnDismissListener() { // from class: com.applovin.impl.adview.a$$ExternalSyntheticLambda4
@Override // android.content.DialogInterface.OnDismissListener
public final void onDismiss(DialogInterface dialogInterface) {
a.this.a(dialogInterface);
}
});
this.v.show();
gc.c(this.E, this.t, (AppLovinAdView) this.b);
if (this.t.isOpenMeasurementEnabled()) {
this.t.getAdEventTracker().a((View) this.v.c());
return;
}
return;
}
com.applovin.impl.sdk.n.h("AppLovinAdView", "Unable to expand ad. No Activity found.");
Uri i = aVar.i();
if (i != null) {
this.d.trackAndLaunchClick(aVar, k(), this, i, motionEvent, this.B, null);
}
this.o.a("javascript:al_onFailedExpand();");
}
}
public void b(final AppLovinAd appLovinAd) {
if (appLovinAd != null) {
if (!this.A) {
c(appLovinAd);
} else {
this.x.set(appLovinAd);
if (com.applovin.impl.sdk.n.a()) {
this.f.a("AppLovinAdView", "Ad view has paused when an ad was received, ad saved for later");
}
}
a(new Runnable() { // from class: com.applovin.impl.adview.a$$ExternalSyntheticLambda3
@Override // java.lang.Runnable
public final void run() {
a.this.a(appLovinAd);
}
});
return;
}
if (com.applovin.impl.sdk.n.a()) {
this.f.b("AppLovinAdView", "No provided when to the view controller");
}
b(-1);
}
/* JADX INFO: Access modifiers changed from: private */
public void b(final int i) {
if (!this.A) {
a(this.s);
}
a(new Runnable() { // from class: com.applovin.impl.adview.a$$ExternalSyntheticLambda9
@Override // java.lang.Runnable
public final void run() {
a.this.a(i);
}
});
}
public void b(Uri uri) {
if (this.t != null && this.t.D0() && this.p == null) {
String queryParameter = uri.getQueryParameter("tracking_id");
if (TextUtils.isEmpty(queryParameter)) {
this.c.J();
if (com.applovin.impl.sdk.n.a()) {
this.c.J().b("AppLovinAdView", "Invalid tracking id. Cannot initialize GA");
return;
}
return;
}
WebView webView = new WebView(this.a);
this.p = webView;
webView.setWebViewClient(new pi());
this.p.getSettings().setJavaScriptEnabled(true);
this.p.loadDataWithBaseURL((String) this.c.a(sj.M6), "<html><head><link rel=\"icon\" href=\"data:,\"><G-SCRIPT_TAG></head><body></body></html>".replace("<G-SCRIPT_TAG>", "<script src='https://www.googletagmanager.com/gtag/js?id=<G-TRACKING_ID>'></script><script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', '<G-TRACKING_ID>')</script>".replace("<G-TRACKING_ID>", queryParameter)), "text/html", "UTF-8", null);
}
}
private void a(AppLovinAdView appLovinAdView, com.applovin.impl.sdk.j jVar, AppLovinAdSize appLovinAdSize, String str, Context context) {
if (appLovinAdView == null) {
throw new IllegalArgumentException("No parent view specified");
}
if (jVar == null) {
throw new IllegalArgumentException("No sdk specified");
}
if (appLovinAdSize != null) {
this.c = jVar;
this.d = jVar.i();
this.f = jVar.J();
this.g = AppLovinCommunicator.getInstance(context);
this.j = appLovinAdSize;
this.k = str;
if (!(context instanceof AppLovinFullscreenActivity)) {
context = context.getApplicationContext();
}
this.a = context;
this.b = appLovinAdView;
this.m = new com.applovin.impl.adview.c(this, jVar);
this.s = new c();
this.r = new d();
this.n = new e(this, jVar);
a(appLovinAdSize);
return;
}
throw new IllegalArgumentException("No ad size specified");
}
public void a(AppLovinAdSize appLovinAdSize) {
try {
if (((Boolean) this.c.a(sj.I1)).booleanValue()) {
this.o = (com.applovin.impl.adview.b) f().a(new vb.a() { // from class: com.applovin.impl.adview.a$$ExternalSyntheticLambda12
@Override // com.applovin.impl.vb.a
public final Object a() {
b o;
o = a.this.o();
return o;
}
});
} else {
this.o = new com.applovin.impl.adview.b(this.c, this.a);
}
this.o.a(this.m);
this.o.setBackgroundColor(0);
this.o.setWillNotCacheDrawing(false);
this.b.setBackgroundColor(0);
this.b.addView(this.o);
b(this.o, appLovinAdSize);
if (!this.z) {
a(this.s);
}
a(new Runnable() { // from class: com.applovin.impl.adview.a$$ExternalSyntheticLambda13
@Override // java.lang.Runnable
public final void run() {
a.this.p();
}
});
this.z = true;
} catch (Throwable th) {
com.applovin.impl.sdk.n.c("AppLovinAdView", "Failed to initialize AdWebView", th);
this.c.E().a("AppLovinAdView", "initAdWebView", th);
this.y.set(true);
}
}
public void a(AppLovinAdView appLovinAdView, Context context, AppLovinAdSize appLovinAdSize, String str, AppLovinSdk appLovinSdk, AttributeSet attributeSet) {
if (appLovinAdView == null) {
throw new IllegalArgumentException("No parent view specified");
}
if (context == null) {
com.applovin.impl.sdk.n.h("AppLovinAdView", "Unable to build AppLovinAdView: no context provided. Please use a different constructor for this view.");
return;
}
if (appLovinAdSize == null && (appLovinAdSize = e0.a(attributeSet)) == null) {
appLovinAdSize = AppLovinAdSize.BANNER;
}
AppLovinAdSize appLovinAdSize2 = appLovinAdSize;
if (appLovinSdk == null) {
appLovinSdk = AppLovinSdk.getInstance(context);
}
if (appLovinSdk != null) {
a(appLovinAdView, appLovinSdk.a(), appLovinAdSize2, str, context);
if (e0.b(attributeSet)) {
v();
}
}
}
public void a(String str, Object obj) {
this.i.put(str, obj);
}
public void a(AppLovinAd appLovinAd, String str) {
if (appLovinAd != null) {
yp.b(appLovinAd, this.c);
if (this.z) {
com.applovin.impl.sdk.ad.b bVar = (com.applovin.impl.sdk.ad.b) yp.a(appLovinAd, this.c);
if (bVar == null) {
com.applovin.impl.sdk.n.h("AppLovinAdView", "Unable to retrieve the loaded ad: " + appLovinAd);
gc.a(this.D, "Unable to retrieve the loaded ad");
return;
}
if (bVar == this.t) {
com.applovin.impl.sdk.n.h("AppLovinAdView", "Attempting to show ad again: " + bVar);
if (((Boolean) this.c.a(sj.a2)).booleanValue()) {
if (this.D instanceof qb) {
gc.a(this.D, "Attempting to show ad again");
return;
}
throw new IllegalStateException("Attempting to show ad again");
}
return;
}
if (com.applovin.impl.sdk.n.a()) {
this.f.a("AppLovinAdView", "Rendering ad #" + bVar.getAdIdNumber() + " (" + bVar.getSize() + ")");
}
gc.b(this.D, this.t);
if (this.t != null && this.t.isOpenMeasurementEnabled()) {
this.t.getAdEventTracker().f();
}
this.x.set(null);
this.u = null;
this.t = bVar;
if (this.t.B0()) {
this.l = this.c.x().a(this);
this.c.x().b(this.t.z(), this.l);
}
if (!this.A && yp.a(this.j)) {
this.c.i().trackImpression(bVar);
}
if (this.v != null) {
c();
}
a(this.r);
return;
}
com.applovin.impl.sdk.n.i("AppLovinAdView", "Unable to render ad: AppLovinAdView is not initialized.");
return;
}
throw new IllegalArgumentException("No ad specified");
}
public void a(final WebView webView, String str) {
if (this.t == null) {
return;
}
a(new Runnable() { // from class: com.applovin.impl.adview.a$$ExternalSyntheticLambda5
@Override // java.lang.Runnable
public final void run() {
webView.setVisibility(0);
}
});
if (!((Boolean) this.c.a(sj.q6)).booleanValue() || (str != null && str.startsWith(this.t.g()))) {
try {
if (this.t != this.u) {
this.u = this.t;
y();
this.o.setAdHtmlLoaded(true);
if (this.D != null) {
this.c.w().d(this.t);
this.c.E().a(la.k, this.t);
gc.a(this.D, this.t);
this.o.a("javascript:al_onAdViewRendered();");
}
if ((this.t instanceof com.applovin.impl.sdk.ad.a) && this.t.isOpenMeasurementEnabled()) {
this.c.j0().a(new jn(this.c, "StartOMSDK", new Runnable() { // from class: com.applovin.impl.adview.a$$ExternalSyntheticLambda6
@Override // java.lang.Runnable
public final void run() {
a.this.b(webView);
}
}), tm.b.OTHER, 500L);
}
}
} catch (Throwable th) {
com.applovin.impl.sdk.n.c("AppLovinAdView", "Exception while notifying ad display listener", th);
com.applovin.impl.sdk.j jVar = this.c;
if (jVar != null) {
jVar.E().a("AppLovinAdView", "onAdHtmlLoaded", th);
}
}
}
}
public void a(final MotionEvent motionEvent) {
a(new Runnable() { // from class: com.applovin.impl.adview.a$$ExternalSyntheticLambda11
@Override // java.lang.Runnable
public final void run() {
a.this.b(motionEvent);
}
});
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void a(DialogInterface dialogInterface) {
a();
}
public void a() {
a(new Runnable() { // from class: com.applovin.impl.adview.a$$ExternalSyntheticLambda2
@Override // java.lang.Runnable
public final void run() {
a.this.q();
}
});
}
public void a(com.applovin.impl.sdk.ad.b bVar, AppLovinAdView appLovinAdView, Uri uri, MotionEvent motionEvent, Bundle bundle) {
if (appLovinAdView != null) {
this.d.trackAndLaunchClick(bVar, appLovinAdView, this, uri, motionEvent, this.B, bundle);
} else if (com.applovin.impl.sdk.n.a()) {
this.f.b("AppLovinAdView", "Unable to process ad click - AppLovinAdView destroyed prematurely");
}
gc.a(this.F, bVar);
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void a(AppLovinAd appLovinAd) {
if (this.y.compareAndSet(true, false)) {
a(this.j);
}
try {
if (this.C != null) {
this.C.adReceived(appLovinAd);
}
} catch (Throwable th) {
com.applovin.impl.sdk.n.h("AppLovinAdView", "Exception while running ad load callback: " + th.getMessage());
com.applovin.impl.sdk.j jVar = this.c;
if (jVar != null) {
jVar.E().a("AppLovinAdView", "notifyAdLoaded", th);
}
}
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void a(int i) {
try {
if (this.C != null) {
this.C.failedToReceiveAd(i);
}
} catch (Throwable th) {
com.applovin.impl.sdk.n.c("AppLovinAdView", "Exception while running app load callback", th);
com.applovin.impl.sdk.j jVar = this.c;
if (jVar != null) {
jVar.E().a("AppLovinAdView", "notifyAdLoadFailed", th);
}
}
}
private void a(Runnable runnable) {
AppLovinSdkUtils.runOnUiThread(runnable);
}
public void a(Uri uri) {
if (this.t == null || !this.t.D0()) {
return;
}
if (this.p == null) {
this.c.J();
if (com.applovin.impl.sdk.n.a()) {
this.c.J().a("AppLovinAdView", "GA is not initialized. Cannot fire GA event");
return;
}
return;
}
final String queryParameter = uri.getQueryParameter(TJAdUnitConstants.PARAM_PLACEMENT_NAME);
final String queryParameter2 = uri.getQueryParameter("event_params_json");
if (TextUtils.isEmpty(queryParameter)) {
this.c.J();
if (com.applovin.impl.sdk.n.a()) {
this.c.J().a("AppLovinAdView", "Invalid GA event name. Cannot fire GA event");
return;
}
return;
}
a(new Runnable() { // from class: com.applovin.impl.adview.a$$ExternalSyntheticLambda14
@Override // java.lang.Runnable
public final void run() {
a.this.a(queryParameter2, queryParameter);
}
});
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void a(String str, String str2) {
String str3;
if (StringUtils.isValidString(str)) {
str3 = "gtag('event', '" + str2 + "', " + str + ");";
} else {
str3 = "gtag('event', '" + str2 + "')";
}
tr.a(this.p, str3);
}
}

View File

@@ -0,0 +1,103 @@
package com.applovin.impl.adview.activity;
import android.app.Service;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.Messenger;
import android.os.RemoteException;
import com.applovin.adview.AppLovinFullscreenActivity;
import com.applovin.impl.gc;
import com.applovin.impl.sdk.n;
import com.applovin.impl.tb;
import com.applovin.impl.yp;
/* loaded from: classes.dex */
public class FullscreenAdService extends Service {
public static final String DATA_KEY_RAW_FULL_AD_RESPONSE = "raw_full_ad_response";
private static final String TAG = "FullscreenAdService";
public static class b extends Handler {
private b() {
}
@Override // android.os.Handler
public void handleMessage(Message message) {
try {
tb tbVar = AppLovinFullscreenActivity.parentInterstitialWrapper;
if (tbVar == null) {
if (!yp.a(1.0d)) {
super.handleMessage(message);
return;
}
throw new RuntimeException("parentWrapper is null for " + message.what);
}
com.applovin.impl.sdk.ad.b f = tbVar.f();
int i = message.what;
c cVar = c.AD;
if (i == cVar.b()) {
Bundle bundle = new Bundle();
bundle.putString(FullscreenAdService.DATA_KEY_RAW_FULL_AD_RESPONSE, f.getRawFullResponse());
Message obtain = Message.obtain((Handler) null, cVar.b());
obtain.setData(bundle);
try {
message.replyTo.send(obtain);
return;
} catch (RemoteException e) {
n.c(FullscreenAdService.TAG, "Failed to respond to Fullscreen Activity in another process with ad", e);
return;
}
}
if (message.what == c.AD_DISPLAYED.b()) {
gc.a(tbVar.c(), f);
return;
}
if (message.what == c.AD_CLICKED.b()) {
gc.a(tbVar.b(), f);
return;
}
if (message.what == c.AD_VIDEO_STARTED.b()) {
gc.a(tbVar.d(), f);
return;
}
if (message.what == c.AD_VIDEO_ENDED.b()) {
Bundle data = message.getData();
gc.a(tbVar.d(), f, data.getDouble("percent_viewed"), data.getBoolean("fully_watched"));
return;
}
if (message.what == c.AD_HIDDEN.b()) {
gc.b(tbVar.c(), f);
} else {
super.handleMessage(message);
}
} catch (Throwable unused) {
}
}
}
public enum c {
AD(0),
AD_DISPLAYED(1),
AD_CLICKED(2),
AD_VIDEO_STARTED(3),
AD_VIDEO_ENDED(4),
AD_HIDDEN(5);
private final int a;
c(int i2) {
this.a = i2;
}
public int b() {
return this.a;
}
}
@Override // android.app.Service
public IBinder onBind(Intent intent) {
return new Messenger(new b()).getBinder();
}
}

View File

@@ -0,0 +1,236 @@
package com.applovin.impl.adview.activity;
import android.content.ComponentName;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.Messenger;
import android.os.RemoteException;
import android.text.TextUtils;
import com.applovin.adview.AppLovinFullscreenActivity;
import com.applovin.impl.adview.activity.FullscreenAdService;
import com.applovin.impl.h0;
import com.applovin.impl.p9;
import com.applovin.impl.sdk.j;
import com.applovin.impl.sdk.n;
import com.applovin.impl.sdk.utils.JsonUtils;
import com.applovin.impl.tb;
import com.applovin.impl.um;
import com.applovin.sdk.AppLovinAd;
import com.applovin.sdk.AppLovinAdClickListener;
import com.applovin.sdk.AppLovinAdDisplayListener;
import com.applovin.sdk.AppLovinAdLoadListener;
import com.applovin.sdk.AppLovinAdVideoPlaybackListener;
import java.lang.ref.WeakReference;
import java.util.concurrent.atomic.AtomicBoolean;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes.dex */
public class a implements ServiceConnection {
private final j a;
private final n b;
private final WeakReference c;
private final AtomicBoolean d = new AtomicBoolean();
private Messenger e;
public class b implements AppLovinAdDisplayListener, AppLovinAdClickListener, AppLovinAdVideoPlaybackListener {
private b() {
}
private void a(FullscreenAdService.c cVar) {
a(null, cVar);
}
@Override // com.applovin.sdk.AppLovinAdClickListener
public void adClicked(AppLovinAd appLovinAd) {
a(FullscreenAdService.c.AD_CLICKED);
}
@Override // com.applovin.sdk.AppLovinAdDisplayListener
public void adDisplayed(AppLovinAd appLovinAd) {
a(FullscreenAdService.c.AD_DISPLAYED);
}
@Override // com.applovin.sdk.AppLovinAdDisplayListener
public void adHidden(AppLovinAd appLovinAd) {
a(FullscreenAdService.c.AD_HIDDEN);
}
@Override // com.applovin.sdk.AppLovinAdVideoPlaybackListener
public void videoPlaybackBegan(AppLovinAd appLovinAd) {
a(FullscreenAdService.c.AD_VIDEO_STARTED);
}
@Override // com.applovin.sdk.AppLovinAdVideoPlaybackListener
public void videoPlaybackEnded(AppLovinAd appLovinAd, double d, boolean z) {
Bundle bundle = new Bundle();
bundle.putDouble("percent_viewed", d);
bundle.putBoolean("fully_watched", z);
a(bundle, FullscreenAdService.c.AD_VIDEO_ENDED);
}
public /* synthetic */ b(a aVar, C0016a c0016a) {
this();
}
private void a(Bundle bundle, FullscreenAdService.c cVar) {
Message obtain = Message.obtain((Handler) null, cVar.b());
if (bundle != null) {
obtain.setData(bundle);
}
try {
a.this.e.send(obtain);
} catch (RemoteException e) {
n unused = a.this.b;
if (n.a()) {
a.this.b.a("AppLovinFullscreenActivity", "Failed to forward callback (" + cVar.b() + ")", e);
}
}
}
}
public static class c extends Handler {
private final WeakReference a;
public /* synthetic */ c(a aVar, C0016a c0016a) {
this(aVar);
}
@Override // android.os.Handler
public void handleMessage(Message message) {
a aVar;
if (message.what != FullscreenAdService.c.AD.b() || (aVar = (a) this.a.get()) == null) {
super.handleMessage(message);
} else {
aVar.a(message.getData().getString(FullscreenAdService.DATA_KEY_RAW_FULL_AD_RESPONSE));
}
}
private c(a aVar) {
this.a = new WeakReference(aVar);
}
}
public a(AppLovinFullscreenActivity appLovinFullscreenActivity, j jVar) {
this.a = jVar;
this.b = jVar.J();
this.c = new WeakReference(appLovinFullscreenActivity);
}
@Override // android.content.ServiceConnection
public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
if (this.d.compareAndSet(false, true)) {
if (n.a()) {
this.b.a("AppLovinFullscreenActivity", "Fullscreen ad service connected to " + componentName);
}
this.e = new Messenger(iBinder);
Message obtain = Message.obtain((Handler) null, FullscreenAdService.c.AD.b());
obtain.replyTo = new Messenger(new c(this, null));
try {
if (n.a()) {
this.b.a("AppLovinFullscreenActivity", "Requesting ad from FullscreenAdService...");
}
this.e.send(obtain);
} catch (RemoteException e) {
if (n.a()) {
this.b.a("AppLovinFullscreenActivity", "Failed to send ad request message to FullscreenAdService", e);
}
a();
}
}
}
@Override // android.content.ServiceConnection
public void onServiceDisconnected(ComponentName componentName) {
if (this.d.compareAndSet(true, false) && n.a()) {
this.b.a("AppLovinFullscreenActivity", "FullscreenAdService disconnected from " + componentName);
}
}
/* JADX INFO: Access modifiers changed from: private */
public void a() {
AppLovinFullscreenActivity appLovinFullscreenActivity = (AppLovinFullscreenActivity) this.c.get();
if (appLovinFullscreenActivity != null) {
if (n.a()) {
this.b.a("AppLovinFullscreenActivity", "Dismissing...");
}
appLovinFullscreenActivity.dismiss();
} else if (n.a()) {
this.b.b("AppLovinFullscreenActivity", "Unable to dismiss parent Activity");
}
}
/* JADX INFO: Access modifiers changed from: private */
public void a(String str) {
try {
JSONObject jSONObject = new JSONObject(str);
String string = JsonUtils.getString(jSONObject, "zone_id", "");
if (!TextUtils.isEmpty(string)) {
this.a.j0().a(new um(jSONObject, h0.a(string), true, new C0016a(), this.a));
return;
}
throw new IllegalStateException("No zone identifier found in ad response: " + jSONObject);
} catch (JSONException e) {
if (n.a()) {
this.b.a("AppLovinFullscreenActivity", "Unable to process ad: " + str, e);
}
a();
}
}
/* renamed from: com.applovin.impl.adview.activity.a$a, reason: collision with other inner class name */
public class C0016a implements AppLovinAdLoadListener {
public C0016a() {
}
@Override // com.applovin.sdk.AppLovinAdLoadListener
public void adReceived(AppLovinAd appLovinAd) {
AppLovinFullscreenActivity appLovinFullscreenActivity = (AppLovinFullscreenActivity) a.this.c.get();
if (appLovinFullscreenActivity != null) {
n unused = a.this.b;
if (n.a()) {
a.this.b.a("AppLovinFullscreenActivity", "Presenting ad...");
}
b bVar = new b(a.this, null);
p9.a((com.applovin.impl.sdk.ad.b) appLovinAd, bVar, bVar, bVar, null, a.this.a, appLovinFullscreenActivity, new C0017a(appLovinFullscreenActivity, appLovinAd, bVar));
return;
}
n unused2 = a.this.b;
if (n.a()) {
a.this.b.b("AppLovinFullscreenActivity", "Unable to present ad, parent activity has been GC'd - " + appLovinAd);
}
}
@Override // com.applovin.sdk.AppLovinAdLoadListener
public void failedToReceiveAd(int i) {
a.this.a();
}
/* renamed from: com.applovin.impl.adview.activity.a$a$a, reason: collision with other inner class name */
public class C0017a implements p9.d {
final /* synthetic */ AppLovinFullscreenActivity a;
final /* synthetic */ AppLovinAd b;
final /* synthetic */ b c;
public C0017a(AppLovinFullscreenActivity appLovinFullscreenActivity, AppLovinAd appLovinAd, b bVar) {
this.a = appLovinFullscreenActivity;
this.b = appLovinAd;
this.c = bVar;
}
@Override // com.applovin.impl.p9.d
public void a(p9 p9Var) {
this.a.setPresenter(p9Var);
p9Var.y();
}
@Override // com.applovin.impl.p9.d
public void a(String str, Throwable th) {
tb.a((com.applovin.impl.sdk.ad.b) this.b, this.c, str, th, this.a);
}
}
}
}

View File

@@ -0,0 +1,295 @@
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.applovin.impl.aq;
import com.applovin.impl.dq;
import com.applovin.impl.f0;
import com.applovin.impl.iq;
import com.applovin.impl.j3;
import com.applovin.impl.pi;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.sj;
import com.applovin.impl.tr;
import com.applovin.impl.yp;
import com.applovin.impl.z3;
import com.unity3d.ads.adplayer.AndroidWebViewClient;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/* loaded from: classes.dex */
public class b extends j3 {
private final com.applovin.impl.sdk.n c;
private final com.applovin.impl.sdk.j d;
private com.applovin.impl.sdk.ad.b f;
private boolean g;
private boolean h;
private final List i;
private final Object j;
public b(com.applovin.impl.sdk.j jVar, Context context) {
super(context);
this.i = new ArrayList();
this.j = new Object();
if (jVar == null) {
throw new IllegalArgumentException("No sdk specified.");
}
this.d = jVar;
this.c = jVar.J();
setBackgroundColor(0);
WebSettings settings = getSettings();
settings.setSupportMultipleWindows(false);
settings.setJavaScriptEnabled(true);
setVerticalScrollBarEnabled(false);
setHorizontalScrollBarEnabled(false);
setScrollBarStyle(33554432);
if (z3.k() && ((Boolean) jVar.a(sj.W5)).booleanValue()) {
setWebViewRenderProcessClient(new d(jVar).a());
}
setOnTouchListener(new View.OnTouchListener() { // from class: com.applovin.impl.adview.b$$ExternalSyntheticLambda0
@Override // android.view.View.OnTouchListener
public final boolean onTouch(View view, MotionEvent motionEvent) {
boolean a;
a = b.a(view, motionEvent);
return a;
}
});
setOnLongClickListener(new View.OnLongClickListener() { // from class: com.applovin.impl.adview.b$$ExternalSyntheticLambda1
@Override // android.view.View.OnLongClickListener
public final boolean onLongClick(View view) {
boolean a;
a = b.this.a(view);
return a;
}
});
}
private void b() {
synchronized (this.j) {
try {
Iterator it = this.i.iterator();
while (it.hasNext()) {
tr.a(this, (String) it.next(), "AdWebView", this.d);
}
this.i.clear();
} catch (Throwable th) {
throw th;
}
}
}
@Override // android.webkit.WebView, android.view.View
public void computeScroll() {
}
public com.applovin.impl.sdk.ad.b getCurrentAd() {
return this.f;
}
@Override // android.webkit.WebView, android.view.View
public void onScrollChanged(int i, int i2, int i3, int i4) {
}
@Override // android.view.View
public void scrollTo(int i, int i2) {
}
@Override // android.webkit.WebView
public void destroy() {
this.g = true;
this.h = false;
super.destroy();
}
public void setAdHtmlLoaded(boolean z) {
this.h = z;
if (z && ((Boolean) this.d.a(sj.q6)).booleanValue()) {
b();
}
}
private void a(String str, String str2, String str3, com.applovin.impl.sdk.j jVar, aq aqVar) {
String a = a(str3, str);
if (StringUtils.isValidString(a)) {
if (com.applovin.impl.sdk.n.a()) {
this.c.a("AdWebView", "Rendering webview for VAST ad with resourceContents : " + a);
}
loadDataWithBaseURL(str2, a, "text/html", null, "");
return;
}
String a2 = a((String) jVar.a(sj.S4), str);
if (StringUtils.isValidString(a2)) {
if (aqVar.B1() && aqVar.isOpenMeasurementEnabled()) {
a2 = jVar.W().a(a2);
}
String str4 = a2;
if (com.applovin.impl.sdk.n.a()) {
this.c.a("AdWebView", "Rendering webview for VAST ad with resourceContents : " + str4);
}
loadDataWithBaseURL(str2, str4, "text/html", null, "");
return;
}
if (com.applovin.impl.sdk.n.a()) {
this.c.a("AdWebView", "Rendering webview for VAST ad with resourceURL : " + str);
}
loadUrl(str);
}
/* JADX INFO: Access modifiers changed from: private */
public static /* synthetic */ boolean a(View view, MotionEvent motionEvent) {
if (view.hasFocus()) {
return false;
}
view.requestFocus();
return false;
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ boolean a(View view) {
if (!com.applovin.impl.sdk.n.a()) {
return true;
}
this.c.a("AdWebView", "Received a LongClick event.");
return true;
}
public void a(c cVar) {
if (((Boolean) this.d.a(sj.H1)).booleanValue()) {
loadUrl(AndroidWebViewClient.BLANK_PAGE);
clearView();
}
setWebViewClient(cVar != null ? cVar : new pi());
setWebChromeClient(new f0(cVar != null ? cVar.c() : null, this.d));
synchronized (this.i) {
this.i.clear();
}
onResume();
}
public void a(com.applovin.impl.sdk.ad.b bVar) {
if (!this.g) {
this.f = bVar;
try {
applySettings(bVar);
if (yp.a(bVar.getSize())) {
setVisibility(0);
}
if (bVar instanceof com.applovin.impl.sdk.ad.a) {
loadDataWithBaseURL(bVar.g(), ((com.applovin.impl.sdk.ad.a) bVar).j1(), "text/html", null, "");
if (com.applovin.impl.sdk.n.a()) {
this.c.a("AdWebView", "AppLovinAd rendered");
return;
}
return;
}
if (bVar instanceof aq) {
aq aqVar = (aq) bVar;
dq j1 = aqVar.j1();
if (j1 != null) {
iq d = j1.d();
Uri b = d.b();
String uri = b != null ? b.toString() : "";
String a = d.a();
String l1 = aqVar.l1();
if (!StringUtils.isValidString(uri) && !StringUtils.isValidString(a)) {
if (com.applovin.impl.sdk.n.a()) {
this.c.b("AdWebView", "Unable to load companion ad. No resources provided.");
return;
}
return;
}
if (d.c() == iq.a.STATIC) {
if (com.applovin.impl.sdk.n.a()) {
this.c.a("AdWebView", "Rendering WebView for static VAST ad");
}
String a2 = a((String) this.d.a(sj.R4), uri);
if (aqVar.B1() && aqVar.isOpenMeasurementEnabled() && aqVar.C1()) {
a2 = this.d.W().a(a2);
}
loadDataWithBaseURL(bVar.g(), a2, "text/html", null, "");
return;
}
if (d.c() == iq.a.HTML) {
if (StringUtils.isValidString(a)) {
String a3 = a(l1, a);
String str = StringUtils.isValidString(a3) ? a3 : a;
if (com.applovin.impl.sdk.n.a()) {
this.c.a("AdWebView", "Rendering WebView for HTML VAST ad with resourceContents: " + str);
}
loadDataWithBaseURL(bVar.g(), str, "text/html", null, "");
return;
}
if (StringUtils.isValidString(uri)) {
if (com.applovin.impl.sdk.n.a()) {
this.c.a("AdWebView", "Preparing to load HTML VAST ad resourceUri");
}
a(uri, bVar.g(), l1, this.d, aqVar);
return;
}
return;
}
if (d.c() == iq.a.IFRAME) {
if (StringUtils.isValidString(uri)) {
if (com.applovin.impl.sdk.n.a()) {
this.c.a("AdWebView", "Preparing to load iFrame VAST ad resourceUri");
}
a(uri, bVar.g(), l1, this.d, aqVar);
return;
} else {
if (StringUtils.isValidString(a)) {
String a4 = a(l1, a);
String str2 = StringUtils.isValidString(a4) ? a4 : a;
if (com.applovin.impl.sdk.n.a()) {
this.c.a("AdWebView", "Rendering WebView for iFrame VAST ad with resourceContents: " + str2);
}
loadDataWithBaseURL(bVar.g(), str2, "text/html", null, "");
return;
}
return;
}
}
if (com.applovin.impl.sdk.n.a()) {
this.c.b("AdWebView", "Failed to render VAST companion ad of invalid type");
return;
}
return;
}
if (com.applovin.impl.sdk.n.a()) {
this.c.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.d.a(sj.q6)).booleanValue()) {
tr.a(this, str, "AdWebView", this.d);
} else {
if (this.h) {
tr.a(this, str, "AdWebView", this.d);
return;
}
synchronized (this.i) {
this.i.add(str);
}
}
}
private String a(String str, String str2) {
if (StringUtils.isValidString(str)) {
return str.replace("{SOURCE}", str2);
}
return null;
}
}

View File

@@ -0,0 +1,402 @@
package com.applovin.impl.adview;
import android.content.Intent;
import android.net.Uri;
import android.net.http.SslError;
import android.os.Bundle;
import android.view.MotionEvent;
import android.webkit.RenderProcessGoneDetail;
import android.webkit.SslErrorHandler;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import com.applovin.adview.AppLovinAdView;
import com.applovin.impl.aq;
import com.applovin.impl.dq;
import com.applovin.impl.la;
import com.applovin.impl.ma;
import com.applovin.impl.mq;
import com.applovin.impl.pi;
import com.applovin.impl.sdk.AppLovinBroadcastManager;
import com.applovin.impl.sdk.utils.CollectionUtils;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.sj;
import com.applovin.impl.tp;
import com.applovin.impl.yp;
import com.applovin.impl.z3;
import com.applovin.sdk.AppLovinAdSize;
import com.facebook.share.internal.ShareConstants;
import com.google.android.gms.measurement.AppMeasurement;
import com.ironsource.mediationsdk.utils.IronSourceConstants;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/* loaded from: classes.dex */
public class c extends pi {
private final com.applovin.impl.sdk.j a;
private final com.applovin.impl.sdk.n b;
private final a c;
public c(a aVar, com.applovin.impl.sdk.j jVar) {
this.a = jVar;
this.b = jVar.J();
this.c = aVar;
}
private void b() {
this.c.a();
}
public a c() {
return this.c;
}
@Override // android.webkit.WebViewClient
public void onLoadResource(WebView webView, String str) {
super.onLoadResource(webView, str);
if (com.applovin.impl.sdk.n.a()) {
this.b.d("AdWebView", "Loaded resource: " + str);
}
}
@Override // android.webkit.WebViewClient
public void onPageFinished(WebView webView, String str) {
super.onPageFinished(webView, str);
if (com.applovin.impl.sdk.n.a()) {
this.b.d("AdWebView", "Loaded URL: " + str);
}
a aVar = this.c;
if (aVar != null) {
aVar.a(webView, str);
}
}
@Override // android.webkit.WebViewClient
public void onReceivedError(WebView webView, WebResourceRequest webResourceRequest, WebResourceError webResourceError) {
super.onReceivedError(webView, webResourceRequest, webResourceError);
onReceivedError(webView, webResourceError.getErrorCode(), webResourceError.getDescription().toString(), webResourceRequest.getUrl().toString());
}
@Override // android.webkit.WebViewClient
public void onReceivedHttpError(WebView webView, WebResourceRequest webResourceRequest, WebResourceResponse webResourceResponse) {
super.onReceivedHttpError(webView, webResourceRequest, webResourceResponse);
a aVar = this.c;
if (aVar != null) {
com.applovin.impl.sdk.ad.b i = aVar.i();
if (com.applovin.impl.sdk.n.a()) {
this.b.b("AdWebView", "Received HTTP error: " + webResourceResponse + "for url: " + webResourceRequest.getUrl() + " and ad: " + i);
}
}
if (yp.a(webResourceRequest.getUrl().toString(), this.a)) {
this.a.E().a("adWebViewReceivedHttpError", webResourceRequest.getUrl().toString(), webResourceResponse.getStatusCode());
}
}
@Override // android.webkit.WebViewClient
public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
super.onReceivedSslError(webView, sslErrorHandler, sslError);
a aVar = this.c;
if (aVar != null) {
com.applovin.impl.sdk.ad.b i = aVar.i();
String str = "Received SSL error: " + sslError;
if (com.applovin.impl.sdk.n.a()) {
this.b.b("AdWebView", str + " for ad: " + i);
}
}
}
@Override // com.applovin.impl.pi, android.webkit.WebViewClient
public boolean onRenderProcessGone(WebView webView, RenderProcessGoneDetail renderProcessGoneDetail) {
AppLovinBroadcastManager.sendBroadcast(new Intent("com.applovin.render_process_gone"), null);
if (this.c == null) {
return true;
}
com.applovin.impl.sdk.n.h("AdWebView", "Render process gone for ad: " + this.c.i() + ". Process did crash: " + renderProcessGoneDetail.didCrash());
com.applovin.impl.sdk.ad.b i = this.c.i();
if (i != null) {
Map a = ma.a(i);
CollectionUtils.putStringIfValid("top_main_method", "onRenderProcessGone", a);
if (z3.i()) {
a.put(ShareConstants.FEED_SOURCE_PARAM, renderProcessGoneDetail.didCrash() ? AppMeasurement.CRASH_ORIGIN : "non_crash");
}
this.a.E().a(la.U, a);
}
if (((Boolean) this.a.a(sj.S5)).booleanValue()) {
if (renderProcessGoneDetail.didCrash() && ((Boolean) this.a.a(sj.V5)).booleanValue()) {
throw new RuntimeException("Render process crashed. This is likely caused by a crash in an AppLovin ad with ID: " + (i != null ? String.valueOf(i.getAdIdNumber()) : "null"));
}
if (webView != null && webView.equals(this.c.g())) {
this.c.b();
AppLovinAdSize m = this.c.m();
if (yp.a(m)) {
this.c.a(m);
this.c.H();
}
}
}
return super.onRenderProcessGone(webView, renderProcessGoneDetail);
}
@Override // android.webkit.WebViewClient
public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
Uri url = webResourceRequest.getUrl();
if (url != null) {
return a(webView, url.toString());
}
if (!com.applovin.impl.sdk.n.a()) {
return false;
}
this.b.b("AdWebView", "No url found for request");
return false;
}
@Override // android.webkit.WebViewClient
public void onReceivedError(WebView webView, int i, String str, String str2) {
super.onReceivedError(webView, i, str, str2);
a aVar = this.c;
if (aVar != null) {
com.applovin.impl.sdk.ad.b i2 = aVar.i();
String str3 = "Received error with error code: " + i + " with description \\'" + str + "\\' for URL: " + str2;
if (com.applovin.impl.sdk.n.a()) {
this.b.b("AdWebView", str3 + " for ad: " + i2);
}
}
if (yp.a(str2, this.a)) {
this.a.E().a("adWebViewReceivedError", str2, i);
}
}
@Override // android.webkit.WebViewClient
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
return a(webView, str);
}
private void a(aq aqVar, b bVar) {
a(aqVar, bVar, (Bundle) null);
}
private void a(aq aqVar, b bVar, Bundle bundle) {
dq j1 = aqVar.j1();
if (j1 != null) {
mq.a(j1.a(), this.c.l());
a(bVar, j1.b(), bundle);
}
}
public boolean a(WebView webView, String str) {
boolean z;
if (this.c == null) {
return true;
}
if (com.applovin.impl.sdk.n.a()) {
this.b.d("AdWebView", "Processing click on ad URL \"" + str + "\"");
}
if (str != null && (webView instanceof b)) {
Uri parse = Uri.parse(str);
b bVar = (b) webView;
String scheme = parse.getScheme();
String host = parse.getHost();
String path = parse.getPath();
com.applovin.impl.sdk.ad.b i = this.c.i();
if (i == null) {
if (com.applovin.impl.sdk.n.a()) {
this.b.b("AdWebView", "Unable to process click, ad not found!");
}
return true;
}
Iterator it = i.d0().iterator();
while (true) {
if (!it.hasNext()) {
z = true;
break;
}
String str2 = (String) it.next();
if (StringUtils.isValidString(path) && path.contains(str2)) {
z = false;
break;
}
}
boolean a = bVar.a();
boolean z2 = (!i.Y0() || a) ? z : false;
if ("applovin".equals(scheme) && "com.applovin.sdk".equals(host)) {
if ("/adservice/close_ad".equals(path)) {
String str3 = this.a.g0().getExtraParameters().get("enable_close_URL_ad_value");
if (StringUtils.isValidString(str3) && Boolean.parseBoolean(str3)) {
i.setMaxAdValue("close_url", str);
}
a();
} else if ("/adservice/expand_ad".equals(path)) {
if (i.Z0() && !a) {
if (com.applovin.impl.sdk.n.a()) {
this.b.b("AdWebView", "Skipping expand command without user interaction");
}
return true;
}
a(bVar.getLastClickEvent());
} else if ("/adservice/contract_ad".equals(path)) {
b();
} else {
if ("/adservice/no_op".equals(path)) {
return true;
}
if ("/adservice/load_url".equals(path)) {
if (a(a, i, parse)) {
if (com.applovin.impl.sdk.n.a()) {
this.b.b("AdWebView", "Skipping URL load command without user interaction");
}
return true;
}
tp.a(parse, this.c, this.a);
} else if ("/adservice/track_click_now".equals(path)) {
if (a(a, i, parse)) {
if (com.applovin.impl.sdk.n.a()) {
this.b.b("AdWebView", "Skipping click tracking command without user interaction");
}
return true;
}
if (i instanceof aq) {
a((aq) i, bVar);
} else {
a(bVar, Uri.parse("/adservice/track_click_now"));
}
} else if ("/adservice/deeplink".equals(path)) {
if (a(a, i, parse)) {
if (com.applovin.impl.sdk.n.a()) {
this.b.b("AdWebView", "Skipping deep link plus command without user interaction");
}
return true;
}
if (i instanceof aq) {
aq aqVar = (aq) i;
if (aqVar.A1()) {
a(aqVar, bVar);
}
}
a(bVar, parse);
} else if ("/adservice/postback".equals(path)) {
tp.a(parse, i, this.a);
} else if ("/ga_init".equals(path)) {
this.c.b(parse);
} else if ("/ga_event".equals(path)) {
this.c.a(parse);
} else if ("/playable_event".equals(path)) {
a(parse);
} else if ("/adservice/direct_download".equals(path)) {
Bundle a2 = tp.a(parse);
if (i instanceof aq) {
aq aqVar2 = (aq) i;
if (aqVar2.A1()) {
a(aqVar2, bVar, a2);
}
}
a(bVar, i.i(), a2);
} else if ("/template_error".equals(path)) {
tp.b(parse, i, this.a);
} else if (this.c.h() != null) {
if ("/video_began".equals(path)) {
this.c.h().b(yp.a(parse.getQueryParameter(IronSourceConstants.EVENTS_DURATION), 0.0d));
} else if ("/video_completed".equals(path)) {
this.c.h().e();
} else if ("/video_progress".equals(path)) {
this.c.h().a(yp.a(parse.getQueryParameter("percent_viewed"), 0.0d));
} else if ("/video_waiting".equals(path)) {
this.c.h().a();
} else if ("/video_resumed".equals(path)) {
this.c.h().d();
}
} else if ("/adservice/fully_watched".equals(path)) {
this.c.A();
} else {
if (com.applovin.impl.sdk.n.a()) {
this.b.k("AdWebView", "Unknown URL: " + str);
}
if (com.applovin.impl.sdk.n.a()) {
this.b.k("AdWebView", "Path: " + path);
}
}
}
} else if (z2) {
List x0 = i.x0();
List w0 = i.w0();
if ((!x0.isEmpty() && !x0.contains(scheme)) || (!w0.isEmpty() && !w0.contains(host))) {
if (com.applovin.impl.sdk.n.a()) {
this.b.b("AdWebView", "URL is not whitelisted - bypassing click");
}
} else {
if (i instanceof aq) {
aq aqVar3 = (aq) i;
if (aqVar3.A1()) {
a(aqVar3, bVar);
if (!a && i.f1()) {
this.a.E().a(la.E, a(i, parse));
}
}
}
a(bVar, parse);
if (!a) {
this.a.E().a(la.E, a(i, parse));
}
}
}
}
return true;
}
private boolean a(boolean z, com.applovin.impl.sdk.ad.b bVar, Uri uri) {
if (z) {
return false;
}
if (bVar.Z0()) {
return true;
}
if (bVar.f1()) {
this.a.E().a(la.E, a(bVar, uri));
}
return false;
}
private static Map a(com.applovin.impl.sdk.ad.b bVar, Uri uri) {
Map a = ma.a(bVar);
CollectionUtils.putStringIfValid("url", uri.toString(), a);
return a;
}
private void a() {
this.c.z();
}
private void a(MotionEvent motionEvent) {
this.c.a(motionEvent);
}
private void a(b bVar, Uri uri) {
a(bVar, uri, (Bundle) null);
}
private void a(b bVar, Uri uri, Bundle bundle) {
com.applovin.impl.sdk.ad.b currentAd = bVar.getCurrentAd();
AppLovinAdView k = this.c.k();
if (k != null && currentAd != null) {
if (currentAd instanceof aq) {
((aq) currentAd).getAdEventTracker().v();
}
this.c.a(currentAd, k, uri, bVar.getAndClearLastClickEvent(), bundle);
} else if (com.applovin.impl.sdk.n.a()) {
this.b.b("AdWebView", "Attempting to track click that is null or not an ApplovinAdView instance for clickedUri = " + uri);
}
}
private void a(Uri uri) {
String str;
boolean booleanQueryParameter = uri.getBooleanQueryParameter("success", false);
String queryParameter = uri.getQueryParameter("type");
if (booleanQueryParameter) {
str = "Tracked event: " + queryParameter;
} else {
str = "Failed to track event: " + queryParameter;
}
yp.a(str, com.applovin.impl.sdk.j.l());
}
}

View File

@@ -0,0 +1,37 @@
package com.applovin.impl.adview;
import android.webkit.WebView;
import android.webkit.WebViewRenderProcess;
import android.webkit.WebViewRenderProcessClient;
/* loaded from: classes.dex */
class d {
private final com.applovin.impl.sdk.j a;
private final WebViewRenderProcessClient b = new a();
public class a extends WebViewRenderProcessClient {
public a() {
}
public void onRenderProcessResponsive(WebView webView, WebViewRenderProcess webViewRenderProcess) {
}
public void onRenderProcessUnresponsive(WebView webView, WebViewRenderProcess webViewRenderProcess) {
if (webView instanceof b) {
com.applovin.impl.sdk.ad.b currentAd = ((b) webView).getCurrentAd();
d.this.a.J();
if (com.applovin.impl.sdk.n.a()) {
d.this.a.J().b("AdWebViewRenderProcessClient", "WebView render process unresponsive for ad: " + currentAd);
}
}
}
}
public d(com.applovin.impl.sdk.j jVar) {
this.a = jVar;
}
public WebViewRenderProcessClient a() {
return this.b;
}
}

View File

@@ -0,0 +1,66 @@
package com.applovin.impl.adview;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
/* loaded from: classes.dex */
public abstract class e extends View {
protected float a;
protected final Context b;
public enum a {
WHITE_ON_BLACK(0),
WHITE_ON_TRANSPARENT(1),
INVISIBLE(2),
TRANSPARENT_SKIP(3);
private final int a;
a(int i) {
this.a = i;
}
public int b() {
return this.a;
}
}
public e(Context context) {
super(context);
this.a = 1.0f;
this.b = context;
}
public void a(int i) {
setViewScale(i / 30.0f);
ViewGroup.LayoutParams layoutParams = getLayoutParams();
if (layoutParams != null) {
layoutParams.width = (int) getSize();
layoutParams.height = (int) getSize();
}
}
public float getSize() {
return this.a * 30.0f;
}
public abstract a getStyle();
public void setViewScale(float f) {
this.a = f;
}
public static e a(a aVar, Context context) {
if (aVar.equals(a.INVISIBLE)) {
return new h(context);
}
if (aVar.equals(a.WHITE_ON_TRANSPARENT)) {
return new i(context);
}
if (aVar.equals(a.TRANSPARENT_SKIP)) {
return new j(context);
}
return new n(context);
}
}

View File

@@ -0,0 +1,235 @@
package com.applovin.impl.adview;
import android.R;
import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.widget.RelativeLayout;
import com.applovin.impl.adview.e;
import com.applovin.impl.sj;
import com.applovin.impl.t6;
import com.applovin.sdk.AppLovinSdkUtils;
/* loaded from: classes.dex */
class f extends Dialog implements t6 {
private final Activity a;
private final com.applovin.impl.sdk.j b;
private final com.applovin.impl.sdk.n c;
private final b d;
private final com.applovin.impl.sdk.ad.a f;
private RelativeLayout g;
private e h;
public class a implements Animation.AnimationListener {
public a() {
}
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationEnd(Animation animation) {
f.this.h.setClickable(true);
}
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationRepeat(Animation animation) {
}
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationStart(Animation animation) {
}
}
public f(com.applovin.impl.sdk.ad.a aVar, b bVar, Activity activity, com.applovin.impl.sdk.j jVar) {
super(activity, R.style.Theme.Translucent.NoTitleBar);
if (aVar == null) {
throw new IllegalArgumentException("No ad specified");
}
if (bVar == null) {
throw new IllegalArgumentException("No main view specified");
}
if (jVar == null) {
throw new IllegalArgumentException("No sdk specified");
}
if (activity == null) {
throw new IllegalArgumentException("No activity specified");
}
this.b = jVar;
this.c = jVar.J();
this.a = activity;
this.d = bVar;
this.f = aVar;
requestWindowFeature(1);
setCancelable(false);
}
private void d() {
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
layoutParams.addRule(13);
this.d.setLayoutParams(layoutParams);
RelativeLayout relativeLayout = new RelativeLayout(this.a);
this.g = relativeLayout;
relativeLayout.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
this.g.setBackgroundColor(-1157627904);
this.g.addView(this.d);
if (!this.f.p1()) {
a(this.f.i1());
g();
}
setContentView(this.g);
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void e() {
this.g.removeView(this.d);
super.dismiss();
}
private void g() {
this.a.runOnUiThread(new Runnable() { // from class: com.applovin.impl.adview.f$$ExternalSyntheticLambda2
@Override // java.lang.Runnable
public final void run() {
f.this.f();
}
});
}
public com.applovin.impl.sdk.ad.a b() {
return this.f;
}
public b c() {
return this.d;
}
@Override // android.app.Dialog, android.content.DialogInterface, com.applovin.impl.t6
public void dismiss() {
this.a.runOnUiThread(new Runnable() { // from class: com.applovin.impl.adview.f$$ExternalSyntheticLambda3
@Override // java.lang.Runnable
public final void run() {
f.this.e();
}
});
}
@Override // android.app.Dialog
public void onBackPressed() {
this.d.a("javascript:al_onBackPressed();");
dismiss();
}
@Override // android.app.Dialog
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
d();
}
@Override // android.app.Dialog
public void onStart() {
super.onStart();
try {
Window window = getWindow();
if (window != null) {
window.setFlags(this.a.getWindow().getAttributes().flags, this.a.getWindow().getAttributes().flags);
window.addFlags(16777216);
} else if (com.applovin.impl.sdk.n.a()) {
this.c.b("ExpandedAdDialog", "Unable to turn on hardware acceleration - window is null");
}
} catch (Throwable th) {
if (com.applovin.impl.sdk.n.a()) {
this.c.a("ExpandedAdDialog", "Setting window flags failed.", th);
}
}
}
private void a() {
this.d.a("javascript:al_onCloseTapped();");
dismiss();
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void b(View view) {
if (this.h.isClickable()) {
this.h.performClick();
}
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void f() {
try {
if (this.h == null) {
a();
}
this.h.setVisibility(0);
this.h.bringToFront();
AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, 1.0f);
alphaAnimation.setDuration(300L);
alphaAnimation.setAnimationListener(new a());
this.h.startAnimation(alphaAnimation);
} catch (Throwable th) {
if (com.applovin.impl.sdk.n.a()) {
this.c.a("ExpandedAdDialog", "Unable to fade in close button", th);
}
a();
}
}
private void a(e.a aVar) {
if (this.h != null) {
if (com.applovin.impl.sdk.n.a()) {
this.c.k("ExpandedAdDialog", "Attempting to create duplicate close button");
return;
}
return;
}
e a2 = e.a(aVar, this.a);
this.h = a2;
a2.setVisibility(8);
this.h.setOnClickListener(new View.OnClickListener() { // from class: com.applovin.impl.adview.f$$ExternalSyntheticLambda0
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
f.this.a(view);
}
});
this.h.setClickable(false);
int a3 = a(((Integer) this.b.a(sj.V1)).intValue());
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(a3, a3);
layoutParams.addRule(10);
com.applovin.impl.sdk.j jVar = this.b;
sj sjVar = sj.Y1;
layoutParams.addRule(((Boolean) jVar.a(sjVar)).booleanValue() ? 9 : 11);
this.h.a(a3);
int a4 = a(((Integer) this.b.a(sj.X1)).intValue());
int a5 = a(((Integer) this.b.a(sj.W1)).intValue());
layoutParams.setMargins(a5, a4, a5, 0);
this.g.addView(this.h, layoutParams);
this.h.bringToFront();
int a6 = a(((Integer) this.b.a(sj.Z1)).intValue());
View view = new View(this.a);
view.setBackgroundColor(0);
int i = a3 + a6;
RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(i, i);
layoutParams2.addRule(10);
layoutParams2.addRule(((Boolean) this.b.a(sjVar)).booleanValue() ? 9 : 11);
layoutParams2.setMargins(a5 - a(5), a4 - a(5), a5 - a(5), 0);
view.setOnClickListener(new View.OnClickListener() { // from class: com.applovin.impl.adview.f$$ExternalSyntheticLambda1
@Override // android.view.View.OnClickListener
public final void onClick(View view2) {
f.this.b(view2);
}
});
this.g.addView(view, layoutParams2);
view.bringToFront();
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void a(View view) {
a();
}
private int a(int i) {
return AppLovinSdkUtils.dpToPx(this.a, i);
}
}

View File

@@ -0,0 +1,49 @@
package com.applovin.impl.adview;
import android.app.Activity;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import com.applovin.impl.adview.e;
/* loaded from: classes.dex */
public class g extends FrameLayout {
private e a;
private int b;
public g(e.a aVar, Activity activity) {
super(activity);
setBackgroundColor(0);
e a = e.a(aVar, activity);
this.a = a;
addView(a);
}
public void a(e.a aVar) {
if (aVar == null || aVar == this.a.getStyle()) {
return;
}
ViewGroup.LayoutParams layoutParams = this.a.getLayoutParams();
removeView(this.a);
e a = e.a(aVar, getContext());
this.a = a;
addView(a);
this.a.setLayoutParams(layoutParams);
this.a.a(this.b);
}
public void a(int i, int i2, int i3, int i4) {
this.b = i;
int i5 = i2 + i + i3;
ViewGroup.LayoutParams layoutParams = getLayoutParams();
if (layoutParams != null) {
layoutParams.height = i5;
layoutParams.width = i5;
} else {
setLayoutParams(new FrameLayout.LayoutParams(i5, i5));
}
FrameLayout.LayoutParams layoutParams2 = new FrameLayout.LayoutParams(i, i, i4);
layoutParams2.setMargins(i3, i3, i3, 0);
this.a.setLayoutParams(layoutParams2);
this.a.a(i);
}
}

View File

@@ -0,0 +1,21 @@
package com.applovin.impl.adview;
import android.content.Context;
import com.applovin.impl.adview.e;
/* loaded from: classes.dex */
public final class h extends e {
public h(Context context) {
super(context);
}
@Override // com.applovin.impl.adview.e
public void a(int i) {
setViewScale(i / 30.0f);
}
@Override // com.applovin.impl.adview.e
public e.a getStyle() {
return e.a.INVISIBLE;
}
}

View File

@@ -0,0 +1,55 @@
package com.applovin.impl.adview;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import com.applovin.impl.adview.e;
/* loaded from: classes.dex */
public final class i extends e {
private static final Paint c = new Paint(1);
private static final Paint d = new Paint(1);
public i(Context context) {
super(context);
c.setARGB(80, 0, 0, 0);
Paint paint = d;
paint.setColor(-1);
paint.setStyle(Paint.Style.STROKE);
}
@Override // com.applovin.impl.adview.e
public void a(int i) {
setViewScale(i / 30.0f);
}
public float getCenter() {
return getSize() / 2.0f;
}
public float getCrossOffset() {
return this.a * 8.0f;
}
public float getStrokeWidth() {
return this.a * 2.0f;
}
@Override // com.applovin.impl.adview.e
public e.a getStyle() {
return e.a.WHITE_ON_TRANSPARENT;
}
@Override // android.view.View
public void onDraw(Canvas canvas) {
super.onDraw(canvas);
float center = getCenter();
canvas.drawCircle(center, center, center, c);
float crossOffset = getCrossOffset();
float size = getSize() - crossOffset;
Paint paint = d;
paint.setStrokeWidth(getStrokeWidth());
canvas.drawLine(crossOffset, crossOffset, size, size, paint);
canvas.drawLine(crossOffset, size, size, crossOffset, paint);
}
}

View File

@@ -0,0 +1,85 @@
package com.applovin.impl.adview;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import com.applovin.impl.adview.e;
/* loaded from: classes.dex */
public final class j extends e {
private static final Paint f = new Paint(1);
private static final Paint g = new Paint(1);
private final float[] c;
private Path d;
public j(Context context) {
super(context);
this.c = new float[]{30.0f, 30.0f, 50.0f, 50.0f, 30.0f, 70.0f, 55.0f, 30.0f, 75.0f, 50.0f, 55.0f, 70.0f};
f.setARGB(80, 0, 0, 0);
Paint paint = g;
paint.setColor(-1);
paint.setStyle(Paint.Style.STROKE);
}
@Override // com.applovin.impl.adview.e
public void a(int i) {
setViewScale(i / 30.0f);
a();
}
public float getCenter() {
return getSize() / 2.0f;
}
public float getStrokeWidth() {
return this.a * 2.0f;
}
@Override // com.applovin.impl.adview.e
public e.a getStyle() {
return e.a.TRANSPARENT_SKIP;
}
@Override // android.view.View
public void onDraw(Canvas canvas) {
super.onDraw(canvas);
float center = getCenter();
canvas.drawCircle(center, center, center, f);
Paint paint = g;
paint.setStrokeWidth(getStrokeWidth());
canvas.drawPath(this.d, paint);
}
private void a() {
int i = 0;
while (true) {
float[] fArr = this.c;
if (i < fArr.length) {
fArr[i] = fArr[i] * 0.3f * this.a;
i++;
} else {
Path path = new Path();
this.d = path;
float[] fArr2 = this.c;
path.moveTo(fArr2[0], fArr2[1]);
Path path2 = this.d;
float[] fArr3 = this.c;
path2.lineTo(fArr3[2], fArr3[3]);
Path path3 = this.d;
float[] fArr4 = this.c;
path3.lineTo(fArr4[4], fArr4[5]);
Path path4 = this.d;
float[] fArr5 = this.c;
path4.moveTo(fArr5[6], fArr5[7]);
Path path5 = this.d;
float[] fArr6 = this.c;
path5.lineTo(fArr6[8], fArr6[9]);
Path path6 = this.d;
float[] fArr7 = this.c;
path6.lineTo(fArr7[10], fArr7[11]);
return;
}
}
}
}

View File

@@ -0,0 +1,59 @@
package com.applovin.impl.adview;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.View;
import com.applovin.impl.ea;
/* loaded from: classes.dex */
public class k extends View {
private final ea a;
private boolean b;
public interface a {
void a();
void onFailure();
}
public boolean a() {
return this.b;
}
public void b() {
a(null);
}
public String getIdentifier() {
return this.a.b();
}
public void a(a aVar) {
if (this.b) {
if (aVar != null) {
aVar.a();
return;
}
return;
}
Drawable a2 = this.a.a();
if (a2 == null) {
if (aVar != null) {
aVar.onFailure();
}
} else {
setBackground(a2);
this.b = true;
if (aVar != null) {
aVar.a();
}
}
}
public k(ea eaVar, Context context) {
super(context);
this.a = eaVar;
setClickable(false);
setFocusable(false);
}
}

View File

@@ -0,0 +1,40 @@
package com.applovin.impl.adview;
import android.content.Context;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import com.applovin.impl.j3;
import com.applovin.impl.rr;
import com.applovin.impl.z3;
/* loaded from: classes.dex */
public class l extends j3 {
private final String c;
public void a(String str) {
loadDataWithBaseURL(this.c, str, "text/html", null, "");
}
public l(String str, com.applovin.impl.sdk.ad.b bVar, rr rrVar, Context context) {
super(context);
this.c = str;
setBackgroundColor(0);
WebSettings settings = getSettings();
settings.setSupportMultipleWindows(false);
settings.setJavaScriptEnabled(true);
if (bVar.N0()) {
applySettings(bVar);
} else {
settings.setAllowFileAccess(true);
if (z3.e() && bVar.J0()) {
WebView.setWebContentsDebuggingEnabled(true);
}
}
setWebViewClient(rrVar);
setWebChromeClient(new WebChromeClient());
setVerticalScrollBarEnabled(false);
setHorizontalScrollBarEnabled(false);
setScrollBarStyle(33554432);
}
}

View File

@@ -0,0 +1,108 @@
package com.applovin.impl.adview;
import android.webkit.WebSettings;
import com.applovin.impl.sdk.utils.JsonUtils;
import com.applovin.impl.sdk.utils.StringUtils;
import com.tapjoy.TJAdUnitConstants;
import org.json.JSONObject;
/* loaded from: classes.dex */
public final class m {
private final JSONObject a;
public m(JSONObject jSONObject) {
this.a = jSONObject;
}
public Integer a() {
String string = JsonUtils.getString(this.a, "mixed_content_mode", null);
if (StringUtils.isValidString(string)) {
if ("always_allow".equalsIgnoreCase(string)) {
return 0;
}
if ("never_allow".equalsIgnoreCase(string)) {
return 1;
}
if ("compatibility_mode".equalsIgnoreCase(string)) {
return 2;
}
}
return null;
}
public WebSettings.PluginState b() {
String string = JsonUtils.getString(this.a, "plugin_state", null);
if (StringUtils.isValidString(string)) {
if (TJAdUnitConstants.String.SPLIT_VIEW_TRIGGER_ON.equalsIgnoreCase(string)) {
return WebSettings.PluginState.ON;
}
if ("on_demand".equalsIgnoreCase(string)) {
return WebSettings.PluginState.ON_DEMAND;
}
if ("off".equalsIgnoreCase(string)) {
return WebSettings.PluginState.OFF;
}
}
return null;
}
public Boolean c() {
return JsonUtils.getBoolean(this.a, "geolocation_enabled", null);
}
public Boolean d() {
return JsonUtils.getBoolean(this.a, "allow_content_access", null);
}
public Boolean e() {
return JsonUtils.getBoolean(this.a, "allow_file_access", null);
}
public Boolean f() {
return JsonUtils.getBoolean(this.a, "allow_file_access_from_file_urls", null);
}
public Boolean g() {
return JsonUtils.getBoolean(this.a, "allow_universal_access_from_file_urls", null);
}
public Boolean h() {
return JsonUtils.getBoolean(this.a, "display_zoom_controls", null);
}
public Boolean i() {
return JsonUtils.getBoolean(this.a, "load_with_overview_mode", null);
}
public Boolean j() {
return JsonUtils.getBoolean(this.a, "need_initial_focus", null);
}
public Boolean k() {
return JsonUtils.getBoolean(this.a, "offscreen_pre_raster", null);
}
public Boolean l() {
return JsonUtils.getBoolean(this.a, "save_form_data", null);
}
public Boolean m() {
return JsonUtils.getBoolean(this.a, "algorithmic_darkening_allowed", null);
}
public Boolean n() {
return JsonUtils.getBoolean(this.a, "block_network_image", null);
}
public Boolean o() {
return JsonUtils.getBoolean(this.a, "loads_images_automatically", null);
}
public Boolean p() {
return JsonUtils.getBoolean(this.a, "use_built_in_zoom_controls", null);
}
public Boolean q() {
return JsonUtils.getBoolean(this.a, "use_wide_view_port", null);
}
}

View File

@@ -0,0 +1,62 @@
package com.applovin.impl.adview;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import androidx.core.view.ViewCompat;
import com.applovin.impl.adview.e;
/* loaded from: classes.dex */
public final class n extends e {
private static final Paint c = new Paint(1);
private static final Paint d = new Paint(1);
private static final Paint f = new Paint(1);
public n(Context context) {
super(context);
c.setColor(-1);
d.setColor(ViewCompat.MEASURED_STATE_MASK);
Paint paint = f;
paint.setColor(-1);
paint.setStyle(Paint.Style.STROKE);
}
public float getCenter() {
return getSize() / 2.0f;
}
public float getCrossOffset() {
return this.a * 10.0f;
}
public float getInnerCircleOffset() {
return this.a * 2.0f;
}
public float getInnerCircleRadius() {
return getCenter() - getInnerCircleOffset();
}
public float getStrokeWidth() {
return this.a * 3.0f;
}
@Override // com.applovin.impl.adview.e
public e.a getStyle() {
return e.a.WHITE_ON_BLACK;
}
@Override // android.view.View
public void onDraw(Canvas canvas) {
super.onDraw(canvas);
float center = getCenter();
canvas.drawCircle(center, center, center, c);
canvas.drawCircle(center, center, getInnerCircleRadius(), d);
float crossOffset = getCrossOffset();
float size = getSize() - crossOffset;
Paint paint = f;
paint.setStrokeWidth(getStrokeWidth());
canvas.drawLine(crossOffset, crossOffset, size, size, paint);
canvas.drawLine(crossOffset, size, size, crossOffset, paint);
}
}