ZStore v1.7版本的 MD5 值为:ca9bb200afd8d690876bd39318f8215c
以下内容为反编译后的 a.java 源代码,内容仅作参考
package com.applovin.impl.adview.activity.b;
import android.app.Activity;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.net.Uri;
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 androidx.annotation.Nullable;
import com.applovin.adview.AppLovinAdView;
import com.applovin.adview.AppLovinFullscreenActivity;
import com.applovin.impl.adview.j;
import com.applovin.impl.adview.n;
import com.applovin.impl.adview.p;
import com.applovin.impl.adview.q;
import com.applovin.impl.adview.v;
import com.applovin.impl.sdk.AppLovinBroadcastManager;
import com.applovin.impl.sdk.b.b;
import com.applovin.impl.sdk.e.ac;
import com.applovin.impl.sdk.e.r;
import com.applovin.impl.sdk.e.y;
import com.applovin.impl.sdk.j;
import com.applovin.impl.sdk.k;
import com.applovin.impl.sdk.o;
import com.applovin.impl.sdk.s;
import com.applovin.impl.sdk.utils.CollectionUtils;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.sdk.utils.Utils;
import com.applovin.impl.sdk.utils.s;
import com.applovin.impl.sdk.x;
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 java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
public abstract class a implements AppLovinBroadcastManager.Receiver, b.a {
private long C;
private boolean D;
private final k G;
protected final com.applovin.impl.sdk.ad.e a;
protected final o b;
protected final x c;
protected final com.applovin.impl.sdk.d.d d;
protected Activity e;
protected AppLovinAdView f;
@Nullable
protected v g;
@Nullable
protected final n h;
protected final n i;
protected boolean l;
protected int m;
protected boolean n;
protected boolean r;
protected AppLovinAdClickListener s;
protected AppLovinAdDisplayListener t;
protected AppLovinAdVideoPlaybackListener u;
protected final com.applovin.impl.sdk.b.b v;
@Nullable
protected s w;
@Nullable
private final com.applovin.impl.sdk.utils.a y;
@Nullable
private final j.a z;
private final Handler x = new Handler(Looper.getMainLooper());
protected final long j = SystemClock.elapsedRealtime();
private final AtomicBoolean A = new AtomicBoolean();
private final AtomicBoolean B = new AtomicBoolean();
protected long k = -1;
private int E = 0;
private final ArrayList<Long> F = new ArrayList<>();
protected int o = 0;
protected int p = 0;
protected int q = j.a;
private boolean H = false;
public interface InterfaceC0046a {
void a(a aVar);
void a(String str, Throwable th);
}
public abstract void a(long j);
public abstract void a(@Nullable ViewGroup viewGroup);
public abstract void d();
public abstract void e();
protected abstract void n();
protected abstract boolean s();
protected abstract boolean t();
protected abstract void v();
static int b(a aVar) {
int i = aVar.E;
aVar.E = i + 1;
return i;
}
public static void a(com.applovin.impl.sdk.ad.e eVar, AppLovinAdClickListener appLovinAdClickListener, AppLovinAdDisplayListener appLovinAdDisplayListener, AppLovinAdVideoPlaybackListener appLovinAdVideoPlaybackListener, @Nullable Map<String, Object> map, o oVar, Activity activity, InterfaceC0046a interfaceC0046a) {
a bVar;
boolean aM = eVar.aM();
if (eVar instanceof com.applovin.impl.c.a) {
if (aM) {
try {
bVar = new c(eVar, activity, map, oVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
} catch (Throwable th) {
oVar.M();
if (x.a()) {
oVar.M().a("AppLovinFullscreenActivity", "Failed to create ExoPlayer presenter to show the ad. Falling back to using native media player presenter.", th);
}
try {
bVar = new d(eVar, activity, map, oVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
} catch (Throwable th2) {
interfaceC0046a.a("Failed to create FullscreenVastVideoAdPresenter with sdk: " + oVar + " and throwable: " + th2.getMessage(), th2);
return;
}
}
} else {
try {
bVar = new d(eVar, activity, map, oVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
} catch (Throwable th3) {
interfaceC0046a.a("Failed to create FullscreenVastVideoAdPresenter with sdk: " + oVar + " and throwable: " + th3.getMessage(), th3);
return;
}
}
} else if (eVar.hasVideoUrl()) {
if (eVar.aP()) {
try {
bVar = new g(eVar, activity, map, oVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
} catch (Throwable th4) {
interfaceC0046a.a("Failed to create FullscreenWebVideoAdPresenter with sdk: " + oVar + " and throwable: " + th4.getMessage(), th4);
return;
}
} else if (aM) {
try {
bVar = new e(eVar, activity, map, oVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
} catch (Throwable th5) {
oVar.M();
if (x.a()) {
oVar.M().a("AppLovinFullscreenActivity", "Failed to create ExoPlayer presenter to show the ad. Falling back to using native media player presenter.", th5);
}
try {
bVar = new f(eVar, activity, map, oVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
} catch (Throwable th6) {
interfaceC0046a.a("Failed to create FullscreenVideoAdExoPlayerPresenter with sdk: " + oVar + " and throwable: " + th6.getMessage(), th6);
return;
}
}
} else {
try {
bVar = new f(eVar, activity, map, oVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
} catch (Throwable th7) {
interfaceC0046a.a("Failed to create FullscreenVideoAdPresenter with sdk: " + oVar + " and throwable: " + th7.getMessage(), th7);
return;
}
}
} else {
try {
bVar = new com.applovin.impl.adview.activity.b.b(eVar, activity, map, oVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
} catch (Throwable th8) {
interfaceC0046a.a("Failed to create FullscreenGraphicAdPresenter with sdk: " + oVar + " and throwable: " + th8.getMessage(), th8);
return;
}
}
bVar.c();
interfaceC0046a.a(bVar);
}
public a(com.applovin.impl.sdk.ad.e eVar, Activity activity, @Nullable Map<String, Object> map, o oVar, AppLovinAdClickListener appLovinAdClickListener, AppLovinAdDisplayListener appLovinAdDisplayListener, AppLovinAdVideoPlaybackListener appLovinAdVideoPlaybackListener) {
this.a = eVar;
this.b = oVar;
this.c = oVar.M();
this.e = activity;
this.s = appLovinAdClickListener;
this.t = appLovinAdDisplayListener;
this.u = appLovinAdVideoPlaybackListener;
this.v = new com.applovin.impl.sdk.b.b(activity, oVar);
this.v.a(this);
this.d = new com.applovin.impl.sdk.d.d(eVar, oVar);
this.G = new k(oVar);
b bVar = new b();
if (((Boolean) oVar.a(com.applovin.impl.sdk.c.b.cZ)).booleanValue()) {
AppLovinBroadcastManager.registerReceiver(this, new IntentFilter("com.applovin.render_process_gone"));
}
this.f = new com.applovin.impl.adview.o(oVar.L(), AppLovinAdSize.INTERSTITIAL, activity);
this.f.setAdClickListener(bVar);
this.f.setAdDisplayListener(new AppLovinAdDisplayListener() {
@Override
public void adDisplayed(AppLovinAd appLovinAd) {
x xVar = a.this.c;
if (x.a()) {
a.this.c.b("AppLovinFullscreenActivity", "Web content rendered");
}
}
@Override
public void adHidden(AppLovinAd appLovinAd) {
x xVar = a.this.c;
if (x.a()) {
a.this.c.b("AppLovinFullscreenActivity", "Closing from WebView");
}
a.this.h();
}
});
this.f.getController().a(this.d);
if (((Boolean) oVar.a(com.applovin.impl.sdk.c.b.ax)).booleanValue()) {
this.g = new v(new p(map, oVar), activity);
}
oVar.F().trackImpression(eVar);
List<Integer> u = eVar.u();
if (eVar.t() >= 0 || u != null) {
this.h = new n(eVar.v(), activity);
this.h.setVisibility(8);
this.h.setOnClickListener(bVar);
} else {
this.h = null;
}
this.i = new n(j.a.WHITE_ON_TRANSPARENT, activity);
this.i.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
a.this.h();
}
});
if (eVar.ao()) {
this.z = new j.a() {
@Override
public void a(int i) {
if (a.this.q != com.applovin.impl.sdk.j.a) {
a.this.r = true;
}
com.applovin.impl.adview.d s = a.this.f.getController().s();
if (com.applovin.impl.sdk.j.a(i) && !com.applovin.impl.sdk.j.a(a.this.q)) {
s.a("javascript:al_muteSwitchOn();");
} else if (i == 2) {
s.a("javascript:al_muteSwitchOff();");
}
a.this.q = i;
}
};
} else {
this.z = null;
}
if (((Boolean) oVar.a(com.applovin.impl.sdk.c.b.fQ)).booleanValue()) {
this.y = new com.applovin.impl.sdk.utils.a() {
@Override
public void onActivityCreated(Activity activity2, Bundle bundle) {
if (!a.this.B.get()) {
if (activity2.getClass().getName().equals(Utils.retrieveLauncherActivityFullyQualifiedName(activity2.getApplicationContext()))) {
AppLovinSdkUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
x.j("AppLovinFullscreenActivity", "Dismissing on-screen ad due to app relaunched via launcher.");
try {
a.this.h();
} catch (Throwable th) {
x.c("AppLovinFullscreenActivity", "Failed to dismiss ad.", th);
try {
a.this.o();
} catch (Throwable th2) {
}
}
}
});
}
}
}
};
} else {
this.y = null;
}
}
private void c() {
if (this.z != null) {
this.b.ae().a(this.z);
}
if (this.y != null) {
this.b.x().a(this.y);
}
}
public void a(boolean z) {
List<Uri> checkCachedResourcesExist = Utils.checkCachedResourcesExist(z, this.a, this.b, this.e);
if (!checkCachedResourcesExist.isEmpty()) {
if (((Boolean) this.b.a(com.applovin.impl.sdk.c.b.fV)).booleanValue()) {
x xVar = this.c;
if (x.a()) {
this.c.e("AppLovinFullscreenActivity", "Dismissing ad due to missing resources: " + checkCachedResourcesExist);
}
q.a(this.a, this.t, "Missing ad resources", null, null);
h();
return;
}
x xVar2 = this.c;
if (x.a()) {
this.c.e("AppLovinFullscreenActivity", "Streaming ad due to missing ad resources: " + checkCachedResourcesExist);
}
this.a.a();
}
}
public void b(boolean z) {
a(z, ((Long) this.b.a(com.applovin.impl.sdk.c.b.cW)).longValue());
com.applovin.impl.sdk.utils.n.a(this.t, this.a);
this.b.aa().a(this.a);
if (this.a.hasVideoUrl() || u()) {
com.applovin.impl.sdk.utils.n.a(this.u, this.a);
}
new com.applovin.impl.adview.activity.b(this.e).a(this.a);
this.d.a();
this.a.setHasShown(true);
}
public void f() {
x xVar = this.c;
if (x.a()) {
this.c.c("AppLovinFullscreenActivity", "onResume()");
}
this.d.d(SystemClock.elapsedRealtime() - this.C);
a("javascript:al_onAppResumed();");
r();
if (this.v.c()) {
this.v.a();
}
}
public void c(boolean z) {
x xVar = this.c;
if (x.a()) {
this.c.c("AppLovinFullscreenActivity", "onWindowFocusChanged(boolean) - " + z);
}
a("javascript:al_onWindowFocusChanged( " + z + " );");
}
public void g() {
x xVar = this.c;
if (x.a()) {
this.c.c("AppLovinFullscreenActivity", "onPause()");
}
this.C = SystemClock.elapsedRealtime();
a("javascript:al_onAppPaused();");
if (this.v.c()) {
this.v.a();
}
q();
}
public void h() {
this.D = true;
x xVar = this.c;
if (x.a()) {
this.c.c("AppLovinFullscreenActivity", "dismiss()");
}
if (this.a != null) {
this.a.o().e();
}
this.x.removeCallbacksAndMessages(null);
a("javascript:al_onPoststitialDismiss();", this.a.W());
o();
this.d.c();
this.G.a();
if (this.z != null) {
this.b.ae().b(this.z);
}
if (this.y != null) {
this.b.x().b(this.y);
}
if (p()) {
this.e.finish();
return;
}
this.b.M();
if (x.a()) {
this.b.M().b("AppLovinFullscreenActivity", "Fullscreen ad shown in container view dismissed, destroying the presenter.");
}
k();
}
public boolean i() {
return this.D;
}
public void j() {
x xVar = this.c;
if (x.a()) {
this.c.c("AppLovinFullscreenActivity", "onStop()");
}
}
public void k() {
if (this.f != null) {
ViewParent parent = this.f.getParent();
this.f.destroy();
this.f = null;
if ((parent instanceof ViewGroup) && p()) {
((ViewGroup) parent).removeAllViews();
}
}
n();
o();
this.s = null;
this.t = null;
this.u = null;
this.e = null;
AppLovinBroadcastManager.unregisterReceiver(this);
}
public void a(Configuration configuration) {
x xVar = this.c;
if (x.a()) {
this.c.c("AppLovinFullscreenActivity", "onConfigurationChanged(Configuration) - " + configuration);
}
}
public void a(int i, KeyEvent keyEvent) {
if (this.c != null) {
x xVar = this.c;
if (x.a()) {
this.c.c("AppLovinFullscreenActivity", "onKeyDown(int, KeyEvent) - " + i + ", " + keyEvent);
}
}
}
public void l() {
x xVar = this.c;
if (x.a()) {
this.c.c("AppLovinFullscreenActivity", "onBackPressed()");
}
if (this.H) {
h();
}
if (this.a.Y()) {
b("javascript:onBackPressed();");
}
}
protected void a(String str) {
if (this.a.Z()) {
a(str, 0L);
}
}
public void b(String str) {
a(str, 0L);
}
public void a(final String str, long j) {
if (j >= 0) {
a(new Runnable() {
@Override
public void run() {
com.applovin.impl.adview.d s;
if (!StringUtils.isValidString(str) || a.this.f == null || (s = a.this.f.getController().s()) == null) {
return;
}
s.a(str);
}
}, j);
}
}
public void a(n nVar, long j, Runnable runnable) {
if (j < ((Long) this.b.a(com.applovin.impl.sdk.c.b.cG)).longValue()) {
this.b.N().a(new ac(this.b, new AnonymousClass6(nVar, runnable)), r.b.MAIN, TimeUnit.SECONDS.toMillis(j), true);
}
}
public class AnonymousClass6 implements Runnable {
final n a;
final Runnable b;
AnonymousClass6(n nVar, Runnable runnable) {
this.a = nVar;
this.b = runnable;
}
@Override
public void run() {
AppLovinSdkUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
com.applovin.impl.sdk.utils.v.a(AnonymousClass6.this.a, 400L, new Runnable() {
@Override
public void run() {
AnonymousClass6.this.a.bringToFront();
AnonymousClass6.this.b.run();
}
});
}
});
}
}
public int m() {
int H = this.a.H();
if (H <= 0 && ((Boolean) this.b.a(com.applovin.impl.sdk.c.b.cV)).booleanValue()) {
return this.m + 1;
}
return H;
}
public void a(int i, boolean z, boolean z2, long j) {
if (this.A.compareAndSet(false, true)) {
if (this.a.hasVideoUrl() || u()) {
com.applovin.impl.sdk.utils.n.a(this.u, this.a, i, z2);
}
if (this.a.hasVideoUrl()) {
this.d.c(i);
}
long elapsedRealtime = SystemClock.elapsedRealtime() - this.j;
this.b.F().trackVideoEnd(this.a, TimeUnit.MILLISECONDS.toSeconds(elapsedRealtime), i, z);
long elapsedRealtime2 = this.k == -1 ? -1L : SystemClock.elapsedRealtime() - this.k;
this.b.F().trackFullScreenAdClosed(this.a, elapsedRealtime2, this.F, j, this.r, this.q);
x xVar = this.c;
if (x.a()) {
this.c.b("AppLovinFullscreenActivity", "Video ad ended at percent: " + i + "%, elapsedTime: " + elapsedRealtime + "ms, skipTimeMillis: " + j + "ms, closeTimeMillis: " + elapsedRealtime2 + "ms");
}
}
}
protected void o() {
if (this.B.compareAndSet(false, true)) {
com.applovin.impl.sdk.utils.n.b(this.t, this.a);
this.b.aa().b(this.a);
}
}
protected boolean p() {
return this.e instanceof AppLovinFullscreenActivity;
}
public void q() {
if (this.w != null) {
this.w.b();
}
}
protected void r() {
if (this.w != null) {
this.w.c();
}
}
public boolean u() {
return AppLovinAdType.INCENTIVIZED == this.a.getType() || AppLovinAdType.AUTO_INCENTIVIZED == this.a.getType();
}
public void b(long j) {
x xVar = this.c;
if (x.a()) {
this.c.b("AppLovinFullscreenActivity", "Scheduling report reward in " + TimeUnit.MILLISECONDS.toSeconds(j) + " seconds...");
}
this.w = s.a(j, this.b, new Runnable() {
@Override
public void run() {
if (!a.this.a.aj().getAndSet(true)) {
a.this.b.N().a(new y(a.this.a, a.this.b), r.b.REWARD);
}
}
});
}
public void a(boolean z, long j) {
if (this.a.X()) {
a(z ? "javascript:al_mute();" : "javascript:al_unmute();", j);
}
}
public void w() {
com.applovin.impl.adview.d s;
if (this.f != null && this.a.G() && (s = this.f.getController().s()) != null) {
this.G.a(s, new k.a() {
@Override
public void a(View view) {
a.this.b.ak().a(s.a.BLACK_VIEW, CollectionUtils.map("clcode", a.this.a.getClCode()));
if (((Boolean) a.this.b.a(com.applovin.impl.sdk.c.b.gn)).booleanValue()) {
a.this.h();
return;
}
a.this.H = ((Boolean) a.this.b.a(com.applovin.impl.sdk.c.b.go)).booleanValue();
if (((Boolean) a.this.b.a(com.applovin.impl.sdk.c.b.gp)).booleanValue() && a.this.h != null) {
a.this.h.setVisibility(0);
}
}
});
}
}
public void x() {
x xVar = this.c;
if (x.a()) {
this.c.c("AppLovinFullscreenActivity", "Handling render process crash");
}
this.l = true;
}
@Override
public void onReceive(Intent intent, @Nullable Map<String, Object> map) {
if ("com.applovin.render_process_gone".equals(intent.getAction()) && !this.l) {
x();
}
}
public void a(Runnable runnable, long j) {
AppLovinSdkUtils.runOnUiThreadDelayed(runnable, j, this.x);
}
private class b implements View.OnClickListener, AppLovinAdClickListener {
private b() {
}
@Override
public void adClicked(AppLovinAd appLovinAd) {
x xVar = a.this.c;
if (x.a()) {
a.this.c.b("AppLovinFullscreenActivity", "Clicking through graphic");
}
com.applovin.impl.sdk.utils.n.a(a.this.s, appLovinAd);
a.this.d.b();
a.this.p++;
}
@Override
public void onClick(View view) {
if (view == a.this.h && ((Boolean) a.this.b.a(com.applovin.impl.sdk.c.b.cH)).booleanValue()) {
a.b(a.this);
if (a.this.a.Y()) {
a.this.b("javascript:al_onCloseButtonTapped(" + a.this.E + "," + a.this.o + "," + a.this.p + ");");
}
List<Integer> u = a.this.a.u();
x xVar = a.this.c;
if (x.a()) {
a.this.c.b("AppLovinFullscreenActivity", "Handling close button tap " + a.this.E + " with multi close delay: " + u);
}
if (u != null && u.size() > a.this.E) {
a.this.F.add(Long.valueOf(SystemClock.elapsedRealtime() - a.this.k));
List<j.a> w = a.this.a.w();
if (w != null && w.size() > a.this.E) {
a.this.h.a(w.get(a.this.E));
}
x xVar2 = a.this.c;
if (x.a()) {
a.this.c.b("AppLovinFullscreenActivity", "Scheduling next close button with delay: " + u.get(a.this.E));
}
a.this.h.setVisibility(8);
a.this.a(a.this.h, u.get(a.this.E).intValue(), new Runnable() {
@Override
public void run() {
a.this.k = SystemClock.elapsedRealtime();
}
});
return;
}
a.this.h();
return;
}
x xVar3 = a.this.c;
if (x.a()) {
a.this.c.e("AppLovinFullscreenActivity", "Unhandled click on widget: " + view);
}
}
}
}