Spermatid v6.1.8版本的 MD5 值为:a375ce51a42d528ba6e2583c10478296
以下内容为反编译后的 b.java 源代码,内容仅作参考
package com.mbridge.msdk.click;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.Process;
import android.text.TextUtils;
import android.widget.Toast;
import com.bytedance.sdk.openadsdk.TTAdConstant;
import com.czhj.sdk.common.network.JsonRequest;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.click.CommonJumpLoader;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.tools.SameMD5;
import com.mbridge.msdk.foundation.tools.ad;
import com.mbridge.msdk.foundation.tools.ae;
import com.mbridge.msdk.foundation.tools.ah;
import com.mbridge.msdk.foundation.tools.aj;
import com.mbridge.msdk.foundation.tools.ak;
import com.mbridge.msdk.foundation.tools.o;
import com.mbridge.msdk.foundation.tools.v;
import com.mbridge.msdk.foundation.tools.z;
import com.mbridge.msdk.out.BaseTrackingListener;
import com.mbridge.msdk.out.Campaign;
import com.mbridge.msdk.out.Frame;
import com.mbridge.msdk.out.LoadingActivity;
import com.mbridge.msdk.out.NativeListener;
import com.mbridge.msdk.playercommon.exoplayer2.text.ttml.TtmlNode;
import com.mbridge.msdk.scheme.applet.AppletModelManager;
import com.mbridge.msdk.scheme.applet.AppletSchemeCallBack;
import com.mbridge.msdk.scheme.applet.AppletsModel;
import java.io.File;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
public final class b {
public static boolean f18770a = false;
public static Set<String> f18771b = new HashSet();
public static Set<String> f18772c = new HashSet();
public static Map<String, Long> f18773d = new HashMap();
public static Map<String, Long> f18774e = new HashMap();
public static Handler f18775f = new Handler(Looper.getMainLooper()) {
@Override
public final void handleMessage(Message message) {
super.handleMessage(message);
int i10 = message.what;
if (i10 != 0) {
if (i10 != 1) {
return;
}
b.d();
} else {
Object obj = message.obj;
if (obj == null || !(obj instanceof Context)) {
return;
}
b.a((Context) obj);
}
}
};
private String f18776g;
private long f18777h;
private long f18778i;
private boolean f18779j;
private boolean f18780k;
private boolean f18781l;
private com.mbridge.msdk.c.a f18784o;
private com.mbridge.msdk.foundation.db.i f18785p;
private Context f18786q;
private CommonJumpLoader f18787r;
private HashMap<String, CommonJumpLoader> f18788s;
private com.mbridge.msdk.foundation.same.report.d f18790u;
private h f18791v;
private boolean f18782m = false;
private boolean f18783n = true;
private NativeListener.NativeTrackingListener f18789t = null;
private Handler f18792w = new Handler() {
@Override
public final void handleMessage(Message message) {
super.handleMessage(message);
int i10 = message.what;
if (i10 == 0) {
if (b.this.f18789t != null) {
b.this.f18789t.onDownloadStart(null);
}
} else {
if (i10 != 1) {
if (i10 == 2 && b.this.f18789t != null) {
b.this.f18789t.onDownloadFinish((Campaign) message.obj);
return;
}
return;
}
if (b.this.f18789t != null) {
b.this.f18789t.onDownloadProgress(message.arg1);
}
}
}
};
public b(Context context, String str) {
this.f18785p = null;
this.f18786q = null;
com.mbridge.msdk.c.a b10 = com.mbridge.msdk.c.b.a().b(str);
this.f18784o = b10;
if (b10 == null) {
this.f18784o = com.mbridge.msdk.c.b.a().b();
}
this.f18780k = this.f18784o.ae();
Context applicationContext = context.getApplicationContext();
this.f18786q = applicationContext;
this.f18776g = str;
if (this.f18785p == null) {
this.f18785p = com.mbridge.msdk.foundation.db.i.a(applicationContext);
}
this.f18790u = new com.mbridge.msdk.foundation.same.report.d(this.f18786q);
this.f18788s = new HashMap<>();
}
public static void g(b bVar) {
try {
Intent intent = new Intent();
intent.setAction("ExitApp");
bVar.f18786q.sendBroadcast(intent);
} catch (Exception e10) {
z.c("MBridge SDK M", "Exception", e10);
}
}
private boolean d(CampaignEx campaignEx) {
Long l10;
if (campaignEx != null) {
try {
} catch (Exception e10) {
if (!MBridgeConstans.DEBUG) {
return true;
}
e10.printStackTrace();
return true;
}
}
if (3 != campaignEx.getLinkType()) {
return true;
}
String id2 = campaignEx.getId();
Map<String, Long> map = f18773d;
if (map == null) {
return true;
}
if (map.containsKey(id2) && (l10 = f18773d.get(id2)) != null) {
long currentTimeMillis = System.currentTimeMillis();
if (l10.longValue() > currentTimeMillis || f18771b.contains(campaignEx.getId())) {
z.b("MBridge SDK M", "点击时间未超过coit " + currentTimeMillis + "|" + l10);
return false;
}
}
z.b("MBridge SDK M", "未发现有点击或点击超时保存点击时间 interval = " + campaignEx.getClickTimeOutInterval());
return true;
}
private boolean e(CampaignEx campaignEx) {
Long l10;
if (campaignEx != null) {
try {
} catch (Exception e10) {
if (!MBridgeConstans.DEBUG) {
return true;
}
e10.printStackTrace();
return true;
}
}
if (3 != campaignEx.getLinkType()) {
return true;
}
String id2 = campaignEx.getId();
Map<String, Long> map = f18773d;
if (map == null) {
return true;
}
if (map.containsKey(id2) && (l10 = f18773d.get(id2)) != null) {
long currentTimeMillis = System.currentTimeMillis();
if (l10.longValue() > currentTimeMillis || f18771b.contains(campaignEx.getId())) {
z.b("MBridge SDK M", "点击时间未超过coit " + currentTimeMillis + "|" + l10);
return false;
}
}
z.b("MBridge SDK M", "未发现有点击或点击超时保存点击时间 interval = " + campaignEx.getClickTimeOutInterval());
f18773d.put(campaignEx.getId(), Long.valueOf(System.currentTimeMillis() + ((long) (campaignEx.getClickTimeOutInterval() * 1000))));
return true;
}
private void f(CampaignEx campaignEx) {
if (c() == 2) {
ad.a(this.f18786q, campaignEx.getClickURL(), campaignEx, this.f18789t);
} else {
ad.a(this.f18786q, campaignEx.getClickURL(), (BaseTrackingListener) this.f18789t);
}
}
public final void c(CampaignEx campaignEx) {
boolean z10;
String clickURL;
try {
this.f18779j = false;
if (!e(campaignEx)) {
return;
}
String noticeUrl = campaignEx.getNoticeUrl();
com.mbridge.msdk.foundation.db.c a10 = com.mbridge.msdk.foundation.db.c.a(this.f18785p);
a10.a();
CommonJumpLoader.JumpLoaderResult b10 = a10.b(campaignEx.getId(), this.f18776g);
if (b10 != null) {
if (b10.getNoticeurl() != null) {
b10.setNoticeurl(null);
}
campaignEx.setJumpResult(b10);
a10.a(campaignEx, this.f18776g, false, -1, campaignEx.getTtc_type());
}
if (ae.a(campaignEx)) {
o.a().a(campaignEx);
if (c.e(this.f18786q, campaignEx.getDeepLinkURL())) {
NativeListener.NativeTrackingListener nativeTrackingListener = this.f18789t;
if (nativeTrackingListener != null) {
nativeTrackingListener.onStartRedirection(campaignEx, campaignEx.getClickURL());
}
if (this.f18786q != null) {
Intent intent = new Intent();
intent.setAction("mb_dp_close_broadcast_receiver");
try {
this.f18786q.sendBroadcast(intent);
} catch (Exception unused) {
}
}
a(campaignEx, noticeUrl + "&opdptype=1", -1);
c.b(campaignEx);
NativeListener.NativeTrackingListener nativeTrackingListener2 = this.f18789t;
if (nativeTrackingListener2 != null) {
nativeTrackingListener2.onFinishRedirection(campaignEx, campaignEx.getClickURL());
return;
}
return;
}
noticeUrl = noticeUrl + "&opdptype=0";
o.a().b(campaignEx);
}
if (campaignEx.getLinkType() == 12) {
NativeListener.NativeTrackingListener nativeTrackingListener3 = this.f18789t;
if (nativeTrackingListener3 != null) {
nativeTrackingListener3.onStartRedirection(campaignEx, campaignEx.getClickURL());
}
a(campaignEx, noticeUrl, -1);
a(this.f18786q, campaignEx);
NativeListener.NativeTrackingListener nativeTrackingListener4 = this.f18789t;
if (nativeTrackingListener4 != null) {
nativeTrackingListener4.onFinishRedirection(campaignEx, campaignEx.getClickURL());
return;
}
return;
}
AppletsModel appletsModel = AppletModelManager.getInstance().get(campaignEx);
if (appletsModel != null && appletsModel.isSupportWxScheme()) {
if (appletsModel.isRequestSuccess()) {
if (c.e(this.f18786q, appletsModel.getDeepLink())) {
NativeListener.NativeTrackingListener nativeTrackingListener5 = this.f18789t;
if (nativeTrackingListener5 != null) {
nativeTrackingListener5.onStartRedirection(campaignEx, campaignEx.getClickURL());
}
if (this.f18786q != null) {
Intent intent2 = new Intent();
intent2.setAction("mb_dp_close_broadcast_receiver");
try {
this.f18786q.sendBroadcast(intent2);
} catch (Exception unused2) {
}
}
a(campaignEx, noticeUrl + "&opdptype=1", -1);
c.b(campaignEx);
NativeListener.NativeTrackingListener nativeTrackingListener6 = this.f18789t;
if (nativeTrackingListener6 != null) {
nativeTrackingListener6.onFinishRedirection(campaignEx, campaignEx.getClickURL());
return;
}
return;
}
noticeUrl = noticeUrl + "&opdptype=0";
} else {
if (appletsModel.isRequesting()) {
NativeListener.NativeTrackingListener nativeTrackingListener7 = this.f18789t;
if (nativeTrackingListener7 != null) {
nativeTrackingListener7.onStartRedirection(campaignEx, campaignEx.getClickURL());
}
appletsModel.setAppletSchemeCallBack(a(this.f18789t, campaignEx, appletsModel, this));
return;
}
if (appletsModel.can(1)) {
if (appletsModel.isRequestTimesMaxPerDay()) {
if (!TextUtils.isEmpty(appletsModel.getReBuildClickUrl())) {
campaignEx.setClickURL(appletsModel.getReBuildClickUrl());
}
} else {
NativeListener.NativeTrackingListener nativeTrackingListener8 = this.f18789t;
if (nativeTrackingListener8 != null) {
nativeTrackingListener8.onStartRedirection(campaignEx, campaignEx.getClickURL());
}
appletsModel.requestWxAppletsScheme(1, a(this.f18789t, campaignEx, appletsModel, this));
return;
}
}
}
}
if (!campaignEx.getUserActivation() && c.d(this.f18786q, campaignEx.getPackageName())) {
c.f(this.f18786q, campaignEx.getPackageName());
z.a("MBridge SDK M", campaignEx.getPackageName() + " is intalled.");
a(campaignEx, noticeUrl, com.mbridge.msdk.foundation.same.a.f19799K);
NativeListener.NativeTrackingListener nativeTrackingListener9 = this.f18789t;
if (nativeTrackingListener9 != null) {
nativeTrackingListener9.onStartRedirection(campaignEx, campaignEx.getClickURL());
}
a(campaignEx, false, false, false, campaignEx.getTtc_type(), true, Boolean.TRUE);
NativeListener.NativeTrackingListener nativeTrackingListener10 = this.f18789t;
if (nativeTrackingListener10 != null) {
nativeTrackingListener10.onFinishRedirection(campaignEx, campaignEx.getClickURL());
ad.a(this.f18789t);
return;
}
return;
}
int linkType = campaignEx.getLinkType();
int c10 = c();
if (linkType != 3) {
a(campaignEx, noticeUrl, -1);
}
z.b("MBridge SDK M", "======302跳转前linkType:" + linkType + " openType:" + c10 + "======landingType:" + campaignEx.getLandingType());
if (linkType != 8 && linkType != 9 && linkType != 4) {
z10 = false;
clickURL = campaignEx.getClickURL();
if (TextUtils.isEmpty(clickURL) && (clickURL.startsWith("market://") || clickURL.startsWith("https://play.google.com/"))) {
NativeListener.NativeTrackingListener nativeTrackingListener11 = this.f18789t;
if (nativeTrackingListener11 != null) {
nativeTrackingListener11.onStartRedirection(campaignEx, campaignEx.getClickURL());
}
if (ad.a.a(this.f18786q, campaignEx.getClickURL(), this.f18789t)) {
a(b10, campaignEx, false, false);
z.b("MBridge SDK M", "不用做302跳转 最终地址已经是gp了:" + campaignEx.getClickURL());
NativeListener.NativeTrackingListener nativeTrackingListener12 = this.f18789t;
if (nativeTrackingListener12 != null) {
nativeTrackingListener12.onFinishRedirection(campaignEx, campaignEx.getClickURL());
return;
}
return;
}
a(c10, campaignEx.getClickURL(), campaignEx, this.f18789t);
a(b10, campaignEx, false, false);
z.b("MBridge SDK M", "最终地址是gp, 但是打开失败了:" + campaignEx.getClickURL());
NativeListener.NativeTrackingListener nativeTrackingListener13 = this.f18789t;
if (nativeTrackingListener13 != null) {
nativeTrackingListener13.onFinishRedirection(campaignEx, campaignEx.getClickURL());
return;
}
return;
}
if (z10) {
if (linkType == 2) {
z.b("MBridge SDK M", "linktype为2 开始做302跳转" + campaignEx.getClickURL());
a(campaignEx, false, true, false, campaignEx.getTtc_type(), false, Boolean.TRUE);
return;
}
if (linkType == 3) {
z.b("MBridge SDK M", "linktype为3 开始做302跳转" + campaignEx.getClickURL());
a(campaignEx, false, true, false, campaignEx.getTtc_type(), false, Boolean.TRUE);
return;
}
String clickURL2 = campaignEx.getClickURL();
NativeListener.NativeTrackingListener nativeTrackingListener14 = this.f18789t;
if (nativeTrackingListener14 != null) {
nativeTrackingListener14.onStartRedirection(campaignEx, clickURL2);
}
if (TextUtils.isEmpty(clickURL2)) {
z.b("MBridge SDK M", "linketype=" + linkType + " clickurl 为空");
NativeListener.NativeTrackingListener nativeTrackingListener15 = this.f18789t;
if (nativeTrackingListener15 != null) {
nativeTrackingListener15.onRedirectionFailed(campaignEx, clickURL2);
}
a(b10, campaignEx, true, false);
return;
}
NativeListener.NativeTrackingListener nativeTrackingListener16 = this.f18789t;
if (nativeTrackingListener16 != null) {
nativeTrackingListener16.onFinishRedirection(campaignEx, clickURL2);
}
z.b("MBridge SDK M", "linketyp不是23489的值 用浏览器 打开");
ad.a(this.f18786q, clickURL2, (BaseTrackingListener) this.f18789t);
a(b10, campaignEx, false, false);
return;
}
String clickURL3 = campaignEx.getClickURL();
NativeListener.NativeTrackingListener nativeTrackingListener17 = this.f18789t;
if (nativeTrackingListener17 != null) {
nativeTrackingListener17.onStartRedirection(campaignEx, clickURL3);
}
if (TextUtils.isEmpty(clickURL3)) {
z.b("MBridge SDK M", "linketype=" + linkType + " clickurl 为空");
NativeListener.NativeTrackingListener nativeTrackingListener18 = this.f18789t;
if (nativeTrackingListener18 != null) {
nativeTrackingListener18.onRedirectionFailed(campaignEx, clickURL3);
}
a(b10, campaignEx, true, false);
return;
}
if (linkType == 8) {
z.b("MBridge SDK M", "linketype=8 用webview 打开");
if (campaignEx.getAabEntity() != null && campaignEx.getAabEntity().getHlp() == 1) {
BaseTrackingListener baseTrackingListener = this.f18789t;
if (baseTrackingListener == null && (baseTrackingListener = this.f18791v) != null) {
baseTrackingListener.onStartRedirection(campaignEx, clickURL3);
}
ad.a(this.f18786q, clickURL3, campaignEx, this, baseTrackingListener);
} else {
ad.a(this.f18786q, clickURL3, campaignEx, this.f18789t);
NativeListener.NativeTrackingListener nativeTrackingListener19 = this.f18789t;
if (nativeTrackingListener19 != null) {
nativeTrackingListener19.onFinishRedirection(campaignEx, clickURL3);
}
}
a(b10, campaignEx, false, false);
return;
}
if (linkType == 9) {
z.b("MBridge SDK M", "linketype=9 用浏览器 打开");
ad.a(this.f18786q, clickURL3, (BaseTrackingListener) this.f18789t);
a(b10, campaignEx, false, false);
NativeListener.NativeTrackingListener nativeTrackingListener20 = this.f18789t;
if (nativeTrackingListener20 != null) {
nativeTrackingListener20.onFinishRedirection(campaignEx, clickURL3);
return;
}
return;
}
if (linkType == 4) {
if (c10 == 2) {
z.b("MBridge SDK M", "linketype=4 opent=2 用webview 打开");
ad.a(this.f18786q, clickURL3, campaignEx, this.f18789t);
} else {
z.b("MBridge SDK M", "linketype=4 opent=不为2 用Browser 打开");
ad.a(this.f18786q, clickURL3, (BaseTrackingListener) this.f18789t);
}
}
NativeListener.NativeTrackingListener nativeTrackingListener21 = this.f18789t;
if (nativeTrackingListener21 != null) {
nativeTrackingListener21.onFinishRedirection(campaignEx, clickURL3);
}
a(b10, campaignEx, false, false);
return;
}
z10 = true;
clickURL = campaignEx.getClickURL();
if (TextUtils.isEmpty(clickURL)) {
}
if (z10) {
}
} catch (Throwable th) {
z.c("MBridge SDK M", th.getMessage(), th);
}
}
public final boolean b(CampaignEx campaignEx) {
if (!d(campaignEx)) {
return true;
}
if (!ae.a(campaignEx)) {
return false;
}
String noticeUrl = campaignEx.getNoticeUrl();
o.a().a(campaignEx);
if (c.e(this.f18786q, campaignEx.getDeepLinkURL())) {
try {
} catch (Exception e10) {
if (MBridgeConstans.DEBUG) {
e10.printStackTrace();
}
}
if (2 != campaignEx.getLinkType()) {
if (3 == campaignEx.getLinkType()) {
}
if (this.f18786q != null) {
Intent intent = new Intent();
intent.setAction("mb_dp_close_broadcast_receiver");
try {
this.f18786q.sendBroadcast(intent);
} catch (Exception unused) {
}
}
a(campaignEx, noticeUrl + "&opdptype=1", -1);
c.b(campaignEx);
return true;
}
String id2 = campaignEx.getId();
if (f18773d != null) {
f18773d.put(id2, Long.valueOf(System.currentTimeMillis() + (campaignEx.getClickTimeOutInterval() * 1000)));
}
if (this.f18786q != null) {
}
a(campaignEx, noticeUrl + "&opdptype=1", -1);
c.b(campaignEx);
return true;
}
o.a().b(campaignEx);
return false;
}
public final void a(String str) {
this.f18776g = str;
}
public final void a(NativeListener.NativeTrackingListener nativeTrackingListener) {
this.f18789t = nativeTrackingListener;
}
public final void a(h hVar) {
this.f18791v = hVar;
}
public final void a(boolean z10) {
this.f18783n = z10;
}
public final void a() {
Set<Map.Entry<String, CommonJumpLoader>> entrySet;
CommonJumpLoader value;
try {
HashMap<String, CommonJumpLoader> hashMap = this.f18788s;
if (hashMap != null && (entrySet = hashMap.entrySet()) != null && entrySet.size() > 0) {
for (Map.Entry<String, CommonJumpLoader> entry : entrySet) {
if (entry != null && (value = entry.getValue()) != null) {
value.a();
}
}
}
this.f18789t = null;
} catch (Exception unused) {
}
}
public static void d() {
try {
String language = Locale.getDefault().getLanguage();
if (!TextUtils.isEmpty(language) && language.equals("zh")) {
Toast.makeText(com.mbridge.msdk.foundation.controller.a.f().j(), "正在下载中,请稍候...", 0).show();
} else {
Toast.makeText(com.mbridge.msdk.foundation.controller.a.f().j(), "Downloading....", 0).show();
}
} catch (Exception unused) {
}
}
public final void a(CampaignEx campaignEx, NativeListener.NativeAdListener nativeAdListener) {
if (nativeAdListener != null && campaignEx != null) {
nativeAdListener.onAdClick(campaignEx);
}
z.b("MBridge SDK M", "clickStart");
c(campaignEx);
}
public final void a(CampaignEx campaignEx) {
try {
if (e(campaignEx)) {
com.mbridge.msdk.foundation.db.c a10 = com.mbridge.msdk.foundation.db.c.a(this.f18785p);
a10.a();
CommonJumpLoader.JumpLoaderResult b10 = a10.b(campaignEx.getId(), this.f18776g);
if (b10 != null) {
if (b10.getNoticeurl() != null) {
b10.setNoticeurl(null);
}
campaignEx.setJumpResult(b10);
a10.a(campaignEx, this.f18776g, false, -1, campaignEx.getTtc_type());
}
if (c.d(this.f18786q, campaignEx.getPackageName())) {
z.a("MBridge SDK M", campaignEx.getPackageName() + " is intalled.");
return;
}
a(campaignEx, false, false, false, campaignEx.getTtc_type(), false, Boolean.FALSE);
}
} catch (Throwable th) {
z.c("MBridge SDK M", th.getMessage(), th);
}
}
public static void b(CampaignEx campaignEx, Context context, String str) {
try {
if (str.equals("start") || str.equals("downloading")) {
if (Looper.myLooper() == Looper.getMainLooper()) {
a(context);
} else {
Message obtainMessage = f18775f.obtainMessage(0);
obtainMessage.obj = context;
f18775f.sendMessage(obtainMessage);
}
}
c(campaignEx, context, str);
} catch (Throwable th) {
z.c("MBridge SDK M", th.getMessage(), th);
}
}
private void b(final CampaignEx campaignEx, final String str, final boolean z10) {
String md5;
if (campaignEx != null && !TextUtils.isEmpty(campaignEx.getAkdlui())) {
md5 = campaignEx.getAkdlui();
} else {
md5 = SameMD5.getMD5(str);
}
final String str2 = md5;
try {
com.mbridge.msdk.foundation.tools.g.a(str, 1, campaignEx);
Context j10 = com.mbridge.msdk.foundation.controller.a.f().j();
boolean a10 = ak.a(j10);
boolean c10 = ak.c(j10);
try {
if (!ak.b(j10)) {
a(campaignEx, campaignEx.getNoticeUrl(), com.mbridge.msdk.foundation.same.a.I);
c.a(j10, str, str2);
return;
}
if (!c10) {
c(campaignEx, str, z10);
return;
}
if (!a10) {
c(campaignEx, str, z10);
return;
}
ah.a(com.mbridge.msdk.foundation.controller.a.f().j(), str2 + "isDowning", Long.valueOf(System.currentTimeMillis()));
ah.a(com.mbridge.msdk.foundation.controller.a.f().j(), str2 + "process", Integer.valueOf(Process.myPid()));
} catch (Throwable th) {
th = th;
ah.a(com.mbridge.msdk.foundation.controller.a.f().j(), str2 + "isDowning", 0L);
ah.a(com.mbridge.msdk.foundation.controller.a.f().j(), str2 + "process", 0);
if (MBridgeConstans.DEBUG) {
th.printStackTrace();
}
c(campaignEx, str, z10);
}
} catch (Throwable th2) {
th = th2;
}
}
public void a(CampaignEx campaignEx, String str, int i10) {
if (TextUtils.isEmpty(str)) {
return;
}
if (i10 != -1) {
str = str + "&apk_ptype=" + i10;
}
if (!str.contains("opdptype")) {
str = str + "&opdptype=0";
}
a(this.f18786q, campaignEx, this.f18776g, str, true, false, com.mbridge.msdk.click.a.a.f18741i);
}
private AppletSchemeCallBack a(NativeListener.NativeTrackingListener nativeTrackingListener, CampaignEx campaignEx, AppletsModel appletsModel, b bVar) {
return new f(nativeTrackingListener, campaignEx, appletsModel, bVar);
}
private void a(Context context, CampaignEx campaignEx) {
if (context == null) {
com.mbridge.msdk.foundation.same.report.e.a(com.mbridge.msdk.foundation.controller.a.f().j(), campaignEx, 2, "context is null", this.f18776g);
return;
}
boolean z10 = v.w() == 1;
boolean z11 = v.s(context) == 1;
if (z10 && z11) {
String ghId = campaignEx.getGhId();
String ghPath = campaignEx.getGhPath();
String bindId = campaignEx.getBindId();
String m10 = com.mbridge.msdk.foundation.controller.a.f().m();
if (!TextUtils.isEmpty(ghId)) {
try {
if (!TextUtils.isEmpty(m10)) {
bindId = m10;
}
Object g10 = v.g(bindId);
Class<?> cls = Class.forName("com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram$Req");
Object newInstance = cls.newInstance();
cls.getField("userName").set(newInstance, ghId);
cls.getField(MBridgeConstans.DYNAMIC_VIEW_WX_PATH).set(newInstance, ghPath);
cls.getField("miniprogramType").set(newInstance, cls.getField("MINIPTOGRAM_TYPE_RELEASE").get(null));
Class.forName("com.tencent.mm.opensdk.openapi.IWXAPI").getMethod("sendReq", Class.forName("com.tencent.mm.opensdk.modelbase.BaseReq")).invoke(g10, newInstance);
com.mbridge.msdk.foundation.same.report.e.a(context, campaignEx, 1, "", this.f18776g);
return;
} catch (Throwable th) {
com.mbridge.msdk.foundation.same.report.e.a(context, campaignEx, 2, th.getMessage(), this.f18776g);
f(campaignEx);
return;
}
}
f(campaignEx);
com.mbridge.msdk.foundation.same.report.e.a(context, campaignEx, 2, "ghid is empty", this.f18776g);
return;
}
com.mbridge.msdk.foundation.same.report.e.a(context, campaignEx, 2, "integrated:" + z10 + "-hasWx:" + z11, this.f18776g);
f(campaignEx);
}
public static void a(Context context, CampaignEx campaignEx, String str, String str2, boolean z10, boolean z11) {
if (context == null) {
return;
}
new CommonJumpLoader(context.getApplicationContext(), true).a("2", str, campaignEx, null, str2, z10, z11, com.mbridge.msdk.click.a.a.f18738f);
}
public static void a(Context context, CampaignEx campaignEx, String str, String str2, boolean z10, boolean z11, int i10) {
if (context == null) {
return;
}
new CommonJumpLoader(context.getApplicationContext(), true).a("2", str, campaignEx, null, str2, z10, z11, i10);
}
public static void a(Context context, CampaignEx campaignEx, String str, String[] strArr, boolean z10, boolean z11) {
if (context == null || campaignEx == null || TextUtils.isEmpty(str) || strArr == null) {
return;
}
CommonJumpLoader commonJumpLoader = new CommonJumpLoader(context.getApplicationContext(), true);
for (String str2 : strArr) {
commonJumpLoader.a("2", str, campaignEx, null, str2, z10, z11, com.mbridge.msdk.click.a.a.f18738f);
}
}
private void a(final CampaignEx campaignEx, final boolean z10, boolean z11, boolean z12, final int i10, final boolean z13, final Boolean bool) {
final boolean z14;
CommonJumpLoader commonJumpLoader;
Set<String> set;
try {
this.f18777h = System.currentTimeMillis();
if (z10) {
z.b("MBridge SDK M", "Start 302 Redirection... ");
if (z12 || !this.f18788s.containsKey(campaignEx.getClickURL()) || z11) {
CommonJumpLoader commonJumpLoader2 = new CommonJumpLoader(this.f18786q, z11 ? false : true);
this.f18788s.put(campaignEx.getClickURL(), commonJumpLoader2);
commonJumpLoader2.a("2", this.f18776g, campaignEx, new e() {
@Override
public final void a(Object obj) {
try {
com.mbridge.msdk.foundation.db.c.a(b.this.f18785p).a(campaignEx, b.this.f18776g, z10, 0, i10);
Set<String> set2 = b.f18772c;
if (set2 != null) {
set2.add(campaignEx.getId());
}
} catch (Exception e10) {
e10.printStackTrace();
}
}
@Override
public final void b(Object obj) {
CampaignEx campaignEx2;
if (obj != null) {
try {
if (obj instanceof CommonJumpLoader.JumpLoaderResult) {
CommonJumpLoader.JumpLoaderResult jumpLoaderResult = (CommonJumpLoader.JumpLoaderResult) obj;
z.b("MBridge SDK M", "Redirection done... code: " + jumpLoaderResult.getCode());
CampaignEx campaignEx3 = campaignEx;
if (campaignEx3 != null) {
campaignEx3.setJumpResult(jumpLoaderResult);
b.a(b.this, campaignEx, z10, jumpLoaderResult, i10, true);
}
}
} catch (Exception e10) {
e10.printStackTrace();
return;
}
}
if (campaignEx != null) {
b.this.f18788s.remove(campaignEx.getClickURL());
}
Set<String> set2 = b.f18772c;
if (set2 == null || (campaignEx2 = campaignEx) == null) {
return;
}
set2.remove(campaignEx2.getId());
}
@Override
public final void a(Object obj, String str) {
try {
if (z10) {
com.mbridge.msdk.foundation.db.c.a(b.this.f18785p).a(campaignEx, b.this.f18776g, z10, 0, i10);
}
if (obj != null && (obj instanceof CommonJumpLoader.JumpLoaderResult)) {
b.this.a((CommonJumpLoader.JumpLoaderResult) obj, campaignEx, true, true);
}
b.this.f18788s.remove(campaignEx.getClickURL());
Set<String> set2 = b.f18772c;
if (set2 != null) {
set2.remove(campaignEx.getId());
}
} catch (Exception e10) {
e10.printStackTrace();
}
}
});
return;
}
return;
}
NativeListener.NativeTrackingListener nativeTrackingListener = this.f18789t;
if (nativeTrackingListener == null || z13) {
z14 = true;
} else {
nativeTrackingListener.onStartRedirection(campaignEx, campaignEx.getClickURL());
z14 = !this.f18789t.onInterceptDefaultLoadingDialog();
}
if (this.f18788s.containsKey(campaignEx.getClickURL())) {
this.f18788s.get(campaignEx.getClickURL()).a();
this.f18788s.remove(campaignEx.getClickURL());
}
final boolean z15 = true;
this.f18781l = false;
if (campaignEx.getJumpResult() != null) {
if (!z13) {
a(campaignEx, campaignEx.getJumpResult(), true, this.f18782m, false, bool);
}
this.f18781l = true;
this.f18782m = false;
z15 = false;
}
if (!com.mbridge.msdk.foundation.db.c.a(this.f18785p).a(campaignEx.getId(), this.f18776g) || campaignEx.getJumpResult() == null) {
com.mbridge.msdk.foundation.db.c a10 = com.mbridge.msdk.foundation.db.c.a(this.f18785p);
a10.a();
CommonJumpLoader.JumpLoaderResult b10 = a10.b(campaignEx.getId(), this.f18776g);
if (b10 != null && !z13) {
campaignEx.setJumpResult(b10);
if (z15) {
if (!z13) {
a(campaignEx, b10, z15, this.f18782m, false, bool);
}
this.f18781l = true;
this.f18782m = false;
z15 = false;
}
z.b("MBridge SDK M", "Start 302 Redirection... ");
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public final void run() {
if (z14 && !b.f18770a && !b.this.f18781l && MBridgeConstans.NATIVE_SHOW_LOADINGPAGER && !z13) {
b.a(b.this, campaignEx);
}
if (z14 || b.this.f18789t == null || b.f18770a || b.this.f18781l || !MBridgeConstans.NATIVE_SHOW_LOADINGPAGER) {
return;
}
b.this.f18789t.onShowLoading(campaignEx);
}
});
commonJumpLoader = this.f18787r;
if (commonJumpLoader != null) {
}
set = f18771b;
if (set == null) {
}
f18771b.add(campaignEx.getId());
CommonJumpLoader commonJumpLoader3 = new CommonJumpLoader(this.f18786q, false);
this.f18787r = commonJumpLoader3;
final boolean z16 = z14;
commonJumpLoader3.a("1", this.f18776g, campaignEx, new e() {
@Override
public final void a(Object obj) {
}
@Override
public final void a(Object obj, String str) {
Set<String> set2 = b.f18771b;
if (set2 != null) {
set2.remove(campaignEx.getId());
}
if (obj != null && (obj instanceof CommonJumpLoader.JumpLoaderResult)) {
b.this.f18779j = true;
b.this.a((CommonJumpLoader.JumpLoaderResult) obj, campaignEx, true, false);
}
if (b.this.f18789t != null) {
b.this.f18789t.onRedirectionFailed(campaignEx, str);
}
b.a(b.this, z16, campaignEx);
}
@Override
public final void b(Object obj) {
Set<String> set2 = b.f18771b;
if (set2 != null) {
set2.remove(campaignEx.getId());
}
if (obj == null || !(obj instanceof CommonJumpLoader.JumpLoaderResult)) {
return;
}
CommonJumpLoader.JumpLoaderResult jumpLoaderResult = (CommonJumpLoader.JumpLoaderResult) obj;
z.b("MBridge SDK M", "Redirection done... code: " + jumpLoaderResult.getCode());
b.this.f18779j = true;
campaignEx.setJumpResult(jumpLoaderResult);
b bVar = b.this;
bVar.a(campaignEx, jumpLoaderResult, z15, bVar.f18782m, false, bool);
if (jumpLoaderResult.isjumpDone()) {
com.mbridge.msdk.foundation.db.c.a(b.this.f18785p).a(campaignEx, b.this.f18776g, false, -1, i10);
}
b.a(b.this, z16, campaignEx);
}
});
}
if (campaignEx.getClick_mode().equals("6") && !campaignEx.getPackageName().isEmpty() && campaignEx.getLinkType() == 2 && !z13) {
ad.a.a(this.f18786q, "market://details?id=" + campaignEx.getPackageName(), this.f18789t);
NativeListener.NativeTrackingListener nativeTrackingListener2 = this.f18789t;
if (nativeTrackingListener2 != null && z15) {
nativeTrackingListener2.onDismissLoading(campaignEx);
this.f18789t.onFinishRedirection(campaignEx, null);
}
this.f18781l = true;
z15 = false;
}
if (z13) {
this.f18781l = true;
this.f18782m = false;
z15 = false;
}
z.b("MBridge SDK M", "Start 302 Redirection... ");
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public final void run() {
if (z14 && !b.f18770a && !b.this.f18781l && MBridgeConstans.NATIVE_SHOW_LOADINGPAGER && !z13) {
b.a(b.this, campaignEx);
}
if (z14 || b.this.f18789t == null || b.f18770a || b.this.f18781l || !MBridgeConstans.NATIVE_SHOW_LOADINGPAGER) {
return;
}
b.this.f18789t.onShowLoading(campaignEx);
}
});
commonJumpLoader = this.f18787r;
if (commonJumpLoader != null) {
commonJumpLoader.a();
}
set = f18771b;
if (set == null && set.contains(campaignEx.getId())) {
NativeListener.NativeTrackingListener nativeTrackingListener3 = this.f18789t;
if (nativeTrackingListener3 != null) {
nativeTrackingListener3.onDismissLoading(campaignEx);
this.f18789t.onFinishRedirection(campaignEx, campaignEx.getClickURL());
}
z.b("MBridge SDK M", "点击正在tracking");
return;
}
f18771b.add(campaignEx.getId());
CommonJumpLoader commonJumpLoader32 = new CommonJumpLoader(this.f18786q, false);
this.f18787r = commonJumpLoader32;
final boolean z162 = z14;
commonJumpLoader32.a("1", this.f18776g, campaignEx, new e() {
@Override
public final void a(Object obj) {
}
@Override
public final void a(Object obj, String str) {
Set<String> set2 = b.f18771b;
if (set2 != null) {
set2.remove(campaignEx.getId());
}
if (obj != null && (obj instanceof CommonJumpLoader.JumpLoaderResult)) {
b.this.f18779j = true;
b.this.a((CommonJumpLoader.JumpLoaderResult) obj, campaignEx, true, false);
}
if (b.this.f18789t != null) {
b.this.f18789t.onRedirectionFailed(campaignEx, str);
}
b.a(b.this, z162, campaignEx);
}
@Override
public final void b(Object obj) {
Set<String> set2 = b.f18771b;
if (set2 != null) {
set2.remove(campaignEx.getId());
}
if (obj == null || !(obj instanceof CommonJumpLoader.JumpLoaderResult)) {
return;
}
CommonJumpLoader.JumpLoaderResult jumpLoaderResult = (CommonJumpLoader.JumpLoaderResult) obj;
z.b("MBridge SDK M", "Redirection done... code: " + jumpLoaderResult.getCode());
b.this.f18779j = true;
campaignEx.setJumpResult(jumpLoaderResult);
b bVar = b.this;
bVar.a(campaignEx, jumpLoaderResult, z15, bVar.f18782m, false, bool);
if (jumpLoaderResult.isjumpDone()) {
com.mbridge.msdk.foundation.db.c.a(b.this.f18785p).a(campaignEx, b.this.f18776g, false, -1, i10);
}
b.a(b.this, z162, campaignEx);
}
});
}
} catch (Exception e10) {
e10.printStackTrace();
}
}
public final void a(CommonJumpLoader.JumpLoaderResult jumpLoaderResult, CampaignEx campaignEx, int i10, boolean z10) {
if (campaignEx == null || jumpLoaderResult == null) {
return;
}
try {
this.f18778i = System.currentTimeMillis() - this.f18777h;
com.mbridge.msdk.foundation.entity.e eVar = new com.mbridge.msdk.foundation.entity.e();
int E = v.E(this.f18786q);
eVar.a(E);
eVar.a(v.a(this.f18786q, E));
eVar.j(campaignEx.getRequestId());
eVar.k(campaignEx.getRequestIdNotice());
eVar.d(i10);
eVar.i(this.f18778i + "");
eVar.h(campaignEx.getId());
eVar.f(jumpLoaderResult.getType());
if (!TextUtils.isEmpty(jumpLoaderResult.getUrl())) {
eVar.g(URLEncoder.encode(jumpLoaderResult.getUrl(), JsonRequest.PROTOCOL_CHARSET));
}
eVar.c((this.f18777h / 1000) + "");
eVar.b(Integer.parseInt(campaignEx.getLandingType()));
eVar.c(campaignEx.getLinkType());
eVar.b(this.f18776g);
eVar.f(jumpLoaderResult.getType());
if (!TextUtils.isEmpty(jumpLoaderResult.getUrl())) {
eVar.g(URLEncoder.encode(jumpLoaderResult.getUrl(), JsonRequest.PROTOCOL_CHARSET));
}
if (this.f18780k) {
eVar.e(jumpLoaderResult.getStatusCode());
if (!TextUtils.isEmpty(jumpLoaderResult.getHeader())) {
eVar.e(URLEncoder.encode(jumpLoaderResult.getHeader(), JsonRequest.PROTOCOL_CHARSET));
}
if (!TextUtils.isEmpty(jumpLoaderResult.getContent())) {
eVar.f(URLEncoder.encode(jumpLoaderResult.getContent(), "UTF-8"));
}
if (!TextUtils.isEmpty(jumpLoaderResult.getExceptionMsg())) {
eVar.d(URLEncoder.encode(jumpLoaderResult.getExceptionMsg(), JsonRequest.PROTOCOL_CHARSET));
}
}
if (z10) {
this.f18790u.a("click_jump_error", eVar, this.f18776g);
return;
}
ArrayList arrayList = new ArrayList();
arrayList.add(eVar);
String a10 = com.mbridge.msdk.foundation.entity.e.a(arrayList);
if (aj.b(a10)) {
if (com.mbridge.msdk.foundation.same.report.b.a().c()) {
com.mbridge.msdk.foundation.same.report.b.a().a(a10);
} else {
new com.mbridge.msdk.foundation.same.report.d(this.f18786q, 0).a("click_jump_success", a10, (String) null, (Frame) null);
}
}
} catch (Throwable th) {
th.printStackTrace();
}
}
private int c() {
try {
com.mbridge.msdk.c.a aVar = this.f18784o;
if (aVar != null) {
return aVar.V();
}
return 1;
} catch (Exception e10) {
e10.printStackTrace();
return 1;
}
}
private static void c(CampaignEx campaignEx, Context context, String str) {
if (campaignEx != null) {
try {
if (campaignEx.getNativeVideoTracking() == null) {
return;
}
int i10 = 0;
if (!str.equals("start") && !str.equals("shortcuts_start")) {
if (str.equals(TtmlNode.END)) {
if (campaignEx.getNativeVideoTracking().b() != null) {
while (i10 < campaignEx.getNativeVideoTracking().b().length) {
a(context, campaignEx, campaignEx.getCampaignUnitId(), campaignEx.getNativeVideoTracking().b()[i10], false, false);
i10++;
}
return;
}
return;
}
if (str.equals("install")) {
if (campaignEx.getNativeVideoTracking().c() != null) {
while (i10 < campaignEx.getNativeVideoTracking().c().length) {
a(context, campaignEx, campaignEx.getCampaignUnitId(), campaignEx.getNativeVideoTracking().c()[i10], false, false);
i10++;
}
}
com.mbridge.msdk.foundation.db.g.b(com.mbridge.msdk.foundation.db.i.a(context)).i(campaignEx.getPackageName());
return;
}
return;
}
if (campaignEx.getNativeVideoTracking().a() != null) {
while (i10 < campaignEx.getNativeVideoTracking().a().length) {
a(context, campaignEx, campaignEx.getCampaignUnitId(), campaignEx.getNativeVideoTracking().a()[i10], false, false);
i10++;
}
}
} catch (Throwable th) {
z.c("MBridge SDK M", th.getMessage(), th);
}
}
}
private void c(final CampaignEx campaignEx, final String str, final boolean z10) {
String akdlui;
Context j10;
if (campaignEx != null) {
try {
if (!TextUtils.isEmpty(campaignEx.getAkdlui())) {
akdlui = campaignEx.getAkdlui();
if (TextUtils.isEmpty(akdlui)) {
akdlui = SameMD5.getMD5(str);
}
com.mbridge.msdk.foundation.tools.g.a(str, 2, campaignEx);
j10 = com.mbridge.msdk.foundation.controller.a.f().j();
if (ak.b(j10)) {
a(campaignEx, campaignEx.getNoticeUrl(), com.mbridge.msdk.foundation.same.a.I);
c.a(j10, str, akdlui);
return;
}
ah.a(com.mbridge.msdk.foundation.controller.a.f().j(), akdlui + "isDowning", Long.valueOf(System.currentTimeMillis()));
ah.a(com.mbridge.msdk.foundation.controller.a.f().j(), akdlui + "process", Integer.valueOf(Process.myPid()));
new Thread(new Runnable() {
@Override
public final void run() {
b.a(b.this, campaignEx, str, z10);
}
}).start();
return;
}
} catch (Throwable th) {
if (MBridgeConstans.DEBUG) {
th.printStackTrace();
return;
}
return;
}
}
akdlui = str;
if (TextUtils.isEmpty(akdlui)) {
}
com.mbridge.msdk.foundation.tools.g.a(str, 2, campaignEx);
j10 = com.mbridge.msdk.foundation.controller.a.f().j();
if (ak.b(j10)) {
}
}
public final void a(Campaign campaign, String str) {
try {
if (!TextUtils.isEmpty(str) && campaign != null) {
CampaignEx campaignEx = campaign instanceof CampaignEx ? (CampaignEx) campaign : null;
if (!str.startsWith("market://") && !str.startsWith("https://play.google.com/")) {
com.mbridge.msdk.a.ALLOW_APK_DOWNLOAD = com.mbridge.msdk.c.a.ar();
if (!str.toLowerCase().endsWith(".apk") || com.mbridge.msdk.a.ALLOW_APK_DOWNLOAD) {
return;
}
if (campaignEx != null && !TextUtils.isEmpty(campaignEx.getPackageName())) {
if (!ad.a.a(this.f18786q, "market://details?id=" + campaignEx.getPackageName(), this.f18789t)) {
try {
this.f18792w.post(new Runnable() {
@Override
public final void run() {
Toast.makeText(b.this.f18786q, "Opps!Access Unavailable", 0).show();
}
});
return;
} catch (Exception unused) {
z.d("MBridge SDK M", "Opps!Access Unavailable.");
return;
}
} else {
if (com.mbridge.msdk.a.ALLOW_APK_DOWNLOAD) {
a(campaignEx, str, true);
return;
}
return;
}
}
if (com.mbridge.msdk.a.ALLOW_APK_DOWNLOAD) {
a(campaignEx, str, true);
return;
}
return;
}
if (!ad.a.a(this.f18786q, str, this.f18789t) && campaignEx != null) {
if (!TextUtils.isEmpty(campaignEx.getPackageName())) {
ad.a.a(this.f18786q, "market://details?id=" + campaignEx.getPackageName(), this.f18789t);
} else if (c() == 2) {
ad.a(this.f18786q, campaignEx.getClickURL(), campaignEx, this.f18789t);
} else {
ad.a(this.f18786q, campaignEx.getClickURL(), (BaseTrackingListener) this.f18789t);
}
}
z.b("MBridge SDK M", "Jump to Google Play: " + str);
}
} catch (Exception e10) {
e10.printStackTrace();
}
}
public void a(CommonJumpLoader.JumpLoaderResult jumpLoaderResult, CampaignEx campaignEx, boolean z10, boolean z11) {
if (this.f18779j) {
a(jumpLoaderResult, campaignEx, 1, z10);
} else if (z11) {
a(jumpLoaderResult, campaignEx, 2, z10);
}
}
private void a(int i10, String str, CampaignEx campaignEx, NativeListener.NativeTrackingListener nativeTrackingListener) {
try {
if (!TextUtils.isEmpty(str)) {
if (i10 == 2) {
ad.a(this.f18786q, str, campaignEx, nativeTrackingListener);
} else {
ad.a(this.f18786q, str, (BaseTrackingListener) nativeTrackingListener);
}
}
} catch (Throwable th) {
z.c("MBridge SDK M", th.getMessage(), th);
}
}
private boolean a(CampaignEx campaignEx, CommonJumpLoader.JumpLoaderResult jumpLoaderResult, boolean z10, boolean z11, int i10) {
boolean z12 = false;
if (z10) {
try {
int intValue = Integer.valueOf(campaignEx.getLandingType()).intValue();
if (intValue == 1) {
ad.a(this.f18786q, jumpLoaderResult.getUrl(), (BaseTrackingListener) this.f18789t);
} else if (intValue == 2) {
ad.a(this.f18786q, jumpLoaderResult.getUrl(), campaignEx, this.f18789t);
} else if (campaignEx.getPackageName() != null) {
if (!ad.a.a(this.f18786q, "market://details?id=" + campaignEx.getPackageName(), this.f18789t)) {
a(i10, jumpLoaderResult.getUrl(), campaignEx, this.f18789t);
}
} else {
a(i10, jumpLoaderResult.getUrl(), campaignEx, this.f18789t);
}
z12 = true;
} catch (Throwable th) {
z.c("MBridge SDK M", th.getMessage(), th);
}
}
if (z12) {
a(jumpLoaderResult, campaignEx, true, z11);
NativeListener.NativeTrackingListener nativeTrackingListener = this.f18789t;
if (nativeTrackingListener != null && z10) {
nativeTrackingListener.onFinishRedirection(campaignEx, jumpLoaderResult.getUrl());
}
} else {
a(jumpLoaderResult, campaignEx, true, z11);
NativeListener.NativeTrackingListener nativeTrackingListener2 = this.f18789t;
if (nativeTrackingListener2 != null && z10) {
nativeTrackingListener2.onRedirectionFailed(campaignEx, jumpLoaderResult.getUrl());
}
}
return z12;
}
private boolean a(CampaignEx campaignEx, CommonJumpLoader.JumpLoaderResult jumpLoaderResult, boolean z10, boolean z11) {
boolean z12 = false;
if (z10) {
try {
a(campaignEx, campaignEx.getNoticeUrl(), com.mbridge.msdk.foundation.same.a.I);
ad.a(this.f18786q, campaignEx.getClickURL(), (BaseTrackingListener) this.f18789t);
z12 = true;
} catch (Throwable th) {
z.c("MBridge SDK M", th.getMessage(), th);
}
}
if (z12) {
a(jumpLoaderResult, campaignEx, true, z11);
NativeListener.NativeTrackingListener nativeTrackingListener = this.f18789t;
if (nativeTrackingListener != null && z10) {
nativeTrackingListener.onFinishRedirection(campaignEx, jumpLoaderResult.getUrl());
}
} else {
a(jumpLoaderResult, campaignEx, true, z11);
NativeListener.NativeTrackingListener nativeTrackingListener2 = this.f18789t;
if (nativeTrackingListener2 != null && z10) {
nativeTrackingListener2.onRedirectionFailed(campaignEx, jumpLoaderResult.getUrl());
}
}
return z12;
}
public void a(CampaignEx campaignEx, CommonJumpLoader.JumpLoaderResult jumpLoaderResult, boolean z10, boolean z11, boolean z12, Boolean bool) {
try {
if (this.f18783n) {
com.mbridge.msdk.a.ALLOW_APK_DOWNLOAD = com.mbridge.msdk.c.a.ar();
if (campaignEx != null && jumpLoaderResult != null) {
int c10 = c();
int code = jumpLoaderResult.getCode();
if (!bool.booleanValue()) {
if (TextUtils.isEmpty(jumpLoaderResult.getUrl())) {
return;
}
a(campaignEx, jumpLoaderResult.getUrl(), bool.booleanValue());
return;
}
if (TextUtils.isEmpty(jumpLoaderResult.getUrl()) && z10) {
int linkType = campaignEx.getLinkType();
if (linkType == 2) {
a(campaignEx, jumpLoaderResult, z10, z12, c());
return;
}
if (linkType == 3) {
a(campaignEx, jumpLoaderResult, z10, z12);
return;
}
ad.a(this.f18786q, campaignEx.getClickURL(), (BaseTrackingListener) this.f18789t);
a(jumpLoaderResult, campaignEx, true, z12);
NativeListener.NativeTrackingListener nativeTrackingListener = this.f18789t;
if (nativeTrackingListener == null || !z10) {
return;
}
nativeTrackingListener.onFinishRedirection(campaignEx, jumpLoaderResult.getUrl());
return;
}
if (code == 1) {
z.b("MBridge SDK M", "Jump to Google Play: " + jumpLoaderResult.getUrl());
if (TextUtils.isEmpty(campaignEx.getPackageName()) || TextUtils.isEmpty(jumpLoaderResult.getUrl()) || !jumpLoaderResult.getUrl().contains(campaignEx.getPackageName()) || !z10) {
if (z10) {
if (!TextUtils.isEmpty(campaignEx.getPackageName())) {
}
a(c10, jumpLoaderResult.getUrl(), campaignEx, this.f18789t);
z.d("MBridge SDK M", "code market This pkg is " + campaignEx.getPackageName());
}
} else if (!ad.a.a(this.f18786q, jumpLoaderResult.getUrl(), this.f18789t)) {
a(c10, jumpLoaderResult.getUrl(), campaignEx, this.f18789t);
}
NativeListener.NativeTrackingListener nativeTrackingListener2 = this.f18789t;
if (nativeTrackingListener2 != null && z10) {
nativeTrackingListener2.onFinishRedirection(campaignEx, jumpLoaderResult.getUrl());
}
} else if (code == 3) {
if (z10) {
if (com.mbridge.msdk.a.ALLOW_APK_DOWNLOAD) {
z.b("MBridge SDK M", "Jump to download: " + jumpLoaderResult.getUrl());
a(campaignEx, jumpLoaderResult.getUrl(), bool.booleanValue());
} else {
ad.a(this.f18786q, jumpLoaderResult.getUrl(), (BaseTrackingListener) this.f18789t);
}
}
NativeListener.NativeTrackingListener nativeTrackingListener3 = this.f18789t;
if (nativeTrackingListener3 != null && z10) {
nativeTrackingListener3.onFinishRedirection(campaignEx, jumpLoaderResult.getUrl());
}
} else if (z10) {
z.b("MBridge SDK M", "Jump to Web: " + jumpLoaderResult.getUrl());
if (3 == campaignEx.getLinkType()) {
a(campaignEx, jumpLoaderResult, z10, z12);
return;
}
if (2 == campaignEx.getLinkType()) {
a(campaignEx, jumpLoaderResult, z10, z12, c());
return;
}
ad.a(this.f18786q, jumpLoaderResult.getUrl(), (BaseTrackingListener) this.f18789t);
NativeListener.NativeTrackingListener nativeTrackingListener4 = this.f18789t;
if (nativeTrackingListener4 != null && z10) {
nativeTrackingListener4.onFinishRedirection(campaignEx, jumpLoaderResult.getUrl());
}
}
if (a(campaignEx.getLinkType(), jumpLoaderResult.getUrl())) {
a(jumpLoaderResult, campaignEx, false, z12);
} else {
a(jumpLoaderResult, campaignEx, true, z12);
}
NativeListener.NativeTrackingListener nativeTrackingListener5 = this.f18789t;
if (nativeTrackingListener5 == null || z10 || !z11) {
return;
}
nativeTrackingListener5.onFinishRedirection(campaignEx, jumpLoaderResult.getUrl());
}
}
} catch (Exception e10) {
e10.printStackTrace();
}
}
private boolean a(int i10, String str) {
boolean z10 = true;
boolean z11 = false;
try {
if (i10 == 2) {
if (ad.a.a(str)) {
z11 = z10;
return z11;
}
z10 = false;
z11 = z10;
return z11;
}
} catch (Exception e10) {
e10.printStackTrace();
return z11;
}
}
private void a(CampaignEx campaignEx, String str, boolean z10) {
String akdlui = campaignEx.getAkdlui();
if (TextUtils.isEmpty(akdlui)) {
akdlui = SameMD5.getMD5(str);
}
try {
String obj = ah.b(com.mbridge.msdk.foundation.controller.a.f().j(), akdlui, "").toString();
if (!TextUtils.isEmpty(obj)) {
File file = new File(obj);
if (file.exists()) {
if (z10) {
a(campaignEx, campaignEx.getNoticeUrl(), com.mbridge.msdk.foundation.same.a.J);
c.a(this.f18786q, Uri.fromFile(file), str, akdlui);
return;
}
return;
}
} else {
int intValue = ((Integer) ah.b(com.mbridge.msdk.foundation.controller.a.f().j(), akdlui + "process", 0)).intValue();
int myPid = Process.myPid();
if (intValue != 0 && intValue == myPid) {
long longValue = ((Long) ah.b(com.mbridge.msdk.foundation.controller.a.f().j(), akdlui + "isDowning", 0L)).longValue();
long currentTimeMillis = System.currentTimeMillis() - longValue;
if (longValue != 0 && currentTimeMillis < TTAdConstant.AD_MAX_EVENT_TIME) {
if (z10) {
int intValue2 = ((Integer) ah.b(com.mbridge.msdk.foundation.controller.a.f().j(), akdlui + "downloadType", -1)).intValue();
if (intValue2 == 1) {
b(campaignEx, this.f18786q, "downloading");
a(campaignEx, campaignEx.getNoticeUrl(), com.mbridge.msdk.foundation.same.a.F);
return;
} else if (intValue2 == 2) {
a(campaignEx, this.f18786q, "downloading");
a(campaignEx, campaignEx.getNoticeUrl(), com.mbridge.msdk.foundation.same.a.F);
return;
} else {
ad.a(this.f18786q, campaignEx.getClickURL(), (BaseTrackingListener) this.f18789t);
a(campaignEx, campaignEx.getNoticeUrl(), com.mbridge.msdk.foundation.same.a.I);
return;
}
}
return;
}
}
}
if (ak.f20273a == -1) {
try {
int i10 = com.mbridge.msdk.mbdownload.b.A;
int i11 = com.mbridge.msdk.mbdownload.f.B;
ak.f20273a = 1;
ak.f20274b = "ok";
} catch (ClassNotFoundException e10) {
ak.f20273a = 0;
ak.f20274b = e10.getMessage();
}
}
if (ak.f20273a == 1 && z10) {
b(campaignEx, str, z10);
} else {
c(campaignEx, str, z10);
}
} catch (Throwable th) {
ak.f20273a = -1;
ak.f20274b = th.getMessage();
z.b("downloadapk", "can't find download jar, use simple method");
c(campaignEx, str, z10);
}
}
public static void a(CampaignEx campaignEx, Context context, String str) {
try {
if (str.equals("start") || str.equals("downloading")) {
if (Looper.myLooper() == Looper.getMainLooper()) {
d();
} else {
Message obtainMessage = f18775f.obtainMessage(1);
obtainMessage.obj = context;
f18775f.sendMessage(obtainMessage);
}
}
c(campaignEx, context, str);
} catch (Throwable th) {
z.c("MBridge SDK M", th.getMessage(), th);
}
}
public static void a(Context context) {
com.mbridge.msdk.c.a b10 = com.mbridge.msdk.c.b.a().b(com.mbridge.msdk.foundation.controller.a.f().k());
if (b10 == null) {
b10 = com.mbridge.msdk.c.b.a().b();
}
if (b10 != null) {
if (com.mbridge.msdk.foundation.controller.a.f().j() == null && context != null) {
Toast.makeText(context, b10.R(), 0).show();
} else {
Toast.makeText(com.mbridge.msdk.foundation.controller.a.f().j(), b10.R(), 0).show();
}
}
}
public static void a(b bVar, CampaignEx campaignEx, boolean z10, CommonJumpLoader.JumpLoaderResult jumpLoaderResult, int i10, boolean z11) {
if (campaignEx == null) {
return;
}
String str = "";
if (jumpLoaderResult != null) {
try {
str = jumpLoaderResult.getUrl();
} catch (Exception e10) {
e10.printStackTrace();
return;
}
}
com.mbridge.msdk.foundation.db.c a10 = com.mbridge.msdk.foundation.db.c.a(bVar.f18785p);
if (bVar.a(campaignEx.getLinkType(), str)) {
bVar.a(jumpLoaderResult, campaignEx, false, z11);
if (campaignEx.getJumpResult() != null && !TextUtils.isEmpty(campaignEx.getNoticeUrl())) {
campaignEx.getJumpResult().setNoticeurl(campaignEx.getNoticeUrl());
}
a10.a(campaignEx, bVar.f18776g, z10, 1, i10);
return;
}
bVar.a(jumpLoaderResult, campaignEx, true, z11);
a10.a(campaignEx, bVar.f18776g, z10, 0, i10);
}
public static void a(b bVar, CampaignEx campaignEx) {
try {
Intent intent = new Intent(bVar.f18786q, (Class<?>) LoadingActivity.class);
intent.setFlags(268435456);
intent.putExtra(CampaignEx.JSON_KEY_ICON_URL, campaignEx.getIconUrl());
bVar.f18786q.startActivity(intent);
} catch (Exception e10) {
z.c("MBridge SDK M", "Exception", e10);
}
}
public static void a(b bVar, final boolean z10, final Campaign campaign) {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public final void run() {
if (z10 && !b.f18770a && MBridgeConstans.NATIVE_SHOW_LOADINGPAGER) {
b.g(b.this);
}
if (b.this.f18789t == null || b.f18770a || !MBridgeConstans.NATIVE_SHOW_LOADINGPAGER) {
return;
}
b.this.f18789t.onDismissLoading(campaign);
}
});
}
public static void a(b bVar, final CampaignEx campaignEx, final String str, final boolean z10) {
String md5;
if (campaignEx != null && !TextUtils.isEmpty(campaignEx.getAkdlui())) {
md5 = campaignEx.getAkdlui();
} else {
md5 = SameMD5.getMD5(str);
}
try {
final String str2 = md5;
com.mbridge.msdk.optimize.a.a(com.mbridge.msdk.foundation.tools.f.a("/apk", bVar.f18786q, new boolean[1]), c.a(str), str, new com.mbridge.msdk.optimize.b() {
@Override
public final void a() {
b.this.f18792w.sendMessage(b.this.f18792w.obtainMessage(0));
b bVar2 = b.this;
CampaignEx campaignEx2 = campaignEx;
bVar2.a(campaignEx2, campaignEx2.getNoticeUrl(), com.mbridge.msdk.foundation.same.a.H);
if (z10) {
b.a(campaignEx, b.this.f18786q, "start");
} else {
b.a(campaignEx, b.this.f18786q, "shortcuts_start");
}
}
@Override
public final void b() {
c.a(b.this.f18786q, str, str2);
}
@Override
public final void a(int i10) {
Message obtainMessage = b.this.f18792w.obtainMessage(1);
obtainMessage.arg1 = i10;
b.this.f18792w.sendMessage(obtainMessage);
}
@Override
public final void a(File file) {
ah.a(com.mbridge.msdk.foundation.controller.a.f().j(), str2 + "isDowning", 0L);
ah.a(com.mbridge.msdk.foundation.controller.a.f().j(), str2 + "process", 0);
b.a(campaignEx, b.this.f18786q, TtmlNode.END);
com.mbridge.msdk.foundation.db.g.b(com.mbridge.msdk.foundation.db.i.a(com.mbridge.msdk.foundation.controller.a.f().j())).a(campaignEx);
if (file.exists() && z10) {
c.a(b.this.f18786q, Uri.fromFile(file), str, str2);
ah.a(com.mbridge.msdk.foundation.controller.a.f().j(), str2, file.getAbsolutePath());
} else {
if (z10) {
return;
}
ah.a(com.mbridge.msdk.foundation.controller.a.f().j(), str2, file.getAbsolutePath());
}
}
});
} catch (Throwable unused) {
c.a(com.mbridge.msdk.foundation.controller.a.f().j(), str, md5);
}
}
}