- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
178 lines
6.4 KiB
Java
178 lines
6.4 KiB
Java
package com.mbridge.msdk.foundation.tools;
|
|
|
|
import android.content.ContentResolver;
|
|
import android.content.Context;
|
|
import android.os.Build;
|
|
import android.provider.Settings;
|
|
import android.text.TextUtils;
|
|
import com.google.android.gms.ads.identifier.AdvertisingIdClient;
|
|
import com.mbridge.msdk.MBridgeConstans;
|
|
import com.mbridge.msdk.foundation.tools.b;
|
|
import com.mbridge.msdk.mbsignalcommon.webEnvCheck.WebEnvCheckEntry;
|
|
import org.json.JSONObject;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public class f {
|
|
public static volatile String a = null;
|
|
public static String b = null;
|
|
public static boolean c = false;
|
|
public static int d = 0;
|
|
private static String e = "";
|
|
private static boolean f = false;
|
|
private static String g = "";
|
|
private static boolean h = false;
|
|
private static boolean i = false;
|
|
|
|
public static int a() {
|
|
return d;
|
|
}
|
|
|
|
public static void a(int i2) {
|
|
d = i2;
|
|
}
|
|
|
|
public static String b() {
|
|
if (!com.mbridge.msdk.foundation.controller.authoritycontroller.c.k() || !com.mbridge.msdk.foundation.controller.authoritycontroller.c.j().c(MBridgeConstans.AUTHORITY_DEVICE_ID)) {
|
|
return "";
|
|
}
|
|
if (!com.mbridge.msdk.foundation.controller.authoritycontroller.b.a()) {
|
|
return TextUtils.isEmpty(b) ? "" : b;
|
|
}
|
|
if (!TextUtils.isEmpty(b)) {
|
|
return (com.mbridge.msdk.foundation.controller.authoritycontroller.b.b() || d == 0) ? b : "";
|
|
}
|
|
if (!c) {
|
|
a(com.mbridge.msdk.foundation.controller.c.m().c());
|
|
c = true;
|
|
}
|
|
return "";
|
|
}
|
|
|
|
public static void a(final Context context) {
|
|
new Thread(new Runnable() { // from class: com.mbridge.msdk.foundation.tools.f.1
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
if (com.mbridge.msdk.foundation.controller.authoritycontroller.c.j().c(MBridgeConstans.AUTHORITY_DEVICE_ID) && com.mbridge.msdk.foundation.controller.authoritycontroller.b.a()) {
|
|
try {
|
|
AdvertisingIdClient.Info advertisingIdInfo = AdvertisingIdClient.getAdvertisingIdInfo(context);
|
|
f.a(advertisingIdInfo.getId());
|
|
f.d = advertisingIdInfo.isLimitAdTrackingEnabled() ? 1 : 0;
|
|
f.a(context, advertisingIdInfo.getId(), f.d);
|
|
} catch (Exception unused) {
|
|
af.d("DomainSameDiTool", "GET ADID ERROR TRY TO GET FROM GOOGLE PLAY APP");
|
|
try {
|
|
b.a a2 = new b().a(context);
|
|
f.a(a2.a());
|
|
f.d = a2.b() ? 1 : 0;
|
|
f.a(context, a2.a(), f.d);
|
|
} catch (Exception unused2) {
|
|
af.d("DomainSameDiTool", "GET ADID FROM GOOGLE PLAY APP ERROR");
|
|
}
|
|
} catch (Throwable th) {
|
|
af.b("DomainSameDiTool", th.getMessage());
|
|
}
|
|
}
|
|
}
|
|
}).start();
|
|
}
|
|
|
|
public static String c() {
|
|
if (!com.mbridge.msdk.foundation.controller.authoritycontroller.c.k() || !com.mbridge.msdk.foundation.controller.authoritycontroller.c.j().c(MBridgeConstans.AUTHORITY_DEVICE_ID)) {
|
|
return "";
|
|
}
|
|
if (!com.mbridge.msdk.foundation.controller.authoritycontroller.b.a()) {
|
|
return TextUtils.isEmpty(a) ? "" : a;
|
|
}
|
|
if (!TextUtils.isEmpty(a)) {
|
|
return (com.mbridge.msdk.foundation.controller.authoritycontroller.b.b() || d == 0) ? a : "";
|
|
}
|
|
ab.j();
|
|
if (!c) {
|
|
a(com.mbridge.msdk.foundation.controller.c.m().c());
|
|
c = true;
|
|
}
|
|
return TextUtils.isEmpty(a) ? "" : a;
|
|
}
|
|
|
|
public static void a(String str) {
|
|
b = z.b(str);
|
|
a = str;
|
|
}
|
|
|
|
public static String d() {
|
|
if (TextUtils.isEmpty(g) && !f) {
|
|
e();
|
|
}
|
|
return g;
|
|
}
|
|
|
|
public static String e() {
|
|
if (!com.mbridge.msdk.foundation.controller.authoritycontroller.c.k() || !com.mbridge.msdk.foundation.controller.authoritycontroller.c.j().c(MBridgeConstans.AUTHORITY_DEVICE_ID)) {
|
|
return "";
|
|
}
|
|
if (f) {
|
|
return e;
|
|
}
|
|
try {
|
|
JSONObject jSONObject = new JSONObject();
|
|
try {
|
|
ContentResolver contentResolver = com.mbridge.msdk.foundation.controller.c.m().c().getContentResolver();
|
|
int i2 = Settings.Secure.getInt(contentResolver, "limit_ad_tracking");
|
|
String string = Settings.Secure.getString(contentResolver, "advertising_id");
|
|
jSONObject.put("status", i2);
|
|
jSONObject.put("amazonId", string);
|
|
String jSONObject2 = jSONObject.toString();
|
|
if (!TextUtils.isEmpty(jSONObject2)) {
|
|
g = jSONObject2;
|
|
e = z.b(jSONObject2);
|
|
}
|
|
} catch (Settings.SettingNotFoundException e2) {
|
|
af.b("DomainSameDiTool", e2.getMessage());
|
|
}
|
|
} catch (Throwable th) {
|
|
af.b("DomainSameDiTool", th.getMessage());
|
|
}
|
|
f = true;
|
|
return e;
|
|
}
|
|
|
|
public static void b(Context context) {
|
|
if (context == null) {
|
|
return;
|
|
}
|
|
try {
|
|
WebEnvCheckEntry.class.getMethod("check", Context.class).invoke(WebEnvCheckEntry.class.newInstance(), context);
|
|
} catch (Exception e2) {
|
|
e2.printStackTrace();
|
|
}
|
|
}
|
|
|
|
public static boolean c(Context context) {
|
|
try {
|
|
} catch (Exception unused) {
|
|
h = false;
|
|
}
|
|
if (i) {
|
|
return h;
|
|
}
|
|
if (Build.VERSION.SDK_INT >= 30) {
|
|
h = context.getPackageManager().checkPermission(z.a("DkP3hrKuHoPMH+zwL+fALkK/WQc5x5zH+TcincKNNVfWNVJcVM=="), context.getPackageName()) == 0;
|
|
} else {
|
|
h = true;
|
|
}
|
|
i = true;
|
|
return h;
|
|
}
|
|
|
|
public static /* synthetic */ void a(Context context, String str, int i2) {
|
|
try {
|
|
if (ap.b(str)) {
|
|
an.b(context, MBridgeConstans.SP_GA_ID, str);
|
|
}
|
|
an.b(context, MBridgeConstans.SP_GA_ID_LIMIT, Integer.valueOf(i2));
|
|
} catch (Exception e2) {
|
|
af.b("DomainSameDiTool", e2.getMessage());
|
|
}
|
|
}
|
|
}
|