Puzzle King v2.3.8版本的 MD5 值为:1734eb975c9d2843afa462aec387292e
以下内容为反编译后的 b.java 源代码,内容仅作参考
package com.com.bytedance.overseas.sdk.a;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.text.TextUtils;
import com.bytedance.sdk.component.utils.l;
import com.bytedance.sdk.openadsdk.c.j;
import com.bytedance.sdk.openadsdk.core.m;
import com.bytedance.sdk.openadsdk.core.model.n;
import com.bytedance.sdk.openadsdk.core.y;
import com.safedk.android.utils.Logger;
import java.lang.ref.WeakReference;
import java.util.concurrent.atomic.AtomicBoolean;
public class b implements c {
protected com.bytedance.sdk.openadsdk.core.model.c a;
protected n b;
protected String c;
private WeakReference<Context> f;
protected boolean d = false;
protected final AtomicBoolean e = new AtomicBoolean(false);
private boolean g = false;
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;
}
p0.startActivity(p1);
}
public b(Context context, n nVar, String str) {
this.f = new WeakReference<>(context);
this.b = nVar;
this.a = nVar.aa();
this.c = str;
l.c("GPDownLoader", "====tag===" + str);
if (m.a() == null) {
m.a(context);
}
}
@Override
public void a(boolean z) {
this.g = z;
}
public boolean a(Context context, String str) {
return b(context, str);
}
public static boolean b(Context context, String str) {
Intent launchIntentForPackage;
if (context != null && str != null && !TextUtils.isEmpty(str)) {
l.c("GPDownLoader", "gotoGooglePlay :market://details?id=" + str);
try {
Intent intent = new Intent("android.intent.action.VIEW");
Uri parse = Uri.parse("market://details?id=" + str);
intent.setData(parse);
for (ResolveInfo resolveInfo : context.getPackageManager().queryIntentActivities(intent, 65536)) {
if (resolveInfo.activityInfo.packageName.equals("com.android.vending") && (launchIntentForPackage = context.getPackageManager().getLaunchIntentForPackage("com.android.vending")) != null) {
launchIntentForPackage.setComponent(new ComponentName(resolveInfo.activityInfo.packageName, resolveInfo.activityInfo.name));
launchIntentForPackage.setData(parse);
if (!(context instanceof Activity)) {
launchIntentForPackage.setFlags(268435456);
}
safedk_Context_startActivity_97cb3195734cf5c9cc3418feeafa6dd6(context, launchIntentForPackage);
return true;
}
}
try {
Intent intent2 = new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/details?id=" + str));
intent2.setFlags(268435456);
safedk_Context_startActivity_97cb3195734cf5c9cc3418feeafa6dd6(context, intent2);
return true;
} catch (Throwable th) {
th.printStackTrace();
}
} catch (Throwable unused) {
}
}
return false;
}
public Context c() {
WeakReference<Context> weakReference = this.f;
return (weakReference == null || weakReference.get() == null) ? m.a() : this.f.get();
}
@Override
public void d() {
if (c() == null) {
return;
}
if (b()) {
this.e.set(true);
} else {
if (a() || e() || this.b.aa() != null || this.b.O() == null) {
return;
}
y.a(c(), this.b.O(), this.b, com.bytedance.sdk.openadsdk.l.y.a(this.c), this.c, true);
}
}
public boolean b() {
if (this.b.ab() == null) {
return false;
}
String a = this.b.ab().a();
if (!TextUtils.isEmpty(a)) {
Uri parse = Uri.parse(a);
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(parse);
if (com.bytedance.sdk.openadsdk.l.y.a(c(), intent)) {
if (!(c() instanceof Activity)) {
intent.addFlags(268435456);
}
try {
com.bytedance.sdk.openadsdk.c.c.d(m.a(), this.b, this.c, "open_url_app", null);
safedk_Context_startActivity_97cb3195734cf5c9cc3418feeafa6dd6(c(), intent);
j.a().a(this.b, this.c);
return true;
} catch (Throwable th) {
th.printStackTrace();
}
}
}
if (this.d && !this.e.get()) {
return false;
}
this.d = true;
com.bytedance.sdk.openadsdk.c.c.d(c(), this.b, this.c, "open_fallback_url", null);
return false;
}
@Override
public boolean e() {
this.e.set(true);
return this.a != null && a(c(), this.a.c());
}
@Override
public boolean a() {
Intent a;
if (this.a == null) {
return false;
}
n nVar = this.b;
if (nVar != null && nVar.as() == 0) {
return false;
}
String c = this.a.c();
if (TextUtils.isEmpty(c) || !com.bytedance.sdk.openadsdk.l.y.b(c(), c) || (a = com.bytedance.sdk.openadsdk.l.y.a(c(), c)) == null) {
return false;
}
a.putExtra("START_ONLY_FOR_ANDROID", true);
try {
safedk_Context_startActivity_97cb3195734cf5c9cc3418feeafa6dd6(c(), a);
com.bytedance.sdk.openadsdk.c.c.d(c(), this.b, this.c, "click_open", null);
return true;
} catch (Throwable th) {
th.printStackTrace();
return false;
}
}
}