Puzzle King v2.3.8版本的 MD5 值为:1734eb975c9d2843afa462aec387292e
以下内容为反编译后的 z.java 源代码,内容仅作参考
package com.mbridge.msdk.foundation.tools;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Log;
import com.applovin.impl.sdk.utils.Utils;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.out.NativeListener;
import com.safedk.android.analytics.brandsafety.BrandSafetyUtils;
import com.safedk.android.analytics.brandsafety.creatives.infos.CreativeInfo;
import com.safedk.android.utils.Logger;
import java.io.File;
import java.util.Iterator;
import java.util.List;
public final class z extends g {
public static boolean a;
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 void safedk_Context_startActivity_97cb3195734cf5c9cc3418feeafa6dd6(Context p0, Intent p1) {
Logger.d("SafeDK-Special|SafeDK: Call> Landroid/content/Context;->startActivity(Landroid/content/Intent;)V");
if (p1 == null) {
return;
}
BrandSafetyUtils.detectAdClick(p1, com.safedk.android.utils.g.o);
p0.startActivity(p1);
}
public static class a {
public static void safedk_Context_startActivity_97cb3195734cf5c9cc3418feeafa6dd6(Context p0, Intent p1) {
Logger.d("SafeDK-Special|SafeDK: Call> Landroid/content/Context;->startActivity(Landroid/content/Intent;)V");
if (p1 == null) {
return;
}
BrandSafetyUtils.detectAdClick(p1, com.safedk.android.utils.g.o);
p0.startActivity(p1);
}
private static Intent a(Context context) {
return new Intent("android.intent.action.VIEW", Uri.parse("market://details?id=com.package.name"));
}
private static List<ResolveInfo> b(Context context) {
try {
return context.getPackageManager().queryIntentActivities(a(context), 0);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public static boolean a(String str) {
return b(str) || c(str);
}
public static boolean b(String str) {
try {
if (TextUtils.isEmpty(str)) {
return false;
}
return Uri.parse(str).getScheme().equals(Utils.PLAY_STORE_SCHEME);
} catch (Throwable th) {
v.d("SDKUtil", Log.getStackTraceString(th));
return false;
}
}
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) {
v.d("SDKUtil", Log.getStackTraceString(th));
}
return false;
}
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(CreativeInfo.A));
} 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;
}
}
safedk_Context_startActivity_97cb3195734cf5c9cc3418feeafa6dd6(context, a);
z.a(nativeTrackingListener);
return true;
}
return false;
} catch (Throwable th) {
v.d("SDKUtil", Log.getStackTraceString(th));
return false;
}
}
}
public static void a(NativeListener.NativeTrackingListener nativeTrackingListener) {
if (nativeTrackingListener instanceof NativeListener.TrackingExListener) {
((NativeListener.TrackingExListener) nativeTrackingListener).onLeaveApp();
}
}
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) {
b(context, "https://play.google.com/store/apps/details?id=" + str.replace("market://details?id=", ""), 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 {
safedk_Context_startActivity_97cb3195734cf5c9cc3418feeafa6dd6(context, intent);
a(nativeTrackingListener);
} catch (Exception unused) {
b(context, "https://play.google.com/store/apps/details?id=" + str.replace("market://details?id=", ""), nativeTrackingListener);
}
} catch (Exception e) {
v.d("SDKUtil", e.getMessage());
}
}
public static void a(Context context, String str, CampaignEx campaignEx, NativeListener.NativeTrackingListener nativeTrackingListener) {
if (context == null) {
return;
}
if (a) {
b(context, str, nativeTrackingListener);
return;
}
try {
Class.forName("com.mbridge.msdk.activity.MBCommonActivity");
Intent intent = new Intent(context, Class.forName("com.mbridge.msdk.activity.MBCommonActivity"));
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);
v.b("url", "webview url = " + str);
intent.setFlags(268435456);
intent.putExtra("mvcommon", campaignEx);
safedk_Context_startActivity_97cb3195734cf5c9cc3418feeafa6dd6(context, intent);
} catch (Exception unused) {
b(context, str, nativeTrackingListener);
}
}
public static void b(Context context, String str, NativeListener.NativeTrackingListener nativeTrackingListener) {
if (str == null || context == null) {
return;
}
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) {
intent.setClassName(resolveActivity.activityInfo.packageName, resolveActivity.activityInfo.name);
}
safedk_Context_startActivity_97cb3195734cf5c9cc3418feeafa6dd6(context, intent);
a(nativeTrackingListener);
} catch (Exception e) {
e.printStackTrace();
try {
Intent intent2 = new Intent("android.intent.action.VIEW", Uri.parse(str));
intent2.addFlags(268468224);
safedk_Context_startActivity_97cb3195734cf5c9cc3418feeafa6dd6(context, intent2);
a(nativeTrackingListener);
} catch (Exception e2) {
e2.printStackTrace();
}
}
}
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.hashCode() + str.substring(str.lastIndexOf("/") + 1).hashCode()) + "";
}
}
return new File(a2, str2).getAbsolutePath();
}
}