- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
300 lines
12 KiB
Java
300 lines
12 KiB
Java
package com.mbridge.msdk.click;
|
|
|
|
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.PackageInfo;
|
|
import android.content.pm.ResolveInfo;
|
|
import android.net.Uri;
|
|
import android.os.Bundle;
|
|
import android.os.Handler;
|
|
import android.os.Looper;
|
|
import android.os.Message;
|
|
import android.text.TextUtils;
|
|
import android.view.ContextThemeWrapper;
|
|
import android.widget.Toast;
|
|
import com.facebook.gamingservices.cloudgaming.internal.SDKConstants;
|
|
import com.google.android.gms.drive.DriveFile;
|
|
import com.mbridge.msdk.MBridgeConstans;
|
|
import com.mbridge.msdk.activity.MBCommonActivity;
|
|
import com.mbridge.msdk.c.b;
|
|
import com.mbridge.msdk.foundation.entity.CampaignEx;
|
|
import com.mbridge.msdk.foundation.tools.ab;
|
|
import com.mbridge.msdk.foundation.tools.af;
|
|
import com.mbridge.msdk.foundation.tools.u;
|
|
import com.mbridge.msdk.mbbid.common.BidResponsedEx;
|
|
import java.lang.reflect.Method;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public final class c {
|
|
static Handler a = new Handler(Looper.getMainLooper()) { // from class: com.mbridge.msdk.click.c.1
|
|
@Override // android.os.Handler
|
|
public final void handleMessage(Message message) {
|
|
String str;
|
|
String str2;
|
|
String str3;
|
|
super.handleMessage(message);
|
|
try {
|
|
if (message.what == 1000) {
|
|
int i = message.arg1;
|
|
int i2 = message.arg2;
|
|
Bundle data = message.getData();
|
|
if (data != null) {
|
|
String string = data.getString("rid");
|
|
String string2 = data.getString("rid_n");
|
|
str3 = data.getString(BidResponsedEx.KEY_CID);
|
|
str = string;
|
|
str2 = string2;
|
|
} else {
|
|
str = "";
|
|
str2 = str;
|
|
str3 = str2;
|
|
}
|
|
new com.mbridge.msdk.foundation.same.report.h(com.mbridge.msdk.foundation.controller.c.m().c()).a(i, i2, str, str2, str3);
|
|
}
|
|
} catch (Throwable th) {
|
|
if (MBridgeConstans.DEBUG) {
|
|
th.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
public static boolean a(CampaignEx campaignEx) {
|
|
return true;
|
|
}
|
|
|
|
public static String a(String str, String str2, String str3) {
|
|
Map<String, b.a> s;
|
|
try {
|
|
if (TextUtils.isEmpty(str)) {
|
|
return str;
|
|
}
|
|
String host = Uri.parse(str).getHost();
|
|
com.mbridge.msdk.c.g b = com.mbridge.msdk.c.h.a().b(com.mbridge.msdk.foundation.controller.c.m().k());
|
|
if (b == null || (s = b.s()) == null || TextUtils.isEmpty(host)) {
|
|
return str;
|
|
}
|
|
Iterator<Map.Entry<String, b.a>> it = s.entrySet().iterator();
|
|
while (it.hasNext()) {
|
|
String key = it.next().getKey();
|
|
if (!TextUtils.isEmpty(key) && host.contains(key)) {
|
|
b.a aVar = s.get(key);
|
|
return aVar != null ? a(a(a(a(str, aVar.a(), String.valueOf(ab.h(com.mbridge.msdk.foundation.controller.c.m().c()))), aVar.b(), String.valueOf(ab.j(com.mbridge.msdk.foundation.controller.c.m().c()))), aVar.c(), str2), aVar.d(), str3) : str;
|
|
}
|
|
}
|
|
return str;
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
return str;
|
|
}
|
|
}
|
|
|
|
private static String a(String str, List<String> list, String str2) {
|
|
if (list != null) {
|
|
for (String str3 : list) {
|
|
if (!TextUtils.isEmpty(str3)) {
|
|
str = str.replaceAll(str3, str2);
|
|
}
|
|
}
|
|
}
|
|
return str;
|
|
}
|
|
|
|
public static void a(Context context, String str) {
|
|
try {
|
|
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
|
|
intent.addFlags(DriveFile.MODE_READ_ONLY);
|
|
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=", ""));
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (!z) {
|
|
d(context, "https://play.google.com/store/apps/details?id=" + str.replace("market://details?id=", ""));
|
|
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);
|
|
} catch (Exception unused) {
|
|
d(context, "https://play.google.com/store/apps/details?id=" + str.replace("market://details?id=", ""));
|
|
}
|
|
} catch (Exception e) {
|
|
af.b("CommonClickUtil", "Exception", e);
|
|
}
|
|
}
|
|
|
|
public static void b(Context context, String str) {
|
|
Intent launchIntentForPackage;
|
|
List<ResolveInfo> queryIntentActivities;
|
|
ResolveInfo next;
|
|
try {
|
|
if (TextUtils.isEmpty(str) || !c(context, str) || (launchIntentForPackage = context.getPackageManager().getLaunchIntentForPackage(str)) == null || (queryIntentActivities = context.getPackageManager().queryIntentActivities(launchIntentForPackage, 0)) == null || queryIntentActivities.size() <= 0 || (next = queryIntentActivities.iterator().next()) == null) {
|
|
return;
|
|
}
|
|
ActivityInfo activityInfo = next.activityInfo;
|
|
ComponentName componentName = new ComponentName(activityInfo.packageName, activityInfo.name);
|
|
Intent intent = new Intent();
|
|
intent.setComponent(componentName);
|
|
intent.addFlags(DriveFile.MODE_READ_ONLY);
|
|
context.startActivity(intent);
|
|
} catch (Exception e) {
|
|
if (com.mbridge.msdk.e.b.a()) {
|
|
Toast.makeText(context, "The app connot start up", 0).show();
|
|
}
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
public static boolean c(Context context, String str) {
|
|
if (str != null && !"".equals(str)) {
|
|
try {
|
|
PackageInfo packageInfo = context.getPackageManager().getPackageInfo(str, 8192);
|
|
if (packageInfo != null) {
|
|
return str.equals(packageInfo.packageName);
|
|
}
|
|
} catch (Exception unused) {
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public static void d(Context context, String str) {
|
|
if (str == null || context == null) {
|
|
return;
|
|
}
|
|
try {
|
|
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
|
|
intent.addFlags(DriveFile.MODE_READ_ONLY);
|
|
ResolveInfo resolveActivity = context.getPackageManager().resolveActivity(intent, 65536);
|
|
if (resolveActivity != null) {
|
|
ActivityInfo activityInfo = resolveActivity.activityInfo;
|
|
intent.setClassName(activityInfo.packageName, activityInfo.name);
|
|
}
|
|
context.startActivity(intent);
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
try {
|
|
Intent intent2 = new Intent("android.intent.action.VIEW", Uri.parse(str));
|
|
intent2.addFlags(DriveFile.MODE_READ_ONLY);
|
|
context.startActivity(intent2);
|
|
} catch (Exception e2) {
|
|
e2.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
|
|
public static boolean e(Context context, String str) {
|
|
Intent intent;
|
|
try {
|
|
if (TextUtils.isEmpty(str)) {
|
|
return false;
|
|
}
|
|
Uri parse = Uri.parse(str);
|
|
if (parse.getScheme().equals(SDKConstants.PARAM_INTENT)) {
|
|
intent = Intent.parseUri(str, 1);
|
|
} else if (parse.getScheme().equals("android-app")) {
|
|
intent = Intent.parseUri(str, 2);
|
|
} else {
|
|
intent = new Intent("android.intent.action.VIEW", parse);
|
|
intent.setData(parse);
|
|
}
|
|
if (intent == null) {
|
|
return false;
|
|
}
|
|
intent.setComponent(null);
|
|
intent.setSelector(null);
|
|
if (a(context, intent)) {
|
|
return true;
|
|
}
|
|
intent.setFlags(DriveFile.MODE_READ_ONLY);
|
|
context.startActivity(intent);
|
|
return true;
|
|
} catch (Throwable th) {
|
|
af.b("CommonClickUtil", th.getMessage(), th);
|
|
return false;
|
|
}
|
|
}
|
|
|
|
private static boolean a(Context context, Intent intent) {
|
|
try {
|
|
} catch (Throwable th) {
|
|
af.b("CommonClickUtil", th.getMessage(), th);
|
|
}
|
|
if (context instanceof Activity) {
|
|
context.startActivity(intent);
|
|
return true;
|
|
}
|
|
if (com.mbridge.msdk.foundation.controller.c.m().e() != null) {
|
|
Context e = com.mbridge.msdk.foundation.controller.c.m().e();
|
|
if (!(e instanceof Activity)) {
|
|
return false;
|
|
}
|
|
e.startActivity(intent);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public static void f(Context context, String str) {
|
|
if (context == null || str == null) {
|
|
return;
|
|
}
|
|
try {
|
|
int i = MBCommonActivity.$r8$clinit;
|
|
Intent intent = new Intent(context, (Class<?>) MBCommonActivity.class);
|
|
intent.putExtra("url", str);
|
|
if (!(context instanceof ContextThemeWrapper)) {
|
|
intent.setFlags(DriveFile.MODE_READ_ONLY);
|
|
}
|
|
context.startActivity(intent);
|
|
} catch (ClassNotFoundException e) {
|
|
af.b("CommonClickUtil", e.getMessage());
|
|
} catch (Throwable th) {
|
|
af.b("CommonClickUtil", th.getMessage());
|
|
}
|
|
}
|
|
|
|
public static void a(final Context context, int i, final String str) {
|
|
if (i == 0) {
|
|
return;
|
|
}
|
|
try {
|
|
com.mbridge.msdk.foundation.same.f.a.b().execute(new Runnable() { // from class: com.mbridge.msdk.click.c.2
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
try {
|
|
Method method = u.class.getMethod("mia", Context.class, String.class);
|
|
Context context2 = context;
|
|
if (context2 != null) {
|
|
method.invoke(null, context2, str);
|
|
} else {
|
|
af.b("CommonClickUtil", "Context is null");
|
|
}
|
|
} catch (Throwable th) {
|
|
af.b("CommonClickUtil", th.getMessage());
|
|
}
|
|
}
|
|
});
|
|
} catch (Throwable th) {
|
|
af.b("CommonClickUtil", th.getMessage());
|
|
}
|
|
}
|
|
}
|