Recover Files v1.3.9版本的 MD5 值为:27a8b2c239c6cb7111d74d6bb07d21b2
以下内容为反编译后的 a.java 源代码,内容仅作参考
package com.mbridge.msdk.click;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import androidx.exifinterface.media.ExifInterface;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.click.entity.JumpLoaderResult;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.same.report.p;
import com.mbridge.msdk.foundation.tools.aa;
import com.mbridge.msdk.foundation.tools.ae;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.ak;
import com.mbridge.msdk.foundation.tools.q;
import com.mbridge.msdk.foundation.tools.w;
import com.mbridge.msdk.out.BaseTrackingListener;
import com.mbridge.msdk.out.Campaign;
import com.mbridge.msdk.out.LoadingActivity;
import com.mbridge.msdk.out.NativeListener;
import com.mbridge.msdk.scheme.applet.AppletModelManager;
import com.mbridge.msdk.scheme.applet.AppletSchemeCallBack;
import com.mbridge.msdk.scheme.applet.AppletsModel;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public final class a {
public static boolean f25260a = false;
public static Map<String, Long> f25261b = new HashMap();
public static Set<String> f25262c = new HashSet();
private String f25263d;
private long f25264e;
private com.mbridge.msdk.foundation.db.h f25265f;
private Context f25266g;
private c f25267h;
private p f25269j;
private com.mbridge.msdk.c.e f25270k;
private boolean f25271l;
private boolean f25274o;
private h f25275p;
private NativeListener.NativeTrackingListener f25268i = null;
private boolean f25272m = false;
private boolean f25273n = true;
public a(Context context, String str) {
this.f25265f = null;
this.f25266g = null;
com.mbridge.msdk.c.e b10 = com.mbridge.msdk.c.f.a().b(str);
this.f25270k = b10;
if (b10 == null) {
this.f25270k = com.mbridge.msdk.c.f.a().b();
}
this.f25271l = this.f25270k.T();
Context applicationContext = context.getApplicationContext();
this.f25266g = applicationContext;
this.f25263d = str;
if (this.f25265f == null) {
this.f25265f = com.mbridge.msdk.foundation.db.h.a(applicationContext);
}
this.f25269j = new p(this.f25266g);
}
public static String a(int i10) {
return i10 != 1 ? i10 != 2 ? i10 != 3 ? i10 != 4 ? "" : "2000138" : "2000139" : "2000137" : "2000136";
}
public static void f(a aVar) {
try {
Intent intent = new Intent();
intent.setAction("ExitApp");
aVar.f25266g.sendBroadcast(intent);
} catch (Exception e10) {
aa.b("MBridge SDK M", "Exception", e10);
}
}
private boolean b(CampaignEx campaignEx) {
Long l10;
if (campaignEx == null) {
return true;
}
try {
if (2 != campaignEx.getLinkType() && 3 != campaignEx.getLinkType()) {
return true;
}
String id2 = campaignEx.getId();
Map<String, Long> map = f25261b;
if (map == null) {
return true;
}
if (map.containsKey(id2) && (l10 = f25261b.get(id2)) != null) {
if (l10.longValue() > System.currentTimeMillis() || f25262c.contains(campaignEx.getId())) {
return false;
}
}
f25261b.put(campaignEx.getId(), Long.valueOf(System.currentTimeMillis() + (campaignEx.getClickTimeOutInterval() * 1000)));
return true;
} catch (Exception e10) {
if (!MBridgeConstans.DEBUG) {
return true;
}
e10.printStackTrace();
return true;
}
}
private void c(CampaignEx campaignEx) {
if (b() == 2) {
ae.a(this.f25266g, campaignEx.getClickURL(), campaignEx, this.f25268i);
} else {
ae.a(this.f25266g, campaignEx.getClickURL(), this.f25268i, campaignEx.getCurrentLRid());
}
}
public final void a(String str) {
this.f25263d = str;
}
public final void a(NativeListener.NativeTrackingListener nativeTrackingListener) {
this.f25268i = nativeTrackingListener;
}
public final void a(h hVar) {
this.f25275p = hVar;
}
public final void a(boolean z10) {
this.f25273n = z10;
}
public final void a() {
try {
this.f25268i = null;
} catch (Exception e10) {
e10.printStackTrace();
}
}
public final void a(CampaignEx campaignEx, NativeListener.NativeAdListener nativeAdListener) {
if (nativeAdListener != null && campaignEx != null) {
nativeAdListener.onAdClick(campaignEx);
}
a(campaignEx);
}
private void a(CampaignEx campaignEx, String str) {
if (TextUtils.isEmpty(str)) {
return;
}
a(this.f25266g, campaignEx, this.f25263d, str, true, false, com.mbridge.msdk.click.a.a.f25298i);
}
private int b() {
try {
com.mbridge.msdk.c.e eVar = this.f25270k;
if (eVar != null) {
return eVar.O();
}
return 1;
} catch (Exception e10) {
e10.printStackTrace();
return 1;
}
}
public final void a(CampaignEx campaignEx) {
String str;
Object obj;
boolean z10;
String clickURL;
try {
if (!b(campaignEx)) {
return;
}
HashMap hashMap = new HashMap();
hashMap.put("update", "1");
com.mbridge.msdk.foundation.same.report.m.a().a("2000149", campaignEx, hashMap);
String noticeUrl = campaignEx.getNoticeUrl();
com.mbridge.msdk.foundation.db.d a10 = com.mbridge.msdk.foundation.db.d.a(this.f25265f);
a10.a();
JumpLoaderResult b10 = a10.b(campaignEx.getId(), this.f25263d);
if (b10 != null) {
if (b10.getNoticeurl() != null) {
b10.setNoticeurl(null);
}
campaignEx.setJumpResult(b10);
a10.a(campaignEx, this.f25263d);
}
AppletsModel appletsModel = AppletModelManager.getInstance().get(campaignEx);
if (af.a(campaignEx)) {
q.a().a(campaignEx);
HashMap hashMap2 = new HashMap();
str = "最终地址是gp, 但是打开失败了:";
hashMap2.put("type", ExifInterface.GPS_MEASUREMENT_3D);
obj = "type";
if (b.d(this.f25266g, campaignEx.getDeepLinkURL())) {
NativeListener.NativeTrackingListener nativeTrackingListener = this.f25268i;
if (nativeTrackingListener != null) {
nativeTrackingListener.onStartRedirection(campaignEx, campaignEx.getClickURL());
}
a(campaignEx, noticeUrl + "&opdptype=1");
NativeListener.NativeTrackingListener nativeTrackingListener2 = this.f25268i;
if (nativeTrackingListener2 != null) {
nativeTrackingListener2.onFinishRedirection(campaignEx, campaignEx.getClickURL());
}
try {
hashMap2.put("result", "1");
com.mbridge.msdk.foundation.same.report.m.a().a("2000150", campaignEx, hashMap2);
return;
} catch (Exception unused) {
return;
}
}
try {
hashMap2.put("result", "2");
com.mbridge.msdk.foundation.same.report.m.a().a("2000150", campaignEx, hashMap2);
} catch (Exception unused2) {
}
noticeUrl = noticeUrl + "&opdptype=0";
q.a().b(campaignEx);
} else {
str = "最终地址是gp, 但是打开失败了:";
obj = "type";
}
if (campaignEx.getLinkType() == 12) {
NativeListener.NativeTrackingListener nativeTrackingListener3 = this.f25268i;
if (nativeTrackingListener3 != null) {
nativeTrackingListener3.onStartRedirection(campaignEx, campaignEx.getClickURL());
}
a(campaignEx, noticeUrl);
a(this.f25266g, campaignEx);
NativeListener.NativeTrackingListener nativeTrackingListener4 = this.f25268i;
if (nativeTrackingListener4 != null) {
nativeTrackingListener4.onFinishRedirection(campaignEx, campaignEx.getClickURL());
return;
}
return;
}
if (appletsModel != null && appletsModel.isSupportWxScheme()) {
if (appletsModel.isRequestSuccess()) {
if (b.d(this.f25266g, appletsModel.getDeepLink())) {
NativeListener.NativeTrackingListener nativeTrackingListener5 = this.f25268i;
if (nativeTrackingListener5 != null) {
nativeTrackingListener5.onStartRedirection(campaignEx, campaignEx.getClickURL());
}
if (this.f25266g != null) {
Intent intent = new Intent();
intent.setAction("mb_dp_close_broadcast_receiver");
try {
this.f25266g.sendBroadcast(intent);
} catch (Exception unused3) {
}
}
a(campaignEx, noticeUrl + "&opdptype=1");
NativeListener.NativeTrackingListener nativeTrackingListener6 = this.f25268i;
if (nativeTrackingListener6 != null) {
nativeTrackingListener6.onFinishRedirection(campaignEx, campaignEx.getClickURL());
return;
}
return;
}
noticeUrl = noticeUrl + "&opdptype=0";
} else {
if (appletsModel.isRequesting()) {
NativeListener.NativeTrackingListener nativeTrackingListener7 = this.f25268i;
if (nativeTrackingListener7 != null) {
nativeTrackingListener7.onStartRedirection(campaignEx, campaignEx.getClickURL());
}
appletsModel.setAppletSchemeCallBack(a(this.f25268i, 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.f25268i;
if (nativeTrackingListener8 != null) {
nativeTrackingListener8.onStartRedirection(campaignEx, campaignEx.getClickURL());
}
appletsModel.requestWxAppletsScheme(1, a(this.f25268i, campaignEx, appletsModel, this));
return;
}
}
}
}
a(campaignEx, noticeUrl);
if (!campaignEx.getUserActivation() && b.c(this.f25266g, campaignEx.getPackageName())) {
b.e(this.f25266g, campaignEx.getPackageName());
NativeListener.NativeTrackingListener nativeTrackingListener9 = this.f25268i;
if (nativeTrackingListener9 != null) {
nativeTrackingListener9.onStartRedirection(campaignEx, campaignEx.getClickURL());
}
a(campaignEx, true);
NativeListener.NativeTrackingListener nativeTrackingListener10 = this.f25268i;
if (nativeTrackingListener10 != null) {
nativeTrackingListener10.onFinishRedirection(campaignEx, campaignEx.getClickURL());
ae.a(this.f25268i);
return;
}
return;
}
int linkType = campaignEx.getLinkType();
int b11 = b();
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.f25268i;
if (nativeTrackingListener11 != null) {
nativeTrackingListener11.onStartRedirection(campaignEx, campaignEx.getClickURL());
}
if (ae.a.a(this.f25266g, campaignEx.getClickURL(), this.f25268i)) {
a(b10, campaignEx, false);
aa.b("MBridge SDK M", "不用做302跳转 最终地址已经是gp了:" + campaignEx.getClickURL());
NativeListener.NativeTrackingListener nativeTrackingListener12 = this.f25268i;
if (nativeTrackingListener12 != null) {
nativeTrackingListener12.onFinishRedirection(campaignEx, campaignEx.getClickURL());
}
try {
HashMap hashMap3 = new HashMap();
hashMap3.put(obj, "1");
hashMap3.put("result", "1");
com.mbridge.msdk.foundation.same.report.m.a().a("2000150", campaignEx, hashMap3);
return;
} catch (Exception unused4) {
return;
}
}
Object obj2 = obj;
try {
HashMap hashMap4 = new HashMap();
hashMap4.put(obj2, "1");
hashMap4.put("result", "2");
com.mbridge.msdk.foundation.same.report.m.a().a("2000150", campaignEx, hashMap4);
} catch (Exception unused5) {
}
a(b11, campaignEx.getClickURL(), campaignEx, this.f25268i);
a(b10, campaignEx, false);
aa.b("MBridge SDK M", str + campaignEx.getClickURL());
NativeListener.NativeTrackingListener nativeTrackingListener13 = this.f25268i;
if (nativeTrackingListener13 != null) {
nativeTrackingListener13.onFinishRedirection(campaignEx, campaignEx.getClickURL());
return;
}
return;
}
Object obj3 = obj;
if (z10) {
if (linkType == 2) {
a(campaignEx, false);
return;
}
if (linkType == 3) {
try {
HashMap hashMap5 = new HashMap();
hashMap5.put(obj3, "2");
hashMap5.put("result", "1");
com.mbridge.msdk.foundation.same.report.m.a().a("2000150", campaignEx, hashMap5);
} catch (Exception unused6) {
}
a(campaignEx, false);
return;
}
String clickURL2 = campaignEx.getClickURL();
NativeListener.NativeTrackingListener nativeTrackingListener14 = this.f25268i;
if (nativeTrackingListener14 != null) {
nativeTrackingListener14.onStartRedirection(campaignEx, clickURL2);
}
if (TextUtils.isEmpty(clickURL2)) {
NativeListener.NativeTrackingListener nativeTrackingListener15 = this.f25268i;
if (nativeTrackingListener15 != null) {
nativeTrackingListener15.onRedirectionFailed(campaignEx, clickURL2);
}
a(b10, campaignEx, true);
return;
}
NativeListener.NativeTrackingListener nativeTrackingListener16 = this.f25268i;
if (nativeTrackingListener16 != null) {
nativeTrackingListener16.onFinishRedirection(campaignEx, clickURL2);
}
ae.a(this.f25266g, clickURL2, this.f25268i, campaignEx.getCurrentLRid());
a(b10, campaignEx, true);
return;
}
String clickURL3 = campaignEx.getClickURL();
NativeListener.NativeTrackingListener nativeTrackingListener17 = this.f25268i;
if (nativeTrackingListener17 != null) {
nativeTrackingListener17.onStartRedirection(campaignEx, clickURL3);
}
if (TextUtils.isEmpty(clickURL3)) {
NativeListener.NativeTrackingListener nativeTrackingListener18 = this.f25268i;
if (nativeTrackingListener18 != null) {
nativeTrackingListener18.onRedirectionFailed(campaignEx, clickURL3);
}
a(b10, campaignEx, true);
return;
}
if (linkType == 8) {
if (campaignEx.getAabEntity() != null && campaignEx.getAabEntity().getHlp() == 1) {
BaseTrackingListener baseTrackingListener = this.f25268i;
if (baseTrackingListener == null && (baseTrackingListener = this.f25275p) != null) {
baseTrackingListener.onStartRedirection(campaignEx, clickURL3);
}
ae.a(this.f25266g, clickURL3, campaignEx, this, baseTrackingListener);
} else {
ae.a(this.f25266g, clickURL3, campaignEx, this.f25268i);
NativeListener.NativeTrackingListener nativeTrackingListener19 = this.f25268i;
if (nativeTrackingListener19 != null) {
nativeTrackingListener19.onFinishRedirection(campaignEx, clickURL3);
}
}
a(b10, campaignEx, false);
return;
}
if (linkType == 9) {
ae.a(this.f25266g, clickURL3, this.f25268i, campaignEx.getCurrentLRid());
a(b10, campaignEx, false);
NativeListener.NativeTrackingListener nativeTrackingListener20 = this.f25268i;
if (nativeTrackingListener20 != null) {
nativeTrackingListener20.onFinishRedirection(campaignEx, clickURL3);
return;
}
return;
}
if (linkType == 4) {
if (b11 == 2) {
ae.a(this.f25266g, clickURL3, campaignEx, this.f25268i);
} else {
ae.a(this.f25266g, clickURL3, this.f25268i, campaignEx.getCurrentLRid());
}
}
NativeListener.NativeTrackingListener nativeTrackingListener21 = this.f25268i;
if (nativeTrackingListener21 != null) {
nativeTrackingListener21.onFinishRedirection(campaignEx, clickURL3);
}
a(b10, campaignEx, false);
return;
}
z10 = true;
clickURL = campaignEx.getClickURL();
if (TextUtils.isEmpty(clickURL)) {
}
Object obj32 = obj;
if (z10) {
}
} catch (Throwable th2) {
aa.b("MBridge SDK M", th2.getMessage(), th2);
}
}
private AppletSchemeCallBack a(NativeListener.NativeTrackingListener nativeTrackingListener, CampaignEx campaignEx, AppletsModel appletsModel, a aVar) {
return new f(nativeTrackingListener, campaignEx, appletsModel, aVar);
}
private void a(Context context, CampaignEx campaignEx) {
if (context == null) {
com.mbridge.msdk.foundation.same.report.q.a(com.mbridge.msdk.foundation.controller.b.d().g(), campaignEx, 2, "context is null", this.f25263d);
return;
}
boolean z10 = w.g() == 1;
boolean z11 = w.f(context) == 1;
if (z10 && z11) {
String ghId = campaignEx.getGhId();
String ghPath = campaignEx.getGhPath();
String bindId = campaignEx.getBindId();
String i10 = com.mbridge.msdk.foundation.controller.b.d().i();
if (!TextUtils.isEmpty(ghId)) {
try {
if (!TextUtils.isEmpty(i10)) {
bindId = i10;
}
Object b10 = w.b(bindId);
Class<?> cls = Class.forName("com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram$Req");
Object newInstance = cls.newInstance();
cls.getField("userName").set(newInstance, ghId);
cls.getField("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(b10, newInstance);
com.mbridge.msdk.foundation.same.report.q.a(context, campaignEx, 1, "", this.f25263d);
return;
} catch (Throwable th2) {
com.mbridge.msdk.foundation.same.report.q.a(context, campaignEx, 2, th2.getMessage(), this.f25263d);
c(campaignEx);
return;
}
}
c(campaignEx);
com.mbridge.msdk.foundation.same.report.q.a(context, campaignEx, 2, "ghid is empty", this.f25263d);
return;
}
com.mbridge.msdk.foundation.same.report.q.a(context, campaignEx, 2, "integrated:" + z10 + "-hasWx:" + z11, this.f25263d);
c(campaignEx);
}
public static void a(Context context, CampaignEx campaignEx, String str, String str2, boolean z10, boolean z11) {
if (context == null) {
return;
}
new c(context.getApplicationContext()).a(str, campaignEx, null, str2, z10, z11, com.mbridge.msdk.click.a.a.f25295f);
}
public static void a(Context context, final CampaignEx campaignEx, String str, String str2, boolean z10, boolean z11, final int i10) {
if (context == null) {
return;
}
final int i11 = TextUtils.isEmpty(str2) ? -1 : str2.startsWith("tcp") ? 1 : 0;
new c(context.getApplicationContext()).a(str, campaignEx, new e() {
@Override
public final void a(Object obj) {
}
@Override
public final void b(Object obj) {
try {
HashMap hashMap = new HashMap();
hashMap.put("result", "2");
hashMap.put("net_ty", String.valueOf(i11));
if (obj instanceof JumpLoaderResult) {
if ((((JumpLoaderResult) obj).getStatusCode() + "").startsWith("2")) {
hashMap.put("result", "1");
}
}
String a10 = a.a(i10);
hashMap.put("update", "1");
com.mbridge.msdk.foundation.same.report.m.a().a(a10, campaignEx, hashMap);
} catch (Exception e10) {
aa.d("MBridge SDK M", e10.getMessage());
}
}
@Override
public final void a(Object obj, String str3) {
try {
String a10 = a.a(i10);
HashMap hashMap = new HashMap();
hashMap.put("result", "2");
hashMap.put("code", "");
hashMap.put(f5.b.f31104m, str3);
hashMap.put("failing", "");
hashMap.put("update", "1");
hashMap.put("net_ty", String.valueOf(i11));
com.mbridge.msdk.foundation.same.report.m.a().a(a10, campaignEx, hashMap);
} catch (Exception e10) {
aa.d("MBridge SDK M", e10.getMessage());
}
}
}, 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;
}
c cVar = new c(context.getApplicationContext());
for (String str2 : strArr) {
cVar.a(str, campaignEx, new e() {
@Override
public final void a(Object obj) {
}
@Override
public final void a(Object obj, String str3) {
}
@Override
public final void b(Object obj) {
}
}, str2, z10, z11, com.mbridge.msdk.click.a.a.f25295f);
}
}
private void a(final CampaignEx campaignEx, final boolean z10) {
final boolean z11;
boolean z12;
try {
this.f25264e = System.currentTimeMillis();
NativeListener.NativeTrackingListener nativeTrackingListener = this.f25268i;
if (nativeTrackingListener == null || z10) {
z11 = true;
} else {
nativeTrackingListener.onStartRedirection(campaignEx, campaignEx.getClickURL());
z11 = !this.f25268i.onInterceptDefaultLoadingDialog();
}
final boolean z13 = false;
this.f25274o = false;
if (campaignEx.getJumpResult() != null) {
if (!z10) {
a(campaignEx, campaignEx.getJumpResult(), true, this.f25272m);
}
this.f25274o = true;
this.f25272m = false;
z12 = false;
} else {
z12 = true;
}
if (!com.mbridge.msdk.foundation.db.d.a(this.f25265f).a(campaignEx.getId(), this.f25263d) || campaignEx.getJumpResult() == null) {
com.mbridge.msdk.foundation.db.d a10 = com.mbridge.msdk.foundation.db.d.a(this.f25265f);
a10.a();
JumpLoaderResult b10 = a10.b(campaignEx.getId(), this.f25263d);
if (b10 != null && !z10) {
campaignEx.setJumpResult(b10);
if (z12) {
a(campaignEx, b10, z12, this.f25272m);
this.f25274o = true;
this.f25272m = false;
}
z13 = z12;
} else {
if (campaignEx.getClick_mode().equals("6") && !campaignEx.getPackageName().isEmpty() && campaignEx.getLinkType() == 2 && !z10) {
ae.a.a(this.f25266g, "market://details?id=" + campaignEx.getPackageName(), this.f25268i);
NativeListener.NativeTrackingListener nativeTrackingListener2 = this.f25268i;
if (nativeTrackingListener2 != null && z12) {
nativeTrackingListener2.onDismissLoading(campaignEx);
this.f25268i.onFinishRedirection(campaignEx, null);
}
this.f25274o = true;
z12 = false;
}
if (z10) {
this.f25274o = true;
this.f25272m = false;
}
z13 = z12;
}
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public final void run() {
if (z11 && !a.f25260a && !a.this.f25274o && MBridgeConstans.NATIVE_SHOW_LOADINGPAGER && !z10) {
a.a(a.this, campaignEx);
}
if (!z11 && a.this.f25268i != null && !a.f25260a && !a.this.f25274o && MBridgeConstans.NATIVE_SHOW_LOADINGPAGER) {
a.this.f25268i.onShowLoading(campaignEx);
}
}
});
c cVar = this.f25267h;
if (cVar != null) {
cVar.a();
}
Set<String> set = f25262c;
if (set != null && set.contains(campaignEx.getId())) {
NativeListener.NativeTrackingListener nativeTrackingListener3 = this.f25268i;
if (nativeTrackingListener3 != null) {
nativeTrackingListener3.onDismissLoading(campaignEx);
this.f25268i.onFinishRedirection(campaignEx, campaignEx.getClickURL());
return;
}
return;
}
Set<String> set2 = f25262c;
if (set2 != null) {
set2.add(campaignEx.getId());
}
c cVar2 = new c(this.f25266g);
this.f25267h = cVar2;
cVar2.a(this.f25263d, campaignEx, new e() {
@Override
public final void a(Object obj) {
}
@Override
public final void b(Object obj) {
Set<String> set3 = a.f25262c;
if (set3 != null) {
set3.remove(campaignEx.getId());
}
if (obj instanceof JumpLoaderResult) {
JumpLoaderResult jumpLoaderResult = (JumpLoaderResult) obj;
campaignEx.setJumpResult(jumpLoaderResult);
a aVar = a.this;
aVar.a(campaignEx, jumpLoaderResult, z13, aVar.f25272m);
if (jumpLoaderResult.isjumpDone()) {
com.mbridge.msdk.foundation.db.d.a(a.this.f25265f).a(campaignEx, a.this.f25263d);
}
a.a(a.this, z11, campaignEx);
}
try {
HashMap hashMap = new HashMap();
hashMap.put("result", "1");
hashMap.put("update", "1");
int i10 = -1;
i10 = -1;
try {
String clickURL = campaignEx.getClickURL();
if (!TextUtils.isEmpty(clickURL)) {
i10 = clickURL.startsWith("tcp");
}
} catch (Throwable th2) {
aa.d("MBridge SDK M", th2.getMessage());
}
hashMap.put("net_ty", String.valueOf(i10));
com.mbridge.msdk.foundation.same.report.m.a().a("2000138", campaignEx, hashMap);
} catch (Throwable th3) {
aa.d("MBridge SDK M", th3.getMessage());
}
}
@Override
public final void a(Object obj, String str) {
Set<String> set3 = a.f25262c;
if (set3 != null) {
set3.remove(campaignEx.getId());
}
if (obj instanceof JumpLoaderResult) {
a.this.a((JumpLoaderResult) obj, campaignEx, true);
}
if (a.this.f25268i != null) {
a.this.f25268i.onRedirectionFailed(campaignEx, str);
}
a.a(a.this, z11, campaignEx);
try {
HashMap hashMap = new HashMap();
hashMap.put("result", "2");
hashMap.put("update", "1");
int i10 = -1;
i10 = -1;
try {
String clickURL = campaignEx.getClickURL();
if (!TextUtils.isEmpty(clickURL)) {
i10 = clickURL.startsWith("tcp");
}
} catch (Throwable th2) {
aa.d("MBridge SDK M", th2.getMessage());
}
hashMap.put("net_ty", String.valueOf(i10));
com.mbridge.msdk.foundation.same.report.m.a().a("2000138", campaignEx, hashMap);
} catch (Throwable th3) {
aa.d("MBridge SDK M", th3.getMessage());
}
}
});
}
} catch (Exception e10) {
e10.printStackTrace();
}
}
public final void a(JumpLoaderResult jumpLoaderResult, CampaignEx campaignEx, int i10, boolean z10) {
if (campaignEx == null || jumpLoaderResult == null) {
return;
}
try {
long currentTimeMillis = System.currentTimeMillis() - this.f25264e;
com.mbridge.msdk.foundation.entity.d dVar = new com.mbridge.msdk.foundation.entity.d();
int r10 = w.r(this.f25266g);
dVar.a(r10);
dVar.a(w.a(this.f25266g, r10));
dVar.j(campaignEx.getRequestId());
dVar.k(campaignEx.getRequestIdNotice());
dVar.d(i10);
dVar.i(currentTimeMillis + "");
dVar.h(campaignEx.getId());
dVar.f(jumpLoaderResult.getType());
if (!TextUtils.isEmpty(jumpLoaderResult.getUrl())) {
dVar.g(URLEncoder.encode(jumpLoaderResult.getUrl(), w2.q.f40313v));
}
dVar.c((this.f25264e / 1000) + "");
dVar.b(Integer.parseInt(campaignEx.getLandingType()));
dVar.c(campaignEx.getLinkType());
dVar.b(this.f25263d);
dVar.f(jumpLoaderResult.getType());
if (!TextUtils.isEmpty(jumpLoaderResult.getUrl())) {
dVar.g(URLEncoder.encode(jumpLoaderResult.getUrl(), w2.q.f40313v));
}
if (this.f25271l) {
dVar.e(jumpLoaderResult.getStatusCode());
if (!TextUtils.isEmpty(jumpLoaderResult.getHeader())) {
dVar.e(URLEncoder.encode(jumpLoaderResult.getHeader(), w2.q.f40313v));
}
if (!TextUtils.isEmpty(jumpLoaderResult.getContent())) {
dVar.f(URLEncoder.encode(jumpLoaderResult.getContent(), "UTF-8"));
}
if (!TextUtils.isEmpty(jumpLoaderResult.getExceptionMsg())) {
dVar.d(URLEncoder.encode(jumpLoaderResult.getExceptionMsg(), w2.q.f40313v));
}
}
if (z10) {
this.f25269j.a("click_jump_error", dVar, this.f25263d);
return;
}
ArrayList arrayList = new ArrayList();
arrayList.add(dVar);
String a10 = com.mbridge.msdk.foundation.entity.d.a(arrayList);
if (ak.b(a10)) {
if (com.mbridge.msdk.foundation.same.report.k.a().c()) {
com.mbridge.msdk.foundation.same.report.k.a().a(a10);
} else {
new p(this.f25266g, 0).a("click_jump_success", a10, null, null);
}
}
} catch (Throwable th2) {
th2.printStackTrace();
}
}
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/")) || ae.a.a(this.f25266g, str, this.f25268i) || campaignEx == null) {
return;
}
if (!TextUtils.isEmpty(campaignEx.getPackageName())) {
ae.a.a(this.f25266g, "market://details?id=" + campaignEx.getPackageName(), this.f25268i);
return;
}
if (b() == 2) {
ae.a(this.f25266g, campaignEx.getClickURL(), campaignEx, this.f25268i);
} else {
ae.a(this.f25266g, campaignEx.getClickURL(), this.f25268i, campaignEx.getCurrentLRid());
}
}
} catch (Exception e10) {
e10.printStackTrace();
}
}
public void a(JumpLoaderResult jumpLoaderResult, CampaignEx campaignEx, boolean z10) {
a(jumpLoaderResult, campaignEx, 1, z10);
}
private void a(int i10, String str, CampaignEx campaignEx, NativeListener.NativeTrackingListener nativeTrackingListener) {
try {
if (!TextUtils.isEmpty(str)) {
if (i10 == 2) {
ae.a(this.f25266g, str, campaignEx, nativeTrackingListener);
} else {
ae.a(this.f25266g, str, nativeTrackingListener, campaignEx.getCurrentLRid());
}
}
} catch (Throwable th2) {
aa.b("MBridge SDK M", th2.getMessage(), th2);
}
}
private boolean a(CampaignEx campaignEx, JumpLoaderResult jumpLoaderResult, boolean z10, int i10) {
boolean z11 = false;
if (z10) {
try {
int parseInt = Integer.parseInt(campaignEx.getLandingType());
if (parseInt == 1) {
ae.a(this.f25266g, jumpLoaderResult.getUrl(), this.f25268i, campaignEx.getCurrentLRid());
} else if (parseInt == 2) {
ae.a(this.f25266g, jumpLoaderResult.getUrl(), campaignEx, this.f25268i);
} else if (campaignEx.getPackageName() != null) {
if (!ae.a.a(this.f25266g, "market://details?id=" + campaignEx.getPackageName(), this.f25268i)) {
a(i10, jumpLoaderResult.getUrl(), campaignEx, this.f25268i);
}
} else {
a(i10, jumpLoaderResult.getUrl(), campaignEx, this.f25268i);
}
z11 = true;
} catch (Throwable th2) {
aa.b("MBridge SDK M", th2.getMessage(), th2);
}
}
if (z11) {
a(jumpLoaderResult, campaignEx, true);
NativeListener.NativeTrackingListener nativeTrackingListener = this.f25268i;
if (nativeTrackingListener != null) {
nativeTrackingListener.onFinishRedirection(campaignEx, jumpLoaderResult.getUrl());
}
} else {
a(jumpLoaderResult, campaignEx, true);
NativeListener.NativeTrackingListener nativeTrackingListener2 = this.f25268i;
if (nativeTrackingListener2 != null && z10) {
nativeTrackingListener2.onRedirectionFailed(campaignEx, jumpLoaderResult.getUrl());
}
}
return z11;
}
private boolean a(CampaignEx campaignEx, JumpLoaderResult jumpLoaderResult, boolean z10) {
boolean z11 = false;
if (z10) {
try {
ae.a(this.f25266g, campaignEx.getClickURL(), this.f25268i, campaignEx.getCurrentLRid());
z11 = true;
} catch (Throwable th2) {
aa.b("MBridge SDK M", th2.getMessage(), th2);
}
}
a(jumpLoaderResult, campaignEx, true);
if (z11) {
NativeListener.NativeTrackingListener nativeTrackingListener = this.f25268i;
if (nativeTrackingListener != null) {
nativeTrackingListener.onFinishRedirection(campaignEx, jumpLoaderResult.getUrl());
}
} else {
NativeListener.NativeTrackingListener nativeTrackingListener2 = this.f25268i;
if (nativeTrackingListener2 != null) {
nativeTrackingListener2.onRedirectionFailed(campaignEx, jumpLoaderResult.getUrl());
}
}
return z11;
}
public void a(CampaignEx campaignEx, JumpLoaderResult jumpLoaderResult, boolean z10, boolean z11) {
NativeListener.NativeTrackingListener nativeTrackingListener;
try {
if (this.f25273n) {
if (campaignEx != null && jumpLoaderResult != null) {
int b10 = b();
int code = jumpLoaderResult.getCode();
if (TextUtils.isEmpty(jumpLoaderResult.getUrl()) && z10) {
int linkType = campaignEx.getLinkType();
if (linkType == 2) {
a(campaignEx, jumpLoaderResult, z10, b());
return;
}
if (linkType == 3) {
a(campaignEx, jumpLoaderResult, z10);
return;
}
ae.a(this.f25266g, campaignEx.getClickURL(), this.f25268i, campaignEx.getCurrentLRid());
a(jumpLoaderResult, campaignEx, true);
NativeListener.NativeTrackingListener nativeTrackingListener2 = this.f25268i;
if (nativeTrackingListener2 != null) {
nativeTrackingListener2.onFinishRedirection(campaignEx, jumpLoaderResult.getUrl());
return;
}
return;
}
if (code == 1) {
if (!TextUtils.isEmpty(campaignEx.getPackageName()) && !TextUtils.isEmpty(jumpLoaderResult.getUrl()) && jumpLoaderResult.getUrl().contains(campaignEx.getPackageName()) && z10) {
if (!ae.a.a(this.f25266g, jumpLoaderResult.getUrl(), this.f25268i)) {
a(b10, jumpLoaderResult.getUrl(), campaignEx, this.f25268i);
}
nativeTrackingListener = this.f25268i;
if (nativeTrackingListener != null) {
nativeTrackingListener.onFinishRedirection(campaignEx, jumpLoaderResult.getUrl());
}
} else {
if (z10) {
if (!TextUtils.isEmpty(campaignEx.getPackageName())) {
}
a(b10, jumpLoaderResult.getUrl(), campaignEx, this.f25268i);
}
nativeTrackingListener = this.f25268i;
if (nativeTrackingListener != null && z10) {
nativeTrackingListener.onFinishRedirection(campaignEx, jumpLoaderResult.getUrl());
}
}
} else if (code == 3) {
if (z10) {
ae.a(this.f25266g, jumpLoaderResult.getUrl(), this.f25268i, campaignEx.getCurrentLRid());
}
NativeListener.NativeTrackingListener nativeTrackingListener3 = this.f25268i;
if (nativeTrackingListener3 != null && z10) {
nativeTrackingListener3.onFinishRedirection(campaignEx, jumpLoaderResult.getUrl());
}
} else if (z10) {
if (3 == campaignEx.getLinkType()) {
a(campaignEx, jumpLoaderResult, z10);
return;
} else {
if (2 == campaignEx.getLinkType()) {
a(campaignEx, jumpLoaderResult, z10, b());
return;
}
ae.a(this.f25266g, jumpLoaderResult.getUrl(), this.f25268i, campaignEx.getCurrentLRid());
NativeListener.NativeTrackingListener nativeTrackingListener4 = this.f25268i;
if (nativeTrackingListener4 != null) {
nativeTrackingListener4.onFinishRedirection(campaignEx, jumpLoaderResult.getUrl());
}
}
}
if (a(campaignEx.getLinkType(), jumpLoaderResult.getUrl())) {
a(jumpLoaderResult, campaignEx, false);
} else {
a(jumpLoaderResult, campaignEx, true);
}
NativeListener.NativeTrackingListener nativeTrackingListener5 = this.f25268i;
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 (ae.a.a(str)) {
z11 = z10;
return z11;
}
z10 = false;
z11 = z10;
return z11;
}
} catch (Exception e10) {
e10.printStackTrace();
return z11;
}
}
public static void a(a aVar, CampaignEx campaignEx) {
try {
Intent intent = new Intent(aVar.f25266g, (Class<?>) LoadingActivity.class);
intent.setFlags(268435456);
intent.putExtra(CampaignEx.JSON_KEY_ICON_URL, campaignEx.getIconUrl());
aVar.f25266g.startActivity(intent);
} catch (Exception e10) {
aa.b("MBridge SDK M", "Exception", e10);
}
}
public static void a(a aVar, final boolean z10, final Campaign campaign) {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public final void run() {
if (z10 && !a.f25260a && MBridgeConstans.NATIVE_SHOW_LOADINGPAGER) {
a.f(a.this);
}
if (a.this.f25268i != null && !a.f25260a && MBridgeConstans.NATIVE_SHOW_LOADINGPAGER) {
a.this.f25268i.onDismissLoading(campaign);
}
}
});
}
}