正在查看: CallApp v2.226 应用的 b.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: CallApp v2.226 应用的 b.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package sg.bigo.ads.ad.interstitial.a.a;
import a1.d0;
import android.app.Activity;
import android.content.Context;
import android.os.SystemClock;
import android.text.TextUtils;
import android.view.View;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
import android.widget.FrameLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.lang.ref.WeakReference;
import sg.bigo.ads.ad.banner.b;
import sg.bigo.ads.ad.banner.g;
import sg.bigo.ads.ad.interstitial.a.b.b;
import sg.bigo.ads.ad.interstitial.s;
import sg.bigo.ads.api.Ad;
import sg.bigo.ads.common.i;
import sg.bigo.ads.common.utils.t;
import sg.bigo.ads.common.utils.u;
import sg.bigo.ads.controller.landing.d;
import sg.bigo.ads.core.c.c;
import sg.bigo.ads.core.f.a.a;
import sg.bigo.ads.core.f.a.p;
import sg.bigo.ads.core.mraid.c;
import sg.bigo.ads.core.mraid.e;
import sg.bigo.ads.core.mraid.n;
public final class b implements b.InterfaceC0051b, sg.bigo.ads.ad.interstitial.a.b.b {
@NonNull
final sg.bigo.ads.api.core.c a;
long e;
sg.bigo.ads.core.c.b f;
public g g;
WebView h;
public View i;
boolean j;
boolean k;
@Nullable
final b.a n;
private final boolean o;
private final String p;
private final a.C0131a q;
@Nullable
private final sg.bigo.ads.core.player.c r;
@Nullable
private final p s;
@NonNull
private final Ad t;
private e u;
boolean b = false;
boolean c = false;
boolean d = false;
boolean l = false;
final C0060b m = new C0060b(0);
public final class a {
private a() {
}
@JavascriptInterface
public final void gameEnd(String str) {
b.a aVar = b.this.n;
if (aVar != null) {
aVar.b();
}
}
@JavascriptInterface
public final void onBGNDomContentLoaded() {
b bVar = b.this;
bVar.k = true;
b.a aVar = bVar.n;
if (aVar != null) {
aVar.c(bVar.a, SystemClock.elapsedRealtime() - b.this.e);
}
}
@JavascriptInterface
public final void onBGNLoaded() {
b bVar = b.this;
bVar.j = true;
b.a aVar = bVar.n;
if (aVar != null) {
aVar.b(bVar.a, SystemClock.elapsedRealtime() - b.this.e);
}
}
public a(b bVar, byte b) {
this();
}
}
public static final class C0060b {
private boolean a;
private int b;
private WeakReference<Activity> c;
private C0060b() {
this.a = false;
this.b = -1;
}
private void b() {
if (this.a) {
int i = this.b;
this.b = -1;
if (i == 0 || i == 1) {
WeakReference<Activity> weakReference = this.c;
Activity activity = weakReference == null ? null : weakReference.get();
if (activity == null) {
return;
}
activity.setRequestedOrientation(i);
}
}
}
public final void a() {
this.a = true;
b();
}
public C0060b(byte b) {
this();
}
public final void a(Activity activity, int i) {
this.b = i;
this.c = new WeakReference<>(activity);
b();
}
}
public b(@NonNull Ad ad, @NonNull sg.bigo.ads.api.core.c cVar, @Nullable sg.bigo.ads.core.player.c cVar2, @Nullable p pVar, @Nullable a.C0131a c0131a, @Nullable b.a aVar) {
this.q = c0131a;
this.p = c0131a == null ? null : c0131a.b;
this.r = cVar2;
this.s = pVar;
this.t = ad;
this.a = cVar;
this.n = aVar;
this.o = !TextUtils.isEmpty(r7);
}
@Override
@Nullable
public final View a() {
return this.i;
}
@Override
public final boolean b() {
if (this.o) {
return this.c;
}
return false;
}
@Override
public final void c() {
sg.bigo.ads.common.t.a.a(0, 3, "HtmlVastCompanion", "resume");
e eVar = this.u;
if (eVar != null) {
eVar.d();
}
}
@Override
public final void d() {
sg.bigo.ads.common.t.a.a(0, 3, "HtmlVastCompanion", "pause");
e eVar = this.u;
if (eVar != null) {
eVar.a(false);
}
}
@Override
public final void e() {
sg.bigo.ads.common.t.a.a(0, 3, "HtmlVastCompanion", "release");
sg.bigo.ads.ad.banner.b.h(this);
sg.bigo.ads.core.c.b bVar = this.f;
if (bVar != null) {
bVar.b();
}
e eVar = this.u;
if (eVar != null) {
eVar.e();
this.u = null;
}
WebView webView = this.h;
if (webView != null) {
u.b(webView);
this.h = null;
}
this.g = null;
}
@Override
public final void f() {
b.a aVar;
if (this.j || this.k || this.l || (aVar = this.n) == null || this.e <= 0) {
return;
}
aVar.d(this.a, SystemClock.elapsedRealtime() - this.e);
}
@Override
public final void a(int i) {
if (i == 1) {
this.m.a();
sg.bigo.ads.core.player.c cVar = this.r;
if (cVar != null) {
cVar.b();
}
}
}
@Override
public final void a(int i, int i2) {
int i3;
int i4;
WebView webView = this.h;
if (webView == null) {
return;
}
Context context = webView.getContext();
a.C0131a c0131a = this.q;
int i5 = 0;
if (c0131a != null) {
i4 = c0131a.c;
i3 = c0131a.d;
} else {
i3 = 0;
i4 = 0;
}
if (sg.bigo.ads.common.utils.e.a(context, i4) <= i && sg.bigo.ads.common.utils.e.a(context, i3) <= i2) {
i5 = i4;
}
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) this.h.getLayoutParams();
if (i5 <= 0 || i3 <= 0) {
layoutParams.width = i;
layoutParams.height = i2;
} else {
layoutParams.gravity = 17;
layoutParams.width = sg.bigo.ads.common.utils.e.a(context, i5);
layoutParams.height = sg.bigo.ads.common.utils.e.a(context, i3);
}
}
public final void a(Context context, String str, i iVar) {
sg.bigo.ads.api.core.e a2;
sg.bigo.ads.common.t.a.a(0, 3, "HtmlVastCompanion", "handle ad click.");
b.a aVar = this.n;
if (aVar == null || !aVar.c()) {
str = null;
}
String str2 = str;
if (this.a.f().c() == 0 || !(this.t instanceof sg.bigo.ads.ad.c)) {
a2 = sg.bigo.ads.ad.interstitial.a.a.a.a(context, this.t, this.a, str2, this.s, this.q);
a2.g = 0;
} else {
Context context2 = this.i.getContext();
Ad ad = this.t;
d.a(context2, (sg.bigo.ads.ad.c<?, ?>) (ad instanceof s ? ((s) ad).x : (sg.bigo.ads.ad.c) ad));
a2 = new sg.bigo.ads.api.core.e();
a2.g = 1;
}
sg.bigo.ads.core.player.c cVar = this.r;
if (cVar != null && !cVar.c()) {
this.r.a();
}
g gVar = this.g;
if (gVar != null) {
gVar.a(iVar, a2);
}
}
@Override
public final boolean a(final Context context) {
sg.bigo.ads.core.c.c cVar;
int i;
int i2;
byte b = 0;
if (!this.o) {
return false;
}
if (this.u == null) {
try {
this.u = new e(context, n.INTERSTITIAL);
} catch (NoClassDefFoundError unused) {
sg.bigo.ads.common.t.a.a(0, "HtmlVastCompanion", "Banner webview is not support");
}
e eVar = this.u;
if (eVar == null) {
return false;
}
eVar.g = new e.b() {
@Override
public final void a() {
sg.bigo.ads.core.c.c cVar2;
b bVar = b.this;
bVar.c = true;
bVar.d = false;
cVar2 = c.a.a;
bVar.f = cVar2.a(b.this.h, new View[0]);
b bVar2 = b.this;
if (bVar2.b) {
if (bVar2.h != null) {
sg.bigo.ads.common.t.a.a(0, 3, "HtmlVastCompanion", "javascript:onViewImpression()");
bVar2.h.loadUrl("javascript:onViewImpression()");
}
sg.bigo.ads.core.c.b bVar3 = b.this.f;
if (bVar3 != null) {
bVar3.a();
}
}
sg.bigo.ads.ad.banner.b.b(b.this);
b.a aVar = b.this.n;
if (aVar != null) {
aVar.a();
}
}
@Override
public final void b() {
b bVar = b.this;
bVar.d = false;
bVar.l = true;
sg.bigo.ads.ad.banner.b.c(bVar);
b bVar2 = b.this;
b.a aVar = bVar2.n;
if (aVar != null) {
aVar.a(bVar2.a, SystemClock.elapsedRealtime() - b.this.e);
}
}
@Override
public final void c() {
sg.bigo.ads.common.t.a.a(0, "HtmlVastCompanion", "onRenderProcessGone");
}
@Override
public final void d() {
sg.bigo.ads.common.t.a.a(0, 3, "HtmlVastCompanion", "onExpand");
}
@Override
public final void e() {
sg.bigo.ads.common.t.a.a(0, 3, "HtmlVastCompanion", "onResize");
}
@Override
public final void f() {
g gVar = b.this.g;
if (gVar != null) {
gVar.a();
}
}
@Override
public final void g() {
g gVar = b.this.g;
if (gVar != null) {
gVar.a();
}
}
@Override
public final void a(@NonNull String str, @Nullable i iVar) {
b.this.a(context, str, iVar);
}
@Override
public final boolean b(Activity activity, int i3) {
b.this.m.a(activity, i3);
return true;
}
@Override
public final boolean a(Activity activity, int i3) {
b.this.m.a(activity, i3);
return true;
}
};
String str = this.p;
cVar = c.a.a;
String o = d0.o(d0.o(cVar.c(str), "\n<script>document.addEventListener('DOMContentLoaded',function(){BGN_PLAYABLE.onBGNDomContentLoaded()});\nwindow.addEventListener('load',function(){BGN_PLAYABLE.onBGNLoaded()});</script>"), "\n<script type=\"text/javascript\">\n document.body.style.margin = '0px';\n</script>");
this.e = SystemClock.elapsedRealtime();
b.a aVar = this.n;
if (aVar != null) {
aVar.a(this.a);
}
this.u.a(o, new e.d() {
@Override
public final void a() {
sg.bigo.ads.common.t.a.a(0, 3, "HtmlVastCompanion", "onReady");
}
});
this.d = true;
t.a();
}
c.C0136c b2 = this.u.b();
this.h = b2;
if (b2 != null) {
b2.setOverScrollMode(2);
this.h.setHorizontalScrollBarEnabled(false);
this.h.setHorizontalScrollbarOverlay(false);
this.h.setVerticalScrollBarEnabled(false);
this.h.setVerticalScrollbarOverlay(false);
this.h.getSettings().setSupportZoom(false);
this.h.setBackgroundColor(-1);
a.C0131a c0131a = this.q;
if (c0131a != null) {
i2 = c0131a.c;
i = c0131a.d;
} else {
i = 0;
i2 = 0;
}
WebView webView = this.h;
if (webView != null) {
Object parent = webView.getParent();
if (parent instanceof FrameLayout) {
this.i = (View) parent;
sg.bigo.ads.ad.banner.b.a(this);
Context context2 = webView.getContext();
int i3 = context2.getResources().getDisplayMetrics().widthPixels;
int c = sg.bigo.ads.common.utils.e.c(context2);
if (sg.bigo.ads.common.utils.e.a(context2, i2) > i3 || sg.bigo.ads.common.utils.e.a(context2, i) > c) {
i2 = 0;
}
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) webView.getLayoutParams();
if (i2 <= 0 || i <= 0) {
layoutParams.width = -1;
layoutParams.height = -1;
} else {
layoutParams.gravity = 17;
layoutParams.width = sg.bigo.ads.common.utils.e.a(context2, i2);
layoutParams.height = sg.bigo.ads.common.utils.e.a(context2, i);
}
}
}
this.h.addJavascriptInterface(new a(this, b), "BGN_PLAYABLE");
}
return true;
}
}