正在查看: Handling Master v2 应用的 n.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Handling Master v2 应用的 n.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.thinkup.expressad.mbbanner.o.o0;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.util.Base64;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import com.thinkup.core.common.n.o0n;
import com.thinkup.core.express.web.BaseWebView;
import com.thinkup.expressad.atsignalcommon.bridge.CommonJSBridgeImpUtils;
import com.thinkup.expressad.atsignalcommon.windvane.BaseAbsFeedBackForH5;
import com.thinkup.expressad.atsignalcommon.windvane.m0;
import com.thinkup.expressad.foundation.m0.mn;
import com.thinkup.expressad.foundation.m0.o00;
import com.thinkup.expressad.foundation.m0.omn;
import com.thinkup.expressad.foundation.m0.oom;
import com.thinkup.expressad.foundation.m0.ooo;
import com.thinkup.expressad.foundation.o0.o0;
import com.thinkup.expressad.mbbanner.o.n.oo;
import com.thinkup.expressad.mbbanner.view.TUBannerWebView;
import com.thinkup.expressad.out.TemplateBannerView;
import com.thinkup.expressad.out.mn;
import com.thinkup.expressad.widget.TUAdChoice;
import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.json.JSONObject;
public final class n {
private static final String n = "BannerShowManager";
com.thinkup.expressad.out.n m;
private ImageView m0;
private ImageView mm;
private ImageView mn;
private TUBannerWebView mo;
private boolean n0;
private boolean nm;
private boolean nn;
private boolean no;
com.thinkup.expressad.m.o o;
private com.thinkup.expressad.mbbanner.o.n.n o0;
private boolean o00;
private boolean o0m;
private final String o0n;
private boolean o0o;
private o0 om;
private com.thinkup.expressad.mbbanner.o.o.n omo;
private final TemplateBannerView on;
private float on0;
private float ono;
private boolean oo;
private final String oo0;
private int oon;
private List<o0> ooo;
private int oom = 1;
private final long om0 = 15000;
private final Handler omm = new Handler(Looper.getMainLooper()) {
@Override
public final void handleMessage(Message message) {
super.handleMessage(message);
int i = message.what;
}
};
private final com.thinkup.expressad.foundation.on.m0.o omn = new com.thinkup.expressad.foundation.on.m0.o() {
@Override
public final void m() {
}
@Override
public final void n() {
}
@Override
public final void o() {
n.this.o(com.thinkup.expressad.mbbanner.o.o.nm);
}
};
private final View.OnClickListener onm = new View.OnClickListener() {
@Override
public final void onClick(View view) {
if (n.this.o0m) {
n.m(n.this);
}
}
};
private com.thinkup.expressad.mbbanner.o.n.o onn = new com.thinkup.expressad.mbbanner.o.n.o() {
@Override
public final void m() {
n.m(n.this);
}
@Override
public final void o(int i) {
if (i == 2) {
n.n(n.this);
} else {
n.this.mm();
}
}
@Override
public final void m(int i) {
if (i == 1) {
n.this.om();
} else {
n.this.n();
}
}
@Override
public final void o() {
n.m(n.this);
}
@Override
public final void o(o0 o0Var) {
n.this.o(o0Var, false, "");
}
@Override
public final void o(boolean z) {
if (n.this.o0 != null) {
n.this.o0o = z;
if (z) {
n.this.o0.m();
} else {
n.this.o0.n();
}
}
}
@Override
public final void o(boolean z, String str) {
try {
if (n.this.o0 != null) {
if (TextUtils.isEmpty(str)) {
n.this.o0.o(n.this.om);
n.this.o0.o();
} else {
o0 m = o0.m(o0.o(n.this.om));
m.o00(str);
n.this.o(m, z, str);
}
}
} catch (Exception e) {
e.getMessage();
}
}
};
private com.thinkup.expressad.atsignalcommon.m.m m00 = new com.thinkup.expressad.atsignalcommon.m.m() {
@Override
public final void onPageFinished(WebView webView, String str) {
n.nm(n.this);
m0.o();
com.thinkup.core.express.o0.o.o(webView);
n.o0m(n.this);
if (n.this.om == null || n.this.om.oo0()) {
return;
}
n.this.om();
}
@Override
public final void onReceivedError(WebView webView, int i, String str, String str2) {
n.this.o(str);
}
@Override
public final void onRenderProcessGone(WebView webView) {
n.this.n();
}
};
public n(TemplateBannerView templateBannerView, com.thinkup.expressad.mbbanner.o.n.n nVar, String str, String str2, boolean z, com.thinkup.expressad.om.n nVar2) {
this.oo = z;
this.on = templateBannerView;
this.o0n = str2;
this.oo0 = str;
this.o0 = new oo(nVar, nVar2);
}
@SuppressLint({"ClickableViewAccessibility"})
public void n() {
if (this.on == null) {
o(com.thinkup.expressad.mbbanner.o.o.mo);
return;
}
BaseWebView baseWebView = this.mo;
if (baseWebView != null && baseWebView.getParent() != null) {
this.on.removeView(this.mo);
}
if (this.m0 == null) {
ImageView imageView = new ImageView(o0n.m().on());
this.m0 = imageView;
imageView.setOnTouchListener(new View.OnTouchListener() {
@Override
public final boolean onTouch(View view, MotionEvent motionEvent) {
n.this.on0 = motionEvent.getRawX();
n.this.ono = motionEvent.getRawY();
float unused = n.this.on0;
float unused2 = n.this.ono;
return false;
}
});
this.m0.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
n.this.o(com.thinkup.expressad.mbbanner.o.oo.m.o(CommonJSBridgeImpUtils.buildClickJsonObject(n.this.on0, n.this.ono), n.this.om), false, "");
}
});
}
String onoo = this.om.onoo();
if (TextUtils.isEmpty(onoo)) {
o(com.thinkup.expressad.mbbanner.o.o.m0);
} else {
com.thinkup.expressad.foundation.on.o0.m.o(o0n.m().on()).o(onoo, new com.thinkup.expressad.foundation.on.o0.n() {
@Override
public final void o(Bitmap bitmap, String str) {
if (n.this.m0 != null) {
n.this.m0.setImageBitmap(bitmap);
}
n.nm(n.this);
n.nn(n.this);
n.this.mm();
n.this.mn();
if (n.this.o0m) {
return;
}
n.this.om();
}
@Override
public final void o(String str, String str2) {
n.this.o(com.thinkup.expressad.mbbanner.o.o.mm);
}
});
}
}
public static boolean nm(n nVar) {
nVar.nm = true;
return true;
}
private static void nn() {
}
public static void nn(n nVar) {
if (nVar.m0 != null) {
BaseWebView baseWebView = nVar.mo;
if (baseWebView != null) {
baseWebView.setVisibility(8);
}
if (nVar.m0.getVisibility() != 0) {
nVar.m0.setVisibility(0);
}
if (nVar.on != null) {
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
layoutParams.addRule(10);
nVar.m0.setScaleType(ImageView.ScaleType.FIT_XY);
if (nVar.m0.getParent() == null) {
nVar.on.addView(nVar.m0, layoutParams);
}
nVar.o0(true);
}
}
}
private static void no() {
}
public static boolean o0m(n nVar) {
nVar.o00 = true;
return true;
}
private boolean m() {
String o = o(this.om);
if (TextUtils.isEmpty(o)) {
return false;
}
if (this.on == null) {
o(com.thinkup.expressad.mbbanner.o.o.mo);
return true;
}
if (this.mo == null) {
try {
?? tUBannerWebView = new TUBannerWebView(o0n.m().on());
this.mo = tUBannerWebView;
tUBannerWebView.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
this.mo.setWebViewClient(new com.thinkup.expressad.mbbanner.view.o(this.o0n, this.ooo, this.onn));
} catch (Throwable unused) {
return false;
}
}
ImageView imageView = this.m0;
if (imageView != null) {
imageView.setVisibility(8);
}
if (this.mo.getVisibility() != 0) {
this.mo.setVisibility(0);
}
if (this.mo.getParent() == null) {
this.on.addView(this.mo);
o0(this.om.m0n());
}
if (this.om.m0n()) {
mn();
}
mm();
com.thinkup.expressad.mbbanner.o.o.n nVar = new com.thinkup.expressad.mbbanner.o.o.n(this.on.getContext(), this.oo0, this.o0n);
this.omo = nVar;
nVar.o(this.ooo);
this.omo.o(this.onn);
this.omo.o(this.oon);
this.mo.setWebViewListener(this.m00);
this.mo.setObject(this.omo);
if (o.startsWith("file")) {
this.mo.loadUrl(o);
} else {
this.mo.loadDataWithBaseURL(this.om.o00(), o, "text/html", com.thinkup.expressad.foundation.on.o.moo0, (String) null);
}
BaseWebView baseWebView = this.mo;
if (baseWebView == null) {
return true;
}
baseWebView.postDelayed(new Runnable() {
@Override
public final void run() {
try {
if (n.this.mo != null) {
String str = n.this.oom == 2 ? "false" : "true";
n.this.mo.evaluateJavascript("(function() {\n var videos = document.getElementsByTagName('video');\n for (var i = 0; i < videos.length; i++) {\n videos[i].muted = " + str + ";\n }\n var audios = document.getElementsByTagName('audio');\n for (var i = 0; i < audios.length; i++) {\n audios[i].muted = " + str + ";\n }\n })()", null);
}
} catch (Throwable unused2) {
}
}
}, 1000L);
return true;
}
private void m0() {
com.thinkup.expressad.mbbanner.o.n.n nVar = this.o0;
if (nVar != null) {
nVar.o0();
}
}
public void mm() {
ImageView imageView;
if (!this.oo || (imageView = this.mm) == null) {
return;
}
if (imageView.getVisibility() != 0) {
this.mm.setVisibility(0);
this.mm.setOnClickListener(this.onm);
}
if (this.mm.getParent() != null || this.on == null) {
return;
}
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(oom.m(o0n.m().on(), 12.0f), oom.m(o0n.m().on(), 12.0f));
layoutParams.addRule(11);
layoutParams.addRule(10);
this.on.addView(this.mm, layoutParams);
}
public void mn() {
if (this.on == null) {
return;
}
o0 o0Var = this.om;
if (o0Var != null) {
if (!(o0Var.o() == 1)) {
return;
}
}
TUAdChoice tUAdChoice = new TUAdChoice(o0n.m().on());
tUAdChoice.setCampaign(this.om);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(oom.m(o0n.m().on(), 6.0f), oom.m(o0n.m().on(), 6.0f));
layoutParams.addRule(11);
layoutParams.addRule(12);
this.on.addView(tUAdChoice, layoutParams);
}
private void mo() {
if (this.m0 != null) {
BaseWebView baseWebView = this.mo;
if (baseWebView != null) {
baseWebView.setVisibility(8);
}
if (this.m0.getVisibility() != 0) {
this.m0.setVisibility(0);
}
if (this.on != null) {
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
layoutParams.addRule(10);
this.m0.setScaleType(ImageView.ScaleType.FIT_XY);
if (this.m0.getParent() == null) {
this.on.addView(this.m0, layoutParams);
}
o0(true);
}
}
}
private void n0() {
ImageView imageView;
if (this.oo && (imageView = this.mm) != null && imageView.getVisibility() == 0) {
this.mm.setVisibility(8);
this.mm.setOnClickListener(null);
if (this.on == null || this.mm.getParent() == null) {
return;
}
this.on.removeView(this.mm);
}
}
private int nm() {
return this.oom;
}
private void o0() {
if (this.oo && this.mm == null) {
ImageView imageView = new ImageView(o0n.m().on());
this.mm = imageView;
imageView.setBackgroundResource(mn.o(o0n.m().on(), "thinkup_banner_close", mn.n));
this.mm.setVisibility(8);
this.mm.setContentDescription("closeButton");
}
}
public void om() {
throw new UnsupportedOperationException("Method not decompiled: com.thinkup.expressad.mbbanner.o.o0.n.om():void");
}
private synchronized boolean on() {
boolean n0o;
n0o = this.om.n0o();
if (!n0o) {
this.om.n(true);
}
return n0o;
}
private boolean oo() {
if (this.on == null) {
return false;
}
o0 o0Var = this.om;
return (omn.o(this.on, o0Var != null ? o0Var.oomm() : 0) || this.o0o) ? false : true;
}
public final void o(com.thinkup.expressad.out.n nVar) {
this.m = nVar;
}
public final void o(boolean z, int i) {
this.oon = i;
if (i == 0) {
com.thinkup.expressad.om.m.o();
com.thinkup.expressad.om.n n2 = com.thinkup.expressad.om.m.n(com.thinkup.expressad.foundation.m.m.n().om(), this.o0n);
if (n2 == null) {
return;
} else {
z = n2.o0() == 1;
}
}
this.oo = z;
}
private void o0(boolean z) {
if (this.on != null) {
View m = com.thinkup.expressad.foundation.om.m.o().m(this.o0n);
if (com.thinkup.expressad.foundation.om.m.o().m() && z && m != null) {
ViewGroup viewGroup = (ViewGroup) m.getParent();
if (viewGroup != null) {
viewGroup.removeView(m);
}
m.setVisibility(0);
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) m.getLayoutParams();
if (layoutParams == null) {
layoutParams = new RelativeLayout.LayoutParams(com.thinkup.expressad.foundation.om.m.o, com.thinkup.expressad.foundation.om.m.m);
}
layoutParams.addRule(12);
m.setLayoutParams(layoutParams);
this.on.addView(m);
}
com.thinkup.expressad.foundation.om.m.o().o(this.o0n, new com.thinkup.expressad.foundation.om.o() {
public final void m() {
String str;
n.this.on.onResume();
try {
JSONObject jSONObject = new JSONObject();
if (o0n.m().on() != null) {
jSONObject.put("status", 2);
}
str = jSONObject.toString();
} catch (Throwable th) {
th.getMessage();
str = "";
}
String encodeToString = Base64.encodeToString(str.getBytes(), 2);
m0.o();
com.thinkup.core.express.o0.o.o(n.this.mo, BaseAbsFeedBackForH5.m, encodeToString);
}
public final void n() {
String str;
n.this.on.onResume();
try {
JSONObject jSONObject = new JSONObject();
if (o0n.m().on() != null) {
jSONObject.put("status", 2);
}
str = jSONObject.toString();
} catch (Throwable th) {
th.getMessage();
str = "";
}
String encodeToString = Base64.encodeToString(str.getBytes(), 2);
m0.o();
com.thinkup.core.express.o0.o.o(n.this.mo, BaseAbsFeedBackForH5.m, encodeToString);
}
public final void o() {
String str;
n.this.on.onPause();
try {
JSONObject jSONObject = new JSONObject();
if (o0n.m().on() != null) {
jSONObject.put("status", 1);
}
str = jSONObject.toString();
} catch (Throwable th) {
th.getMessage();
str = "";
}
String encodeToString = Base64.encodeToString(str.getBytes(), 2);
m0.o();
com.thinkup.core.express.o0.o.o(n.this.mo, BaseAbsFeedBackForH5.m, encodeToString);
}
});
this.om.n0(this.o0n);
com.thinkup.expressad.foundation.om.m.o().o(this.o0n, this.om);
}
}
public final void o(boolean z) {
this.oo = z;
}
private static String o(o0 o0Var) {
String concat;
File file;
if (o0Var == null) {
return "";
}
String m = com.thinkup.expressad.videocommon.m.m0.o().m(o0Var.o00());
if (TextUtils.isEmpty(m)) {
m = o0Var.o0o();
if (o0Var.o0nn()) {
try {
file = new File(m);
} catch (Exception unused) {
File file2 = new File(m);
if (file2.exists() && file2.isFile() && file2.canRead()) {
concat = "file:////".concat(String.valueOf(m));
}
}
if (!file.exists()) {
return "";
}
concat = o00.o(file);
return concat;
}
File file3 = new File(m);
if (file3.exists() && file3.isFile() && file3.canRead()) {
return "file:////".concat(String.valueOf(m));
}
}
return m;
}
public final void n(boolean z) {
this.no = z;
om();
}
private static void n(o0 o0Var, Context context, String str) {
if (!TextUtils.isEmpty(o0Var.nno())) {
com.thinkup.expressad.m.o.o(context, o0Var, str, o0Var.nno(), false, true, com.thinkup.expressad.m.m.o.mo);
}
if (TextUtils.isEmpty(str) || o0Var.mon() == null || o0Var.mon().nn() == null) {
return;
}
com.thinkup.expressad.m.o.o(context, o0Var, str, o0Var.mon().nn(), false);
}
public static void n(n nVar) {
ImageView imageView;
if (nVar.oo && (imageView = nVar.mm) != null && imageView.getVisibility() == 0) {
nVar.mm.setVisibility(8);
nVar.mm.setOnClickListener(null);
if (nVar.on == null || nVar.mm.getParent() == null) {
return;
}
nVar.on.removeView(nVar.mm);
}
}
public void o(String str) {
if (this.om == null || on()) {
return;
}
this.omm.removeCallbacks(this.omn);
com.thinkup.expressad.mbbanner.o.n.n nVar = this.o0;
if (nVar != null) {
nVar.o(str);
}
}
public final void o() {
if (this.o0 != null) {
this.o0 = null;
}
TUBannerWebView tUBannerWebView = this.mo;
if (tUBannerWebView != null) {
tUBannerWebView.setWebViewListener(null);
}
if (this.m00 != null) {
this.m00 = null;
}
ImageView imageView = this.mm;
if (imageView != null) {
imageView.setOnClickListener(null);
}
ImageView imageView2 = this.m0;
if (imageView2 != null) {
imageView2.setOnClickListener(null);
}
TemplateBannerView templateBannerView = this.on;
if (templateBannerView != null) {
templateBannerView.removeAllViews();
}
TUBannerWebView tUBannerWebView2 = this.mo;
if (tUBannerWebView2 != null) {
tUBannerWebView2.release();
}
com.thinkup.expressad.mbbanner.o.o.n nVar = this.omo;
if (nVar != null) {
nVar.o();
}
if (this.onn != null) {
this.onn = null;
}
com.thinkup.expressad.foundation.om.m.o().n(this.o0n);
}
public final void m(boolean z) {
this.n0 = z;
om();
}
private void m(o0 o0Var) {
if (o0Var != null) {
n(o0Var, o0n.m().on(), this.o0n);
m(o0Var, o0n.m().on(), this.o0n);
o(o0Var, o0n.m().on(), this.o0n);
}
}
private static void m(o0 o0Var, Context context, String str) {
if (o0Var != null) {
try {
if (TextUtils.isEmpty(o0Var.nnn())) {
return;
}
com.thinkup.expressad.m.o.o(context, o0Var, str, o0Var.nnn(), false, true, com.thinkup.expressad.m.m.o.mm);
} catch (Throwable th) {
th.getMessage();
}
}
}
private o0 m(com.thinkup.expressad.foundation.o0.oo ooVar) {
if (ooVar != null) {
ArrayList<o0> arrayList = ooVar.moo;
this.ooo = arrayList;
if (arrayList != null && arrayList.size() > 0) {
return this.ooo.get(0);
}
}
return null;
}
public static void m(n nVar) {
com.thinkup.expressad.mbbanner.o.n.n nVar2 = nVar.o0;
if (nVar2 != null) {
nVar2.o0();
}
}
private static void o(o0 o0Var, Context context, String str) {
if (o0Var != null) {
try {
List<String> o0 = o0Var.o0();
if (o0 == null || o0.size() <= 0) {
return;
}
Iterator<String> it = o0.iterator();
while (it.hasNext()) {
com.thinkup.expressad.m.o.o(context, o0Var, str, it.next(), true);
}
} catch (Throwable th) {
th.getMessage();
}
}
}
public final void o(o0 o0Var, boolean z, String str) {
if (this.o0m) {
if (this.o == null) {
this.o = new com.thinkup.expressad.m.o(o0n.m().on(), this.o0n);
}
this.o.o(new mn.oo() {
@Override
public final void m(com.thinkup.expressad.out.oo ooVar) {
}
@Override
public final void m(com.thinkup.expressad.out.oo ooVar, String str2) {
if (ooVar == null) {
return;
}
TemplateBannerView unused = n.this.on;
ooo.m();
}
@Override
public final boolean m() {
return false;
}
@Override
public final void n() {
}
@Override
public final void n(com.thinkup.expressad.out.oo ooVar) {
}
@Override
public final void o(o0 o0Var2, String str2) {
TemplateBannerView unused = n.this.on;
ooo.o();
}
@Override
public final void o(com.thinkup.expressad.out.oo ooVar) {
}
@Override
public final void o0(com.thinkup.expressad.out.oo ooVar) {
}
@Override
public final void o(com.thinkup.expressad.out.oo ooVar, String str2) {
if (ooVar == null) {
return;
}
TemplateBannerView unused = n.this.on;
ooo.m();
}
@Override
public final void o() {
if (n.this.o0 != null) {
n.this.o0.o();
}
}
});
o0Var.n0(this.o0n);
if (!this.om.n0m()) {
this.om.n0n();
}
com.thinkup.expressad.mbbanner.o.n.n nVar = this.o0;
if (nVar != null) {
nVar.o(o0Var);
}
if (z) {
TextUtils.isEmpty(str);
}
}
}
public final void o(int i, int i2, int i3, int i4) {
if (i == i3 && i2 == i4) {
return;
}
BaseWebView baseWebView = this.mo;
try {
com.thinkup.core.express.m.o.o();
com.thinkup.core.express.m.o.o((WebView) baseWebView, i, i2);
} catch (Throwable unused) {
}
}
private void o(int i) {
this.oom = i;
}
public final void o(com.thinkup.expressad.foundation.o0.oo r5) {
throw new UnsupportedOperationException("Method not decompiled: com.thinkup.expressad.mbbanner.o.o0.n.o(com.thinkup.expressad.foundation.o0.oo):void");
}
}