花瓣 v4.6.12版本的 MD5 值为:6a3515d4d16d98931f1b3d25a91b257e
以下内容为反编译后的 d.java 源代码,内容仅作参考
package com.kwad.sdk.utils;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Build;
import android.text.TextUtils;
import com.kwad.sdk.core.response.model.AdTemplate;
import com.kwad.sdk.internal.api.SceneImpl;
import com.mob.pushsdk.plugins.oppo.PushOppo;
import java.util.HashMap;
import java.util.Map;
public final class d {
private static final Map<String, String> atC;
static {
HashMap hashMap = new HashMap();
atC = hashMap;
hashMap.put("HUAWEI", "com.huawei.appmarket");
atC.put(PushOppo.NAME, "com.oppo.market");
atC.put("vivo", "com.bbk.appstore");
atC.put("xiaomi", "com.xiaomi.market");
atC.put("OnePlus", "com.oppo.market");
atC.put("Meizu", "com.meizu.mstore");
atC.put("samsung", "com.sec.android.app.samsungapps");
atC.put("SMARTISAN", "com.smartisanos.appstore");
atC.put("Realme", "com.oppo.market");
atC.put("HONOR", "com.huawei.appmarket");
}
private static boolean A(Context context, String str) {
if (TextUtils.isEmpty(str)) {
return false;
}
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
intent.addFlags(268435456);
try {
context.startActivity(intent);
return true;
} catch (Exception e2) {
e2.printStackTrace();
return false;
}
}
public static boolean a(Context context, String str, AdTemplate adTemplate) {
SceneImpl sceneImpl;
if (!ar.CA() || (sceneImpl = adTemplate.mAdScene) == null || sceneImpl.adStyle == 4 || com.kwad.sdk.core.download.kwai.b.x(context, str) != 1) {
return false;
}
adTemplate.mXiaomiAppStoreDetailViewOpen = true;
return true;
}
private static boolean a(ResolveInfo resolveInfo) {
ActivityInfo activityInfo;
return resolveInfo == null || (activityInfo = resolveInfo.activityInfo) == null || TextUtils.isEmpty(activityInfo.packageName);
}
private static boolean dW(String str) {
return PushOppo.NAME.equals(Build.BRAND) && "com.heytap.market".equals(str);
}
public static boolean g(Context context, String str, String str2) {
if (context == null || TextUtils.isEmpty(str)) {
return false;
}
if ("samsung".equals(Build.BRAND)) {
str = "http://apps.samsung.com/appquery/appDetail.as?appId=" + str2;
}
try {
String str3 = atC.get(Build.BRAND);
Uri parse = Uri.parse(str);
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setData(parse);
intent.addFlags(268435456);
for (ResolveInfo resolveInfo : context.getPackageManager().queryIntentActivities(intent, 0)) {
if (!a(resolveInfo)) {
String str4 = resolveInfo.activityInfo.packageName;
if (str4.equals(str3) || dW(str4)) {
intent.setComponent(new ComponentName(str4, resolveInfo.activityInfo.name));
context.startActivity(intent);
return true;
}
}
}
return A(context, str);
} catch (Exception unused) {
return A(context, str);
}
}
}