Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f
以下内容为反编译后的 e.java 源代码,内容仅作参考
package com.applovin.impl.adview.activity.b;
import android.R;
import android.app.Activity;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.graphics.PointF;
import android.graphics.drawable.AnimatedVectorDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.StrictMode;
import android.os.SystemClock;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ProgressBar;
import androidx.annotation.Nullable;
import by.kufar.complaint.ui.ComplaintActivity;
import com.applovin.adview.AppLovinAdView;
import com.applovin.communicator.AppLovinCommunicator;
import com.applovin.communicator.AppLovinCommunicatorMessage;
import com.applovin.communicator.AppLovinCommunicatorSubscriber;
import com.applovin.exoplayer2.ab;
import com.applovin.exoplayer2.ac;
import com.applovin.exoplayer2.ak;
import com.applovin.exoplayer2.am;
import com.applovin.exoplayer2.an;
import com.applovin.exoplayer2.aw;
import com.applovin.exoplayer2.ba;
import com.applovin.exoplayer2.h.ad;
import com.applovin.exoplayer2.h.u;
import com.applovin.exoplayer2.k0;
import com.applovin.exoplayer2.l.ai;
import com.applovin.exoplayer2.ui.f;
import com.applovin.impl.adview.AppLovinTouchToClickListener;
import com.applovin.impl.adview.j;
import com.applovin.impl.adview.m;
import com.applovin.impl.adview.t;
import com.applovin.impl.adview.u;
import com.applovin.impl.adview.v;
import com.applovin.impl.adview.w;
import com.applovin.impl.sdk.e.o;
import com.applovin.impl.sdk.e.z;
import com.applovin.impl.sdk.p;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.sdk.utils.Utils;
import com.applovin.impl.sdk.utils.k;
import com.applovin.impl.sdk.utils.r;
import com.applovin.impl.sdk.utils.s;
import com.applovin.impl.sdk.y;
import com.applovin.sdk.AppLovinAdClickListener;
import com.applovin.sdk.AppLovinAdDisplayListener;
import com.applovin.sdk.AppLovinAdVideoPlaybackListener;
import com.applovin.sdk.AppLovinSdkUtils;
import com.iab.omid.library.applovin.adsession.FriendlyObstructionPurpose;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
public class e extends com.applovin.impl.adview.activity.b.a implements AppLovinCommunicatorSubscriber {
@Nullable
protected v A;
@Nullable
protected final ProgressBar B;
protected final j C;
protected boolean D;
protected long E;
protected int F;
protected boolean G;
protected boolean H;
private final com.applovin.impl.adview.activity.a.c I;
private final a J;
private final Handler K;
private final boolean L;
private long M;
private final AtomicBoolean N;
private final AtomicBoolean O;
private long P;
private long Q;
protected final com.applovin.exoplayer2.ui.g f29662v;
protected final aw f29663w;
protected final com.applovin.impl.adview.a f29664x;
@Nullable
protected final m f29665y;
@Nullable
protected final ImageView f29666z;
public class a implements w.a {
private a() {
}
@Override
public void a(v vVar) {
y yVar = e.this.f29606c;
if (y.a()) {
e.this.f29606c.b("AppLovinFullscreenActivity", "Clicking through from video button...");
}
e.this.a(vVar.getAndClearLastClickLocation(), false);
}
@Override
public void b(v vVar) {
y yVar = e.this.f29606c;
if (y.a()) {
e.this.f29606c.b("AppLovinFullscreenActivity", "Closing ad from video button...");
}
e.this.h();
}
@Override
public void c(v vVar) {
y yVar = e.this.f29606c;
if (y.a()) {
e.this.f29606c.b("AppLovinFullscreenActivity", "Skipping video from video button...");
}
e.this.c();
}
@Override
public void d(v vVar) {
y yVar = e.this.f29606c;
if (y.a()) {
e.this.f29606c.b("AppLovinFullscreenActivity", "Attempting to install app from video button...");
}
e.this.a(vVar.getAndClearLastClickLocation(), true);
}
}
public class b implements an.b, f.d, AppLovinTouchToClickListener.OnClickListener {
private b() {
}
@Override
public void a(ab abVar, int i11) {
k0.a(this, abVar, i11);
}
@Override
public void b() {
k0.k(this);
}
@Override
public void b_(boolean z11) {
k0.o(this, z11);
}
@Override
public void c(int i11) {
k0.p(this, i11);
}
@Override
public void d(int i11) {
k0.r(this, i11);
}
@Override
public void e(int i11) {
k0.t(this, i11);
}
@Override
public void onClick(View view, PointF pointF) {
e.this.a(pointF, false);
}
@Override
public void a(ac acVar) {
k0.b(this, acVar);
}
@Override
public void b(ak akVar) {
k0.m(this, akVar);
}
@Override
public void c(boolean z11) {
k0.q(this, z11);
}
@Override
public void d(boolean z11) {
k0.s(this, z11);
}
@Override
public void e(boolean z11) {
k0.u(this, z11);
}
@Override
public void a(am amVar) {
k0.d(this, amVar);
}
@Override
public void b(boolean z11, int i11) {
k0.n(this, z11, i11);
}
@Override
public void a(an.a aVar) {
k0.e(this, aVar);
}
@Override
public void b(int i11) {
y yVar = e.this.f29606c;
if (y.a()) {
e.this.f29606c.b("AppLovinFullscreenActivity", "Player state changed to state " + i11 + " and will play when ready: " + e.this.f29663w.x());
}
if (i11 == 2) {
e.this.x();
e.this.f29607d.g();
return;
}
if (i11 != 3) {
if (i11 == 4) {
y yVar2 = e.this.f29606c;
if (y.a()) {
e.this.f29606c.b("AppLovinFullscreenActivity", "Video completed");
}
e eVar = e.this;
eVar.H = true;
if (!eVar.f29615l) {
eVar.A();
return;
} else {
if (eVar.t()) {
e.this.H();
return;
}
return;
}
}
return;
}
e eVar2 = e.this;
eVar2.f29663w.a(!eVar2.D ? 1 : 0);
e eVar3 = e.this;
eVar3.c(eVar3.f29663w.H());
e.this.u();
y yVar3 = e.this.f29606c;
if (y.a()) {
e.this.f29606c.b("AppLovinFullscreenActivity", "MediaPlayer prepared: " + e.this.f29663w);
}
e.this.C.a();
e eVar4 = e.this;
if (eVar4.f29665y != null) {
eVar4.C();
}
e.this.y();
if (e.this.f29623t.c()) {
e.this.e();
}
}
@Override
public void a(an.e eVar, an.e eVar2, int i11) {
k0.f(this, eVar, eVar2, i11);
}
@Override
public void a(an anVar, an.c cVar) {
k0.g(this, anVar, cVar);
}
@Override
public void a(ba baVar, int i11) {
k0.h(this, baVar, i11);
}
@Override
public void a(ad adVar, com.applovin.exoplayer2.j.h hVar) {
k0.i(this, adVar, hVar);
}
@Override
public void a(boolean z11, int i11) {
k0.j(this, z11, i11);
}
@Override
public void a(ak akVar) {
e.this.c("Video view error (" + akVar + ")");
e.this.h();
}
@Override
public void a(int i11) {
if (i11 == 0) {
e.this.f29662v.b();
}
}
}
public class c implements View.OnClickListener {
private c() {
}
@Override
public void onClick(View view) {
e eVar = e.this;
if (view == eVar.f29665y) {
if (eVar.s()) {
e.this.e();
e.this.p();
e.this.f29623t.b();
return;
}
e.this.c();
return;
}
if (view == eVar.f29666z) {
eVar.z();
return;
}
y yVar = eVar.f29606c;
if (y.a()) {
e.this.f29606c.e("AppLovinFullscreenActivity", "Unhandled click on widget: " + view);
}
}
}
public e(com.applovin.impl.sdk.ad.e eVar, Activity activity, @Nullable Map<String, Object> map, p pVar, AppLovinAdClickListener appLovinAdClickListener, AppLovinAdDisplayListener appLovinAdDisplayListener, AppLovinAdVideoPlaybackListener appLovinAdVideoPlaybackListener) {
super(eVar, activity, map, pVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
this.I = new com.applovin.impl.adview.activity.a.c(this.f29604a, this.f29608e, this.f29605b);
a aVar = new a();
this.J = aVar;
Handler handler = new Handler(Looper.getMainLooper());
this.K = handler;
j jVar = new j(handler, this.f29605b);
this.C = jVar;
boolean f11 = this.f29604a.f();
this.L = f11;
this.D = Utils.isVideoMutedInitially(this.f29605b);
this.M = -1L;
this.N = new AtomicBoolean();
this.O = new AtomicBoolean();
this.P = -2L;
this.Q = 0L;
if (eVar.hasVideoUrl()) {
c cVar = new c();
if (eVar.r() >= 0) {
m mVar = new m(eVar.x(), activity);
this.f29665y = mVar;
mVar.setVisibility(8);
mVar.setOnClickListener(cVar);
} else {
this.f29665y = null;
}
if (a(this.D, pVar)) {
ImageView imageView = new ImageView(activity);
this.f29666z = imageView;
imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
imageView.setClickable(true);
imageView.setOnClickListener(cVar);
d(this.D);
} else {
this.f29666z = null;
}
String C = eVar.C();
if (StringUtils.isValidString(C)) {
w wVar = new w(pVar);
wVar.a(new WeakReference<>(aVar));
v vVar = new v(wVar, activity);
this.A = vVar;
vVar.a(C);
} else {
this.A = null;
}
if (f11) {
com.applovin.impl.adview.a aVar2 = new com.applovin.impl.adview.a(activity, ((Integer) pVar.a(com.applovin.impl.sdk.c.b.cQ)).intValue(), R.attr.progressBarStyleLarge);
this.f29664x = aVar2;
aVar2.setColor(Color.parseColor("#75FFFFFF"));
aVar2.setBackgroundColor(Color.parseColor("#00000000"));
aVar2.setVisibility(8);
AppLovinCommunicator.getInstance(activity).subscribe(this, "video_caching_failed");
} else {
this.f29664x = null;
}
if (eVar.O()) {
ProgressBar progressBar = new ProgressBar(activity, null, R.attr.progressBarStyleHorizontal);
this.B = progressBar;
progressBar.setMax(10000);
progressBar.setPadding(0, 0, 0, 0);
if (com.applovin.impl.sdk.utils.h.d()) {
progressBar.setProgressTintList(ColorStateList.valueOf(eVar.P()));
}
jVar.a("PROGRESS_BAR", ((Long) pVar.a(com.applovin.impl.sdk.c.b.cN)).longValue(), new j.a() {
@Override
public void a() {
e eVar2 = e.this;
if (eVar2.G) {
eVar2.B.setVisibility(8);
return;
}
float I = (float) eVar2.f29663w.I();
e eVar3 = e.this;
eVar3.B.setProgress((int) ((I / ((float) eVar3.E)) * 10000.0f));
}
@Override
public boolean b() {
return !e.this.G;
}
});
} else {
this.B = null;
}
aw a11 = new aw.a(activity).a();
this.f29663w = a11;
b bVar = new b();
a11.a((an.b) bVar);
a11.c(0);
com.applovin.exoplayer2.ui.g gVar = new com.applovin.exoplayer2.ui.g(activity);
this.f29662v = gVar;
gVar.b();
gVar.setControllerVisibilityListener(bVar);
gVar.setPlayer(a11);
gVar.setOnTouchListener(new AppLovinTouchToClickListener(pVar, com.applovin.impl.sdk.c.b.aZ, activity, bVar));
B();
return;
}
throw new IllegalStateException("Attempting to use fullscreen video ad presenter for non-video ad");
}
private void G() {
v vVar;
final boolean z11;
t D = this.f29604a.D();
if (D != null && D.e() && !this.G && (vVar = this.A) != null) {
if (vVar.getVisibility() == 4) {
z11 = true;
} else {
z11 = false;
}
final long f11 = D.f();
AppLovinSdkUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
if (z11) {
r.a(e.this.A, f11, (Runnable) null);
} else {
r.b(e.this.A, f11, null);
}
}
});
}
}
public void H() {
this.I.a(this.f29612i);
this.f29614k = SystemClock.elapsedRealtime();
}
public void A() {
D();
this.I.a(this.f29611h, this.f29610g, this.f29609f);
a("javascript:al_onPoststitialShow(" + this.f29616m + "," + this.f29617n + ");", this.f29604a.S());
if (this.f29611h != null) {
if (this.f29604a.t() >= 0) {
a(this.f29611h, this.f29604a.t(), new Runnable() {
@Override
public void run() {
e.this.f29614k = SystemClock.elapsedRealtime();
}
});
} else {
this.f29611h.setVisibility(0);
}
}
ArrayList arrayList = new ArrayList();
m mVar = this.f29611h;
if (mVar != null) {
arrayList.add(new com.applovin.impl.sdk.a.d(mVar, FriendlyObstructionPurpose.CLOSE_AD, "close button"));
}
u uVar = this.f29610g;
if (uVar != null && uVar.b()) {
u uVar2 = this.f29610g;
arrayList.add(new com.applovin.impl.sdk.a.d(uVar2, FriendlyObstructionPurpose.NOT_VISIBLE, uVar2.getIdentifier()));
}
this.f29604a.o().a(this.f29609f, arrayList);
v();
this.G = true;
}
public void B() {
a(!this.L);
Activity activity = this.f29608e;
com.applovin.exoplayer2.h.u a11 = new u.a(new com.applovin.exoplayer2.k.p(activity, ai.a((Context) activity, "com.applovin.sdk"))).a(ab.a(this.f29604a.h()));
this.f29663w.a(!this.D ? 1 : 0);
this.f29663w.a((com.applovin.exoplayer2.h.p) a11);
this.f29663w.w();
this.f29663w.a(false);
}
public void C() {
if (this.O.compareAndSet(false, true)) {
a(this.f29665y, this.f29604a.r(), new Runnable() {
@Override
public void run() {
e.this.P = -1L;
e.this.Q = SystemClock.elapsedRealtime();
}
});
}
}
public void D() {
this.F = F();
this.f29663w.a(false);
}
public void E() {
if (this.G) {
if (y.a()) {
this.f29606c.d("AppLovinFullscreenActivity", "Skip video resume - postitial shown");
return;
}
return;
}
if (this.f29605b.Y().isApplicationPaused()) {
if (y.a()) {
this.f29606c.d("AppLovinFullscreenActivity", "Skip video resume - app paused");
return;
}
return;
}
long j11 = this.M;
if (j11 >= 0) {
if (y.a()) {
this.f29606c.b("AppLovinFullscreenActivity", "Resuming video at position " + j11 + "ms for MediaPlayer: " + this.f29663w);
}
this.f29663w.a(true);
this.C.a();
this.M = -1L;
if (!this.f29663w.a()) {
x();
return;
}
return;
}
if (y.a()) {
this.f29606c.b("AppLovinFullscreenActivity", "Invalid last video position, isVideoPlaying=" + this.f29663w.a());
}
}
public int F() {
aw awVar = this.f29663w;
if (awVar == null) {
return 0;
}
long I = awVar.I();
if (this.H) {
return 100;
}
if (I > 0) {
return (int) ((((float) I) / ((float) this.E)) * 100.0f);
}
return this.F;
}
public void c(long j11) {
this.E = j11;
}
@Override
public void d() {
a((ViewGroup) null);
}
@Override
public void e() {
if (y.a()) {
this.f29606c.b("AppLovinFullscreenActivity", "Pausing video");
}
if (this.f29663w.a()) {
this.M = this.f29663w.I();
this.f29663w.a(false);
this.C.c();
if (y.a()) {
this.f29606c.b("AppLovinFullscreenActivity", "Paused video at position " + this.M + "ms");
return;
}
return;
}
if (y.a()) {
this.f29606c.b("AppLovinFullscreenActivity", "Nothing to pause");
}
}
@Override
public String getCommunicatorId() {
return "FullscreenVideoAdExoPlayerPresenter";
}
@Override
public void h() {
this.C.b();
this.K.removeCallbacksAndMessages(null);
m();
super.h();
}
@Override
public void k() {
if (((Boolean) this.f29605b.a(com.applovin.impl.sdk.c.b.fR)).booleanValue()) {
s.a(this.A);
this.A = null;
}
this.f29663w.E();
if (this.L) {
AppLovinCommunicator.getInstance(this.f29608e).unsubscribe(this, "video_caching_failed");
}
super.k();
}
@Override
public void m() {
super.a(F(), this.L, r(), this.P);
}
@Override
public void onMessageReceived(AppLovinCommunicatorMessage appLovinCommunicatorMessage) {
if ("video_caching_failed".equals(appLovinCommunicatorMessage.getTopic())) {
Bundle messageData = appLovinCommunicatorMessage.getMessageData();
long j11 = messageData.getLong(ComplaintActivity.KEY_AD_ID);
if (((Boolean) this.f29605b.a(com.applovin.impl.sdk.c.b.f31608fz)).booleanValue() && j11 == this.f29604a.getAdIdNumber() && this.L) {
int i11 = messageData.getInt("load_response_code");
String string = messageData.getString("load_exception_message");
if ((string != null || i11 < 200 || i11 >= 300) && !this.H && !this.f29663w.a()) {
c("Video cache error during stream. ResponseCode=" + i11 + ", exception=" + string);
}
}
}
}
@Override
public boolean r() {
if (this.f29604a == null || F() < this.f29604a.Q()) {
return false;
}
return true;
}
@Override
public boolean s() {
if (t() && !r()) {
return true;
}
return false;
}
@Override
public void u() {
long ae2;
long millis;
long j11 = 0;
if (this.f29604a.ad() >= 0 || this.f29604a.ae() >= 0) {
if (this.f29604a.ad() >= 0) {
ae2 = this.f29604a.ad();
} else {
com.applovin.impl.sdk.ad.a aVar = (com.applovin.impl.sdk.ad.a) this.f29604a;
long j12 = this.E;
if (j12 > 0) {
j11 = 0 + j12;
}
if (aVar.af()) {
int l11 = (int) ((com.applovin.impl.sdk.ad.a) this.f29604a).l();
if (l11 > 0) {
millis = TimeUnit.SECONDS.toMillis(l11);
} else {
int t11 = (int) aVar.t();
if (t11 > 0) {
millis = TimeUnit.SECONDS.toMillis(t11);
}
}
j11 += millis;
}
ae2 = (long) (j11 * (this.f29604a.ae() / 100.0d));
}
b(ae2);
}
}
@Override
public void w() {
super.w();
this.I.a(this.A);
this.I.a((View) this.f29665y);
if (!t() || this.G) {
H();
}
}
public void x() {
AppLovinSdkUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
com.applovin.impl.adview.a aVar = e.this.f29664x;
if (aVar != null) {
aVar.a();
}
}
});
}
public void y() {
AppLovinSdkUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
com.applovin.impl.adview.a aVar = e.this.f29664x;
if (aVar != null) {
aVar.b();
}
}
});
}
public void z() {
boolean z11 = !this.D;
this.D = z11;
this.f29663w.a(!z11 ? 1 : 0);
d(this.D);
a(this.D, 0L);
}
@Override
public void b() {
if (y.a()) {
this.f29606c.b("AppLovinFullscreenActivity", "Skipping video from prompt");
}
c();
}
@Override
public void c(boolean z11) {
super.c(z11);
if (z11) {
a(0L);
} else {
if (this.G) {
return;
}
e();
}
}
public void d(boolean z11) {
if (com.applovin.impl.sdk.utils.h.d()) {
AnimatedVectorDrawable animatedVectorDrawable = (AnimatedVectorDrawable) this.f29608e.getDrawable(z11 ? com.applovin.sdk.R.drawable.applovin_ic_unmute_to_mute : com.applovin.sdk.R.drawable.applovin_ic_mute_to_unmute);
if (animatedVectorDrawable != null) {
this.f29666z.setScaleType(ImageView.ScaleType.FIT_XY);
this.f29666z.setImageDrawable(animatedVectorDrawable);
animatedVectorDrawable.start();
return;
}
}
Uri aE = z11 ? this.f29604a.aE() : this.f29604a.aF();
StrictMode.ThreadPolicy allowThreadDiskReads = StrictMode.allowThreadDiskReads();
this.f29666z.setImageURI(aE);
StrictMode.setThreadPolicy(allowThreadDiskReads);
}
@Override
public void a(@Nullable ViewGroup viewGroup) {
this.I.a(this.f29666z, this.f29665y, this.A, this.f29664x, this.B, this.f29662v, this.f29609f, this.f29610g, null, viewGroup);
com.applovin.impl.adview.u uVar = this.f29610g;
if (uVar != null) {
uVar.a();
}
this.f29663w.a(true);
if (this.f29604a.am()) {
this.f29623t.a(this.f29604a, new Runnable() {
@Override
public void run() {
e.this.a(250L);
}
});
}
if (this.L) {
x();
}
this.f29609f.renderAd(this.f29604a);
this.f29607d.b(this.L ? 1L : 0L);
if (this.f29665y != null) {
this.f29605b.M().a(new z(this.f29605b, new Runnable() {
@Override
public void run() {
e.this.C();
}
}), o.a.MAIN, this.f29604a.s(), true);
}
super.b(this.D);
}
public void c() {
this.P = SystemClock.elapsedRealtime() - this.Q;
if (y.a()) {
this.f29606c.b("AppLovinFullscreenActivity", "Skipping video with skip time: " + this.P + "ms");
}
this.f29607d.f();
this.f29616m++;
if (this.f29604a.y()) {
h();
} else {
A();
}
}
public void c(String str) {
if (y.a()) {
this.f29606c.e("AppLovinFullscreenActivity", "Encountered media error: " + str + " for ad: " + this.f29604a);
}
if (this.N.compareAndSet(false, true)) {
AppLovinAdDisplayListener appLovinAdDisplayListener = this.f29621r;
if (appLovinAdDisplayListener instanceof com.applovin.impl.sdk.ad.h) {
((com.applovin.impl.sdk.ad.h) appLovinAdDisplayListener).onAdDisplayFailed(str);
}
h();
}
}
public void a(PointF pointF, boolean z11) {
if (this.f29604a.E()) {
if (y.a()) {
this.f29606c.b("AppLovinFullscreenActivity", "Clicking through video");
}
Uri k11 = this.f29604a.k();
if (k11 != null) {
AppLovinAdView appLovinAdView = this.f29609f;
this.f29605b.E().trackAndLaunchVideoClick(this.f29604a, k11, pointF, z11, this, appLovinAdView != null ? appLovinAdView.getContext() : p.y());
k.a(this.f29620q, this.f29604a);
this.f29607d.b();
this.f29617n++;
return;
}
return;
}
G();
}
@Override
public void a(long j11) {
a(new Runnable() {
@Override
public void run() {
e.this.E();
}
}, j11);
}
private static boolean a(boolean z11, p pVar) {
if (!((Boolean) pVar.a(com.applovin.impl.sdk.c.b.cF)).booleanValue()) {
return false;
}
if (!((Boolean) pVar.a(com.applovin.impl.sdk.c.b.cG)).booleanValue() || z11) {
return true;
}
return ((Boolean) pVar.a(com.applovin.impl.sdk.c.b.cI)).booleanValue();
}
@Override
public void a() {
if (y.a()) {
this.f29606c.b("AppLovinFullscreenActivity", "Continue video from prompt - will resume in onWindowFocusChanged(true) when alert dismisses");
}
}
}