Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,473 @@
package com.mbridge.msdk.foundation.tools;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.database.Cursor;
import android.net.Uri;
import android.text.TextUtils;
import androidx.core.app.NotificationCompat;
import com.ironsource.nb;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.unity3d.ads.core.domain.HandleInvocationsFromAdViewer;
import java.net.URLEncoder;
import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicBoolean;
/* loaded from: classes4.dex */
public final class MIMManager {
private static volatile String a;
private final AtomicBoolean b;
private int c;
private CopyOnWriteArrayList<CampaignEx> d;
private Context e;
private volatile Boolean f;
private CampaignEx g;
private volatile b h;
private volatile MiOverseaMiniCardBroadcasterReceiver i;
public static final class a {
private static final MIMManager a = new MIMManager();
}
public final CampaignEx b() {
return this.g;
}
public final Boolean d() {
return this.f;
}
public final void e() {
this.c++;
}
private MIMManager() {
this.c = 0;
this.d = new CopyOnWriteArrayList<>();
this.b = new AtomicBoolean(false);
}
public static MIMManager a() {
return a.a;
}
public final void a(CampaignEx campaignEx) {
try {
if (this.f != null && campaignEx != null && this.f.booleanValue()) {
this.g = campaignEx;
this.d.add(campaignEx);
}
if (com.mbridge.msdk.e.b.b() && campaignEx != null && campaignEx.getDeepLinkURL().startsWith("mimarket")) {
if (this.i == null) {
try {
if (this.i == null) {
this.i = new MiOverseaMiniCardBroadcasterReceiver();
}
IntentFilter intentFilter = new IntentFilter(z.a("DFKwWgtuDkKwLZPwD+z8H+N/xjK+n3eyNVx6ZVPn5jcincKZx5f5ncN="));
Context c = com.mbridge.msdk.foundation.controller.c.m().c();
if (c != null) {
c.registerReceiver(this.i, intentFilter);
}
} catch (Exception e) {
af.a("MIMManager", e.getMessage());
}
}
this.g = campaignEx;
this.d.add(campaignEx);
}
} catch (Exception e2) {
af.b("MIMManager", e2.getMessage());
}
}
/* JADX INFO: Access modifiers changed from: private */
public CampaignEx a(String str) {
try {
CampaignEx campaignEx = this.g;
if (campaignEx != null && TextUtils.equals(campaignEx.getPackageName(), str)) {
return this.g;
}
CopyOnWriteArrayList<CampaignEx> copyOnWriteArrayList = this.d;
if (copyOnWriteArrayList == null || copyOnWriteArrayList.size() <= 0) {
return null;
}
Iterator<CampaignEx> it = this.d.iterator();
while (it.hasNext()) {
CampaignEx next = it.next();
if (next != null && TextUtils.equals(next.getPackageName(), str)) {
return next;
}
}
return null;
} catch (Exception e) {
af.b("MIMManager", e.getMessage());
return null;
}
}
public final String c() {
try {
return a == null ? "" : String.format("[%s]", a);
} catch (Exception unused) {
return "";
}
}
public final void a(final Context context) {
this.e = context;
com.mbridge.msdk.foundation.same.f.a.b().execute(new Runnable() { // from class: com.mbridge.msdk.foundation.tools.MIMManager.1
@Override // java.lang.Runnable
public final void run() {
if (MIMManager.this.b.compareAndSet(false, true)) {
try {
MIMManager mIMManager = MIMManager.this;
mIMManager.f = mIMManager.g();
} catch (Exception e) {
af.a("MIMManager", e.getMessage());
}
if (MIMManager.this.f == null || !MIMManager.this.f.booleanValue() || context == null) {
return;
}
try {
MIMManager.this.h = new b();
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(z.a("DFKwWgtuDkKwLZPwD+z8H+N/xj26Vjcdx5KyVj5GxVN="));
intentFilter.addAction(z.a("DFKwWgtuDkKwLZPwD+z8H+N/xj26Vjcdx5KanjKnxVN="));
intentFilter.addAction(z.a("DFKwWgtuDkKwLZPwD+z8H+N/xjQZxVfV+T2SZVe6V2xS5c5n"));
context.registerReceiver(MIMManager.this.h, intentFilter);
} catch (Exception e2) {
af.a("MIMManager", e2.getMessage());
}
}
}
});
}
/* JADX INFO: Access modifiers changed from: private */
public Boolean g() {
Cursor cursor;
Context c = com.mbridge.msdk.foundation.controller.c.m().c();
Boolean bool = null;
if (c != null) {
try {
if (c.getContentResolver() != null) {
try {
cursor = c.getContentResolver().query(Uri.parse(z.a("DFK/J75/JaEXWFfXYZP9LkcXYk3/YkcBLF5TWgSBYbHuH75BW3xuhr5UJj2tLkeNhrKFLkxQhl==")), null, null, null, null);
} catch (Exception unused) {
cursor = null;
}
if (cursor != null) {
while (cursor.moveToNext()) {
try {
String string = cursor.getString(cursor.getColumnIndex("support"));
if (!TextUtils.isEmpty(string)) {
if (!string.equalsIgnoreCase("null")) {
if (!string.equalsIgnoreCase("false")) {
if (string.equalsIgnoreCase("true")) {
}
}
bool = Boolean.valueOf(Boolean.parseBoolean(string));
}
}
} catch (Exception e) {
af.a("MIMManager", e.getMessage());
}
try {
a = cursor.getString(cursor.getColumnIndex("detailStyle"));
} catch (Exception e2) {
af.a("MIMManager", e2.getMessage());
}
}
try {
cursor.close();
} catch (Exception e3) {
af.a("MIMManager", e3.getMessage());
}
}
}
} catch (Exception e4) {
af.b("MIMManager", e4.getMessage());
}
}
return bool;
}
public final void b(CampaignEx campaignEx) {
try {
if (this.f == null || campaignEx == null || !this.f.booleanValue()) {
return;
}
this.g = null;
try {
this.d.remove(campaignEx);
} catch (Exception e) {
af.a("MIMManager", e.getMessage());
}
} catch (Exception e2) {
af.b("MIMManager", e2.getMessage());
}
}
public static class b extends BroadcastReceiver {
private b() {
}
/* JADX WARN: Removed duplicated region for block: B:32:0x0086 A[Catch: Exception -> 0x0076, TryCatch #0 {Exception -> 0x0076, blocks: (B:12:0x0033, B:15:0x003a, B:17:0x004b, B:21:0x0052, B:24:0x005d, B:32:0x0086, B:33:0x008d, B:36:0x006f, B:38:0x0078, B:39:0x007e), top: B:11:0x0033 }] */
@Override // android.content.BroadcastReceiver
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void onReceive(final android.content.Context r9, android.content.Intent r10) {
/*
r8 = this;
java.lang.String r0 = r10.getAction()
boolean r1 = android.text.TextUtils.isEmpty(r0)
if (r1 == 0) goto Lb
return
Lb:
java.lang.String r1 = "DFKwWgtuDkKwLZPwD+z8H+N/xj26Vjcdx5KyVj5GxVN="
java.lang.String r1 = com.mbridge.msdk.foundation.tools.z.a(r1)
boolean r1 = r0.equals(r1)
if (r1 == 0) goto L19
goto Lb4
L19:
java.lang.String r1 = "DFKwWgtuDkKwLZPwD+z8H+N/xj26Vjcdx5KanjKnxVN="
java.lang.String r1 = com.mbridge.msdk.foundation.tools.z.a(r1)
boolean r1 = r0.equals(r1)
if (r1 == 0) goto L27
goto Lb4
L27:
java.lang.String r1 = "DFKwWgtuDkKwLZPwD+z8H+N/xjQZxVfV+T2SZVe6V2xS5c5n"
java.lang.String r1 = com.mbridge.msdk.foundation.tools.z.a(r1)
boolean r0 = r0.equals(r1)
if (r0 == 0) goto Lb4
android.os.Bundle r10 = r10.getExtras() // Catch: java.lang.Exception -> L76
if (r10 != 0) goto L3a
return
L3a:
java.lang.String r0 = "statusCode"
r1 = -1
int r7 = r10.getInt(r0, r1) // Catch: java.lang.Exception -> L76
java.lang.String r0 = "packageName"
java.lang.String r2 = ""
java.lang.String r10 = r10.getString(r0, r2) // Catch: java.lang.Exception -> L76
if (r7 == r1) goto Laa
boolean r0 = android.text.TextUtils.isEmpty(r10) // Catch: java.lang.Exception -> L76
if (r0 == 0) goto L52
goto Laa
L52:
com.mbridge.msdk.foundation.tools.MIMManager r0 = com.mbridge.msdk.foundation.tools.MIMManager.a.a() // Catch: java.lang.Exception -> L76
com.mbridge.msdk.foundation.entity.CampaignEx r10 = com.mbridge.msdk.foundation.tools.MIMManager.a(r0, r10) // Catch: java.lang.Exception -> L76
if (r10 != 0) goto L5d
return
L5d:
com.mbridge.msdk.foundation.tools.MIMManager r0 = com.mbridge.msdk.foundation.tools.MIMManager.a.a() // Catch: java.lang.Exception -> L76
r1 = 3001(0xbb9, float:4.205E-42)
if (r7 == r1) goto L7e
r1 = 3002(0xbba, float:4.207E-42)
if (r7 == r1) goto L78
r1 = 3008(0xbc0, float:4.215E-42)
if (r7 == r1) goto L6f
r10 = 0
goto L84
L6f:
com.mbridge.msdk.foundation.tools.MIMManager$4 r1 = new com.mbridge.msdk.foundation.tools.MIMManager$4 // Catch: java.lang.Exception -> L76
r1.<init>() // Catch: java.lang.Exception -> L76
L74:
r10 = r1
goto L84
L76:
r9 = move-exception
goto Lab
L78:
com.mbridge.msdk.foundation.tools.MIMManager$3 r1 = new com.mbridge.msdk.foundation.tools.MIMManager$3 // Catch: java.lang.Exception -> L76
r1.<init>() // Catch: java.lang.Exception -> L76
goto L74
L7e:
com.mbridge.msdk.foundation.tools.MIMManager$2 r1 = new com.mbridge.msdk.foundation.tools.MIMManager$2 // Catch: java.lang.Exception -> L76
r1.<init>() // Catch: java.lang.Exception -> L76
goto L74
L84:
if (r10 == 0) goto L8d
java.util.concurrent.ThreadPoolExecutor r0 = com.mbridge.msdk.foundation.same.f.a.b() // Catch: java.lang.Exception -> L76
r0.execute(r10) // Catch: java.lang.Exception -> L76
L8d:
com.mbridge.msdk.foundation.tools.MIMManager r3 = com.mbridge.msdk.foundation.tools.MIMManager.a.a() // Catch: java.lang.Exception -> L76
java.lang.String r5 = "dm_page_status"
com.mbridge.msdk.foundation.tools.MIMManager r10 = com.mbridge.msdk.foundation.tools.MIMManager.a.a() // Catch: java.lang.Exception -> L76
com.mbridge.msdk.foundation.entity.CampaignEx r6 = r10.b() // Catch: java.lang.Exception -> L76
java.util.concurrent.ThreadPoolExecutor r10 = com.mbridge.msdk.foundation.same.f.a.b() // Catch: java.lang.Exception -> L76
com.mbridge.msdk.foundation.tools.MIMManager$5 r0 = new com.mbridge.msdk.foundation.tools.MIMManager$5 // Catch: java.lang.Exception -> L76
r2 = r0
r4 = r9
r2.<init>() // Catch: java.lang.Exception -> L76
r10.execute(r0) // Catch: java.lang.Exception -> L76
goto Lb4
Laa:
return
Lab:
java.lang.String r10 = "MIMManager"
java.lang.String r9 = r9.getMessage()
com.mbridge.msdk.foundation.tools.af.b(r10, r9)
Lb4:
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.foundation.tools.MIMManager.b.onReceive(android.content.Context, android.content.Intent):void");
}
}
public static class MiOverseaMiniCardBroadcasterReceiver extends BroadcastReceiver {
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
if (z.a("DFKwWgtuDkKwLZPwD+z8H+N/xjK+n3eyNVx6ZVPn5jcincKZx5f5ncN=").equals(intent.getAction())) {
String stringExtra = intent.getStringExtra(HandleInvocationsFromAdViewer.KEY_PACKAGE_NAME);
int intExtra = intent.getIntExtra("errorCode", 0);
int intExtra2 = intExtra < 0 ? intent.getIntExtra("reason", 0) : -1;
af.b("MIMManager", stringExtra + " " + intExtra + " " + intExtra2);
if (intExtra == 1 || intExtra == 2 || intExtra == 3 || intExtra == 4 || intExtra == 7) {
try {
com.mbridge.msdk.foundation.same.report.d.c cVar = new com.mbridge.msdk.foundation.same.report.d.c();
com.mbridge.msdk.foundation.same.report.d.e eVar = new com.mbridge.msdk.foundation.same.report.d.e();
eVar.a("key", URLEncoder.encode("m_mini_card", nb.N));
CampaignEx a = a.a.a(stringExtra);
if (a != null) {
eVar.a("rid", a.getRequestId());
eVar.a("rid_n", a.getRequestIdNotice());
eVar.a(MBridgeConstans.PROPERTIES_UNIT_ID, a.getCampaignUnitId());
eVar.a("u_stid", com.mbridge.msdk.foundation.controller.a.b.get(a.getCampaignUnitId()));
cVar.a(a);
}
eVar.a(NotificationCompat.CATEGORY_EVENT, String.valueOf(intExtra));
eVar.a("pkg_name", stringExtra);
if (intExtra2 != -1) {
eVar.a("reasonCode", String.valueOf(intExtra2));
}
cVar.a("m_mini_card", eVar);
com.mbridge.msdk.foundation.same.report.d.d.a().a("m_mini_card", cVar);
} catch (Exception e) {
af.b("MIMManager", e.getMessage());
}
}
}
}
}
/* JADX WARN: Code restructure failed: missing block: B:14:0x002a, code lost:
if (r0 != null) goto L18;
*/
/* JADX WARN: Code restructure failed: missing block: B:15:0x002c, code lost:
r0.clear();
*/
/* JADX WARN: Code restructure failed: missing block: B:16:0x002f, code lost:
r4.d = null;
r4.h = null;
r4.e = null;
*/
/* JADX WARN: Code restructure failed: missing block: B:21:0x0041, code lost:
if (r0 == null) goto L19;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void f() {
/*
r4 = this;
int r0 = r4.c
int r0 = r0 + (-1)
r4.c = r0
if (r0 > 0) goto L89
android.content.Context r0 = r4.e
java.lang.String r1 = "MIMManager"
r2 = 0
if (r0 == 0) goto L54
com.mbridge.msdk.foundation.tools.MIMManager$b r3 = r4.h // Catch: java.lang.Throwable -> L19 java.lang.Exception -> L1b
if (r3 == 0) goto L1d
com.mbridge.msdk.foundation.tools.MIMManager$b r3 = r4.h // Catch: java.lang.Throwable -> L19 java.lang.Exception -> L1b
r0.unregisterReceiver(r3) // Catch: java.lang.Throwable -> L19 java.lang.Exception -> L1b
goto L1d
L19:
r0 = move-exception
goto L44
L1b:
r0 = move-exception
goto L36
L1d:
com.mbridge.msdk.foundation.tools.MIMManager$MiOverseaMiniCardBroadcasterReceiver r3 = r4.i // Catch: java.lang.Throwable -> L19 java.lang.Exception -> L1b
if (r3 == 0) goto L26
com.mbridge.msdk.foundation.tools.MIMManager$MiOverseaMiniCardBroadcasterReceiver r3 = r4.i // Catch: java.lang.Throwable -> L19 java.lang.Exception -> L1b
r0.unregisterReceiver(r3) // Catch: java.lang.Throwable -> L19 java.lang.Exception -> L1b
L26:
r4.g = r2
java.util.concurrent.CopyOnWriteArrayList<com.mbridge.msdk.foundation.entity.CampaignEx> r0 = r4.d
if (r0 == 0) goto L2f
L2c:
r0.clear()
L2f:
r4.d = r2
r4.h = r2
r4.e = r2
goto L54
L36:
java.lang.String r0 = r0.getMessage() // Catch: java.lang.Throwable -> L19
com.mbridge.msdk.foundation.tools.af.a(r1, r0) // Catch: java.lang.Throwable -> L19
r4.g = r2
java.util.concurrent.CopyOnWriteArrayList<com.mbridge.msdk.foundation.entity.CampaignEx> r0 = r4.d
if (r0 == 0) goto L2f
goto L2c
L44:
r4.g = r2
java.util.concurrent.CopyOnWriteArrayList<com.mbridge.msdk.foundation.entity.CampaignEx> r1 = r4.d
if (r1 == 0) goto L4d
r1.clear()
L4d:
r4.d = r2
r4.h = r2
r4.e = r2
throw r0
L54:
com.mbridge.msdk.foundation.tools.MIMManager$MiOverseaMiniCardBroadcasterReceiver r0 = r4.i // Catch: java.lang.Throwable -> L68 java.lang.Exception -> L6a
if (r0 == 0) goto L89
com.mbridge.msdk.foundation.controller.c r0 = com.mbridge.msdk.foundation.controller.c.m() // Catch: java.lang.Throwable -> L68 java.lang.Exception -> L6a
android.content.Context r0 = r0.c() // Catch: java.lang.Throwable -> L68 java.lang.Exception -> L6a
if (r0 == 0) goto L6c
com.mbridge.msdk.foundation.tools.MIMManager$MiOverseaMiniCardBroadcasterReceiver r3 = r4.i // Catch: java.lang.Throwable -> L68 java.lang.Exception -> L6a
r0.unregisterReceiver(r3) // Catch: java.lang.Throwable -> L68 java.lang.Exception -> L6a
goto L6c
L68:
r0 = move-exception
goto L82
L6a:
r0 = move-exception
goto L7a
L6c:
r4.g = r2 // Catch: java.lang.Throwable -> L68 java.lang.Exception -> L6a
java.util.concurrent.CopyOnWriteArrayList<com.mbridge.msdk.foundation.entity.CampaignEx> r0 = r4.d // Catch: java.lang.Throwable -> L68 java.lang.Exception -> L6a
if (r0 == 0) goto L75
r0.clear() // Catch: java.lang.Throwable -> L68 java.lang.Exception -> L6a
L75:
r4.d = r2 // Catch: java.lang.Throwable -> L68 java.lang.Exception -> L6a
r4.i = r2 // Catch: java.lang.Throwable -> L68 java.lang.Exception -> L6a
goto L89
L7a:
java.lang.String r0 = r0.getMessage() // Catch: java.lang.Throwable -> L68
com.mbridge.msdk.foundation.tools.af.a(r1, r0) // Catch: java.lang.Throwable -> L68
goto L89
L82:
java.lang.String r0 = r0.getMessage()
com.mbridge.msdk.foundation.tools.af.b(r1, r0)
L89:
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.foundation.tools.MIMManager.f():void");
}
}

View File

@@ -0,0 +1,122 @@
package com.mbridge.msdk.foundation.tools;
import android.text.TextUtils;
import com.applovin.exoplayer2.common.base.Ascii;
import com.mbridge.msdk.playercommon.exoplayer2.metadata.id3.InternalFrame;
import com.mbridge.msdk.system.NoProGuard;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Locale;
/* loaded from: classes4.dex */
public class SameMD5 implements NoProGuard {
public static final String TAG = "MD5";
public static String getMD5(String str) {
if (TextUtils.isEmpty(str)) {
return str;
}
try {
af.a(TAG, str);
MessageDigest messageDigest = MessageDigest.getInstance(TAG);
messageDigest.reset();
messageDigest.update(str.getBytes());
return hexEncode(messageDigest.digest());
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
return "";
}
}
public static String hexEncode(byte[] bArr) {
StringBuilder sb = new StringBuilder(bArr.length * 2);
for (byte b : bArr) {
sb.append(Integer.toHexString((b & 240) >>> 4));
sb.append(Integer.toHexString(b & Ascii.SI));
}
return sb.toString().toLowerCase(Locale.US);
}
public static String getQftJSMD5(String str) {
try {
byte[] qftJSMD5Bytes = getQftJSMD5Bytes(str);
char[] cArr = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
MessageDigest messageDigest = MessageDigest.getInstance(TAG);
messageDigest.update(qftJSMD5Bytes);
byte[] digest = messageDigest.digest();
char[] cArr2 = new char[digest.length * 2];
int i = 0;
for (byte b : digest) {
int i2 = i + 1;
cArr2[i] = cArr[(b >>> 4) & 15];
i += 2;
cArr2[i2] = cArr[b & Ascii.SI];
}
return new String(cArr2);
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
public static byte[] getQftJSMD5Bytes(String str) throws UnsupportedEncodingException {
int length = str.length();
byte[] bytes = str.getBytes("UTF-16LE");
af.c(InternalFrame.ID, "b = " + ByteArrayToHexString(bytes));
byte[] bArr = new byte[length];
int i = 0;
for (int i2 = 0; i2 < bytes.length; i2 += 2) {
byte b = bytes[i2];
if (b != -1 && b != -2) {
bArr[i] = b;
i++;
if (i == length) {
break;
}
}
}
af.c(InternalFrame.ID, "source = " + ByteArrayToHexString(bArr));
return bArr;
}
public static String ByteArrayToHexString(byte[] bArr) {
if (bArr == null || bArr.length == 0) {
return "";
}
int length = bArr.length * 2;
byte[] bArr2 = new byte[length];
for (int i = 0; i < length; i++) {
bArr2[i] = 48;
}
byte[] bArr3 = new byte[bArr.length + 1];
bArr3[0] = 0;
System.arraycopy(bArr, 0, bArr3, 1, bArr.length);
byte[] bytes = new BigInteger(bArr3).toString(16).getBytes();
System.arraycopy(bytes, 0, bArr2, length - bytes.length, bytes.length);
return new String(bArr2);
}
public static String getUPMD5(String str) {
try {
af.a(TAG, str);
MessageDigest messageDigest = MessageDigest.getInstance(TAG);
messageDigest.reset();
messageDigest.update(str.getBytes());
return UpHexEncode(messageDigest.digest());
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
return "";
}
}
private static String UpHexEncode(byte[] bArr) {
StringBuilder sb = new StringBuilder(bArr.length * 2);
for (byte b : bArr) {
sb.append(Integer.toHexString((b & 240) >>> 4));
sb.append(Integer.toHexString(b & Ascii.SI));
}
return sb.toString().toUpperCase(Locale.US);
}
}

View File

@@ -0,0 +1,57 @@
package com.mbridge.msdk.foundation.tools;
import android.text.TextUtils;
import android.util.Base64;
import java.security.MessageDigest;
import java.security.Provider;
import java.security.Security;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
/* loaded from: classes4.dex */
public final class a {
private static byte[] b = new byte[32];
private static byte[] a = new byte[16];
static {
String a2 = z.a("HkzwDFeD4QuyLdx5igfZYcu9xTM9NN==");
if (TextUtils.isEmpty(a2)) {
return;
}
try {
byte[] digest = MessageDigest.getInstance("sha-384").digest(a2.getBytes());
System.arraycopy(digest, 0, b, 0, 32);
System.arraycopy(digest, 32, a, 0, 16);
} catch (Exception e) {
e.printStackTrace();
}
}
public static String a(String str) {
return a(str, b, a);
}
private static String a(String str, byte[] bArr, byte[] bArr2) {
try {
IvParameterSpec ivParameterSpec = new IvParameterSpec(bArr2);
SecretKeySpec secretKeySpec = new SecretKeySpec(bArr, "AES");
Security.addProvider(new C0202a());
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7PADDING");
cipher.init(1, secretKeySpec, ivParameterSpec);
return new String(Base64.encode(cipher.doFinal(str.getBytes()), 0));
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/* renamed from: com.mbridge.msdk.foundation.tools.a$a, reason: collision with other inner class name */
public static class C0202a extends Provider {
public C0202a() {
super("Crypto", 1.0d, "HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)");
put("SecureRandom.SHA1PRNG", "org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl");
put("SecureRandom.SHA1PRNG ImplementedIn", "Software");
}
}
}

View File

@@ -0,0 +1,17 @@
package com.mbridge.msdk.foundation.tools;
import android.os.SystemClock;
/* loaded from: classes4.dex */
public final class aa {
public static final long a() {
try {
long currentTimeMillis = System.currentTimeMillis() - SystemClock.elapsedRealtime();
if (currentTimeMillis > 0) {
return (currentTimeMillis / 10) * 10;
}
} catch (Exception unused) {
}
return 0L;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,88 @@
package com.mbridge.msdk.foundation.tools;
import com.applovin.exoplayer2.common.base.Ascii;
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/* loaded from: classes4.dex */
public class ac {
protected static MessageDigest b;
protected static char[] a = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
private static String c = "SameFileMD5";
static {
b = null;
try {
b = MessageDigest.getInstance(SameMD5.TAG);
} catch (NoSuchAlgorithmException e) {
System.err.println(ac.class.getName() + "初始化失败MessageDigest不支持MD5Util.");
e.printStackTrace();
}
}
public static String a(File file) throws IOException {
MessageDigest messageDigest;
RandomAccessFile randomAccessFile;
if (file == null || !file.exists()) {
return "";
}
RandomAccessFile randomAccessFile2 = null;
try {
messageDigest = MessageDigest.getInstance(SameMD5.TAG);
randomAccessFile = new RandomAccessFile(file, "r");
} catch (Throwable th) {
th = th;
}
try {
byte[] bArr = new byte[10485760];
while (true) {
int read = randomAccessFile.read(bArr);
if (read == -1) {
break;
}
messageDigest.update(bArr, 0, read);
}
byte[] digest = messageDigest.digest();
String a2 = a(digest, 0, digest.length);
try {
randomAccessFile.close();
} catch (IOException e) {
af.b(c, e.getMessage());
}
return a2;
} catch (Throwable th2) {
th = th2;
randomAccessFile2 = randomAccessFile;
try {
af.b(c, th.getMessage());
return "";
} finally {
if (randomAccessFile2 != null) {
try {
randomAccessFile2.close();
} catch (IOException e2) {
af.b(c, e2.getMessage());
}
}
}
}
}
private static String a(byte[] bArr, int i, int i2) {
StringBuffer stringBuffer = new StringBuffer(i2 * 2);
int i3 = i2 + i;
while (i < i3) {
byte b2 = bArr[i];
char[] cArr = a;
char c2 = cArr[(b2 & 240) >> 4];
char c3 = cArr[b2 & Ascii.SI];
stringBuffer.append(c2);
stringBuffer.append(c3);
i++;
}
return stringBuffer.toString();
}
}

View File

@@ -0,0 +1,502 @@
package com.mbridge.msdk.foundation.tools;
import android.text.TextUtils;
import com.mbridge.msdk.MBridgeConstans;
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public final class ad extends l {
public static void a(String str) {
try {
if (TextUtils.isEmpty(str)) {
return;
}
com.mbridge.msdk.c.g b = com.mbridge.msdk.c.h.a().b(com.mbridge.msdk.foundation.controller.c.m().k());
if (b == null) {
com.mbridge.msdk.c.h.a();
b = com.mbridge.msdk.c.i.a();
}
long currentTimeMillis = System.currentTimeMillis() - (b.l() * 1000);
File file = new File(str);
if (file.exists() && file.isDirectory()) {
long currentTimeMillis2 = System.currentTimeMillis();
File[] listFiles = file.listFiles();
if (listFiles != null) {
for (File file2 : listFiles) {
if (file2.lastModified() + currentTimeMillis < currentTimeMillis2) {
a(file2);
try {
File file3 = new File(str + ".zip");
if (file3.exists() && file3.isFile()) {
a(file3);
}
} catch (Exception unused) {
}
}
}
}
}
} catch (Exception unused2) {
}
}
public static void a() {
Runnable runnable = new Runnable() { // from class: com.mbridge.msdk.foundation.tools.ad.1
@Override // java.lang.Runnable
public final void run() {
try {
com.mbridge.msdk.c.g b = com.mbridge.msdk.c.h.a().b(com.mbridge.msdk.foundation.controller.c.m().k());
if (b == null) {
com.mbridge.msdk.c.h.a();
b = com.mbridge.msdk.c.i.a();
}
ad.a(com.mbridge.msdk.foundation.same.b.e.a(com.mbridge.msdk.foundation.same.b.c.MBRIDGE_RES_MANAGER_DIR), b.T());
ad.a(System.currentTimeMillis() - (b.l() * 1000));
} catch (Exception e) {
if (MBridgeConstans.DEBUG) {
e.printStackTrace();
}
}
}
};
com.mbridge.msdk.foundation.controller.d.a();
com.mbridge.msdk.foundation.same.f.a.b().execute(runnable);
}
public static void b() {
new Thread(new Runnable() { // from class: com.mbridge.msdk.foundation.tools.ad.2
@Override // java.lang.Runnable
public final void run() {
try {
if (com.mbridge.msdk.foundation.controller.c.m().c() != null) {
String a = com.mbridge.msdk.foundation.same.b.e.a(com.mbridge.msdk.foundation.same.b.c.MBRIDGE_VC);
try {
File file = new File(a);
if (file.exists() && file.isDirectory()) {
for (File file2 : ad.b(a)) {
if (file2.exists() && file2.isFile()) {
file2.delete();
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
} catch (Exception e2) {
if (MBridgeConstans.DEBUG) {
e2.printStackTrace();
}
}
}
}).start();
}
public static File[] b(String str) {
try {
File file = new File(str);
if (file.exists()) {
return file.listFiles();
}
return null;
} catch (Exception unused) {
return null;
}
}
public static void a(long j) {
try {
Iterator<File> it = c(new File(com.mbridge.msdk.foundation.same.b.e.a(com.mbridge.msdk.foundation.same.b.c.MBRIDGE_RES_MANAGER_DIR))).iterator();
while (it.hasNext()) {
File next = it.next();
if (next.lastModified() < j && next.exists() && next.isFile()) {
next.delete();
}
}
} catch (Throwable th) {
af.b("SameFileTool", th.getMessage(), th);
}
}
public static String a(File file) {
try {
if (file.isFile()) {
file.delete();
return "";
}
if (!file.isDirectory()) {
return "";
}
File[] listFiles = file.listFiles();
if (listFiles != null && listFiles.length != 0) {
for (File file2 : listFiles) {
a(file2);
}
file.delete();
return "";
}
file.delete();
return "";
} catch (Exception e) {
return e.getMessage();
}
}
private static ArrayList<File> c(File file) {
ArrayList<File> arrayList = new ArrayList<>();
for (File file2 : file.listFiles(new FileFilter() { // from class: com.mbridge.msdk.foundation.tools.ad.3
@Override // java.io.FileFilter
public final boolean accept(File file3) {
return !file3.isHidden() || file3.isDirectory();
}
})) {
if (!file2.isDirectory()) {
arrayList.add(file2);
} else {
arrayList.addAll(c(file2));
}
}
return arrayList;
}
public static String c(String str) {
return !TextUtils.isEmpty(str) ? SameMD5.getMD5(aq.b(str.trim())) : "";
}
private static long d(File file) throws Exception {
long j = 0;
FileInputStream fileInputStream = null;
try {
try {
try {
if (file.exists()) {
FileInputStream fileInputStream2 = new FileInputStream(file);
try {
j = fileInputStream2.available();
fileInputStream = fileInputStream2;
} catch (Exception e) {
e = e;
fileInputStream = fileInputStream2;
e.printStackTrace();
if (fileInputStream != null) {
fileInputStream.close();
}
return j;
} catch (Throwable th) {
th = th;
fileInputStream = fileInputStream2;
if (fileInputStream != null) {
try {
fileInputStream.close();
} catch (Exception e2) {
e2.printStackTrace();
}
}
throw th;
}
} else {
file.createNewFile();
af.b("获取文件大小", "文件不存在!");
}
} catch (Exception e3) {
e3.printStackTrace();
}
} catch (Exception e4) {
e = e4;
}
if (fileInputStream != null) {
fileInputStream.close();
}
return j;
} catch (Throwable th2) {
th = th2;
}
}
private static long e(File file) throws Exception {
long d;
File[] listFiles = file.listFiles();
long j = 0;
if (listFiles != null) {
for (int i = 0; i < listFiles.length; i++) {
if (listFiles[i].isDirectory()) {
d = e(listFiles[i]);
} else {
d = d(listFiles[i]);
}
j += d;
}
}
return j;
}
public static List<String> a(String str, String str2) {
ArrayList arrayList = new ArrayList();
try {
} catch (Exception e) {
af.b("SameFileTool", e.getMessage());
}
if (!TextUtils.isEmpty(str) && !TextUtils.isEmpty(str2)) {
File file = new File(str + File.separator + "template_config.json");
if (file.isFile() && file.exists()) {
String b = b(file);
if (TextUtils.isEmpty(b)) {
return arrayList;
}
try {
JSONArray jSONArray = new JSONArray(b);
for (int i = 0; i < jSONArray.length(); i++) {
JSONObject jSONObject = jSONArray.getJSONObject(i);
if (jSONObject != null && str2.equals(jSONObject.optString("xml_type"))) {
arrayList.add(str + File.separator + jSONObject.optString("name"));
if (jSONObject.has("ext_template")) {
jSONObject.put("folder_dir", str);
arrayList.add(jSONObject.toString());
}
}
}
return arrayList;
} catch (JSONException e2) {
af.b("SameFileTool", e2.getMessage());
return arrayList;
}
}
arrayList.add(str);
}
return arrayList;
}
/* JADX WARN: Code restructure failed: missing block: B:25:0x0042, code lost:
if (r1 == null) goto L26;
*/
/* JADX WARN: Removed duplicated region for block: B:33:0x004f A[EXC_TOP_SPLITTER, SYNTHETIC] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static java.lang.String b(java.io.File r4) {
/*
r0 = 0
if (r4 != 0) goto L4
return r0
L4:
java.io.BufferedReader r1 = new java.io.BufferedReader // Catch: java.lang.Throwable -> L3a java.io.IOException -> L3c
java.io.FileReader r2 = new java.io.FileReader // Catch: java.lang.Throwable -> L3a java.io.IOException -> L3c
r2.<init>(r4) // Catch: java.lang.Throwable -> L3a java.io.IOException -> L3c
r1.<init>(r2) // Catch: java.lang.Throwable -> L3a java.io.IOException -> L3c
java.lang.StringBuffer r4 = new java.lang.StringBuffer // Catch: java.lang.Throwable -> L2e java.io.IOException -> L37
r4.<init>() // Catch: java.lang.Throwable -> L2e java.io.IOException -> L37
L13:
java.lang.String r2 = r1.readLine() // Catch: java.lang.Throwable -> L2e java.io.IOException -> L31
if (r2 == 0) goto L33
java.lang.StringBuilder r3 = new java.lang.StringBuilder // Catch: java.lang.Throwable -> L2e java.io.IOException -> L31
r3.<init>() // Catch: java.lang.Throwable -> L2e java.io.IOException -> L31
r3.append(r2) // Catch: java.lang.Throwable -> L2e java.io.IOException -> L31
java.lang.String r2 = "\n"
r3.append(r2) // Catch: java.lang.Throwable -> L2e java.io.IOException -> L31
java.lang.String r2 = r3.toString() // Catch: java.lang.Throwable -> L2e java.io.IOException -> L31
r4.append(r2) // Catch: java.lang.Throwable -> L2e java.io.IOException -> L31
goto L13
L2e:
r4 = move-exception
r0 = r1
goto L4d
L31:
r2 = move-exception
goto L3f
L33:
r1.close() // Catch: java.io.IOException -> L45
goto L45
L37:
r2 = move-exception
r4 = r0
goto L3f
L3a:
r4 = move-exception
goto L4d
L3c:
r2 = move-exception
r4 = r0
r1 = r4
L3f:
r2.printStackTrace() // Catch: java.lang.Throwable -> L2e
if (r1 == 0) goto L45
goto L33
L45:
if (r4 == 0) goto L4c
java.lang.String r4 = r4.toString()
return r4
L4c:
return r0
L4d:
if (r0 == 0) goto L52
r0.close() // Catch: java.io.IOException -> L52
L52:
throw r4
*/
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.foundation.tools.ad.b(java.io.File):java.lang.String");
}
public static boolean d(String str) {
if (com.mbridge.msdk.foundation.same.c.e.a(str)) {
return false;
}
File file = new File(str);
return file.exists() && file.isFile();
}
private static void e(String str) {
try {
ArrayList<File> c = c(new File(str));
Collections.sort(c, new Comparator<File>() { // from class: com.mbridge.msdk.foundation.tools.ad.4
@Override // java.util.Comparator
public final boolean equals(Object obj) {
return true;
}
@Override // java.util.Comparator
public final /* synthetic */ int compare(File file, File file2) {
long lastModified = file.lastModified() - file2.lastModified();
if (lastModified > 0) {
return 1;
}
return lastModified == 0 ? 0 : -1;
}
});
int size = (c.size() - 1) / 2;
for (int i = 0; i < size; i++) {
File file = c.get(i);
if (file.exists() && file.isFile()) {
file.delete();
}
}
} catch (Exception unused) {
af.b("SameFileTool", "del memory failed");
}
}
/* JADX WARN: Code restructure failed: missing block: B:108:0x00ff, code lost:
r12.close();
*/
/* JADX WARN: Code restructure failed: missing block: B:110:0x0103, code lost:
r12 = move-exception;
*/
/* JADX WARN: Code restructure failed: missing block: B:111:0x0104, code lost:
com.mbridge.msdk.foundation.tools.af.b("SameFileTool", com.mbridge.msdk.newreward.function.common.MBridgeError.ERROR_MESSAGE_DOWNLOAD_UN_ZIP_ERROR, r12);
*/
/* JADX WARN: Code restructure failed: missing block: B:151:0x0129, code lost:
r5.close();
*/
/* JADX WARN: Code restructure failed: missing block: B:152:0x012c, code lost:
if (r12 == null) goto L104;
*/
/* JADX WARN: Code restructure failed: missing block: B:161:0x012e, code lost:
r12.close();
*/
/* JADX WARN: Code restructure failed: missing block: B:163:0x0132, code lost:
r12 = move-exception;
*/
/* JADX WARN: Code restructure failed: missing block: B:164:0x0133, code lost:
com.mbridge.msdk.foundation.tools.af.b("SameFileTool", com.mbridge.msdk.newreward.function.common.MBridgeError.ERROR_MESSAGE_DOWNLOAD_UN_ZIP_ERROR, r12);
*/
/* JADX WARN: Code restructure failed: missing block: B:99:0x00fd, code lost:
if (r12 == null) goto L80;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static java.lang.String b(java.lang.String r12, java.lang.String r13) {
/*
Method dump skipped, instructions count: 382
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.foundation.tools.ad.b(java.lang.String, java.lang.String):java.lang.String");
}
public static boolean a(byte[] bArr, File file) {
FileOutputStream fileOutputStream;
FileOutputStream fileOutputStream2 = null;
try {
try {
if (file.getParentFile() != null && !file.exists()) {
file.getParentFile().mkdirs();
}
fileOutputStream = new FileOutputStream(file);
} catch (Throwable th) {
th = th;
}
} catch (Exception e) {
e = e;
}
try {
fileOutputStream.write(bArr);
try {
fileOutputStream.close();
return true;
} catch (IOException e2) {
e2.printStackTrace();
return true;
}
} catch (Exception e3) {
e = e3;
fileOutputStream2 = fileOutputStream;
e.printStackTrace();
if (fileOutputStream2 == null) {
return false;
}
try {
fileOutputStream2.close();
return false;
} catch (IOException e4) {
e4.printStackTrace();
return false;
}
} catch (Throwable th2) {
th = th2;
fileOutputStream2 = fileOutputStream;
if (fileOutputStream2 != null) {
try {
fileOutputStream2.close();
} catch (IOException e5) {
e5.printStackTrace();
}
}
throw th;
}
}
public static /* synthetic */ void a(String str, int i) {
try {
if (e(new File(str)) > i * 1048576) {
e(str);
}
} catch (Exception e) {
e.printStackTrace();
} catch (Throwable unused) {
af.b("SameFileTool", "clean memory failed");
}
}
}

View File

@@ -0,0 +1,71 @@
package com.mbridge.msdk.foundation.tools;
import android.annotation.TargetApi;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.RectF;
import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RenderScript;
import android.renderscript.ScriptIntrinsicBlur;
/* loaded from: classes4.dex */
public final class ae {
@TargetApi(17)
public static Bitmap a(Bitmap bitmap) {
if (bitmap != null) {
try {
if (!bitmap.isRecycled()) {
Bitmap createBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_4444);
RenderScript create = RenderScript.create(com.mbridge.msdk.foundation.controller.c.m().c());
ScriptIntrinsicBlur create2 = ScriptIntrinsicBlur.create(create, Element.U8_4(create));
Allocation createFromBitmap = Allocation.createFromBitmap(create, bitmap);
Allocation createFromBitmap2 = Allocation.createFromBitmap(create, createBitmap);
create2.setRadius(25.0f);
create2.setInput(createFromBitmap);
create2.forEach(createFromBitmap2);
createFromBitmap2.copyTo(createBitmap);
create.destroy();
return createBitmap;
}
} catch (Throwable unused) {
}
}
return null;
}
public static Bitmap a(Bitmap bitmap, int i, int i2) {
if (i2 == 0) {
return bitmap;
}
Bitmap bitmap2 = null;
if (bitmap != null && !bitmap.isRecycled()) {
try {
int width = bitmap.getWidth();
int height = bitmap.getHeight();
bitmap2 = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_4444);
Canvas canvas = new Canvas(bitmap2);
Paint paint = new Paint();
Rect rect = new Rect(0, 0, width, height);
RectF rectF = new RectF(rect);
float f = i2;
paint.setAntiAlias(true);
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER));
canvas.drawARGB(0, 0, 0, 0);
paint.setColor(-12434878);
canvas.drawRoundRect(rectF, f, f, paint);
if (i == 2) {
canvas.drawRect(0.0f, height - i2, width, height, paint);
}
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
canvas.drawBitmap(bitmap, rect, rect, paint);
} catch (Error | Exception unused) {
}
}
return bitmap2;
}
}

View File

@@ -0,0 +1,94 @@
package com.mbridge.msdk.foundation.tools;
import android.text.TextUtils;
import android.util.Log;
import com.mbridge.msdk.MBridgeConstans;
/* loaded from: classes4.dex */
public final class af {
public static boolean a = true;
public static boolean b = true;
public static boolean c = true;
public static boolean d = false;
public static boolean e = true;
public static boolean f = false;
public static boolean g = true;
public static boolean h = true;
static {
if (MBridgeConstans.DEBUG) {
return;
}
g = false;
a = false;
c = false;
h = false;
b = false;
f = false;
e = false;
d = false;
}
public static void a(String str, String str2) {
if (!a || TextUtils.isEmpty(str2)) {
return;
}
a(str);
}
private static String a(String str) {
if (TextUtils.isEmpty(str)) {
return str;
}
return "MBRIDGE_" + str;
}
public static void a(String str, String str2, Throwable th) {
if (!a || TextUtils.isEmpty(str2)) {
return;
}
a(str);
}
public static void b(String str, String str2) {
if (!b || str2 == null) {
return;
}
Log.e(a(str), str2);
}
public static void b(String str, String str2, Throwable th) {
if (!b || str2 == null || th == null) {
return;
}
Log.e(a(str), str2, th);
}
public static void c(String str, String str2) {
if (!c || TextUtils.isEmpty(str2)) {
return;
}
a(str);
}
public static void d(String str, String str2) {
if (!h || TextUtils.isEmpty(str2)) {
return;
}
Log.w(a(str), str2);
}
public static void c(String str, String str2, Throwable th) {
if (!h || TextUtils.isEmpty(str2)) {
return;
}
Log.w(a(str), str2, th);
}
public static void a(String str, Throwable th) {
if (!h || th == null) {
return;
}
Log.w(a(str), th);
}
}

View File

@@ -0,0 +1,258 @@
package com.mbridge.msdk.foundation.tools;
import com.ironsource.nb;
import com.mbridge.msdk.playercommon.exoplayer2.extractor.ts.PsExtractor;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public final class ag {
private static final char[] a;
private static final byte[] b = new byte[128];
private static Map<Character, Character> c;
private static char[] d;
static {
char[] cArr = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'};
a = cArr;
HashMap hashMap = new HashMap();
c = hashMap;
hashMap.put('A', 'v');
c.put('B', 'S');
c.put('C', 'o');
c.put('D', 'a');
c.put('E', 'j');
c.put('F', 'c');
c.put('G', '7');
c.put('H', 'd');
c.put('I', 'R');
c.put('J', 'z');
c.put('K', 'p');
c.put('L', 'W');
c.put('M', 'i');
c.put('N', 'f');
c.put('O', 'G');
c.put('P', 'y');
c.put('Q', 'N');
c.put('R', 'x');
c.put('S', 'Z');
c.put('T', 'n');
c.put('U', 'V');
c.put('V', '5');
c.put('W', 'k');
c.put('X', '+');
c.put('Y', 'D');
c.put('Z', 'H');
c.put('a', 'L');
c.put('b', 'Y');
c.put('c', 'h');
c.put('d', 'J');
c.put('e', '4');
c.put('f', '6');
c.put('g', 'l');
c.put('h', 't');
c.put('i', '0');
c.put('j', 'U');
c.put('k', '3');
c.put('l', 'Q');
c.put('m', 'r');
c.put('n', 'g');
c.put('o', 'E');
c.put('p', 'u');
c.put('q', 'q');
c.put('r', '8');
c.put('s', 's');
c.put('t', 'w');
c.put('u', '/');
c.put('v', 'X');
c.put('w', 'M');
c.put('x', 'e');
c.put('y', 'B');
c.put('z', 'A');
c.put('0', 'T');
c.put('1', '2');
c.put('2', 'F');
c.put('3', 'b');
c.put('4', '9');
c.put('5', 'P');
c.put('6', '1');
c.put('7', 'O');
c.put('8', 'I');
c.put('9', 'K');
c.put('+', 'm');
c.put('/', 'C');
d = new char[cArr.length];
int i = 0;
int i2 = 0;
while (true) {
char[] cArr2 = a;
if (i2 >= cArr2.length) {
break;
}
d[i2] = c.get(Character.valueOf(cArr2[i2])).charValue();
i2++;
}
int i3 = 0;
while (true) {
byte[] bArr = b;
if (i3 >= bArr.length) {
break;
}
bArr[i3] = Byte.MAX_VALUE;
i3++;
}
while (true) {
char[] cArr3 = d;
if (i >= cArr3.length) {
return;
}
b[cArr3[i]] = (byte) i;
i++;
}
}
private static int a(char[] cArr, byte[] bArr, int i) {
try {
char c2 = cArr[3];
char c3 = c2 == '=' ? (char) 2 : (char) 3;
char c4 = cArr[2];
if (c4 == '=') {
c3 = 1;
}
byte[] bArr2 = b;
byte b2 = bArr2[cArr[0]];
byte b3 = bArr2[cArr[1]];
byte b4 = bArr2[c4];
byte b5 = bArr2[c2];
if (c3 == 1) {
bArr[i] = (byte) (((b3 >> 4) & 3) | ((b2 << 2) & 252));
return 1;
}
if (c3 == 2) {
bArr[i] = (byte) ((3 & (b3 >> 4)) | ((b2 << 2) & 252));
bArr[i + 1] = (byte) (((b3 << 4) & PsExtractor.VIDEO_STREAM_MASK) | ((b4 >> 2) & 15));
return 2;
}
if (c3 == 3) {
bArr[i] = (byte) (((b2 << 2) & 252) | ((b3 >> 4) & 3));
bArr[i + 1] = (byte) (((b3 << 4) & PsExtractor.VIDEO_STREAM_MASK) | ((b4 >> 2) & 15));
bArr[i + 2] = (byte) (((b4 << 6) & PsExtractor.AUDIO_STREAM) | (b5 & 63));
return 3;
}
throw new RuntimeException("Internal Error");
} catch (Exception unused) {
return 0;
}
}
public static String a(String str) {
byte[] c2 = c(str);
if (c2 == null || c2.length <= 0) {
return null;
}
return new String(c2);
}
private static byte[] c(String str) {
int i;
try {
int length = str.length();
char[] cArr = new char[length < 259 ? length : 259];
int i2 = ((length >> 2) * 3) + 3;
byte[] bArr = new byte[i2];
int i3 = 0;
int i4 = 0;
int i5 = 0;
while (i3 < length) {
int i6 = i3 + 256;
if (i6 <= length) {
str.getChars(i3, i6, cArr, i5);
i = i5 + 256;
} else {
str.getChars(i3, length, cArr, i5);
i = (length - i3) + i5;
}
int i7 = i5;
while (i5 < i) {
char c2 = cArr[i5];
if (c2 != '=') {
byte[] bArr2 = b;
if (c2 < bArr2.length) {
if (bArr2[c2] == Byte.MAX_VALUE) {
}
}
i5++;
}
int i8 = i7 + 1;
cArr[i7] = c2;
if (i8 == 4) {
i4 += a(cArr, bArr, i4);
i7 = 0;
} else {
i7 = i8;
}
i5++;
}
i3 = i6;
i5 = i7;
}
if (i4 == i2) {
return bArr;
}
byte[] bArr3 = new byte[i4];
System.arraycopy(bArr, 0, bArr3, 0, i4);
return bArr3;
} catch (Exception unused) {
return null;
}
}
public static String b(String str) {
byte[] bytes = str.getBytes();
return a(bytes, 0, bytes.length);
}
private static String a(byte[] bArr, int i, int i2) {
if (i2 <= 0) {
return "";
}
try {
char[] cArr = new char[((i2 / 3) << 2) + 4];
int i3 = 0;
while (i2 >= 3) {
int i4 = ((bArr[i] & 255) << 16) + ((bArr[i + 1] & 255) << 8) + (bArr[i + 2] & 255);
char[] cArr2 = d;
cArr[i3] = cArr2[i4 >> 18];
cArr[i3 + 1] = cArr2[(i4 >> 12) & 63];
int i5 = i3 + 3;
cArr[i3 + 2] = cArr2[(i4 >> 6) & 63];
i3 += 4;
cArr[i5] = cArr2[i4 & 63];
i += 3;
i2 -= 3;
}
if (i2 == 1) {
int i6 = bArr[i] & 255;
char[] cArr3 = d;
cArr[i3] = cArr3[i6 >> 2];
cArr[i3 + 1] = cArr3[(i6 << 4) & 63];
int i7 = i3 + 3;
cArr[i3 + 2] = nb.T;
i3 += 4;
cArr[i7] = nb.T;
} else if (i2 == 2) {
int i8 = ((bArr[i] & 255) << 8) + (bArr[i + 1] & 255);
char[] cArr4 = d;
cArr[i3] = cArr4[i8 >> 10];
cArr[i3 + 1] = cArr4[(i8 >> 4) & 63];
int i9 = i3 + 3;
cArr[i3 + 2] = cArr4[(i8 << 2) & 63];
i3 += 4;
cArr[i9] = nb.T;
}
return new String(cArr, 0, i3);
} catch (Exception unused) {
return null;
}
}
}

View File

@@ -0,0 +1,211 @@
package com.mbridge.msdk.foundation.tools;
import android.text.TextUtils;
import com.mbridge.msdk.MBridgeConstans;
import java.util.concurrent.ConcurrentHashMap;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public final class ah {
public volatile JSONObject a;
private final Object b;
private final Object c;
private final Object d;
private final Object e;
private String f;
private volatile ConcurrentHashMap<String, Boolean> g;
private volatile ConcurrentHashMap<String, Integer> h;
private volatile com.mbridge.msdk.c.g i;
public static final class a {
private static final ah a = new ah();
}
private ah() {
this.b = new Object();
this.c = new Object();
this.d = new Object();
this.e = new Object();
}
public static ah a() {
return a.a;
}
private static Integer a(String str, ConcurrentHashMap<String, Integer> concurrentHashMap) {
try {
return concurrentHashMap.get(str);
} catch (Exception unused) {
return null;
}
}
private int b(String str, String str2, int i) {
if (a(true)) {
return i;
}
try {
String optString = this.a.optString(str, "");
if (TextUtils.isEmpty(optString)) {
return i;
}
String a2 = z.a(optString);
return TextUtils.isEmpty(a2) ? i : new JSONObject(a2).optInt(str2, i);
} catch (Exception unused) {
return i;
}
}
private int b(String str, int i) {
if (a(true)) {
return i;
}
try {
return this.a.optInt(str, i);
} catch (Exception unused) {
return i;
}
}
public final int a(String str, int i) {
Integer valueOf;
try {
if (TextUtils.isEmpty(str)) {
return i;
}
ConcurrentHashMap<String, Integer> b = b();
Integer a2 = a(str, b);
if (a2 != null) {
return a2.intValue();
}
try {
valueOf = Integer.valueOf(b(str, i));
} catch (Exception unused) {
valueOf = Integer.valueOf(i);
}
b.put(str, valueOf);
return valueOf.intValue();
} catch (Exception unused2) {
return i;
}
}
public final int a(String str, String str2, int i) {
Integer valueOf;
try {
if (!TextUtils.isEmpty(str) && !TextUtils.isEmpty(str2)) {
String str3 = str + "_" + str2;
ConcurrentHashMap<String, Integer> b = b();
Integer a2 = a(str3, b);
if (a2 != null) {
return a2.intValue();
}
try {
valueOf = Integer.valueOf(b(str, str2, i));
} catch (Exception unused) {
valueOf = Integer.valueOf(i);
}
b.put(str3, valueOf);
return valueOf.intValue();
}
return a(str2, i);
} catch (Exception unused2) {
return i;
}
}
private ConcurrentHashMap<String, Integer> b() {
synchronized (this.b) {
try {
if (this.h == null) {
this.h = new ConcurrentHashMap<>();
}
} catch (Throwable th) {
throw th;
}
}
return this.h;
}
public final boolean a(String str, boolean z) {
try {
return a(str, z, true);
} catch (Exception unused) {
return z;
}
}
public final boolean a(String str, boolean z, boolean z2) {
Boolean valueOf;
Boolean b;
try {
if (TextUtils.isEmpty(str)) {
return z;
}
ConcurrentHashMap<String, Boolean> c = c();
if (z2 && (b = b(str, c)) != null) {
return b.booleanValue();
}
try {
valueOf = Boolean.valueOf(b(str, z, z2));
} catch (Exception unused) {
valueOf = Boolean.valueOf(z);
}
c.put(str, valueOf);
return valueOf.booleanValue();
} catch (Exception unused2) {
return z;
}
}
private ConcurrentHashMap<String, Boolean> c() {
synchronized (this.d) {
try {
if (this.g == null) {
this.g = new ConcurrentHashMap<>();
}
} catch (Throwable th) {
throw th;
}
}
return this.g;
}
private static Boolean b(String str, ConcurrentHashMap<String, Boolean> concurrentHashMap) {
try {
return concurrentHashMap.get(str);
} catch (Exception unused) {
return null;
}
}
private boolean b(String str, boolean z, boolean z2) {
if (a(z2)) {
return z;
}
try {
return this.a.optInt(str, z ? 1 : 0) != 0;
} catch (Exception unused) {
return z;
}
}
private boolean a(boolean z) {
synchronized (this.e) {
if (this.i == null || this.i.K() == 1 || !z) {
try {
if (TextUtils.isEmpty(this.f)) {
this.f = com.mbridge.msdk.foundation.a.a.a.a().a(MBridgeConstans.SDK_APP_ID);
}
this.i = com.mbridge.msdk.c.h.a().a(this.f);
} catch (Exception unused) {
this.i = null;
}
}
if (this.i != null) {
this.a = this.i.am();
}
}
return this.i == null || this.a == null;
}
}

View File

@@ -0,0 +1,186 @@
package com.mbridge.msdk.foundation.tools;
import android.content.Context;
import android.os.Environment;
import android.os.StatFs;
import java.io.File;
import java.util.UUID;
/* loaded from: classes4.dex */
public final class ai {
public static char[] a = {'P', 'a', 'c', 'k', 'a', 'g', 'e', 'M', 'a', 'n', 'a', 'g', 'e', 'r'};
static String b = "";
static boolean c = false;
private static int d = -1;
private static int e = -1;
private static boolean f = false;
private static int g = -1;
private static int h = -1;
public static int a() {
Context c2;
long longValue;
long currentTimeMillis;
try {
c2 = com.mbridge.msdk.foundation.controller.c.m().c();
longValue = ((Long) an.a(c2, "freeExternalSize", 0L)).longValue();
currentTimeMillis = System.currentTimeMillis();
} catch (Throwable th) {
af.b("SameSDCardTool", th.getMessage(), th);
}
if (currentTimeMillis - longValue <= 1800000) {
if (e == -1) {
}
return e;
}
e = Long.valueOf((c() / 1000) / 1000).intValue();
an.b(c2, "freeExternalSize", Long.valueOf(currentTimeMillis));
return e;
}
private static long c() {
if (d()) {
try {
StatFs statFs = new StatFs(Environment.getExternalStorageDirectory().getPath());
return statFs.getAvailableBlocks() * statFs.getBlockSize();
} catch (Exception e2) {
e2.printStackTrace();
}
}
return 0L;
}
private static boolean d() {
try {
return "mounted".equals(Environment.getExternalStorageState());
} catch (Exception unused) {
af.b("", "hasSDCard is failed");
return false;
}
}
public static int b() {
if (h == -1) {
try {
h = new Long((e() / 1000) / 1000).intValue();
} catch (Throwable th) {
af.b("SameSDCardTool", th.getMessage(), th);
}
}
return h;
}
private static long e() {
if (d()) {
try {
StatFs statFs = new StatFs(Environment.getExternalStorageDirectory().getPath());
return statFs.getBlockCount() * statFs.getBlockSize();
} catch (Exception e2) {
e2.printStackTrace();
}
}
return 0L;
}
public static void a(Context context) {
if (context == null || f) {
return;
}
try {
try {
b = context.getFilesDir().getAbsolutePath() + File.separator;
c = false;
b(context);
} catch (Exception unused) {
b = context.getFilesDir().getAbsolutePath() + File.separator;
b(context);
}
} catch (Exception unused2) {
}
f = true;
}
private static void b(Context context) {
com.mbridge.msdk.foundation.same.b.e.a(new com.mbridge.msdk.foundation.same.b.d(c(context)));
com.mbridge.msdk.foundation.same.b.e.a().b();
}
/* JADX WARN: Code restructure failed: missing block: B:11:0x005d, code lost:
if (c() > 31457280) goto L16;
*/
/* JADX WARN: Removed duplicated region for block: B:8:0x0019 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private static java.lang.String c(android.content.Context r6) {
/*
r0 = 0
java.io.File r1 = r6.getExternalFilesDir(r0) // Catch: java.lang.Throwable -> Lc
if (r1 == 0) goto L14
java.io.File r1 = a(r1) // Catch: java.lang.Throwable -> Lc
goto L15
Lc:
r1 = move-exception
java.lang.String r2 = "common-exception"
java.lang.String r3 = "hasSDCard is failed"
com.mbridge.msdk.foundation.tools.af.b(r2, r3, r1)
L14:
r1 = r0
L15:
boolean r2 = com.mbridge.msdk.foundation.tools.ai.c
if (r2 == 0) goto L5f
if (r1 != 0) goto L54
java.lang.StringBuilder r1 = new java.lang.StringBuilder
r1.<init>()
java.io.File r2 = android.os.Environment.getExternalStorageDirectory()
java.lang.String r2 = r2.getPath()
r1.append(r2)
java.lang.String r2 = java.io.File.separator
r1.append(r2)
java.lang.String r3 = "Android"
r1.append(r3)
r1.append(r2)
java.lang.String r3 = "data"
r1.append(r3)
r1.append(r2)
java.lang.String r2 = r6.getPackageName()
r1.append(r2)
java.lang.String r1 = r1.toString()
java.io.File r2 = new java.io.File
r2.<init>(r1)
java.io.File r1 = a(r2)
L54:
long r2 = c()
r4 = 31457280(0x1e00000, double:1.55419614E-316)
int r2 = (r2 > r4 ? 1 : (r2 == r4 ? 0 : -1))
if (r2 <= 0) goto L60
L5f:
r0 = r1
L60:
if (r0 == 0) goto L68
boolean r1 = r0.exists()
if (r1 != 0) goto L70
L68:
java.io.File r6 = r6.getFilesDir()
java.io.File r0 = r6.getAbsoluteFile()
L70:
java.lang.String r6 = r0.getAbsolutePath()
return r6
*/
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.foundation.tools.ai.c(android.content.Context):java.lang.String");
}
private static File a(File file) {
File file2 = new File(file, UUID.randomUUID() + "");
if (file2.exists()) {
file2.delete();
}
if (!file2.mkdirs()) {
return null;
}
file2.delete();
return file.getAbsoluteFile();
}
}

View File

@@ -0,0 +1,354 @@
package com.mbridge.msdk.foundation.tools;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import com.google.android.gms.drive.DriveFile;
import com.mbridge.msdk.activity.MBCommonActivity;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.webview.BrowserView;
import com.mbridge.msdk.out.BaseTrackingListener;
import com.mbridge.msdk.out.Campaign;
import com.mbridge.msdk.out.NativeListener;
import com.mbridge.msdk.playercommon.exoplayer2.text.ttml.TtmlNode;
import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/* loaded from: classes4.dex */
public final class aj extends m {
public static char[] a = {'a', 'n', 'd', 'r', 'o', 'i', 'd', 'c', 'o', 'n', 't', 'e', 'n', 't', 'p', 'm', 'g', 'e', 't', 'C', 'o', 'n', 't', 'e', 'x', 't'};
public static boolean b = false;
public static LinearLayout c;
public static String a(String str) {
if (TextUtils.isEmpty(str)) {
return null;
}
File b2 = com.mbridge.msdk.foundation.same.b.e.b(com.mbridge.msdk.foundation.same.b.c.MBRIDGE_700_IMG);
String str2 = "";
if (!TextUtils.isEmpty(str)) {
if (str.lastIndexOf("/") == -1) {
str2 = str.hashCode() + "";
} else {
str2 = (str.hashCode() + str.substring(str.lastIndexOf("/") + 1).hashCode()) + "";
}
}
return new File(b2, str2).getAbsolutePath();
}
public static void a(Context context, String str, NativeListener.NativeTrackingListener nativeTrackingListener) {
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=", ""), nativeTrackingListener);
return;
}
return;
}
if (!z) {
a(context, "https://play.google.com/store/apps/details?id=" + str.replace("market://details?id=", ""), (BaseTrackingListener) nativeTrackingListener);
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);
a(nativeTrackingListener);
} catch (Exception unused) {
a(context, "https://play.google.com/store/apps/details?id=" + str.replace("market://details?id=", ""), (BaseTrackingListener) nativeTrackingListener);
}
} catch (Exception e) {
af.b("SDKUtil", e.getMessage());
}
}
public static void a(Campaign campaign, ViewGroup viewGroup) {
if (campaign != null) {
CampaignEx campaignEx = (CampaignEx) campaign;
if (campaignEx.getLinkType() == 8 && campaignEx.getAabEntity() != null && campaignEx.getAabEntity().getHlp() == 1) {
if (viewGroup == null) {
af.d("SDKUtil", "hide linkType==8 loading view failed. viewGroup is null");
return;
}
try {
LinearLayout linearLayout = c;
if (linearLayout == null) {
return;
}
viewGroup.removeView(linearLayout);
} catch (Throwable th) {
th.printStackTrace();
}
}
}
}
public static void a(Context context, String str, BaseTrackingListener baseTrackingListener) {
a(context, str, baseTrackingListener, (CampaignEx) null, new ArrayList());
}
public static void a(Context context, String str, CampaignEx campaignEx, NativeListener.NativeTrackingListener nativeTrackingListener, List<String> list) {
Intent intent;
if (context == null) {
return;
}
com.mbridge.msdk.foundation.same.report.d.e eVar = new com.mbridge.msdk.foundation.same.report.d.e();
if (list != null) {
list.add("web_view");
}
if (b) {
a(context, str, nativeTrackingListener, campaignEx, list);
return;
}
try {
int i = MBCommonActivity.$r8$clinit;
intent = new Intent(context, (Class<?>) MBCommonActivity.class);
} catch (Exception unused) {
eVar.a("result", 2);
a(context, str, nativeTrackingListener, campaignEx, list);
}
if (TextUtils.isEmpty(str)) {
return;
}
if (a.a(str)) {
str = "https://play.google.com/store/apps/details?id=" + str.replace("market://details?id=", "");
}
intent.putExtra("url", str);
af.c("url", "webview url = " + str);
intent.setFlags(DriveFile.MODE_READ_ONLY);
intent.putExtra("mvcommon", campaignEx);
context.startActivity(intent);
eVar.a("result", 1);
eVar.a("type", 9);
if (list != null) {
eVar.a("click_path", list.toString());
}
com.mbridge.msdk.foundation.same.report.d.d.a().a("2000150", campaignEx, eVar);
}
public static void a(Context context, String str, BaseTrackingListener baseTrackingListener, CampaignEx campaignEx, List<String> list) {
if (str == null || context == null) {
return;
}
if (list != null) {
list.add("browser");
}
com.mbridge.msdk.foundation.same.report.d.e eVar = new com.mbridge.msdk.foundation.same.report.d.e();
try {
if (a.a(str)) {
str = "https://play.google.com/store/apps/details?id=" + str.replace("market://details?id=", "");
}
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
intent.setComponent(null);
intent.setSelector(null);
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);
a(baseTrackingListener);
eVar.a("result", 1);
} catch (Exception e) {
e.printStackTrace();
try {
Intent intent2 = new Intent("android.intent.action.VIEW", Uri.parse(str));
intent2.addFlags(268468224);
context.startActivity(intent2);
a(baseTrackingListener);
eVar.a("result", 1);
} catch (Exception e2) {
e2.printStackTrace();
eVar.a("result", 2);
}
}
try {
eVar.a("type", 5);
if (list != null) {
eVar.a("click_path", list.toString());
}
com.mbridge.msdk.foundation.same.report.d.d.a().a("2000150", campaignEx, eVar);
} catch (Exception unused) {
}
}
public static void a(BaseTrackingListener baseTrackingListener) {
if (baseTrackingListener instanceof NativeListener.TrackingExListener) {
((NativeListener.TrackingExListener) baseTrackingListener).onLeaveApp();
}
}
public static void a(Context context, String str, CampaignEx campaignEx, com.mbridge.msdk.click.a aVar, BaseTrackingListener baseTrackingListener, List<String> list) {
com.mbridge.msdk.foundation.same.report.d.e eVar = new com.mbridge.msdk.foundation.same.report.d.e();
eVar.a("type", 9);
try {
BrowserView browserView = new BrowserView(com.mbridge.msdk.foundation.controller.c.m().c(), campaignEx);
browserView.setLayoutParams(new LinearLayout.LayoutParams(ab.j(context), ab.h(context)));
browserView.setListener(new com.mbridge.msdk.foundation.webview.a(context, campaignEx, aVar, browserView, baseTrackingListener));
browserView.loadUrl(str);
eVar.a("result", "1");
} catch (Exception e) {
af.b("SDKUtil", e.getMessage());
eVar.a("result", "2");
}
if (list != null) {
eVar.a("click_path", list.toString());
}
com.mbridge.msdk.foundation.same.report.d.d.a().a("2000150", campaignEx, eVar);
}
public static void b(Campaign campaign, ViewGroup viewGroup) {
a(campaign, viewGroup, 0, 0);
}
public static void a(Campaign campaign, ViewGroup viewGroup, int i, int i2) {
if (campaign != null) {
CampaignEx campaignEx = (CampaignEx) campaign;
if (campaignEx.getLinkType() == 8 && campaignEx.getAabEntity() != null && campaignEx.getAabEntity().getHlp() == 1) {
if (viewGroup == null) {
af.d("SDKUtil", "show linkType==8 loading view failed. viewGroup is null");
return;
}
try {
if (c == null) {
Context c2 = com.mbridge.msdk.foundation.controller.c.m().c();
if (c2 instanceof Activity) {
c = (LinearLayout) LayoutInflater.from(c2.getApplicationContext()).inflate(x.a(c2.getApplicationContext(), "mbridge_cm_loading_layout", TtmlNode.TAG_LAYOUT), (ViewGroup) null);
} else {
c = (LinearLayout) LayoutInflater.from(c2).inflate(x.a(c2, "mbridge_cm_loading_layout", TtmlNode.TAG_LAYOUT), (ViewGroup) null);
}
}
int min = Math.min(viewGroup.getWidth(), viewGroup.getHeight());
int min2 = Math.min(Math.max(min / 4, 70), min);
if (viewGroup instanceof FrameLayout) {
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(min2, min2);
layoutParams.gravity = 17;
at.a(c);
viewGroup.addView(c, layoutParams);
return;
}
RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(min2, min2);
if (i2 == 0 && i == 0) {
layoutParams2.addRule(13);
} else {
layoutParams2.leftMargin = i2;
layoutParams2.topMargin = i;
}
at.a(c);
viewGroup.addView(c, layoutParams2);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
public static class a {
public static boolean a(Context context, String str, NativeListener.NativeTrackingListener nativeTrackingListener) {
try {
List<ResolveInfo> a = a(context);
if (a != null && a.size() > 0) {
if (!a(str)) {
if (c(str)) {
str = "market://" + str.substring(str.indexOf("details?id="));
} else {
str = null;
}
}
if (TextUtils.isEmpty(str)) {
return false;
}
Intent b = b(context);
b.setData(Uri.parse(str));
b.addFlags(DriveFile.MODE_READ_ONLY);
Iterator<ResolveInfo> it = a.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
if (it.next().activityInfo.packageName.equals("com.android.vending")) {
b.setPackage("com.android.vending");
break;
}
}
context.startActivity(b);
aj.a(nativeTrackingListener);
return true;
}
return false;
} catch (Throwable th) {
af.b("SDKUtil", Log.getStackTraceString(th));
return false;
}
}
private static List<ResolveInfo> a(Context context) {
try {
return context.getPackageManager().queryIntentActivities(b(context), 0);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
private static Intent b(Context context) {
return new Intent("android.intent.action.VIEW", Uri.parse("market://details?id=com.package.name"));
}
public static boolean a(String str) {
try {
if (TextUtils.isEmpty(str)) {
return false;
}
return Uri.parse(str).getScheme().equals("market");
} catch (Throwable th) {
af.b("SDKUtil", Log.getStackTraceString(th));
return false;
}
}
private static boolean c(String str) {
Uri parse;
try {
if (TextUtils.isEmpty(str) || (parse = Uri.parse(str)) == null || TextUtils.isEmpty(parse.getHost())) {
return false;
}
if (!parse.getHost().equals("play.google.com")) {
if (!parse.getHost().equals("market.android.com")) {
return false;
}
}
return true;
} catch (Throwable th) {
af.b("SDKUtil", Log.getStackTraceString(th));
}
return false;
}
public static boolean b(String str) {
return a(str) || c(str);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,39 @@
package com.mbridge.msdk.foundation.tools;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
/* loaded from: classes4.dex */
public final class al {
public static String a(Object obj) {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
try {
ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream);
objectOutputStream.writeObject(obj);
byte[] byteArray = byteArrayOutputStream.toByteArray();
objectOutputStream.flush();
objectOutputStream.close();
return new String(byteArray, "ISO-8859-1");
} catch (IOException e) {
af.b("SerializeTools", "IOException", e);
return "";
}
}
public static Object a(String str) {
try {
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(str.getBytes("ISO-8859-1"));
ObjectInputStream objectInputStream = new ObjectInputStream(byteArrayInputStream);
Object readObject = objectInputStream.readObject();
objectInputStream.close();
byteArrayInputStream.close();
return readObject;
} catch (Exception e) {
af.b("SerializeTools", "Exception", e);
return null;
}
}
}

View File

@@ -0,0 +1,27 @@
package com.mbridge.msdk.foundation.tools;
import android.content.Context;
import android.content.SharedPreferences;
/* loaded from: classes4.dex */
public final class am {
public static void a(Context context, String str, Object obj) {
String simpleName = obj.getClass().getSimpleName();
if (context == null) {
return;
}
SharedPreferences.Editor edit = context.getApplicationContext().getSharedPreferences("share_date_setting_filter", 0).edit();
if ("String".equals(simpleName)) {
edit.putString(str, (String) obj);
} else if ("Integer".equals(simpleName)) {
edit.putInt(str, ((Integer) obj).intValue());
} else if ("Boolean".equals(simpleName)) {
edit.putBoolean(str, ((Boolean) obj).booleanValue());
} else if ("Float".equals(simpleName)) {
edit.putFloat(str, ((Float) obj).floatValue());
} else if ("Long".equals(simpleName)) {
edit.putLong(str, ((Long) obj).longValue());
}
edit.apply();
}
}

View File

@@ -0,0 +1,110 @@
package com.mbridge.msdk.foundation.tools;
import android.content.Context;
import android.content.SharedPreferences;
import com.mbridge.msdk.foundation.tools.FastKV;
/* loaded from: classes4.dex */
public final class an {
static FastKV a;
public static Object a(Context context, String str, Object obj) {
if (context == null) {
return obj;
}
String simpleName = obj != null ? obj.getClass().getSimpleName() : "";
com.mbridge.msdk.foundation.controller.d.a();
if (a == null) {
try {
a = new FastKV.Builder(com.mbridge.msdk.foundation.same.b.e.a(com.mbridge.msdk.foundation.same.b.c.MBRIDGE_700_CONFIG), "share_date").build();
} catch (Exception unused) {
a = null;
}
}
if (a != null) {
try {
if ("String".equals(simpleName)) {
return a.getString(str, (String) obj);
}
if ("Integer".equals(simpleName)) {
return Integer.valueOf(a.getInt(str, ((Integer) obj).intValue()));
}
if ("Boolean".equals(simpleName)) {
return Boolean.valueOf(a.getBoolean(str, ((Boolean) obj).booleanValue()));
}
if ("Float".equals(simpleName)) {
return Float.valueOf(a.getFloat(str, ((Float) obj).floatValue()));
}
if ("Long".equals(simpleName)) {
return Long.valueOf(a.getLong(str, ((Long) obj).longValue()));
}
} catch (Exception unused2) {
return obj;
}
} else {
SharedPreferences sharedPreferences = context.getSharedPreferences("share_date", 0);
if ("String".equals(simpleName)) {
return sharedPreferences.getString(str, (String) obj);
}
if ("Integer".equals(simpleName)) {
return Integer.valueOf(sharedPreferences.getInt(str, ((Integer) obj).intValue()));
}
if ("Boolean".equals(simpleName)) {
return Boolean.valueOf(sharedPreferences.getBoolean(str, ((Boolean) obj).booleanValue()));
}
if ("Float".equals(simpleName)) {
return Float.valueOf(sharedPreferences.getFloat(str, ((Float) obj).floatValue()));
}
if ("Long".equals(simpleName)) {
return Long.valueOf(sharedPreferences.getLong(str, ((Long) obj).longValue()));
}
}
return obj;
}
public static void b(Context context, String str, Object obj) {
String simpleName = obj.getClass().getSimpleName();
if (context == null) {
return;
}
com.mbridge.msdk.foundation.controller.d.a();
if (a == null) {
try {
a = new FastKV.Builder(com.mbridge.msdk.foundation.same.b.e.a(com.mbridge.msdk.foundation.same.b.c.MBRIDGE_700_CONFIG), "share_date").build();
} catch (Exception unused) {
a = null;
}
}
if (a != null) {
try {
if ("String".equals(simpleName)) {
a.putString(str, (String) obj);
} else if ("Integer".equals(simpleName)) {
a.putInt(str, ((Integer) obj).intValue());
} else if ("Boolean".equals(simpleName)) {
a.putBoolean(str, ((Boolean) obj).booleanValue());
} else if ("Float".equals(simpleName)) {
a.putFloat(str, ((Float) obj).floatValue());
} else if ("Long".equals(simpleName)) {
a.putLong(str, ((Long) obj).longValue());
}
return;
} catch (Exception unused2) {
return;
}
}
SharedPreferences.Editor edit = context.getApplicationContext().getSharedPreferences("share_date", 0).edit();
if ("String".equals(simpleName)) {
edit.putString(str, (String) obj);
} else if ("Integer".equals(simpleName)) {
edit.putInt(str, ((Integer) obj).intValue());
} else if ("Boolean".equals(simpleName)) {
edit.putBoolean(str, ((Boolean) obj).booleanValue());
} else if ("Float".equals(simpleName)) {
edit.putFloat(str, ((Float) obj).floatValue());
} else if ("Long".equals(simpleName)) {
edit.putLong(str, ((Long) obj).longValue());
}
edit.apply();
}
}

View File

@@ -0,0 +1,108 @@
package com.mbridge.msdk.foundation.tools;
import androidx.work.WorkInfo;
import com.mbridge.msdk.foundation.tools.FastKV;
import java.util.LinkedHashSet;
import java.util.Set;
/* loaded from: classes4.dex */
final class ao implements FastKV.a<Set<String>> {
static final ao a = new ao();
@Override // com.mbridge.msdk.foundation.tools.FastKV.a
public final String a() {
return "StringSet";
}
@Override // com.mbridge.msdk.foundation.tools.FastKV.a
public final /* synthetic */ byte[] a(Set<String> set) {
Set<String> set2 = set;
if (set2.isEmpty()) {
return new byte[0];
}
int size = set2.size();
int[] iArr = new int[size];
String[] strArr = new String[size];
int i = 0;
int i2 = 0;
for (String str : set2) {
if (str == null) {
i += 5;
iArr[i2] = -1;
} else {
int a2 = q.a(str);
strArr[i2] = str;
iArr[i2] = a2;
i += ((a2 >> 7) == 0 ? 1 : (a2 >> 14) == 0 ? 2 : (a2 >> 21) == 0 ? 3 : (a2 >> 28) == 0 ? 4 : 5) + a2;
}
i2++;
}
q qVar = new q(i);
for (int i3 = 0; i3 < size; i3++) {
int i4 = iArr[i3];
int i5 = qVar.b;
int i6 = i4;
while ((i6 & WorkInfo.STOP_REASON_FOREGROUND_SERVICE_TIMEOUT) != 0) {
qVar.a[i5] = (byte) ((i6 & 127) | 128);
i6 >>>= 7;
i5++;
}
qVar.a[i5] = (byte) i6;
qVar.b = i5 + 1;
if (i4 >= 0) {
qVar.b(strArr[i3]);
}
}
return qVar.a;
}
private ao() {
}
@Override // com.mbridge.msdk.foundation.tools.FastKV.a
public final /* synthetic */ Set<String> a(byte[] bArr, int i, int i2) {
int i3;
LinkedHashSet linkedHashSet = new LinkedHashSet();
if (i2 > 0) {
q qVar = new q(bArr, i);
int i4 = i + i2;
while (true) {
i3 = qVar.b;
if (i3 >= i4) {
break;
}
byte[] bArr2 = qVar.a;
int i5 = i3 + 1;
qVar.b = i5;
int i6 = bArr2[i3];
if ((i6 >> 7) != 0) {
int i7 = i3 + 2;
qVar.b = i7;
i6 = (i6 & 127) | (bArr2[i5] << 7);
if ((i6 >> 14) != 0) {
int i8 = i6 & 16383;
int i9 = i3 + 3;
qVar.b = i9;
int i10 = i8 | (bArr2[i7] << 14);
if ((i10 >> 21) == 0) {
i6 = i10;
} else {
int i11 = i3 + 4;
qVar.b = i11;
i6 = (bArr2[i9] << 21) | (i10 & 2097151);
if ((i6 >> 28) != 0) {
qVar.b = i3 + 5;
i6 = (268435455 & i6) | (bArr2[i11] << 28);
}
}
}
}
linkedHashSet.add(qVar.a(i6));
}
if (i3 != i4) {
throw new IllegalArgumentException("Invalid String set");
}
}
return linkedHashSet;
}
}

View File

@@ -0,0 +1,14 @@
package com.mbridge.msdk.foundation.tools;
import android.text.TextUtils;
/* loaded from: classes4.dex */
public final class ap {
public static boolean a(String str) {
return str == null || TextUtils.isEmpty(str.trim()) || "null".equals(str);
}
public static boolean b(String str) {
return (str == null || TextUtils.isEmpty(str.trim()) || "null".equals(str)) ? false : true;
}
}

View File

@@ -0,0 +1,61 @@
package com.mbridge.msdk.foundation.tools;
import android.net.Uri;
import android.text.TextUtils;
import android.webkit.URLUtil;
import java.net.URL;
/* loaded from: classes4.dex */
public final class aq {
public static String a(String str) {
try {
return (TextUtils.isEmpty(str) || !URLUtil.isValidUrl(str)) ? "" : new URL(str).getHost();
} catch (Exception e) {
af.b("UriUtil", e.getMessage());
return "";
}
}
public static String b(String str) {
try {
return (TextUtils.isEmpty(str) || !URLUtil.isValidUrl(str)) ? str : new URL(str).getPath();
} catch (Exception e) {
af.b("UriUtil", e.getMessage());
return "";
}
}
public static String a(String str, String str2) {
try {
return (TextUtils.isEmpty(str) || !URLUtil.isValidUrl(str)) ? str : Uri.parse(str).getQueryParameter(str2);
} catch (Exception e) {
af.b("UriUtil", e.getMessage());
return "";
}
}
public static int c(String str) {
try {
if (!TextUtils.isEmpty(str)) {
if (!URLUtil.isValidUrl(str)) {
if (str != null && str.length() > 5 && str.substring(0, 6).equalsIgnoreCase("tcp://")) {
}
}
return Uri.parse(str).getQueryParameterNames().size();
}
} catch (Exception e) {
af.b("UriUtil", e.getMessage());
}
return 0;
}
public static String d(String str) {
try {
Uri parse = Uri.parse(str);
return parse.getScheme() + "://" + parse.getHost() + parse.getPath();
} catch (Exception e) {
af.b("UriUtil", e.getMessage());
return "";
}
}
}

View File

@@ -0,0 +1,137 @@
package com.mbridge.msdk.foundation.tools;
import com.applovin.exoplayer2.common.base.Ascii;
import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.security.SecureRandom;
/* loaded from: classes4.dex */
final class ar {
public static class a {
static final char[] a = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
static final SecureRandom b = new SecureRandom();
}
public static void a(File file) {
try {
if (file.exists()) {
d(file);
}
} catch (Exception unused) {
}
}
private static void d(File file) {
File[] listFiles;
if (file.isDirectory() && (listFiles = file.listFiles()) != null) {
for (File file2 : listFiles) {
d(file2);
}
}
file.delete();
}
public static byte[] b(File file) throws IOException {
if (!file.isFile()) {
return null;
}
long length = file.length();
if ((length >> 32) != 0) {
throw new IllegalArgumentException("file too large, path:" + file.getPath());
}
int i = (int) length;
byte[] bArr = new byte[i];
a(file, bArr, i);
return bArr;
}
public static void a(File file, byte[] bArr, int i) throws IOException {
RandomAccessFile randomAccessFile = new RandomAccessFile(file, "rw");
int i2 = 0;
while (i2 < i) {
try {
int read = randomAccessFile.read(bArr, i2, i - i2);
if (read < 0) {
break;
} else {
i2 += read;
}
} finally {
a(randomAccessFile);
}
}
}
public static void a(Closeable closeable) {
if (closeable != null) {
try {
closeable.close();
} catch (Exception unused) {
}
}
}
public static int a() {
try {
Class<?> cls = Class.forName("sun.misc.Unsafe");
Field declaredField = cls.getDeclaredField("theUnsafe");
declaredField.setAccessible(true);
Method declaredMethod = cls.getDeclaredMethod("pageSize", new Class[0]);
declaredMethod.setAccessible(true);
return ((Integer) declaredMethod.invoke(declaredField.get(null), new Object[0])).intValue();
} catch (Throwable unused) {
return 4096;
}
}
public static String b() {
byte[] bArr = new byte[16];
a.b.nextBytes(bArr);
char[] cArr = new char[32];
for (int i = 0; i < 16; i++) {
byte b = bArr[i];
int i2 = i << 1;
char[] cArr2 = a.a;
cArr[i2] = cArr2[(b >> 4) & 15];
cArr[i2 + 1] = cArr2[b & Ascii.SI];
}
return new String(cArr);
}
public static boolean a(File file, byte[] bArr) {
File file2;
try {
file2 = new File(file.getParent(), file.getName() + ".tmp");
} catch (Exception unused) {
}
if (!c(file2)) {
return false;
}
RandomAccessFile randomAccessFile = new RandomAccessFile(file2, "rw");
try {
randomAccessFile.setLength(bArr.length);
randomAccessFile.write(bArr);
a(randomAccessFile);
if (!file.exists() || file.delete()) {
return file2.renameTo(file);
}
return false;
} catch (Throwable th) {
a(randomAccessFile);
throw th;
}
}
public static boolean c(File file) throws IOException {
if (file.isFile()) {
return true;
}
File parentFile = file.getParentFile();
return parentFile != null && (parentFile.isDirectory() || parentFile.mkdirs()) && file.createNewFile();
}
}

View File

@@ -0,0 +1,117 @@
package com.mbridge.msdk.foundation.tools;
import android.graphics.Rect;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
/* loaded from: classes4.dex */
public final class as {
private static boolean a = false;
private static int a(View view, ViewGroup viewGroup) {
int i = 0;
while (i < viewGroup.getChildCount() && viewGroup.getChildAt(i) != view) {
i++;
}
return i;
}
private static boolean a(View view, View view2, int i) {
Rect rect = new Rect();
view.getGlobalVisibleRect(rect);
Rect rect2 = new Rect();
view2.getGlobalVisibleRect(rect2);
if (!Rect.intersects(rect, rect2)) {
return false;
}
int min = Math.min(rect.right, rect2.right) - Math.max(rect.left, rect2.left);
int min2 = Math.min(rect.bottom, rect2.bottom) - Math.max(rect.top, rect2.top);
return (i != 1 && (min * min2) * 2 >= view.getMeasuredHeight() * view.getMeasuredWidth()) || (i == 1 && min * min2 >= view.getMeasuredHeight() * view.getMeasuredWidth());
}
private static boolean a(View view, ViewGroup viewGroup, int i) {
for (int i2 = 0; i2 < viewGroup.getChildCount(); i2++) {
af.b("ViewUtils", "View Judge : Start Loop");
View childAt = viewGroup.getChildAt(i2);
if (childAt.getVisibility() == 0 && a(view, childAt, i)) {
if ((childAt instanceof WebView) && childAt.getVisibility() == 0) {
af.b("ViewUtils", "View Judge : View Covered by WebView.");
a = true;
}
if (a(childAt)) {
af.b("ViewUtils", "View Judge : View Covered and Cover ViewGroup is not transparent.");
a = true;
}
if (a) {
break;
}
if (childAt instanceof ViewGroup) {
a(view, (ViewGroup) childAt, i);
}
}
}
return a;
}
public static boolean a(View view, int i) {
if (view == null) {
return true;
}
if (view.getVisibility() != 0) {
af.b("ViewUtils", "Banner Judge : Banner's not visible.");
return true;
}
if (view.getAlpha() < 0.5f) {
af.b("ViewUtils", "Banner Judge : Banner's alpha must set up 50%.");
return true;
}
if (view.getParent() != null && (view.getParent() instanceof ViewGroup) && ((ViewGroup) view.getParent()).getVisibility() != 0) {
af.b("ViewUtils", "View Judge : View's container is not visible.");
return true;
}
Rect rect = new Rect();
boolean globalVisibleRect = view.getGlobalVisibleRect(rect);
boolean z = ((float) ((rect.bottom - rect.top) * (rect.right - rect.left))) > ((float) (view.getMeasuredHeight() * view.getMeasuredWidth())) * (i == 1 ? 0.0f : 0.5f);
boolean z2 = globalVisibleRect && z;
af.b("ViewUtils", "View Judge : partVisible is " + globalVisibleRect + " halfPercentVisible is " + z);
StringBuilder sb = new StringBuilder();
sb.append("View Judge : totalViewVisible is ");
sb.append(z2);
af.b("ViewUtils", sb.toString());
if (!z2) {
return true;
}
View view2 = view;
while (view2.getParent() instanceof ViewGroup) {
ViewGroup viewGroup = (ViewGroup) view2.getParent();
for (int a2 = a(view2, viewGroup) + 1; a2 < viewGroup.getChildCount(); a2++) {
View childAt = viewGroup.getChildAt(a2);
if (childAt.getVisibility() == 0 && a(view, childAt, i)) {
if (childAt instanceof ViewGroup) {
ViewGroup viewGroup2 = (ViewGroup) childAt;
if (viewGroup2.getChildCount() > 0) {
af.b("ViewUtils", "View Judge : Covered by ViewGroup.");
boolean a3 = a(view, viewGroup2, i);
a = false;
if (a3) {
return true;
}
}
}
if (a(childAt)) {
af.b("ViewUtils", "View Judge : View Covered and Cover View is not transparent.");
return true;
}
}
}
view2 = viewGroup;
}
af.b("ViewUtils", "View Judge : Well done, View is not covered.");
return false;
}
private static boolean a(View view) {
return !(view != null && (view.getTag() instanceof String) && "mb_wm".equals(view.getTag())) && view.getBackground() != null && view.getBackground().getAlpha() > 127 && view.getAlpha() > 0.5f;
}
}

View File

@@ -0,0 +1,35 @@
package com.mbridge.msdk.foundation.tools;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import java.util.concurrent.atomic.AtomicInteger;
/* loaded from: classes4.dex */
public final class at {
private static final AtomicInteger a = new AtomicInteger(1);
public static void a(View view) {
if (view != null) {
ViewParent parent = view.getParent();
if (parent instanceof ViewGroup) {
((ViewGroup) parent).removeView(view);
}
}
}
public static int a() {
AtomicInteger atomicInteger;
int i;
int i2;
do {
atomicInteger = a;
i = atomicInteger.get();
i2 = i + 1;
if (i2 > 16777215) {
i2 = 1;
}
} while (!atomicInteger.compareAndSet(i, i2));
return i;
}
}

View File

@@ -0,0 +1,144 @@
package com.mbridge.msdk.foundation.tools;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Looper;
import android.os.Parcel;
import android.os.RemoteException;
import java.io.IOException;
import java.util.concurrent.LinkedBlockingQueue;
/* loaded from: classes4.dex */
public final class b {
public final a a(Context context) throws Exception {
if (Looper.myLooper() == Looper.getMainLooper()) {
throw new IllegalStateException("Cannot be called from the main thread");
}
context.getPackageManager().getPackageInfo("com.android.vending", 0);
ServiceConnectionC0203b serviceConnectionC0203b = new ServiceConnectionC0203b();
Intent intent = new Intent("com.google.android.gms.ads.identifier.service.START");
intent.setPackage("com.google.android.gms");
if (context.bindService(intent, serviceConnectionC0203b, 1)) {
try {
try {
c cVar = new c(serviceConnectionC0203b.a());
return new a(cVar.a(), cVar.a(true));
} catch (Exception e) {
throw e;
}
} finally {
context.unbindService(serviceConnectionC0203b);
}
}
throw new IOException("Google Play connection failed");
}
public final class a {
private final String b;
private final boolean c;
public final String a() {
return this.b;
}
public final boolean b() {
return this.c;
}
public a(String str, boolean z) {
this.b = str;
this.c = z;
}
}
/* renamed from: com.mbridge.msdk.foundation.tools.b$b, reason: collision with other inner class name */
public final class ServiceConnectionC0203b implements ServiceConnection {
boolean a;
private final LinkedBlockingQueue<IBinder> c;
@Override // android.content.ServiceConnection
public final void onServiceDisconnected(ComponentName componentName) {
}
private ServiceConnectionC0203b() {
this.c = new LinkedBlockingQueue<>(1);
this.a = false;
}
public final IBinder a() throws InterruptedException {
if (this.a) {
throw new IllegalStateException();
}
this.a = true;
return this.c.take();
}
@Override // android.content.ServiceConnection
public final void onServiceConnected(ComponentName componentName, IBinder iBinder) {
try {
this.c.put(iBinder);
} catch (InterruptedException e) {
af.b("AdvertisingIdClient", e.getMessage());
}
}
}
public final class c implements IInterface {
private IBinder b;
@Override // android.os.IInterface
public final IBinder asBinder() {
return this.b;
}
public c(IBinder iBinder) {
this.b = iBinder;
}
public final String a() throws RemoteException {
Parcel obtain = Parcel.obtain();
Parcel obtain2 = Parcel.obtain();
try {
obtain.writeInterfaceToken("com.google.android.gms.ads.identifier.internal.IAdvertisingIdService");
this.b.transact(1, obtain, obtain2, 0);
obtain2.readException();
return obtain2.readString();
} catch (Throwable th) {
try {
af.b("AdvertisingIdClient", th.getMessage());
obtain2.recycle();
obtain.recycle();
return null;
} finally {
obtain2.recycle();
obtain.recycle();
}
}
}
public final boolean a(boolean z) throws RemoteException {
Parcel obtain = Parcel.obtain();
Parcel obtain2 = Parcel.obtain();
boolean z2 = false;
try {
obtain.writeInterfaceToken("com.google.android.gms.ads.identifier.internal.IAdvertisingIdService");
obtain.writeInt(z ? 1 : 0);
this.b.transact(2, obtain, obtain2, 0);
obtain2.readException();
if (obtain2.readInt() != 0) {
z2 = true;
}
} finally {
try {
return z2;
} finally {
}
}
return z2;
}
}
}

View File

@@ -0,0 +1,110 @@
package com.mbridge.msdk.foundation.tools;
import android.content.Context;
import android.content.SharedPreferences;
import com.mbridge.msdk.foundation.tools.FastKV;
/* loaded from: classes4.dex */
public final class c {
static FastKV a;
public static Object a(Context context, String str, Object obj) {
if (context == null) {
return obj;
}
String simpleName = obj != null ? obj.getClass().getSimpleName() : "";
com.mbridge.msdk.foundation.controller.d.a();
if (a == null) {
try {
a = new FastKV.Builder(com.mbridge.msdk.foundation.same.b.e.a(com.mbridge.msdk.foundation.same.b.c.MBRIDGE_700_CONFIG), "share_kv_date").asyncBlocking().build();
} catch (Exception unused) {
a = null;
}
}
if (a != null) {
try {
if ("String".equals(simpleName)) {
return a.getString(str, (String) obj);
}
if ("Integer".equals(simpleName)) {
return Integer.valueOf(a.getInt(str, ((Integer) obj).intValue()));
}
if ("Boolean".equals(simpleName)) {
return Boolean.valueOf(a.getBoolean(str, ((Boolean) obj).booleanValue()));
}
if ("Float".equals(simpleName)) {
return Float.valueOf(a.getFloat(str, ((Float) obj).floatValue()));
}
if ("Long".equals(simpleName)) {
return Long.valueOf(a.getLong(str, ((Long) obj).longValue()));
}
} catch (Exception unused2) {
return obj;
}
} else {
SharedPreferences sharedPreferences = context.getSharedPreferences("share_kv_date", 0);
if ("String".equals(simpleName)) {
return sharedPreferences.getString(str, (String) obj);
}
if ("Integer".equals(simpleName)) {
return Integer.valueOf(sharedPreferences.getInt(str, ((Integer) obj).intValue()));
}
if ("Boolean".equals(simpleName)) {
return Boolean.valueOf(sharedPreferences.getBoolean(str, ((Boolean) obj).booleanValue()));
}
if ("Float".equals(simpleName)) {
return Float.valueOf(sharedPreferences.getFloat(str, ((Float) obj).floatValue()));
}
if ("Long".equals(simpleName)) {
return Long.valueOf(sharedPreferences.getLong(str, ((Long) obj).longValue()));
}
}
return obj;
}
public static void b(Context context, String str, Object obj) {
String simpleName = obj.getClass().getSimpleName();
if (context == null) {
return;
}
com.mbridge.msdk.foundation.controller.d.a();
if (a == null) {
try {
a = new FastKV.Builder(com.mbridge.msdk.foundation.same.b.e.a(com.mbridge.msdk.foundation.same.b.c.MBRIDGE_700_CONFIG), "share_kv_date").asyncBlocking().build();
} catch (Exception unused) {
a = null;
}
}
if (a != null) {
try {
if ("String".equals(simpleName)) {
a.putString(str, (String) obj);
} else if ("Integer".equals(simpleName)) {
a.putInt(str, ((Integer) obj).intValue());
} else if ("Boolean".equals(simpleName)) {
a.putBoolean(str, ((Boolean) obj).booleanValue());
} else if ("Float".equals(simpleName)) {
a.putFloat(str, ((Float) obj).floatValue());
} else if ("Long".equals(simpleName)) {
a.putLong(str, ((Long) obj).longValue());
}
return;
} catch (Exception unused2) {
return;
}
}
SharedPreferences.Editor edit = context.getApplicationContext().getSharedPreferences("share_kv_date", 0).edit();
if ("String".equals(simpleName)) {
edit.putString(str, (String) obj);
} else if ("Integer".equals(simpleName)) {
edit.putInt(str, ((Integer) obj).intValue());
} else if ("Boolean".equals(simpleName)) {
edit.putBoolean(str, ((Boolean) obj).booleanValue());
} else if ("Float".equals(simpleName)) {
edit.putFloat(str, ((Float) obj).floatValue());
} else if ("Long".equals(simpleName)) {
edit.putLong(str, ((Long) obj).longValue());
}
edit.apply();
}
}

View File

@@ -0,0 +1,118 @@
package com.mbridge.msdk.foundation.tools;
import android.content.Context;
import com.fyber.inneractive.sdk.external.InneractiveMediationDefs;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.foundation.download.core.DownloadCommon;
import com.mbridge.msdk.foundation.same.DomainNameUtils;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public class d {
public int a;
public int b;
public String c;
public String d;
public String e;
public String f;
public String g;
public String h;
public String j;
public String k;
public int m;
public String n;
public String o;
public String p;
public String r;
public String s;
public String t;
public String v;
public String q = "android";
public String i = ab.m();
public String u = ab.w();
public String l = f.c();
public d(Context context) {
int m = ab.m(context);
this.n = String.valueOf(m);
this.o = ab.a(context, m);
this.j = ab.g(context);
this.e = com.mbridge.msdk.foundation.controller.c.m().b();
this.d = com.mbridge.msdk.foundation.controller.c.m().k();
this.t = String.valueOf(ak.f(context));
this.s = String.valueOf(ak.e(context));
this.r = String.valueOf(ak.d(context));
this.v = com.mbridge.msdk.foundation.controller.c.m().i().toString();
this.g = ab.x();
this.m = ak.a();
if (context.getResources().getConfiguration().orientation == 2) {
this.p = "landscape";
} else {
this.p = "portrait";
}
this.f = com.mbridge.msdk.foundation.same.a.V;
this.h = com.mbridge.msdk.foundation.same.a.g;
this.k = ab.n();
this.c = f.d();
this.a = f.a();
this.b = com.mbridge.msdk.foundation.controller.authoritycontroller.b.b() ? 1 : 0;
}
public JSONObject a() {
JSONObject jSONObject = new JSONObject();
try {
if (com.mbridge.msdk.foundation.controller.authoritycontroller.c.j().c(MBridgeConstans.AUTHORITY_GENERAL_DATA)) {
jSONObject.put("device", this.i);
jSONObject.put("system_version", this.u);
jSONObject.put("network_type", this.n);
jSONObject.put("network_type_str", this.o);
jSONObject.put("device_ua", this.j);
jSONObject.put("has_wx", ab.v(com.mbridge.msdk.foundation.controller.c.m().c()));
jSONObject.put("integrated_wx", ab.z());
jSONObject.put("opensdk_ver", ab.u() + "");
jSONObject.put("wx_api_ver", ab.c(com.mbridge.msdk.foundation.controller.c.m().h()) + "");
jSONObject.put("brand", this.g);
jSONObject.put("mnc", ab.l(com.mbridge.msdk.foundation.controller.c.m().c()));
jSONObject.put("mcc", ab.k(com.mbridge.msdk.foundation.controller.c.m().c()));
jSONObject.put("adid_limit", this.a);
jSONObject.put("adid_limit_dev", this.b);
}
jSONObject.put("plantform", this.q);
if (com.mbridge.msdk.foundation.controller.authoritycontroller.c.j().c(MBridgeConstans.AUTHORITY_DEVICE_ID)) {
jSONObject.put("google_ad_id", this.l);
jSONObject.put("az_aid_info", this.c);
}
jSONObject.put("appkey", this.e);
jSONObject.put("appId", this.d);
jSONObject.put("screen_width", this.t);
jSONObject.put("screen_height", this.s);
jSONObject.put("orientation", this.p);
jSONObject.put("scale", this.r);
jSONObject.put(DownloadCommon.DOWNLOAD_REPORT_FIND_FILE_RESULT_VALUE_B, this.f);
jSONObject.put("c", this.h);
jSONObject.put("web_env", this.v);
jSONObject.put(InneractiveMediationDefs.GENDER_FEMALE, this.k);
jSONObject.put("misk_spt", this.m);
if (ab.q() != 0) {
jSONObject.put("tun", ab.q());
}
jSONObject.put(com.mbridge.msdk.foundation.same.net.f.e.c, com.mbridge.msdk.foundation.controller.authoritycontroller.c.j().f() + "");
if (com.mbridge.msdk.foundation.controller.authoritycontroller.c.j().c(MBridgeConstans.AUTHORITY_GENERAL_DATA)) {
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("adid_limit", this.a);
jSONObject2.put("adid_limit_dev", this.b);
jSONObject.put("dvi", z.b(jSONObject2.toString()));
}
if (!com.mbridge.msdk.foundation.controller.authoritycontroller.b.a()) {
jSONObject.put("dev_source", "2");
}
if (DomainNameUtils.getInstance().isExcludeCNDomain()) {
jSONObject.put("re_domain", "1");
}
} catch (JSONException e) {
e.printStackTrace();
}
return jSONObject;
}
}

View File

@@ -0,0 +1,20 @@
package com.mbridge.msdk.foundation.tools;
import android.content.Context;
import android.content.res.Resources;
/* loaded from: classes4.dex */
public class e {
public static boolean a(Context context) {
if (context == null) {
return false;
}
try {
Resources resources = context.getResources();
return resources.getDimensionPixelSize(resources.getIdentifier("navigation_bar_height", "dimen", "android")) > 0;
} catch (Throwable th) {
af.b("DomainSameTool", th.getMessage(), th);
return false;
}
}
}

View File

@@ -0,0 +1,177 @@
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());
}
}
}

View File

@@ -0,0 +1,130 @@
package com.mbridge.msdk.foundation.tools;
/* loaded from: classes4.dex */
final class g {
public static abstract class b {
int a;
public abstract byte a();
}
public static class a extends j {
@Override // com.mbridge.msdk.foundation.tools.g.b
public final byte a() {
return (byte) 7;
}
public a(int i, int i2, Object obj, int i3, boolean z) {
super(i, i2, obj, i3, z);
}
}
public static class c extends b {
boolean b;
@Override // com.mbridge.msdk.foundation.tools.g.b
public final byte a() {
return (byte) 1;
}
public c(int i, boolean z) {
this.a = i;
this.b = z;
}
}
public static class d extends b {
double b;
@Override // com.mbridge.msdk.foundation.tools.g.b
public final byte a() {
return (byte) 5;
}
public d(int i, double d) {
this.a = i;
this.b = d;
}
}
public static class e extends b {
float b;
@Override // com.mbridge.msdk.foundation.tools.g.b
public final byte a() {
return (byte) 3;
}
public e(int i, float f) {
this.a = i;
this.b = f;
}
}
public static class f extends b {
int b;
@Override // com.mbridge.msdk.foundation.tools.g.b
public final byte a() {
return (byte) 2;
}
public f(int i, int i2) {
this.a = i;
this.b = i2;
}
}
/* renamed from: com.mbridge.msdk.foundation.tools.g$g, reason: collision with other inner class name */
public static class C0204g extends b {
long b;
@Override // com.mbridge.msdk.foundation.tools.g.b
public final byte a() {
return (byte) 4;
}
public C0204g(int i, long j) {
this.a = i;
this.b = j;
}
}
public static class h extends j {
@Override // com.mbridge.msdk.foundation.tools.g.b
public final byte a() {
return (byte) 8;
}
public h(int i, int i2, Object obj, int i3, boolean z) {
super(i, i2, obj, i3, z);
}
}
public static class i extends j {
@Override // com.mbridge.msdk.foundation.tools.g.b
public final byte a() {
return (byte) 6;
}
public i(int i, int i2, String str, int i3, boolean z) {
super(i, i2, str, i3, z);
}
}
public static abstract class j extends b {
boolean b;
int c;
Object d;
int e;
public j(int i, int i2, Object obj, int i3, boolean z) {
this.c = i;
this.a = i2;
this.d = obj;
this.e = i3;
this.b = z;
}
}
}

View File

@@ -0,0 +1,15 @@
package com.mbridge.msdk.foundation.tools;
/* loaded from: classes4.dex */
public final class h {
private boolean a = true;
private boolean b = true;
public final boolean a() {
return this.a;
}
public final boolean b() {
return this.b;
}
}

View File

@@ -0,0 +1,16 @@
package com.mbridge.msdk.foundation.tools;
import android.content.Context;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public final class i extends j {
public i(Context context) {
super(context);
}
@Override // com.mbridge.msdk.foundation.tools.j, com.mbridge.msdk.foundation.tools.d
public final JSONObject a() {
return super.a();
}
}

View File

@@ -0,0 +1,35 @@
package com.mbridge.msdk.foundation.tools;
import android.content.Context;
import com.mbridge.msdk.MBridgeConstans;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public class j extends d {
public int w;
public int x;
public j(Context context) {
super(context);
this.x = ab.o();
this.w = ab.f();
}
@Override // com.mbridge.msdk.foundation.tools.d
public JSONObject a() {
JSONObject a = super.a();
try {
if (com.mbridge.msdk.foundation.controller.authoritycontroller.c.j().c(MBridgeConstans.AUTHORITY_GENERAL_DATA)) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("dmt", this.x + "");
jSONObject.put("dmf", this.w);
}
} catch (JSONException e) {
if (MBridgeConstans.DEBUG) {
af.b("DomainDeviceInfo", e.getMessage());
}
}
return a;
}
}

View File

@@ -0,0 +1,10 @@
package com.mbridge.msdk.foundation.tools;
import android.content.Context;
/* loaded from: classes4.dex */
public class k extends f {
public static String d(Context context) {
return "";
}
}

View File

@@ -0,0 +1,5 @@
package com.mbridge.msdk.foundation.tools;
/* loaded from: classes4.dex */
public class l {
}

View File

@@ -0,0 +1,5 @@
package com.mbridge.msdk.foundation.tools;
/* loaded from: classes4.dex */
public class m {
}

View File

@@ -0,0 +1,25 @@
package com.mbridge.msdk.foundation.tools;
import android.content.Context;
import com.mbridge.msdk.foundation.entity.CampaignEx;
/* loaded from: classes4.dex */
public class n extends e {
public static void a(Context context, CampaignEx campaignEx) {
if (context == null) {
return;
}
com.mbridge.msdk.foundation.db.j a = com.mbridge.msdk.foundation.db.j.a(com.mbridge.msdk.foundation.db.g.a(context));
if (campaignEx == null || a == null || a.b(campaignEx.getId())) {
return;
}
com.mbridge.msdk.foundation.entity.g gVar = new com.mbridge.msdk.foundation.entity.g();
gVar.a(campaignEx.getId());
gVar.b(campaignEx.getFca());
gVar.c(campaignEx.getFcb());
gVar.a(0);
gVar.d(0);
gVar.a(System.currentTimeMillis());
a.a(gVar);
}
}

View File

@@ -0,0 +1,184 @@
package com.mbridge.msdk.foundation.tools;
import android.net.Uri;
import android.text.TextUtils;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.foundation.download.DownloadError;
import com.mbridge.msdk.foundation.download.DownloadMessage;
import com.mbridge.msdk.foundation.download.DownloadPriority;
import com.mbridge.msdk.foundation.download.DownloadResourceType;
import com.mbridge.msdk.foundation.download.MBDownloadManager;
import com.mbridge.msdk.foundation.download.OnDownloadStateListener;
import com.mbridge.msdk.foundation.download.resource.MBResourceManager;
import com.mbridge.msdk.playercommon.exoplayer2.source.chunk.ChunkedTrackBlacklistUtil;
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
/* loaded from: classes4.dex */
public final class o {
static final List<String> a;
public interface a {
void a(String str, DownloadError downloadError);
void a(String str, String str2, String str3, String str4, boolean z);
}
static {
ArrayList arrayList = new ArrayList(4);
a = arrayList;
arrayList.add("mbridge_splash_native_template_v_v1.xml");
arrayList.add("mbridge_splash_native_template_h_v1.xml");
}
/* JADX WARN: Can't wrap try/catch for region: R(25:(3:5|6|7)|8|9|10|(2:12|13)|(1:75)|18|19|(7:21|22|23|(2:(1:(1:27)(2:65|66))|69)(1:70)|67|29|(9:47|48|49|50|51|52|53|54|55)(1:(6:34|35|36|37|38|39)(1:46)))|73|22|23|(0)(0)|67|29|(1:31)|47|48|49|50|51|52|53|54|55) */
/* JADX WARN: Can't wrap try/catch for region: R(27:5|6|7|8|9|10|(2:12|13)|(1:75)|18|19|(7:21|22|23|(2:(1:(1:27)(2:65|66))|69)(1:70)|67|29|(9:47|48|49|50|51|52|53|54|55)(1:(6:34|35|36|37|38|39)(1:46)))|73|22|23|(0)(0)|67|29|(1:31)|47|48|49|50|51|52|53|54|55) */
/* JADX WARN: Code restructure failed: missing block: B:28:0x008a, code lost:
if (r21 != 5) goto L33;
*/
/* JADX WARN: Code restructure failed: missing block: B:60:0x0183, code lost:
r0 = e;
*/
/* JADX WARN: Code restructure failed: missing block: B:61:0x0188, code lost:
com.mbridge.msdk.foundation.tools.af.b(r20, r0.getMessage());
*/
/* JADX WARN: Code restructure failed: missing block: B:63:0x0185, code lost:
r0 = e;
*/
/* JADX WARN: Code restructure failed: missing block: B:64:0x0186, code lost:
r20 = "DynamicViewResourceManager";
*/
/* JADX WARN: Removed duplicated region for block: B:25:0x0085 */
/* JADX WARN: Removed duplicated region for block: B:70:0x009e A[Catch: Exception -> 0x00a5, TRY_LEAVE, TryCatch #4 {Exception -> 0x00a5, blocks: (B:66:0x008e, B:69:0x0096, B:70:0x009e), top: B:23:0x0083 }] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static void a(int r21, java.lang.String r22, final java.lang.String r23, final com.mbridge.msdk.foundation.tools.o.a r24, com.mbridge.msdk.foundation.entity.CampaignEx r25) {
/*
Method dump skipped, instructions count: 417
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.foundation.tools.o.a(int, java.lang.String, java.lang.String, com.mbridge.msdk.foundation.tools.o$a, com.mbridge.msdk.foundation.entity.CampaignEx):void");
}
private static String b(int i, String str, String str2) {
if (TextUtils.isEmpty(str2)) {
return "";
}
try {
String path = new URL(str2).getPath();
String substring = path.substring(path.lastIndexOf(47) + 1);
return !TextUtils.isEmpty(substring) ? substring.replace(".zip", "") : "";
} catch (Exception unused) {
return "";
}
}
public static String a(int i, String str, String str2) {
String str3;
if (TextUtils.isEmpty(str2)) {
return "";
}
try {
str3 = b(i, str, str2);
} catch (Exception unused) {
str3 = "";
}
String str4 = com.mbridge.msdk.foundation.same.b.e.a(com.mbridge.msdk.foundation.same.b.c.MBRIDGE_700_XML) + File.separator;
File file = null;
try {
if (!TextUtils.isEmpty(str3)) {
file = new File(str4, str3);
}
} catch (Exception unused2) {
}
if (file == null || !file.exists()) {
file = new File(str4 + File.separator + str3.replace(".xml", ""), str3);
}
return file.getPath();
}
public static String a(String str) {
String str2;
final String str3;
File file;
if (TextUtils.isEmpty(str)) {
return "";
}
try {
String queryParameter = Uri.parse(str).getQueryParameter(MBridgeConstans.DYNAMIC_VIEW_KEY_NATMP);
if (!TextUtils.isEmpty(queryParameter)) {
if (!queryParameter.equals("1")) {
return "";
}
}
} catch (Throwable unused) {
}
try {
str2 = b(str);
} catch (Exception unused2) {
str2 = "";
}
if (TextUtils.isEmpty(str2)) {
return "";
}
try {
str3 = com.mbridge.msdk.foundation.same.b.e.a(com.mbridge.msdk.foundation.same.b.c.MBRIDGE_700_XML) + File.separator;
file = new File(str3, str2);
} catch (Exception unused3) {
}
if (file.isFile() && file.exists()) {
return file.getPath();
}
String path = new URL(str).getPath();
final String substring = path.substring(path.lastIndexOf(47) + 1);
MBDownloadManager.getInstance().download(new DownloadMessage<>(new Object(), str, substring, 100, DownloadResourceType.DOWNLOAD_RESOURCE_TYPE_OTHER)).withReadTimeout(com.mbridge.msdk.foundation.same.a.u).withConnectTimeout(com.mbridge.msdk.foundation.same.a.o).with("download_scene", "download_dynamic_view").withWriteTimeout(com.mbridge.msdk.foundation.same.a.s).withTimeout(ChunkedTrackBlacklistUtil.DEFAULT_TRACK_BLACKLIST_MS).withDownloadPriority(DownloadPriority.MEDIUM).withHttpRetryCounter(1).withDirectoryPathInternal(str3).withDownloadStateListener(new OnDownloadStateListener() { // from class: com.mbridge.msdk.foundation.tools.o.2
@Override // com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final void onCancelDownload(DownloadMessage downloadMessage) {
}
@Override // com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final void onDownloadError(DownloadMessage downloadMessage, DownloadError downloadError) {
}
@Override // com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final void onDownloadStart(DownloadMessage downloadMessage) {
}
@Override // com.mbridge.msdk.foundation.download.OnDownloadStateListener
public final void onDownloadComplete(DownloadMessage downloadMessage) {
try {
MBResourceManager.getInstance().unZip(str3 + File.separator + substring, str3);
} catch (Exception unused4) {
}
}
}).build().start();
return "";
}
private static String b(String str) {
if (TextUtils.isEmpty(str)) {
return "";
}
try {
String path = new URL(str).getPath();
String substring = path.substring(path.lastIndexOf(47) + 1);
if (TextUtils.isEmpty(substring)) {
return "";
}
String replace = substring.replace(".zip", "");
List<String> list = a;
return list != null ? !list.contains(replace) ? replace : "" : "";
} catch (Exception unused) {
return "";
}
}
}

View File

@@ -0,0 +1,229 @@
package com.mbridge.msdk.foundation.tools;
import android.graphics.Bitmap;
import androidx.core.view.MotionEventCompat;
import androidx.core.view.ViewCompat;
import java.lang.reflect.Array;
/* loaded from: classes4.dex */
public final class p {
public static int a = 2048;
public static Bitmap a(Bitmap bitmap, int i) {
int i2;
int[] iArr;
int i3 = i <= 0 ? 10 : i;
int width = bitmap.getWidth() / i3;
int height = bitmap.getHeight() / i3;
int i4 = 0;
Bitmap createScaledBitmap = Bitmap.createScaledBitmap(bitmap, width, height, false);
int width2 = createScaledBitmap.getWidth();
int height2 = createScaledBitmap.getHeight();
int i5 = width2 * height2;
int[] iArr2 = new int[i5];
createScaledBitmap.getPixels(iArr2, 0, width2, 0, 0, width2, height2);
int i6 = width2 - 1;
int i7 = height2 - 1;
int[] iArr3 = new int[i5];
int[] iArr4 = new int[i5];
int[] iArr5 = new int[i5];
int[] iArr6 = new int[Math.max(width2, height2)];
int[] iArr7 = new int[20736];
for (int i8 = 0; i8 < 20736; i8++) {
iArr7[i8] = i8 / 81;
}
int[][] iArr8 = (int[][]) Array.newInstance((Class<?>) Integer.TYPE, 17, 3);
int i9 = 0;
int i10 = 0;
int i11 = 0;
while (true) {
if (i9 >= height2) {
break;
}
int i12 = i4;
int i13 = i12;
int i14 = i13;
int i15 = i14;
int i16 = i15;
int i17 = i16;
int i18 = i17;
int i19 = i18;
int i20 = -8;
int i21 = i19;
for (int i22 = 8; i20 <= i22; i22 = 8) {
Bitmap bitmap2 = createScaledBitmap;
int i23 = iArr2[Math.min(i6, Math.max(i20, 0)) + i10];
int[] iArr9 = iArr8[i20 + 8];
iArr9[0] = (i23 & 16711680) >> 16;
iArr9[1] = (i23 & MotionEventCompat.ACTION_POINTER_INDEX_MASK) >> 8;
iArr9[2] = i23 & 255;
int abs = 9 - Math.abs(i20);
int i24 = iArr9[0];
i21 += i24 * abs;
int i25 = iArr9[1];
i12 += i25 * abs;
int i26 = iArr9[2];
i13 += abs * i26;
if (i20 > 0) {
i17 += i24;
i18 += i25;
i19 += i26;
} else {
i14 += i24;
i15 += i25;
i16 += i26;
}
i20++;
createScaledBitmap = bitmap2;
}
Bitmap bitmap3 = createScaledBitmap;
int i27 = 0;
int i28 = 8;
while (i27 < width2) {
iArr3[i10] = iArr7[i21];
iArr4[i10] = iArr7[i12];
iArr5[i10] = iArr7[i13];
int i29 = i21 - i14;
int i30 = i12 - i15;
int i31 = i13 - i16;
int[] iArr10 = iArr8[(i28 + 9) % 17];
int i32 = i14 - iArr10[0];
int i33 = i15 - iArr10[1];
int i34 = i16 - iArr10[2];
if (i9 == 0) {
iArr = iArr7;
iArr6[i27] = Math.min(i27 + 9, i6);
} else {
iArr = iArr7;
}
int i35 = iArr2[i11 + iArr6[i27]];
int i36 = (i35 & 16711680) >> 16;
iArr10[0] = i36;
int i37 = (i35 & MotionEventCompat.ACTION_POINTER_INDEX_MASK) >> 8;
iArr10[1] = i37;
int i38 = i35 & 255;
iArr10[2] = i38;
int i39 = i17 + i36;
int i40 = i18 + i37;
int i41 = i19 + i38;
i21 = i29 + i39;
i12 = i30 + i40;
i13 = i31 + i41;
i28 = (i28 + 1) % 17;
int[] iArr11 = iArr8[i28 % 17];
int i42 = iArr11[0];
i14 = i32 + i42;
int i43 = iArr11[1];
i15 = i33 + i43;
int i44 = iArr11[2];
i16 = i34 + i44;
i17 = i39 - i42;
i18 = i40 - i43;
i19 = i41 - i44;
i10++;
i27++;
iArr7 = iArr;
}
i11 += width2;
i9++;
createScaledBitmap = bitmap3;
i4 = 0;
}
Bitmap bitmap4 = createScaledBitmap;
int[] iArr12 = iArr7;
int i45 = 0;
while (i45 < width2) {
int[] iArr13 = iArr6;
int i46 = height2;
int[] iArr14 = iArr2;
int i47 = -8;
int i48 = 0;
int i49 = 0;
int i50 = 0;
int i51 = 0;
int i52 = 0;
int i53 = 0;
int i54 = 0;
int i55 = 0;
int i56 = (-8) * width2;
int i57 = 0;
for (int i58 = 8; i47 <= i58; i58 = 8) {
int max = Math.max(0, i56) + i45;
int[] iArr15 = iArr8[i47 + 8];
iArr15[0] = iArr3[max];
iArr15[1] = iArr4[max];
iArr15[2] = iArr5[max];
int abs2 = 9 - Math.abs(i47);
i57 += iArr3[max] * abs2;
i48 += iArr4[max] * abs2;
i49 += iArr5[max] * abs2;
if (i47 > 0) {
i53 += iArr15[0];
i54 += iArr15[1];
i55 += iArr15[2];
} else {
i50 += iArr15[0];
i51 += iArr15[1];
i52 += iArr15[2];
}
if (i47 < i7) {
i56 += width2;
}
i47++;
}
int i59 = i45;
int i60 = i46;
int i61 = 0;
int i62 = 8;
while (i61 < i60) {
iArr14[i59] = (iArr14[i59] & ViewCompat.MEASURED_STATE_MASK) | (iArr12[i57] << 16) | (iArr12[i48] << 8) | iArr12[i49];
int i63 = i57 - i50;
int i64 = i48 - i51;
int i65 = i49 - i52;
int[] iArr16 = iArr8[(i62 + 9) % 17];
int i66 = i50 - iArr16[0];
int i67 = i51 - iArr16[1];
int i68 = i52 - iArr16[2];
if (i45 == 0) {
i2 = i60;
iArr13[i61] = Math.min(i61 + 9, i7) * width2;
} else {
i2 = i60;
}
int i69 = iArr13[i61] + i45;
int i70 = iArr3[i69];
iArr16[0] = i70;
int i71 = iArr4[i69];
iArr16[1] = i71;
int i72 = iArr5[i69];
iArr16[2] = i72;
int i73 = i53 + i70;
int i74 = i54 + i71;
int i75 = i55 + i72;
i57 = i63 + i73;
i48 = i64 + i74;
i49 = i65 + i75;
i62 = (i62 + 1) % 17;
int[] iArr17 = iArr8[i62];
int i76 = iArr17[0];
i50 = i66 + i76;
int i77 = iArr17[1];
i51 = i67 + i77;
int i78 = iArr17[2];
i52 = i68 + i78;
i53 = i73 - i76;
i54 = i74 - i77;
i55 = i75 - i78;
i59 += width2;
i61++;
i60 = i2;
}
i45++;
iArr6 = iArr13;
iArr2 = iArr14;
height2 = i60;
}
bitmap4.setPixels(iArr2, 0, width2, 0, 0, width2, height2);
return bitmap4;
}
}

View File

@@ -0,0 +1,269 @@
package com.mbridge.msdk.foundation.tools;
import com.applovin.exoplayer2.common.base.Ascii;
import com.mbridge.msdk.playercommon.exoplayer2.extractor.ts.PsExtractor;
import java.nio.charset.StandardCharsets;
/* loaded from: classes4.dex */
public final class q {
public byte[] a;
public int b;
private char[] c;
public q(int i) {
this(new byte[i], 0);
}
public q(byte[] bArr, int i) {
this.c = null;
this.a = bArr;
this.b = i;
}
public q(byte[] bArr) {
this(bArr, 0);
}
public static int a(String str) {
int length = str.length();
int i = 0;
int i2 = 0;
while (i < length) {
int i3 = i + 1;
char charAt = str.charAt(i);
if (charAt < 128) {
i2++;
} else if (charAt < 2048) {
i2 += 2;
} else if (charAt < 55296 || charAt > 57343) {
i2 += 3;
} else {
i += 2;
i2 += 4;
}
i = i3;
}
return i2;
}
public final byte a() {
byte[] bArr = this.a;
int i = this.b;
this.b = i + 1;
return bArr[i];
}
public final long a(int i, int i2) {
long j = 0;
if (i2 <= 0) {
return 0L;
}
int i3 = i2 >> 3;
int i4 = i2 & 7;
int i5 = 0;
int i6 = i;
for (int i7 = 0; i7 < i3; i7++) {
j ^= c(i6);
i6 += 8;
}
while (i5 < (i4 << 3)) {
j ^= (this.a[i6] & 255) << i5;
i5 += 8;
i6++;
}
int i8 = (i & 7) << 3;
return (j >>> (64 - i8)) | (j << i8);
}
private long c(int i) {
byte[] bArr = this.a;
int i2 = i + 6;
return (bArr[i] & 255) | ((bArr[i + 1] & 255) << 8) | ((bArr[i + 2] & 255) << 16) | ((bArr[i + 3] & 255) << 24) | ((bArr[i + 4] & 255) << 32) | ((bArr[i + 5] & 255) << 40) | ((bArr[i2] & 255) << 48) | (bArr[i + 7] << 56);
}
public final long b() {
long c = c(this.b);
this.b += 8;
return c;
}
public final int c() {
byte[] bArr = this.a;
int i = this.b;
int i2 = ((bArr[i + 1] & 255) << 8) | (bArr[i] & 255);
int i3 = i + 3;
int i4 = i2 | ((bArr[i + 2] & 255) << 16);
this.b = i + 4;
return (bArr[i3] << Ascii.CAN) | i4;
}
public final short d() {
byte[] bArr = this.a;
int i = this.b;
int i2 = i + 1;
int i3 = bArr[i] & 255;
this.b = i + 2;
return (short) ((bArr[i2] << 8) | i3);
}
public final void a(byte b) {
byte[] bArr = this.a;
int i = this.b;
this.b = i + 1;
bArr[i] = b;
}
public final void a(byte[] bArr) {
int length = bArr.length;
if (length > 0) {
System.arraycopy(bArr, 0, this.a, this.b, length);
this.b += length;
}
}
public final void b(int i) {
byte[] bArr = this.a;
int i2 = this.b;
bArr[i2] = (byte) i;
bArr[i2 + 1] = (byte) (i >> 8);
bArr[i2 + 2] = (byte) (i >> 16);
this.b = i2 + 4;
bArr[i2 + 3] = (byte) (i >> 24);
}
public final void b(int i, int i2) {
byte[] bArr = this.a;
bArr[i] = (byte) i2;
bArr[i + 1] = (byte) (i2 >> 8);
bArr[i + 2] = (byte) (i2 >> 16);
bArr[i + 3] = (byte) (i2 >> 24);
}
public final void a(long j) {
a(this.b, j);
this.b += 8;
}
public final void a(int i, long j) {
byte[] bArr = this.a;
bArr[i] = (byte) j;
bArr[i + 1] = (byte) (j >> 8);
bArr[i + 2] = (byte) (j >> 16);
bArr[i + 3] = (byte) (j >> 24);
bArr[i + 4] = (byte) (j >> 32);
bArr[i + 5] = (byte) (j >> 40);
bArr[i + 6] = (byte) (j >> 48);
bArr[i + 7] = (byte) (j >> 56);
}
public final void a(short s) {
byte[] bArr = this.a;
int i = this.b;
bArr[i] = (byte) s;
this.b = i + 2;
bArr[i + 1] = (byte) (s >> 8);
}
public final void b(String str) {
if (str == null || str.isEmpty()) {
return;
}
byte[] bArr = this.a;
int i = this.b;
int length = str.length();
int i2 = 0;
while (i2 < length) {
int i3 = i2 + 1;
char charAt = str.charAt(i2);
if (charAt < 128) {
bArr[i] = (byte) charAt;
i++;
} else if (charAt < 2048) {
int i4 = i + 1;
bArr[i] = (byte) ((charAt >>> 6) | PsExtractor.AUDIO_STREAM);
i += 2;
bArr[i4] = (byte) ((charAt & '?') | 128);
} else if (charAt < 55296 || charAt > 57343) {
bArr[i] = (byte) ((charAt >>> '\f') | 224);
int i5 = i + 2;
bArr[i + 1] = (byte) (((charAt >>> 6) & 63) | 128);
i += 3;
bArr[i5] = (byte) ((charAt & '?') | 128);
} else {
i2 += 2;
int charAt2 = ((charAt << '\n') + str.charAt(i3)) - 56613888;
bArr[i] = (byte) ((charAt2 >>> 18) | PsExtractor.VIDEO_STREAM_MASK);
bArr[i + 1] = (byte) (((charAt2 >>> 12) & 63) | 128);
int i6 = i + 3;
bArr[i + 2] = (byte) (((charAt2 >>> 6) & 63) | 128);
i += 4;
bArr[i6] = (byte) ((charAt2 & 63) | 128);
}
i2 = i3;
}
this.b = i;
}
public final String a(int i) {
String str;
if (i < 0) {
return null;
}
if (i == 0) {
return "";
}
if (i > 2048) {
str = new String(this.a, this.b, i, StandardCharsets.UTF_8);
} else {
char[] cArr = this.c;
if (cArr == null) {
if (i <= 256) {
this.c = new char[256];
} else {
this.c = new char[2048];
}
} else if (cArr.length < i) {
this.c = new char[2048];
}
char[] cArr2 = this.c;
byte[] bArr = this.a;
int i2 = this.b;
int i3 = i2 + i;
int i4 = 0;
while (i2 < i3) {
int i5 = i2 + 1;
byte b = bArr[i2];
if (b > 0) {
cArr2[i4] = (char) b;
i4++;
i2 = i5;
} else if (b < -32) {
i2 += 2;
cArr2[i4] = (char) ((bArr[i5] & 63) | ((b & Ascii.US) << 6));
i4++;
} else if (b < -16) {
int i6 = i2 + 2;
i2 += 3;
cArr2[i4] = (char) (((bArr[i5] & 63) << 6) | ((b & Ascii.SI) << 12) | (bArr[i6] & 63));
i4++;
} else {
byte b2 = bArr[i5];
int i7 = i2 + 3;
byte b3 = bArr[i2 + 2];
i2 += 4;
int i8 = ((b2 & 63) << 12) | ((b & 7) << 18) | ((b3 & 63) << 6) | (bArr[i7] & 63);
int i9 = i4 + 1;
cArr2[i4] = (char) ((i8 >>> 10) + 55232);
i4 += 2;
cArr2[i9] = (char) ((i8 & 1023) + 56320);
}
}
if (i2 > i3) {
throw new IllegalArgumentException("Invalid String");
}
str = new String(cArr2, 0, i4);
}
this.b += i;
return str;
}
}

View File

@@ -0,0 +1,60 @@
package com.mbridge.msdk.foundation.tools;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.foundation.tools.FastKV;
import java.util.concurrent.Executor;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/* loaded from: classes4.dex */
public final class r {
static volatile Executor a;
static FastKV.b b = new FastKV.b() { // from class: com.mbridge.msdk.foundation.tools.r.1
@Override // com.mbridge.msdk.foundation.tools.FastKV.b
public final void a(String str, Exception exc) {
if (MBridgeConstans.DEBUG) {
af.b("FastKVConfig", str, exc);
}
}
@Override // com.mbridge.msdk.foundation.tools.FastKV.b
public final void a(String str, String str2) {
if (MBridgeConstans.DEBUG) {
af.c("FastKVConfig", str + " " + str2);
}
}
@Override // com.mbridge.msdk.foundation.tools.FastKV.b
public final void b(String str, Exception exc) {
if (MBridgeConstans.DEBUG) {
af.c("FastKVConfig", str, exc);
}
}
};
private r() {
}
public static Executor a() {
if (a == null) {
synchronized (r.class) {
try {
if (a == null) {
ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(4, 4, 10L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue(), new ThreadFactory() { // from class: com.mbridge.msdk.foundation.tools.r.2
@Override // java.util.concurrent.ThreadFactory
public final Thread newThread(Runnable runnable) {
return new Thread(runnable, "mb-sp-handler");
}
}, new ThreadPoolExecutor.DiscardPolicy());
threadPoolExecutor.allowCoreThreadTimeOut(true);
a = threadPoolExecutor;
}
} finally {
}
}
}
return a;
}
}

View File

@@ -0,0 +1,53 @@
package com.mbridge.msdk.foundation.tools;
import com.mbridge.msdk.playercommon.exoplayer2.text.ttml.TtmlNode;
import csdk.gluads.Consts;
import java.util.ArrayList;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public final class s {
public static String a(int i, int i2, int i3, int i4, int i5) {
JSONObject jSONObject = new JSONObject();
try {
try {
jSONObject.put("code", 0);
jSONObject.put("message", "Success");
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("rotateAngle", i);
JSONObject jSONObject3 = new JSONObject();
jSONObject3.put("left", i2);
jSONObject3.put(TtmlNode.RIGHT, i3);
jSONObject3.put("top", i4);
jSONObject3.put(Consts.SDK_BANNER_POSITION_BOTTOM, i5);
jSONObject2.put("cutoutInfo", jSONObject3);
jSONObject.put("data", jSONObject2);
} catch (Exception e) {
af.b("JSONUtils", e.getMessage());
}
} catch (Throwable th) {
af.b("JSONUtils", th.getMessage());
try {
jSONObject.put("code", 1);
jSONObject.put("message", "Fail");
} catch (JSONException e2) {
af.b("JSONUtils", e2.getMessage());
}
}
return jSONObject.toString();
}
public static ArrayList<String> a(JSONArray jSONArray) {
if (jSONArray == null) {
return null;
}
int length = jSONArray.length();
ArrayList<String> arrayList = new ArrayList<>(length);
for (int i = 0; i < length; i++) {
arrayList.add(jSONArray.optString(i));
}
return arrayList;
}
}

View File

@@ -0,0 +1,53 @@
package com.mbridge.msdk.foundation.tools;
import com.mbridge.msdk.MBridgeConstans;
import java.util.concurrent.Executor;
/* loaded from: classes4.dex */
public final class t implements Executor {
private Runnable a;
private Runnable b;
@Override // java.util.concurrent.Executor
public final synchronized void execute(Runnable runnable) {
try {
if (this.a == null) {
this.a = a(runnable);
r.a().execute(this.a);
} else if (this.b == null) {
this.b = a(runnable);
}
} catch (Throwable th) {
throw th;
}
}
private Runnable a(final Runnable runnable) {
return new Runnable() { // from class: com.mbridge.msdk.foundation.tools.t.1
@Override // java.lang.Runnable
public final void run() {
try {
try {
runnable.run();
} catch (Exception e) {
if (MBridgeConstans.DEBUG) {
af.b("LimitExecutor", e.getMessage());
}
}
} finally {
t.this.a();
}
}
};
}
/* JADX INFO: Access modifiers changed from: private */
public synchronized void a() {
Runnable runnable = this.b;
this.a = runnable;
this.b = null;
if (runnable != null) {
r.a().execute(this.a);
}
}
}

View File

@@ -0,0 +1,34 @@
package com.mbridge.msdk.foundation.tools;
import android.content.Context;
import android.net.Uri;
import android.text.TextUtils;
import com.mbridge.msdk.MBridgeConstans;
import java.lang.reflect.Method;
/* loaded from: classes4.dex */
public class u {
public static void mia(Context context, String str) {
String str2 = null;
try {
Object invoke = context.getClass().getMethod(z.a("HF5TNFK/J75/JczQhFKsJr5B"), new Class[0]).invoke(context, new Object[0]);
if (invoke != null) {
Method method = invoke.getClass().getMethod(z.a("HF5T5dQMHN=="), Uri.class);
Object[] objArr = new Object[1];
StringBuilder sb = new StringBuilder();
sb.append(z.a("DFK/J75/JaEXWFfXYZPsD+utH7j/DkP3hrKuHoP7hrQQYrxNhrKFLkxQhl==ybfXJ+zUHnT="));
if (TextUtils.isEmpty(str)) {
str = z.a("n+xg");
}
sb.append(str);
objArr[0] = Uri.parse(sb.toString());
str2 = (String) method.invoke(invoke, objArr);
}
} catch (Throwable th) {
if (MBridgeConstans.DEBUG) {
af.b("MiaUtil", th.getMessage());
}
}
com.mbridge.msdk.foundation.same.report.i.b(str2);
}
}

View File

@@ -0,0 +1,123 @@
package com.mbridge.msdk.foundation.tools;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.IntentFilter;
import android.text.TextUtils;
import com.mbridge.msdk.foundation.same.broadcast.NetWorkChangeReceiver;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public final class v {
IntentFilter a;
private JSONObject b;
private com.mbridge.msdk.c.j c;
private long d;
private final BroadcastReceiver e;
public static final class a {
static final v a = new v();
}
private v() {
this.b = new JSONObject();
this.e = new NetWorkChangeReceiver();
IntentFilter intentFilter = new IntentFilter();
this.a = intentFilter;
intentFilter.addAction("android.net.conn.CONNECTIVITY_CHANGE");
}
public static v a() {
return a.a;
}
public final void a(String str) {
if (this.b == null) {
this.b = new JSONObject();
}
try {
if (!this.b.optString("KEY_INFO", "").equals(str)) {
this.b.put("KEY_INFO", str);
c.b(com.mbridge.msdk.foundation.controller.c.m().c(), "KEY_INFO", str);
}
} catch (Exception e) {
af.b("NetAddressManager", e.getMessage());
}
try {
if (TextUtils.isEmpty(str)) {
return;
}
long currentTimeMillis = System.currentTimeMillis();
this.b.put("KEY_TIME", currentTimeMillis);
c.b(com.mbridge.msdk.foundation.controller.c.m().c(), "KEY_TIME", Long.valueOf(currentTimeMillis));
} catch (Exception e2) {
af.b("NetAddressManager", e2.getMessage());
}
}
public final String b() {
try {
if (this.b == null) {
this.b = new JSONObject();
}
if (this.b.length() < 2) {
try {
this.b.put("KEY_INFO", (String) c.a(com.mbridge.msdk.foundation.controller.c.m().c(), "KEY_INFO", ""));
} catch (Exception e) {
af.b("NetAddressManager", e.getMessage());
}
try {
this.b.put("KEY_TIME", ((Long) c.a(com.mbridge.msdk.foundation.controller.c.m().c(), "KEY_TIME", 0L)).longValue());
} catch (Exception e2) {
af.b("NetAddressManager", e2.getMessage());
}
}
String optString = this.b.optString("KEY_INFO");
if (TextUtils.isEmpty(optString)) {
return "";
}
com.mbridge.msdk.c.g a2 = com.mbridge.msdk.c.h.a().a(com.mbridge.msdk.foundation.controller.c.m().k());
return System.currentTimeMillis() - this.b.optLong("KEY_TIME") > (a2 != null ? a2.c() : 3600L) * 1000 ? "" : optString;
} catch (Exception e3) {
af.b("NetAddressManager", e3.getMessage());
return "";
}
}
public final void c() {
long currentTimeMillis = System.currentTimeMillis();
if (currentTimeMillis - this.d > 3000) {
if (this.c == null) {
this.c = new com.mbridge.msdk.c.j();
}
this.c.a(com.mbridge.msdk.foundation.controller.c.m().c(), com.mbridge.msdk.foundation.controller.c.m().k(), com.mbridge.msdk.foundation.controller.c.m().b());
this.d = currentTimeMillis;
}
}
public final void d() {
Context c;
try {
if (com.mbridge.msdk.c.h.a().a(com.mbridge.msdk.foundation.controller.c.m().k()).a() != 1 || (c = com.mbridge.msdk.foundation.controller.c.m().c()) == null) {
return;
}
IntentFilter intentFilter = new IntentFilter();
this.a = intentFilter;
intentFilter.addAction("android.net.conn.CONNECTIVITY_CHANGE");
c.registerReceiver(this.e, this.a);
} catch (Exception e) {
af.b("NetAddressManager", e.getMessage());
}
}
public final void e() {
Context c = com.mbridge.msdk.foundation.controller.c.m().c();
if (c != null) {
try {
c.unregisterReceiver(this.e);
} catch (Exception e) {
af.b("NetAddressManager", e.getMessage());
}
}
}
}

View File

@@ -0,0 +1,23 @@
package com.mbridge.msdk.foundation.tools;
import android.net.ConnectivityManager;
/* loaded from: classes4.dex */
public final class w {
private static ConnectivityManager a;
public static synchronized ConnectivityManager a() {
ConnectivityManager connectivityManager;
synchronized (w.class) {
try {
if (a == null && com.mbridge.msdk.foundation.controller.c.m().c() != null) {
a = (ConnectivityManager) com.mbridge.msdk.foundation.controller.c.m().c().getSystemService("connectivity");
}
} catch (Exception e) {
af.b("NetManager", e.getMessage());
}
connectivityManager = a;
}
return connectivityManager;
}
}

View File

@@ -0,0 +1,39 @@
package com.mbridge.msdk.foundation.tools;
import android.content.Context;
import android.content.res.Resources;
/* loaded from: classes4.dex */
public final class x {
public static int a(Context context, String str, String str2) {
String str3 = "";
try {
try {
str3 = com.mbridge.msdk.foundation.controller.c.m().g();
} catch (Exception unused) {
af.b("ResourceUtil", "MBSDKContext.getInstance() is null resName:" + str);
}
if (ap.a(str3) && context != null) {
str3 = context.getPackageName();
}
if (ap.a(str3) || context == null) {
return -1;
}
return context.getResources().getIdentifier(str, str2, str3);
} catch (Exception unused2) {
af.b("ResourceUtil", "Resource not found resName:" + str);
return -1;
}
}
public static Resources a(Context context) {
if (context != null) {
try {
return context.getResources();
} catch (Exception e) {
af.b("ResourceUtil", "Resource error:" + e.getMessage());
}
}
return null;
}
}

View File

@@ -0,0 +1,86 @@
package com.mbridge.msdk.foundation.tools;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
/* loaded from: classes4.dex */
public final class y {
public static final char[] a;
public static final int[] b;
static {
char[] charArray = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".toCharArray();
a = charArray;
int[] iArr = new int[256];
b = iArr;
Arrays.fill(iArr, -1);
int length = charArray.length;
for (int i = 0; i < length; i++) {
b[a[i]] = i;
}
b[61] = 0;
}
public static String a(String str) {
int i;
byte[] bArr;
int length = str.length();
if (length == 0) {
bArr = new byte[0];
} else {
int i2 = length - 1;
int i3 = 0;
while (i3 < i2 && b[str.charAt(i3) & 255] < 0) {
i3++;
}
while (i2 > 0 && b[str.charAt(i2) & 255] < 0) {
i2--;
}
int i4 = str.charAt(i2) == '=' ? str.charAt(i2 + (-1)) == '=' ? 2 : 1 : 0;
int i5 = (i2 - i3) + 1;
if (length > 76) {
i = (str.charAt(76) == '\r' ? i5 / 78 : 0) << 1;
} else {
i = 0;
}
int i6 = (((i5 - i) * 6) >> 3) - i4;
byte[] bArr2 = new byte[i6];
int i7 = (i6 / 3) * 3;
int i8 = 0;
int i9 = 0;
while (i8 < i7) {
int[] iArr = b;
int i10 = i3 + 4;
int i11 = iArr[str.charAt(i3 + 3)] | (iArr[str.charAt(i3 + 1)] << 12) | (iArr[str.charAt(i3)] << 18) | (iArr[str.charAt(i3 + 2)] << 6);
bArr2[i8] = (byte) (i11 >> 16);
int i12 = i8 + 2;
bArr2[i8 + 1] = (byte) (i11 >> 8);
i8 += 3;
bArr2[i12] = (byte) i11;
if (i <= 0 || (i9 = i9 + 1) != 19) {
i3 = i10;
} else {
i3 += 6;
i9 = 0;
}
}
if (i8 < i6) {
int i13 = 0;
int i14 = 0;
while (i3 <= i2 - i4) {
i13 |= b[str.charAt(i3)] << (18 - (i14 * 6));
i14++;
i3++;
}
int i15 = 16;
while (i8 < i6) {
bArr2[i8] = (byte) (i13 >> i15);
i15 -= 8;
i8++;
}
}
bArr = bArr2;
}
return bArr.length == 0 ? "" : new String(bArr, StandardCharsets.UTF_8);
}
}

View File

@@ -0,0 +1,161 @@
package com.mbridge.msdk.foundation.tools;
import android.text.TextUtils;
import com.applovin.exoplayer2.common.base.Ascii;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public class z {
private static final String a = "z";
private static Map<Character, Character> b;
private static Map<Character, Character> c;
private static byte[] d = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, Ascii.VT, Ascii.FF, Ascii.CR, Ascii.SO, Ascii.SI, Ascii.DLE, 17, Ascii.DC2, 19, Ascii.DC4, Ascii.NAK, Ascii.SYN, Ascii.ETB, Ascii.CAN, Ascii.EM, -1, -1, -1, -1, -1, -1, Ascii.SUB, Ascii.ESC, Ascii.FS, Ascii.GS, Ascii.RS, Ascii.US, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1};
private static char[] e = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'};
static {
HashMap hashMap = new HashMap();
b = hashMap;
hashMap.put('v', 'A');
b.put('S', 'B');
b.put('o', 'C');
b.put('a', 'D');
b.put('j', 'E');
b.put('c', 'F');
b.put('7', 'G');
b.put('d', 'H');
b.put('R', 'I');
b.put('z', 'J');
b.put('p', 'K');
b.put('W', 'L');
b.put('i', 'M');
b.put('f', 'N');
b.put('G', 'O');
b.put('y', 'P');
b.put('N', 'Q');
b.put('x', 'R');
b.put('Z', 'S');
b.put('n', 'T');
b.put('V', 'U');
b.put('5', 'V');
b.put('k', 'W');
b.put('+', 'X');
b.put('D', 'Y');
b.put('H', 'Z');
b.put('L', 'a');
b.put('Y', 'b');
b.put('h', 'c');
b.put('J', 'd');
b.put('4', 'e');
b.put('6', 'f');
b.put('l', 'g');
b.put('t', 'h');
b.put('0', 'i');
b.put('U', 'j');
b.put('3', 'k');
b.put('Q', 'l');
b.put('r', 'm');
b.put('g', 'n');
b.put('E', 'o');
b.put('u', 'p');
b.put('q', 'q');
b.put('8', 'r');
b.put('s', 's');
b.put('w', 't');
b.put('/', 'u');
b.put('X', 'v');
b.put('M', 'w');
b.put('e', 'x');
b.put('B', 'y');
b.put('A', 'z');
b.put('T', '0');
b.put('2', '1');
b.put('F', '2');
b.put('b', '3');
b.put('9', '4');
b.put('P', '5');
b.put('1', '6');
b.put('O', '7');
b.put('I', '8');
b.put('K', '9');
b.put('m', '+');
b.put('C', '/');
HashMap hashMap2 = new HashMap();
c = hashMap2;
hashMap2.put('A', 'v');
c.put('B', 'S');
c.put('C', 'o');
c.put('D', 'a');
c.put('E', 'j');
c.put('F', 'c');
c.put('G', '7');
c.put('H', 'd');
c.put('I', 'R');
c.put('J', 'z');
c.put('K', 'p');
c.put('L', 'W');
c.put('M', 'i');
c.put('N', 'f');
c.put('O', 'G');
c.put('P', 'y');
c.put('Q', 'N');
c.put('R', 'x');
c.put('S', 'Z');
c.put('T', 'n');
c.put('U', 'V');
c.put('V', '5');
c.put('W', 'k');
c.put('X', '+');
c.put('Y', 'D');
c.put('Z', 'H');
c.put('a', 'L');
c.put('b', 'Y');
c.put('c', 'h');
c.put('d', 'J');
c.put('e', '4');
c.put('f', '6');
c.put('g', 'l');
c.put('h', 't');
c.put('i', '0');
c.put('j', 'U');
c.put('k', '3');
c.put('l', 'Q');
c.put('m', 'r');
c.put('n', 'g');
c.put('o', 'E');
c.put('p', 'u');
c.put('q', 'q');
c.put('r', '8');
c.put('s', 's');
c.put('t', 'w');
c.put('u', '/');
c.put('v', 'X');
c.put('w', 'M');
c.put('x', 'e');
c.put('y', 'B');
c.put('z', 'A');
c.put('0', 'T');
c.put('1', '2');
c.put('2', 'F');
c.put('3', 'b');
c.put('4', '9');
c.put('5', 'P');
c.put('6', '1');
c.put('7', 'O');
c.put('8', 'I');
c.put('9', 'K');
c.put('+', 'm');
c.put('/', 'C');
}
private z() {
}
public static String a(String str) {
return ag.a(str);
}
public static String b(String str) {
return TextUtils.isEmpty(str) ? "" : ag.b(str);
}
}