Picsart v24.6版本的 MD5 值为:21a61631d94e54da68d2ad9268b8b9d9
以下内容为反编译后的 o.java 源代码,内容仅作参考
package com.applovin.impl.adview;
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.j;
import com.applovin.sdk.AppLovinSdkUtils;
public class o extends Dialog implements n {
private final Activity ahP;
private final d ahQ;
private final com.applovin.impl.sdk.ad.a ahR;
private RelativeLayout ahS;
private j ahT;
private final com.applovin.impl.sdk.x logger;
private final com.applovin.impl.sdk.n sdk;
public o(com.applovin.impl.sdk.ad.a aVar, d dVar, Activity activity, com.applovin.impl.sdk.n nVar) {
super(activity, 16973840);
if (aVar == null) {
throw new IllegalArgumentException("No ad specified");
}
if (dVar == null) {
throw new IllegalArgumentException("No main view specified");
}
if (nVar == null) {
throw new IllegalArgumentException("No sdk specified");
}
if (activity == null) {
throw new IllegalArgumentException("No activity specified");
}
this.sdk = nVar;
this.logger = nVar.Ci();
this.ahP = activity;
this.ahQ = dVar;
this.ahR = aVar;
requestWindowFeature(1);
setCancelable(false);
}
private void a(j.a aVar) {
if (this.ahT != null) {
if (com.applovin.impl.sdk.x.FL()) {
this.logger.h("ExpandedAdDialog", "Attempting to create duplicate close button");
return;
}
return;
}
j a = j.a(aVar, this.ahP);
this.ahT = a;
a.setVisibility(8);
this.ahT.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
o.this.j(view);
}
});
this.ahT.setClickable(false);
int ga = ga(((Integer) this.sdk.a(com.applovin.impl.sdk.c.b.aOj)).intValue());
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(ga, ga);
layoutParams.addRule(10);
com.applovin.impl.sdk.n nVar = this.sdk;
com.applovin.impl.sdk.c.b<Boolean> bVar = com.applovin.impl.sdk.c.b.aOm;
layoutParams.addRule(((Boolean) nVar.a(bVar)).booleanValue() ? 9 : 11);
this.ahT.fZ(ga);
int ga2 = ga(((Integer) this.sdk.a(com.applovin.impl.sdk.c.b.aOl)).intValue());
int ga3 = ga(((Integer) this.sdk.a(com.applovin.impl.sdk.c.b.aOk)).intValue());
layoutParams.setMargins(ga3, ga2, ga3, 0);
this.ahS.addView(this.ahT, layoutParams);
this.ahT.bringToFront();
int ga4 = ga(((Integer) this.sdk.a(com.applovin.impl.sdk.c.b.aOn)).intValue());
View view = new View(this.ahP);
view.setBackgroundColor(0);
int i = ga + ga4;
RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(i, i);
layoutParams2.addRule(10);
layoutParams2.addRule(((Boolean) this.sdk.a(bVar)).booleanValue() ? 9 : 11);
layoutParams2.setMargins(ga3 - ga(5), ga2 - ga(5), ga3 - ga(5), 0);
view.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
o.this.i(view2);
}
});
this.ahS.addView(view, layoutParams2);
view.bringToFront();
}
private int ga(int i) {
return AppLovinSdkUtils.dpToPx(this.ahP, i);
}
public void i(View view) {
if (this.ahT.isClickable()) {
this.ahT.performClick();
}
}
public void j(View view) {
rO();
}
private void rN() {
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
layoutParams.addRule(13);
this.ahQ.setLayoutParams(layoutParams);
RelativeLayout relativeLayout = new RelativeLayout(this.ahP);
this.ahS = relativeLayout;
relativeLayout.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
this.ahS.setBackgroundColor(-1157627904);
this.ahS.addView(this.ahQ);
if (!this.ahR.Gr()) {
a(this.ahR.Gs());
rP();
}
setContentView(this.ahS);
}
private void rO() {
this.ahQ.bq("javascript:al_onCloseTapped();");
dismiss();
}
private void rP() {
this.ahP.runOnUiThread(new Runnable() {
@Override
public final void run() {
o.this.rS();
}
});
}
public void rS() {
try {
if (this.ahT == null) {
rO();
}
this.ahT.setVisibility(0);
this.ahT.bringToFront();
AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, 1.0f);
alphaAnimation.setDuration(300L);
alphaAnimation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationEnd(Animation animation) {
o.this.ahT.setClickable(true);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationStart(Animation animation) {
}
});
this.ahT.startAnimation(alphaAnimation);
} catch (Throwable th) {
if (com.applovin.impl.sdk.x.FL()) {
this.logger.c("ExpandedAdDialog", "Unable to fade in close button", th);
}
rO();
}
}
public void rT() {
this.ahS.removeView(this.ahQ);
super.dismiss();
}
@Override
public void dismiss() {
this.ahP.runOnUiThread(new Runnable() {
@Override
public final void run() {
o.this.rT();
}
});
}
@Override
public void onBackPressed() {
this.ahQ.bq("javascript:al_onBackPressed();");
dismiss();
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
rN();
}
@Override
public void onStart() {
super.onStart();
try {
Window window = getWindow();
if (window != null) {
window.setFlags(this.ahP.getWindow().getAttributes().flags, this.ahP.getWindow().getAttributes().flags);
window.addFlags(16777216);
} else if (com.applovin.impl.sdk.x.FL()) {
this.logger.i("ExpandedAdDialog", "Unable to turn on hardware acceleration - window is null");
}
} catch (Throwable th) {
if (com.applovin.impl.sdk.x.FL()) {
this.logger.c("ExpandedAdDialog", "Setting window flags failed.", th);
}
}
}
public com.applovin.impl.sdk.ad.a rQ() {
return this.ahR;
}
public d rR() {
return this.ahQ;
}
}