Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f
以下内容为反编译后的 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.ActivityInfo;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Build;
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.w;
import com.bytedance.sdk.openadsdk.l.aa;
import java.lang.ref.WeakReference;
import java.util.concurrent.atomic.AtomicBoolean;
public class b implements c {
protected com.bytedance.sdk.openadsdk.core.model.c f39068a;
protected n f39069b;
protected String f39070c;
private WeakReference<Context> f39073f;
protected boolean f39071d = false;
protected final AtomicBoolean f39072e = new AtomicBoolean(false);
private boolean f39074g = false;
public b(Context context, n nVar, String str) {
this.f39073f = new WeakReference<>(context);
this.f39069b = nVar;
this.f39068a = nVar.Z();
this.f39070c = str;
l.b("GPDownLoader", str, "====tag===" + str);
if (m.a() == null) {
m.a(context);
}
}
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) {
ActivityInfo activityInfo = resolveInfo.activityInfo;
launchIntentForPackage.setComponent(new ComponentName(activityInfo.packageName, activityInfo.name));
launchIntentForPackage.setData(parse);
if (Build.VERSION.SDK_INT >= 33) {
launchIntentForPackage.setAction("android.intent.action.VIEW");
launchIntentForPackage.removeCategory("android.intent.category.LAUNCHER");
}
if (!(context instanceof Activity)) {
launchIntentForPackage.setFlags(268435456);
}
context.startActivity(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);
context.startActivity(intent2);
return true;
} catch (Throwable th2) {
th2.printStackTrace();
}
} catch (Throwable unused) {
}
}
return false;
}
@Override
public void a(boolean z11) {
this.f39074g = z11;
}
public Context c() {
WeakReference<Context> weakReference = this.f39073f;
if (weakReference != null && weakReference.get() != null) {
return this.f39073f.get();
}
return m.a();
}
@Override
public void d() {
if (c() == null) {
return;
}
if (b()) {
this.f39072e.set(true);
} else if (!a() && !e() && this.f39069b.Z() == null && this.f39069b.O() != null) {
w.a(c(), this.f39069b.O(), this.f39069b, aa.a(this.f39070c), this.f39070c, true);
}
}
@Override
public boolean e() {
this.f39072e.set(true);
if (this.f39068a != null && a(c(), this.f39068a.c())) {
return true;
}
return false;
}
public boolean a(Context context, String str) {
return b(context, str);
}
@Override
public boolean a() {
Intent a11;
if (this.f39068a == null) {
return false;
}
n nVar = this.f39069b;
if (nVar != null && nVar.ar() == 0) {
return false;
}
String c11 = this.f39068a.c();
if (TextUtils.isEmpty(c11) || !aa.b(c(), c11) || (a11 = aa.a(c(), c11)) == null) {
return false;
}
a11.putExtra("START_ONLY_FOR_ANDROID", true);
try {
c().startActivity(a11);
com.bytedance.sdk.openadsdk.c.c.d(c(), this.f39069b, this.f39070c, "click_open", null);
return true;
} catch (Throwable th2) {
th2.printStackTrace();
return false;
}
}
public boolean b() {
if (this.f39069b.aa() == null) {
return false;
}
String a11 = this.f39069b.aa().a();
if (!TextUtils.isEmpty(a11)) {
Uri parse = Uri.parse(a11);
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(parse);
if (aa.a(c(), intent)) {
if (!(c() instanceof Activity)) {
intent.addFlags(268435456);
}
try {
com.bytedance.sdk.openadsdk.c.c.d(m.a(), this.f39069b, this.f39070c, "open_url_app", null);
c().startActivity(intent);
j.a().a(this.f39069b, this.f39070c);
return true;
} catch (Throwable th2) {
th2.printStackTrace();
}
}
}
if (this.f39071d && !this.f39072e.get()) {
return false;
}
this.f39071d = true;
com.bytedance.sdk.openadsdk.c.c.d(c(), this.f39069b, this.f39070c, "open_fallback_url", null);
return false;
}
}