正在查看: Handling Master v2 应用的 f.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Handling Master v2 应用的 f.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
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.g1;
import com.applovin.impl.l4;
import com.applovin.sdk.AppLovinSdkUtils;
class f extends Dialog implements g1 {
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 e;
private RelativeLayout f;
private e g;
public class a implements Animation.AnimationListener {
public a() {
}
@Override
public void onAnimationEnd(Animation animation) {
f.this.g.setClickable(true);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
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.I();
this.a = activity;
this.d = bVar;
this.e = 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.f = relativeLayout;
relativeLayout.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
this.f.setBackgroundColor(-1157627904);
this.f.addView(this.d);
if (!this.e.k1()) {
a(this.e.e1());
g();
}
setContentView(this.f);
}
public void e() {
this.f.removeView(this.d);
super.dismiss();
}
public void f() {
try {
if (this.g == null) {
a();
}
this.g.setVisibility(0);
this.g.bringToFront();
AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, 1.0f);
alphaAnimation.setDuration(300L);
alphaAnimation.setAnimationListener(new a());
this.g.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 g() {
this.a.runOnUiThread(new Runnable() {
@Override
public final void run() {
f.this.f();
}
});
}
public b c() {
return this.d;
}
@Override
public void dismiss() {
this.a.runOnUiThread(new Runnable() {
@Override
public final void run() {
f.this.e();
}
});
}
@Override
public void onBackPressed() {
this.d.a("javascript:al_onBackPressed();");
dismiss();
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
d();
}
@Override
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();
}
public void b(View view) {
if (this.g.isClickable()) {
this.g.performClick();
}
}
private void a(e.a aVar) {
if (this.g != 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.g = a2;
a2.setVisibility(8);
this.g.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
f.this.a(view);
}
});
this.g.setClickable(false);
int a3 = a(((Integer) this.b.a(l4.u1)).intValue());
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(a3, a3);
layoutParams.addRule(10);
com.applovin.impl.sdk.j jVar = this.b;
l4 l4Var = l4.x1;
layoutParams.addRule(((Boolean) jVar.a(l4Var)).booleanValue() ? 9 : 11);
this.g.a(a3);
int a4 = a(((Integer) this.b.a(l4.w1)).intValue());
int a5 = a(((Integer) this.b.a(l4.v1)).intValue());
layoutParams.setMargins(a5, a4, a5, 0);
this.f.addView(this.g, layoutParams);
this.g.bringToFront();
int a6 = a(((Integer) this.b.a(l4.y1)).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(l4Var)).booleanValue() ? 9 : 11);
layoutParams2.setMargins(a5 - a(5), a4 - a(5), a5 - a(5), 0);
view.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
f.this.b(view2);
}
});
this.f.addView(view, layoutParams2);
view.bringToFront();
}
public com.applovin.impl.sdk.ad.a b() {
return this.e;
}
public void a(View view) {
a();
}
private int a(int i) {
return AppLovinSdkUtils.dpToPx(this.a, i);
}
}