正在查看: Handling Master v2 应用的 p1.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Handling Master v2 应用的 p1.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.applovin.impl;
import android.app.Activity;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import com.applovin.adview.AppLovinAdView;
import com.applovin.impl.adview.a;
import com.applovin.impl.adview.e;
import com.applovin.impl.adview.g;
import com.applovin.impl.adview.k;
import com.applovin.impl.c2;
import com.applovin.impl.r5;
import com.applovin.impl.sdk.AppLovinBroadcastManager;
import com.applovin.impl.sdk.h;
import com.applovin.impl.sdk.j;
import com.applovin.impl.sdk.utils.CollectionUtils;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.sdk.AppLovinAd;
import com.applovin.sdk.AppLovinAdClickListener;
import com.applovin.sdk.AppLovinAdDisplayListener;
import com.applovin.sdk.AppLovinAdSize;
import com.applovin.sdk.AppLovinAdType;
import com.applovin.sdk.AppLovinAdVideoPlaybackListener;
import com.applovin.sdk.AppLovinSdkUtils;
import com.s.d.oivI;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.json.JSONException;
import org.json.JSONObject;
public abstract class p1 implements c2.a, AppLovinBroadcastManager.Receiver, a.b {
protected AppLovinAdClickListener A;
protected AppLovinAdDisplayListener B;
protected AppLovinAdVideoPlaybackListener C;
protected final c2 D;
protected t6 E;
protected t6 F;
protected boolean G;
private final d0 H;
protected final com.applovin.impl.sdk.ad.b a;
protected final j b;
protected final com.applovin.impl.sdk.n c;
protected Activity d;
private final com.applovin.impl.b f;
private final h.a g;
protected AppLovinAdView h;
protected k i;
protected final g j;
protected final g k;
protected long p;
private boolean q;
protected boolean r;
protected int s;
protected boolean t;
protected boolean z;
private final Handler e = new Handler(Looper.getMainLooper());
protected final long l = SystemClock.elapsedRealtime();
private final AtomicBoolean m = new AtomicBoolean();
private final AtomicBoolean n = new AtomicBoolean();
protected long o = -1;
private int u = 0;
private final ArrayList v = new ArrayList();
protected int w = 0;
protected int x = 0;
protected int y = h.h;
private boolean I = false;
public class a implements AppLovinAdDisplayListener {
public a() {
}
public void adDisplayed(AppLovinAd appLovinAd) {
com.applovin.impl.sdk.n nVar = p1.this.c;
if (com.applovin.impl.sdk.n.a()) {
p1.this.c.a("AppLovinFullscreenActivity", "Web content rendered");
}
}
public void adHidden(AppLovinAd appLovinAd) {
com.applovin.impl.sdk.n nVar = p1.this.c;
if (com.applovin.impl.sdk.n.a()) {
p1.this.c.a("AppLovinFullscreenActivity", "Closing from WebView");
}
p1.this.c();
}
}
public class b implements h.a {
public b() {
}
@Override
public void a(int i) {
p1 p1Var = p1.this;
if (p1Var.y != h.h) {
p1Var.z = true;
}
com.applovin.impl.adview.b f = p1Var.h.getController().f();
if (f == null) {
com.applovin.impl.sdk.n nVar = p1.this.c;
if (com.applovin.impl.sdk.n.a()) {
p1.this.c.k("AppLovinFullscreenActivity", "Unable to handle ringer mode change: no valid web view.");
}
} else if (h.a(i) && !h.a(p1.this.y)) {
f.a("javascript:al_muteSwitchOn();");
} else if (i == 2) {
f.a("javascript:al_muteSwitchOff();");
}
p1.this.y = i;
}
}
public class c extends com.applovin.impl.b {
final j a;
public c(j jVar) {
this.a = jVar;
}
public void onActivityCreated(Activity activity, Bundle bundle) {
if (!activity.getClass().getName().equals(z6.a(activity.getApplicationContext(), "AppLovinFullscreenActivity", this.a)) || p1.this.n.get()) {
return;
}
com.applovin.impl.sdk.n.h("AppLovinFullscreenActivity", "Dismissing on-screen ad due to app relaunched via launcher.");
try {
p1.this.c();
} catch (Throwable th) {
com.applovin.impl.sdk.n.c("AppLovinFullscreenActivity", "Failed to dismiss ad.", th);
try {
p1.this.k();
} catch (Throwable unused) {
}
}
}
}
public class e implements AppLovinAdClickListener, View.OnClickListener {
private e() {
}
public void a() {
p1.this.o = SystemClock.elapsedRealtime();
}
public void adClicked(AppLovinAd appLovinAd) {
com.applovin.impl.sdk.n nVar = p1.this.c;
if (com.applovin.impl.sdk.n.a()) {
p1.this.c.a("AppLovinFullscreenActivity", "Clicking through graphic");
}
l2.a(p1.this.A, appLovinAd);
p1.this.x++;
}
@Override
public void onClick(View view) {
p1 p1Var = p1.this;
if (view != p1Var.j || !((Boolean) p1Var.b.a(l4.O1)).booleanValue()) {
com.applovin.impl.sdk.n nVar = p1.this.c;
if (com.applovin.impl.sdk.n.a()) {
p1.this.c.b("AppLovinFullscreenActivity", "Unhandled click on widget: " + view);
return;
}
return;
}
p1.c(p1.this);
if (p1.this.a.S0()) {
p1.this.c("javascript:al_onCloseButtonTapped(" + p1.this.u + "," + p1.this.w + "," + p1.this.x + ");");
}
List L = p1.this.a.L();
com.applovin.impl.sdk.n nVar2 = p1.this.c;
if (com.applovin.impl.sdk.n.a()) {
p1.this.c.a("AppLovinFullscreenActivity", "Handling close button tap " + p1.this.u + " with multi close delay: " + L);
}
if (L == null || L.size() <= p1.this.u) {
p1.this.c();
return;
}
p1.this.v.add(Long.valueOf(SystemClock.elapsedRealtime() - p1.this.o));
List J = p1.this.a.J();
if (J != null && J.size() > p1.this.u) {
p1 p1Var2 = p1.this;
p1Var2.j.a((e.a) J.get(p1Var2.u));
}
com.applovin.impl.sdk.n nVar3 = p1.this.c;
if (com.applovin.impl.sdk.n.a()) {
p1.this.c.a("AppLovinFullscreenActivity", "Scheduling next close button with delay: " + L.get(p1.this.u));
}
p1.this.j.setVisibility(8);
p1 p1Var3 = p1.this;
p1Var3.a(p1Var3.j, ((Integer) L.get(p1Var3.u)).intValue(), (Runnable) new ilLIILiLI1i1l(this));
}
public e(p1 p1Var, a aVar) {
this();
}
}
public p1(com.applovin.impl.sdk.ad.b bVar, Activity activity, Map map, j jVar, AppLovinAdClickListener appLovinAdClickListener, AppLovinAdDisplayListener appLovinAdDisplayListener, AppLovinAdVideoPlaybackListener appLovinAdVideoPlaybackListener) {
this.a = bVar;
this.b = jVar;
this.c = jVar.I();
this.d = activity;
this.A = appLovinAdClickListener;
this.B = appLovinAdDisplayListener;
this.C = appLovinAdVideoPlaybackListener;
c2 c2Var = new c2(activity, jVar);
this.D = c2Var;
c2Var.a(this);
this.H = new d0(jVar);
e eVar = new e(this, null);
if (((Boolean) jVar.a(l4.k2)).booleanValue()) {
AppLovinBroadcastManager.registerReceiver(this, new IntentFilter("com.applovin.render_process_gone"));
}
if (((Boolean) jVar.a(l4.q2)).booleanValue()) {
AppLovinBroadcastManager.registerReceiver(this, new IntentFilter("com.applovin.al_onPoststitialShow_evaluation_error"));
}
AppLovinBroadcastManager.registerReceiver(this, new IntentFilter("com.applovin.custom_tabs_shown"));
AppLovinBroadcastManager.registerReceiver(this, new IntentFilter("com.applovin.custom_tabs_hidden"));
AppLovinBroadcastManager.registerReceiver(this, new IntentFilter("com.applovin.custom_tabs_failure"));
AppLovinBroadcastManager.registerReceiver(this, new IntentFilter("com.applovin.external_redirect_success"));
AppLovinBroadcastManager.registerReceiver(this, new IntentFilter("com.applovin.external_redirect_failure"));
n1 n1Var = new n1(jVar.r0(), AppLovinAdSize.INTERSTITIAL, activity);
this.h = n1Var;
n1Var.setAdClickListener(eVar);
this.h.setAdDisplayListener(new a());
bVar.e().putString("ad_view_address", q7.a((View) this.h));
this.h.getController().a(this);
x1 x1Var = new x1(map, jVar);
if (x1Var.c()) {
this.i = new k(x1Var, activity);
}
jVar.k().trackImpression(bVar);
List L = bVar.L();
if (bVar.p() >= 0 || L != null) {
g gVar = new g(bVar.n(), activity);
this.j = gVar;
gVar.setVisibility(8);
gVar.setOnClickListener(eVar);
} else {
this.j = null;
}
g gVar2 = new g(e.a.c, activity);
this.k = gVar2;
gVar2.setOnClickListener(new iiLLIII1(this));
if (bVar.W0()) {
this.g = new b();
} else {
this.g = null;
}
this.f = new c(jVar);
}
public static int c(p1 p1Var) {
int i = p1Var.u;
p1Var.u = i + 1;
return i;
}
public void j() {
if (this.a.E0().getAndSet(true)) {
return;
}
this.b.j0().a(new a6(this.a, this.b), r5.b.OTHER);
}
private void y() {
if (this.g != null) {
this.b.p().a(this.g);
}
if (this.f != null) {
this.b.e().a(this.f);
}
}
public abstract void a(long j);
public abstract void a(ViewGroup viewGroup);
public void e() {
if (com.applovin.impl.sdk.n.a()) {
this.c.d("AppLovinFullscreenActivity", "Handling al_onPoststitialShow evaluation error");
}
}
public void f() {
if (com.applovin.impl.sdk.n.a()) {
this.c.d("AppLovinFullscreenActivity", "Handling render process crash");
}
this.r = true;
}
public boolean g() {
return this.q;
}
public boolean h() {
return AppLovinAdType.INCENTIVIZED == this.a.getType();
}
public boolean i() {
return this.d instanceof oivI;
}
public void k() {
if (this.n.compareAndSet(false, true)) {
l2.b(this.B, this.a);
this.b.D().b(this.a);
this.b.g().a(y1.o, this.a);
}
}
public abstract void l();
public void m() {
t6 t6Var = this.E;
if (t6Var != null) {
t6Var.d();
}
}
public void n() {
t6 t6Var = this.E;
if (t6Var != null) {
t6Var.e();
}
}
public void o() {
com.applovin.impl.adview.b f;
if (this.h == null || !this.a.w0() || (f = this.h.getController().f()) == null) {
return;
}
this.H.a(f, new iIil1IILliL(this));
}
public void onReceive(Intent intent, Map map) {
String action = intent.getAction();
if (action == null) {
}
switch (action) {
case "com.applovin.al_onPoststitialShow_evaluation_error":
e();
break;
case "com.applovin.external_redirect_success":
case "com.applovin.external_redirect_failure":
b(action, map);
break;
case "com.applovin.custom_tabs_failure":
case "com.applovin.custom_tabs_hidden":
case "com.applovin.custom_tabs_shown":
a(action, map);
break;
case "com.applovin.render_process_gone":
if (!this.r) {
f();
break;
}
break;
}
}
public void p() {
if (com.applovin.impl.sdk.n.a()) {
this.c.d("AppLovinFullscreenActivity", "onBackPressed()");
}
if (this.I) {
c();
}
if (this.a.S0()) {
c("javascript:onBackPressed();");
}
}
public void q() {
AppLovinAdView appLovinAdView = this.h;
if (appLovinAdView != null) {
ViewParent parent = appLovinAdView.getParent();
this.h.destroy();
this.h = null;
if ((parent instanceof ViewGroup) && i()) {
((ViewGroup) parent).removeAllViews();
}
}
l();
k();
this.A = null;
this.B = null;
this.C = null;
this.d = null;
AppLovinBroadcastManager.unregisterReceiver(this);
}
public void r() {
if (com.applovin.impl.sdk.n.a()) {
this.c.d("AppLovinFullscreenActivity", "onPause()");
}
b("javascript:al_onAppPaused();");
if (this.D.b()) {
this.D.a();
}
m();
}
public void s() {
if (com.applovin.impl.sdk.n.a()) {
this.c.d("AppLovinFullscreenActivity", "onResume()");
}
b("javascript:al_onAppResumed();");
n();
if (this.D.b()) {
this.D.a();
}
}
public void t() {
if (com.applovin.impl.sdk.n.a()) {
this.c.d("AppLovinFullscreenActivity", "onStop()");
}
}
public abstract void u();
public abstract void v();
public void w() {
if (com.applovin.impl.sdk.n.a()) {
this.c.d("AppLovinFullscreenActivity", "Setting ad fully watched");
}
this.G = true;
}
public abstract void x();
public static void a(com.applovin.impl.sdk.ad.b bVar, AppLovinAdClickListener appLovinAdClickListener, AppLovinAdDisplayListener appLovinAdDisplayListener, AppLovinAdVideoPlaybackListener appLovinAdVideoPlaybackListener, Map map, j jVar, Activity activity, d dVar) {
p1 s1Var;
if (bVar instanceof a7) {
try {
s1Var = new s1(bVar, activity, map, jVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
} catch (Throwable th) {
dVar.a("Failed to create FullscreenVastVideoAdPresenter with sdk: " + jVar + " and throwable: " + th.getMessage(), th);
return;
}
} else if (bVar.hasVideoUrl()) {
try {
s1Var = new t1(bVar, activity, map, jVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
} catch (Throwable th2) {
dVar.a("Failed to create FullscreenVideoAdPresenter with sdk: " + jVar + " and throwable: " + th2.getMessage(), th2);
return;
}
} else {
try {
s1Var = new q1(bVar, activity, map, jVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
} catch (Throwable th3) {
dVar.a("Failed to create FullscreenGraphicAdPresenter with sdk: " + jVar + " and throwable: " + th3.getMessage(), th3);
return;
}
}
s1Var.y();
dVar.a(s1Var);
}
public void b(View view) {
c();
}
public void c(boolean z) {
a(z, ((Long) this.b.a(l4.i2)).longValue());
l2.a(this.B, this.a);
this.b.D().a(this.a);
if (this.a.hasVideoUrl() || h()) {
l2.a(this.C, this.a);
}
new a4(this.d).a(this.a);
this.a.setHasShown(true);
}
public int d() {
int r = this.a.r();
return (r <= 0 && ((Boolean) this.b.a(l4.h2)).booleanValue()) ? this.s + 1 : r;
}
public void b(boolean z) {
if (com.applovin.impl.sdk.n.a()) {
this.c.d("AppLovinFullscreenActivity", "onWindowFocusChanged(boolean) - " + z);
}
b("javascript:al_onWindowFocusChanged( " + z + " );");
t6 t6Var = this.F;
if (t6Var != null) {
if (z) {
t6Var.e();
} else {
t6Var.d();
}
}
}
public void b(String str) {
if (this.a.A0()) {
a(str, 0L);
}
}
public static void b(g gVar, Runnable runnable) {
q7.a((View) gVar, 400L, (Runnable) new IIl1iIiiliIi(gVar, runnable));
}
public void c() {
this.q = true;
if (com.applovin.impl.sdk.n.a()) {
this.c.d("AppLovinFullscreenActivity", "dismiss()");
}
com.applovin.impl.sdk.ad.b bVar = this.a;
if (bVar != null) {
bVar.getAdEventTracker().f();
}
this.e.removeCallbacksAndMessages(null);
a("javascript:al_onPoststitialDismiss();", this.a != null ? r0.C() : 0L);
k();
this.H.b();
if (this.g != null) {
this.b.p().b(this.g);
}
if (this.f != null) {
this.b.e().b(this.f);
}
if (i()) {
this.d.finish();
return;
}
this.b.I();
if (com.applovin.impl.sdk.n.a()) {
this.b.I().a("AppLovinFullscreenActivity", "Fullscreen ad shown in container view dismissed, destroying the presenter.");
}
q();
}
public void b(long j) {
if (com.applovin.impl.sdk.n.a()) {
this.c.a("AppLovinFullscreenActivity", "Scheduling report reward in " + TimeUnit.MILLISECONDS.toSeconds(j) + " seconds...");
}
this.E = t6.a(j, this.b, new iIIL11l1ii(this));
}
public boolean a(boolean z) {
List a2 = z6.a(z, this.a, this.b, this.d);
if (a2.isEmpty()) {
return false;
}
if (((Boolean) this.b.a(l4.l5)).booleanValue()) {
if (com.applovin.impl.sdk.n.a()) {
this.c.b("AppLovinFullscreenActivity", "Dismissing ad due to missing resources: " + a2);
}
if (((Boolean) this.b.a(l4.o5)).booleanValue()) {
AppLovinAdDisplayListener appLovinAdDisplayListener = this.B;
if (appLovinAdDisplayListener instanceof f2) {
l2.a(appLovinAdDisplayListener, "Missing ad resources");
}
c();
} else {
h2.a(this.a, this.B, "Missing ad resources", (Throwable) null, (oivI) null);
c();
}
HashMap hashMap = new HashMap();
CollectionUtils.putStringIfValid("error_message", "Missing ad resources: " + a2, hashMap);
CollectionUtils.putStringIfValid("details", "Failing ad display", hashMap);
this.b.A().a(y1.j0, "missingCachedAdResources", hashMap);
return ((Boolean) this.b.a(l4.n5)).booleanValue();
}
if (com.applovin.impl.sdk.n.a()) {
this.c.b("AppLovinFullscreenActivity", "Streaming ad due to missing ad resources: " + a2);
}
this.a.J0();
HashMap hashMap2 = new HashMap();
CollectionUtils.putStringIfValid("error_message", "Missing ad resources: " + a2, hashMap2);
CollectionUtils.putStringIfValid("details", "Streaming ad", hashMap2);
this.b.A().a(y1.j0, "missingCachedAdResources", hashMap2);
return false;
}
private void b(String str, Map map) {
String str2;
str.hashCode();
if (str.equals("com.applovin.external_redirect_success")) {
str2 = "success";
} else if (!str.equals("com.applovin.external_redirect_failure")) {
return;
} else {
str2 = "failure";
}
a("al_onExternalRedirectEvent", str2, map);
}
public void c(String str) {
a(str, 0L);
}
public static void c(g gVar, Runnable runnable) {
AppLovinSdkUtils.runOnUiThread(new iLliiLi11i(gVar, runnable));
}
public void a(Configuration configuration) {
if (com.applovin.impl.sdk.n.a()) {
this.c.d("AppLovinFullscreenActivity", "onConfigurationChanged(Configuration) - " + configuration);
}
}
public void a(int i, KeyEvent keyEvent) {
if (this.c != null && com.applovin.impl.sdk.n.a()) {
this.c.d("AppLovinFullscreenActivity", "onKeyDown(int, KeyEvent) - " + i + ", " + keyEvent);
}
com.applovin.impl.sdk.ad.b bVar = this.a;
if (bVar == null || !bVar.V0()) {
return;
}
if (i == 24 || i == 25) {
c("javascript:al_onVolumeChangedEvent('" + (i == 24 ? "volume_up" : "volume_down") + "');");
}
}
public void a(String str, long j) {
if (j < 0 || !StringUtils.isValidString(str)) {
return;
}
a((Runnable) new I111lIIiLIlIl(this, str), j);
}
public void a(String str) {
com.applovin.impl.adview.b f;
AppLovinAdView appLovinAdView = this.h;
if (appLovinAdView == null || (f = appLovinAdView.getController().f()) == null) {
return;
}
f.a(str);
}
public void a(g gVar, long j, Runnable runnable) {
if (j >= ((Long) this.b.a(l4.N1)).longValue()) {
return;
}
this.F = t6.a(TimeUnit.SECONDS.toMillis(j), this.b, new iLL1iiLiI11l(gVar, runnable));
}
public static void a(g gVar, Runnable runnable) {
gVar.bringToFront();
runnable.run();
}
public void a(int i, boolean z, boolean z2, long j) {
if (this.m.compareAndSet(false, true)) {
if (this.a.hasVideoUrl() || h()) {
l2.a(this.C, this.a, i, z2);
}
long elapsedRealtime = SystemClock.elapsedRealtime() - this.l;
this.b.k().trackVideoEnd(this.a, TimeUnit.MILLISECONDS.toSeconds(elapsedRealtime), i, z);
long elapsedRealtime2 = this.o != -1 ? SystemClock.elapsedRealtime() - this.o : -1L;
this.b.k().trackFullScreenAdClosed(this.a, elapsedRealtime2, this.v, j, this.z, this.y);
if (com.applovin.impl.sdk.n.a()) {
this.c.a("AppLovinFullscreenActivity", "Video ad ended at percent: " + i + "%, elapsedTime: " + elapsedRealtime + "ms, skipTimeMillis: " + j + "ms, closeTimeMillis: " + elapsedRealtime2 + "ms");
}
}
}
public void a(com.applovin.impl.adview.a aVar) {
if (com.applovin.impl.sdk.n.a()) {
this.c.a("AppLovinFullscreenActivity", "Fully watched from ad web view...");
}
this.G = true;
}
public void a(boolean z, long j) {
if (this.a.K0()) {
a(z ? "javascript:al_mute();" : "javascript:al_unmute();", j);
}
}
public void a(View view) {
if (((Boolean) this.b.a(l4.J0)).booleanValue()) {
this.b.C().c(this.a, j.n());
}
Map b2 = a2.b(this.a);
b2.putAll(a2.a(this.a));
this.b.A().d(y1.i0, b2);
if (((Boolean) this.b.a(l4.H5)).booleanValue()) {
w();
}
if (((Boolean) this.b.a(l4.D5)).booleanValue()) {
c();
return;
}
this.I = ((Boolean) this.b.a(l4.E5)).booleanValue();
if (((Boolean) this.b.a(l4.F5)).booleanValue()) {
x();
}
}
private void a(String str, Map map) {
String str2;
str.hashCode();
switch (str) {
case "com.applovin.custom_tabs_failure":
str2 = "failure";
break;
case "com.applovin.custom_tabs_hidden":
str2 = "hidden";
break;
case "com.applovin.custom_tabs_shown":
str2 = "shown";
break;
default:
return;
}
a("al_onInAppBrowserEvent", str2, map);
}
private void a(String str, String str2, Map map) {
JSONObject jSONObject;
try {
jSONObject = CollectionUtils.toJson(map);
} catch (JSONException unused) {
jSONObject = new JSONObject();
}
c("javascript:" + str + "('" + str2 + "'," + jSONObject + ");");
}
public void a(Runnable runnable, long j) {
AppLovinSdkUtils.runOnUiThreadDelayed(runnable, j, this.e);
}
}