Step Record v1.1.5版本的 MD5 值为:5797275f89198878d2f00ee92d534382
以下内容为反编译后的 ae.java 源代码,内容仅作参考
package com.mbridge.msdk.foundation.tools;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import com.anythink.expressad.foundation.h.v;
import com.mbridge.msdk.activity.MBCommonActivity;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.webview.BrowserView;
import com.mbridge.msdk.out.BaseTrackingListener;
import com.mbridge.msdk.out.Campaign;
import com.mbridge.msdk.out.NativeListener;
import java.io.File;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
public final class ae extends i {
public static boolean a = false;
public static char[] b = {'a', 'n', 'd', 'r', 'o', 'i', 'd', 'c', 'o', 'n', 't', 'e', 'n', 't', 'p', 'm', 'g', 'e', 't', 'C', 'o', 'n', 't', 'e', 'x', 't'};
public static LinearLayout c;
public static class a {
private static Intent a(Context context) {
return new Intent("android.intent.action.VIEW", Uri.parse(v.a.h));
}
private static List<ResolveInfo> b(Context context) {
try {
return context.getPackageManager().queryIntentActivities(a(context), 0);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
private static boolean c(String str) {
Uri parse;
try {
if (TextUtils.isEmpty(str) || (parse = Uri.parse(str)) == null || TextUtils.isEmpty(parse.getHost())) {
return false;
}
if (!parse.getHost().equals("play.google.com")) {
if (!parse.getHost().equals("market.android.com")) {
return false;
}
}
return true;
} catch (Throwable th) {
aa.d("SDKUtil", Log.getStackTraceString(th));
}
return false;
}
public static boolean a(String str) {
return b(str) || c(str);
}
public static boolean a(Context context, String str, NativeListener.NativeTrackingListener nativeTrackingListener) {
try {
List<ResolveInfo> b = b(context);
if (b != null && b.size() > 0) {
if (!b(str)) {
if (c(str)) {
str = "market://" + str.substring(str.indexOf(v.a.g));
} else {
str = null;
}
}
if (TextUtils.isEmpty(str)) {
return false;
}
Intent a = a(context);
a.setData(Uri.parse(str));
a.addFlags(268435456);
Iterator<ResolveInfo> it = b.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
if (it.next().activityInfo.packageName.equals("com.android.vending")) {
a.setPackage("com.android.vending");
break;
}
}
context.startActivity(a);
ae.a(nativeTrackingListener);
return true;
}
return false;
} catch (Throwable th) {
aa.d("SDKUtil", Log.getStackTraceString(th));
return false;
}
}
public static boolean b(String str) {
try {
if (TextUtils.isEmpty(str)) {
return false;
}
return Uri.parse(str).getScheme().equals("market");
} catch (Throwable th) {
aa.d("SDKUtil", Log.getStackTraceString(th));
return false;
}
}
}
public static void a(BaseTrackingListener baseTrackingListener) {
if (baseTrackingListener instanceof NativeListener.TrackingExListener) {
((NativeListener.TrackingExListener) baseTrackingListener).onLeaveApp();
}
}
public static void b(Campaign campaign, ViewGroup viewGroup) {
if (campaign != null) {
CampaignEx campaignEx = (CampaignEx) campaign;
if (campaignEx.getLinkType() == 8 && campaignEx.getAabEntity() != null && campaignEx.getAabEntity().getHlp() == 1) {
if (viewGroup == null) {
aa.c("SDKUtil", "hide linkType==8 loading view failed. viewGroup is null");
return;
}
try {
LinearLayout linearLayout = c;
if (linearLayout == null) {
return;
}
viewGroup.removeView(linearLayout);
} catch (Throwable th) {
th.printStackTrace();
}
}
}
}
public static void a(Context context, String str, NativeListener.NativeTrackingListener nativeTrackingListener) {
try {
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
intent.addFlags(268435456);
List<ResolveInfo> queryIntentActivities = context.getPackageManager().queryIntentActivities(intent, 0);
boolean z = queryIntentActivities.size() > 0;
if (!str.startsWith("market://")) {
if (str.startsWith("https://play.google.com/")) {
a(context, "market://details?id=" + str.replace("https://play.google.com/store/apps/details?id=", ""), nativeTrackingListener);
return;
}
return;
}
if (!z) {
a(context, "https://play.google.com/store/apps/details?id=" + str.replace("market://details?id=", ""), (BaseTrackingListener) nativeTrackingListener);
return;
}
Iterator<ResolveInfo> it = queryIntentActivities.iterator();
while (it.hasNext()) {
if (it.next().activityInfo.packageName.equals("com.android.vending")) {
intent.setClassName("com.android.vending", "com.android.vending.AssetBrowserActivity");
break;
}
}
try {
context.startActivity(intent);
a(nativeTrackingListener);
} catch (Exception unused) {
a(context, "https://play.google.com/store/apps/details?id=" + str.replace("market://details?id=", ""), (BaseTrackingListener) nativeTrackingListener);
}
} catch (Exception e) {
aa.d("SDKUtil", e.getMessage());
}
}
public static void a(Context context, String str, CampaignEx campaignEx, com.mbridge.msdk.click.a aVar, BaseTrackingListener baseTrackingListener) {
HashMap hashMap = new HashMap();
hashMap.put("type", "4");
try {
BrowserView browserView = new BrowserView(com.mbridge.msdk.foundation.controller.b.d().g(), campaignEx);
browserView.setLayoutParams(new LinearLayout.LayoutParams(w.l(context), w.m(context)));
browserView.setListener(new com.mbridge.msdk.foundation.webview.a(context, campaignEx, aVar, browserView, baseTrackingListener));
browserView.loadUrl(str);
hashMap.put(com.anythink.expressad.foundation.d.t.ah, "1");
} catch (Exception e) {
aa.d("SDKUtil", e.getMessage());
hashMap.put(com.anythink.expressad.foundation.d.t.ah, "2");
}
try {
com.mbridge.msdk.foundation.same.report.m.a().a("2000150", campaignEx, hashMap);
} catch (Exception unused) {
}
}
public static void a(Context context, String str, CampaignEx campaignEx, NativeListener.NativeTrackingListener nativeTrackingListener) {
Intent intent;
if (context == null) {
return;
}
HashMap hashMap = new HashMap();
String currentLRid = campaignEx != null ? campaignEx.getCurrentLRid() : "";
if (a) {
a(context, str, nativeTrackingListener, currentLRid);
return;
}
try {
int i = MBCommonActivity.tz;
intent = new Intent(context, (Class<?>) MBCommonActivity.class);
} catch (Exception unused) {
hashMap.put(com.anythink.expressad.foundation.d.t.ah, "2");
a(context, str, nativeTrackingListener, currentLRid);
}
if (TextUtils.isEmpty(str)) {
return;
}
if (a.b(str)) {
str = "https://play.google.com/store/apps/details?id=" + str.replace("market://details?id=", "");
}
intent.putExtra("url", str);
aa.b("url", "webview url = " + str);
intent.setFlags(268435456);
intent.putExtra("mvcommon", campaignEx);
context.startActivity(intent);
hashMap.put(com.anythink.expressad.foundation.d.t.ah, "1");
try {
hashMap.put("type", "5");
com.mbridge.msdk.foundation.same.report.m.a().a("2000150", currentLRid, hashMap);
} catch (Exception unused2) {
}
}
public static void a(Context context, String str, BaseTrackingListener baseTrackingListener) {
a(context, str, baseTrackingListener, "");
}
public static void a(Context context, String str, BaseTrackingListener baseTrackingListener, String str2) {
if (str == null || context == null) {
return;
}
HashMap hashMap = new HashMap();
try {
if (a.b(str)) {
str = "https://play.google.com/store/apps/details?id=" + str.replace("market://details?id=", "");
}
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
intent.addFlags(268435456);
ResolveInfo resolveActivity = context.getPackageManager().resolveActivity(intent, 65536);
if (resolveActivity != null) {
ActivityInfo activityInfo = resolveActivity.activityInfo;
intent.setClassName(activityInfo.packageName, activityInfo.name);
}
context.startActivity(intent);
a(baseTrackingListener);
hashMap.put(com.anythink.expressad.foundation.d.t.ah, "1");
} catch (Exception e) {
e.printStackTrace();
try {
Intent intent2 = new Intent("android.intent.action.VIEW", Uri.parse(str));
intent2.addFlags(268468224);
context.startActivity(intent2);
a(baseTrackingListener);
hashMap.put(com.anythink.expressad.foundation.d.t.ah, "1");
} catch (Exception e2) {
e2.printStackTrace();
hashMap.put(com.anythink.expressad.foundation.d.t.ah, "2");
}
}
try {
hashMap.put("type", "5");
com.mbridge.msdk.foundation.same.report.m.a().a("2000150", str2, hashMap);
} catch (Exception unused) {
}
}
public static String a(String str) {
if (TextUtils.isEmpty(str)) {
return null;
}
File a2 = com.mbridge.msdk.foundation.same.b.e.a(com.mbridge.msdk.foundation.same.b.c.MBRIDGE_700_IMG);
String str2 = "";
if (!TextUtils.isEmpty(str)) {
if (str.lastIndexOf("/") == -1) {
str2 = str.hashCode() + "";
} else {
str2 = (str.substring(str.lastIndexOf("/") + 1).hashCode() + str.hashCode()) + "";
}
}
return new File(a2, str2).getAbsolutePath();
}
public static void a(Campaign campaign, ViewGroup viewGroup) {
a(campaign, viewGroup, 0, 0);
}
public static void a(Campaign campaign, ViewGroup viewGroup, int i, int i2) {
if (campaign != null) {
CampaignEx campaignEx = (CampaignEx) campaign;
if (campaignEx.getLinkType() == 8 && campaignEx.getAabEntity() != null && campaignEx.getAabEntity().getHlp() == 1) {
if (viewGroup == null) {
aa.c("SDKUtil", "show linkType==8 loading view failed. viewGroup is null");
return;
}
try {
if (c == null) {
Context g = com.mbridge.msdk.foundation.controller.b.d().g();
if (g instanceof Activity) {
c = (LinearLayout) LayoutInflater.from(g.getApplicationContext()).inflate(t.a(g.getApplicationContext(), "mbridge_cm_loading_layout", "layout"), (ViewGroup) null);
} else {
c = (LinearLayout) LayoutInflater.from(g).inflate(t.a(g, "mbridge_cm_loading_layout", "layout"), (ViewGroup) null);
}
}
int min = Math.min(viewGroup.getWidth(), viewGroup.getHeight());
int min2 = Math.min(Math.max(min / 4, 70), min);
if (viewGroup instanceof FrameLayout) {
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(min2, min2);
layoutParams.gravity = 17;
ao.a(c);
viewGroup.addView(c, layoutParams);
return;
}
RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(min2, min2);
if (i2 == 0 && i == 0) {
layoutParams2.addRule(13);
} else {
layoutParams2.leftMargin = i2;
layoutParams2.topMargin = i;
}
ao.a(c);
viewGroup.addView(c, layoutParams2);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
}