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

View File

@@ -0,0 +1,35 @@
package com.ironsource.sdk.utils;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public class IronSourceQaProperties {
private static IronSourceQaProperties a;
private static Map<String, String> b = new HashMap();
private IronSourceQaProperties() {
}
public static IronSourceQaProperties getInstance() {
if (a == null) {
a = new IronSourceQaProperties();
}
return a;
}
public static boolean isInitialized() {
return a != null;
}
public Map<String, String> getParameters() {
return b;
}
public void setQaParameter(String str, String str2) {
if (str == null || str2 == null) {
return;
}
b.put(str, str2);
}
}

View File

@@ -0,0 +1,343 @@
package com.ironsource.sdk.utils;
import android.content.Context;
import android.os.Build;
import com.ironsource.ce;
import com.ironsource.el;
import com.ironsource.hs;
import com.ironsource.i9;
import com.ironsource.mediationsdk.logger.IronLog;
import com.ironsource.v8;
import com.ironsource.zf;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.util.ArrayList;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public class IronSourceStorageUtils {
private static final String a = "supersonicads";
private static hs b = null;
private static boolean c = false;
private static void a(Context context) {
hs hsVar = b;
if (hsVar != null && hsVar.b()) {
deleteCacheDirectories(context);
}
hs hsVar2 = b;
if (hsVar2 == null || !hsVar2.c()) {
return;
}
deleteFilesDirectories(context);
}
private static void a(File file) {
if (file != null) {
deleteFolder(b(file).getPath());
}
}
private static boolean a() {
hs hsVar;
return Build.VERSION.SDK_INT > 29 && (hsVar = b) != null && hsVar.a();
}
private static File b(Context context) {
ce f = el.N().f();
hs hsVar = b;
return (hsVar == null || !hsVar.d()) ? f.t(context) : f.e(context);
}
private static File b(File file) {
StringBuilder sb = new StringBuilder();
sb.append(file.getAbsolutePath());
String str = File.separator;
sb.append(str);
sb.append(a);
sb.append(str);
return new File(sb.toString());
}
public static String buildAbsolutePathToDirInCache(String str, String str2) {
if (str2 == null) {
return str;
}
return str + File.separator + str2;
}
public static JSONObject buildFilesMap(String str, String str2) {
Object c2;
String name;
File file = new File(str, str2);
JSONObject jSONObject = new JSONObject();
File[] listFiles = file.listFiles();
if (listFiles != null) {
for (File file2 : listFiles) {
try {
c2 = c(file2);
} catch (JSONException e) {
i9.d().a(e);
IronLog.INTERNAL.error(e.toString());
}
if (c2 instanceof JSONArray) {
name = "files";
} else if (c2 instanceof JSONObject) {
name = file2.getName();
}
jSONObject.put(name, c(file2));
}
}
return jSONObject;
}
public static JSONObject buildFilesMapOfDirectory(zf zfVar, JSONObject jSONObject) throws Exception {
String name;
JSONObject buildFilesMapOfDirectory;
if (zfVar == null || !zfVar.isDirectory()) {
return new JSONObject();
}
File[] listFiles = zfVar.listFiles();
if (listFiles == null) {
return new JSONObject();
}
JSONObject jSONObject2 = new JSONObject();
for (File file : listFiles) {
zf zfVar2 = new zf(file.getPath());
if (zfVar2.isFile()) {
name = zfVar2.getName();
buildFilesMapOfDirectory = zfVar2.a();
if (jSONObject.has(name)) {
buildFilesMapOfDirectory = SDKUtils.mergeJSONObjects(buildFilesMapOfDirectory, jSONObject.getJSONObject(name));
}
} else if (zfVar2.isDirectory()) {
name = zfVar2.getName();
buildFilesMapOfDirectory = buildFilesMapOfDirectory(zfVar2, jSONObject);
}
jSONObject2.put(name, buildFilesMapOfDirectory);
}
return jSONObject2;
}
private static File c(Context context) {
ce f = el.N().f();
hs hsVar = b;
return (hsVar == null || !hsVar.d()) ? f.v(context) : f.k(context);
}
private static Object c(File file) {
JSONObject jSONObject = new JSONObject();
JSONArray jSONArray = new JSONArray();
try {
} catch (JSONException e) {
i9.d().a(e);
IronLog.INTERNAL.error(e.toString());
}
if (file.isFile()) {
jSONArray.put(file.getName());
return jSONArray;
}
for (File file2 : file.listFiles()) {
if (file2.isDirectory()) {
jSONObject.put(file2.getName(), c(file2));
} else {
jSONArray.put(file2.getName());
jSONObject.put("files", jSONArray);
}
}
return jSONObject;
}
public static void deleteCacheDirectories(Context context) {
ce f = el.N().f();
a(f.e(context));
a(f.k(context));
}
public static synchronized boolean deleteFile(zf zfVar) {
synchronized (IronSourceStorageUtils.class) {
if (!zfVar.exists()) {
return false;
}
return zfVar.delete();
}
}
public static void deleteFilesDirectories(Context context) {
ce f = el.N().f();
a(f.t(context));
a(f.v(context));
}
public static synchronized boolean deleteFolder(String str) {
boolean z;
synchronized (IronSourceStorageUtils.class) {
File file = new File(str);
if (deleteFolderContentRecursive(file)) {
z = file.delete();
}
}
return z;
}
public static boolean deleteFolderContentRecursive(File file) {
File[] listFiles = file.listFiles();
boolean z = true;
if (listFiles != null) {
for (File file2 : listFiles) {
if (file2.isDirectory()) {
z &= deleteFolderContentRecursive(file2);
}
if (!file2.delete()) {
z = false;
}
}
}
return z;
}
public static void ensurePathSafety(File file, String str) throws Exception {
hs hsVar = b;
if (hsVar == null || !hsVar.e()) {
String canonicalPath = new File(str).getCanonicalPath();
String canonicalPath2 = file.getCanonicalPath();
if (canonicalPath2.startsWith(canonicalPath)) {
return;
}
throw new Exception(v8.c.u + canonicalPath2);
}
}
public static String getCachedFilesMap(String str, String str2) {
JSONObject buildFilesMap = buildFilesMap(str, str2);
try {
buildFilesMap.put("path", str2);
} catch (JSONException e) {
i9.d().a(e);
IronLog.INTERNAL.error(e.toString());
}
return buildFilesMap.toString();
}
public static String getDiskCacheDirPath(Context context) {
File b2;
if (!a() || !SDKUtils.isExternalStorageAvailable() || (b2 = b(context)) == null || !b2.canWrite()) {
return c(context).getPath();
}
c = true;
return b2.getPath();
}
public static ArrayList<zf> getFilesInFolderRecursive(zf zfVar) {
if (zfVar == null || !zfVar.isDirectory()) {
return new ArrayList<>();
}
ArrayList<zf> arrayList = new ArrayList<>();
File[] listFiles = zfVar.listFiles();
if (listFiles != null) {
for (File file : listFiles) {
zf zfVar2 = new zf(file.getPath());
if (zfVar2.isDirectory()) {
arrayList.addAll(getFilesInFolderRecursive(zfVar2));
}
if (zfVar2.isFile()) {
arrayList.add(zfVar2);
}
}
}
return arrayList;
}
public static String getNetworkStorageDir(Context context) {
File b2 = b(new File(getDiskCacheDirPath(context)));
if (!b2.exists()) {
b2.mkdir();
}
return b2.getPath();
}
public static long getTotalSizeOfDir(zf zfVar) {
long totalSizeOfDir;
long j = 0;
if (zfVar != null && zfVar.isDirectory()) {
File[] listFiles = zfVar.listFiles();
if (listFiles == null) {
return 0L;
}
for (File file : listFiles) {
zf zfVar2 = new zf(file.getPath());
if (zfVar2.isFile()) {
totalSizeOfDir = zfVar2.length();
} else if (zfVar2.isDirectory()) {
totalSizeOfDir = getTotalSizeOfDir(zfVar2);
}
j += totalSizeOfDir;
}
}
return j;
}
public static void initializeCacheDirectory(Context context, hs hsVar) {
b = hsVar;
a(context);
}
public static boolean isPathExist(String str, String str2) {
return new File(str, str2).exists();
}
public static boolean isUxt() {
return c;
}
public static String makeDir(String str) {
File file = new File(str);
if (file.exists() || file.mkdirs()) {
return file.getPath();
}
return null;
}
public static String readFile(zf zfVar) throws Exception {
StringBuilder sb = new StringBuilder();
BufferedReader bufferedReader = new BufferedReader(new FileReader(zfVar));
while (true) {
String readLine = bufferedReader.readLine();
if (readLine == null) {
bufferedReader.close();
return sb.toString();
}
sb.append(readLine);
sb.append('\n');
}
}
public static boolean renameFile(String str, String str2) throws Exception {
return new File(str).renameTo(new File(str2));
}
public static int saveFile(byte[] bArr, String str) throws Exception {
FileOutputStream fileOutputStream = new FileOutputStream(new File(str));
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bArr);
try {
byte[] bArr2 = new byte[102400];
int i = 0;
while (true) {
int read = byteArrayInputStream.read(bArr2);
if (read == -1) {
return i;
}
fileOutputStream.write(bArr2, 0, read);
i += read;
}
} finally {
fileOutputStream.close();
byteArrayInputStream.close();
}
}
}

View File

@@ -0,0 +1,59 @@
package com.ironsource.sdk.utils;
import android.text.TextUtils;
import android.util.Log;
import com.ironsource.qf;
/* loaded from: classes4.dex */
public class Logger {
private static boolean a;
public static void d(String str, String str2) {
}
public static void d(String str, String str2, Throwable th) {
}
public static void e(String str, String str2) {
if (a) {
Log.e(str, str2);
}
}
public static void e(String str, String str2, Throwable th) {
if (a) {
Log.e(str, str2, th);
}
}
public static void enableLogging(int i) {
a = qf.d.MODE_0.a() != i;
}
public static void i(String str, String str2) {
}
public static void i(String str, String str2, Throwable th) {
if (a) {
TextUtils.isEmpty(str2);
}
}
public static void v(String str, String str2) {
}
public static void v(String str, String str2, Throwable th) {
}
public static void w(String str, String str2) {
if (a) {
Log.w(str, str2);
}
}
public static void w(String str, String str2, Throwable th) {
if (a) {
Log.w(str, str2, th);
}
}
}

View File

@@ -0,0 +1,457 @@
package com.ironsource.sdk.utils;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.Resources;
import android.os.Environment;
import android.text.TextUtils;
import android.util.TypedValue;
import android.view.View;
import com.ironsource.ce;
import com.ironsource.el;
import com.ironsource.i9;
import com.ironsource.mediationsdk.logger.IronLog;
import com.ironsource.qf;
import com.ironsource.sdk.controller.ControllerActivity;
import com.ironsource.sdk.controller.OpenUrlActivity;
import com.ironsource.v8;
import com.ironsource.wp;
import com.mbridge.msdk.foundation.tools.SameMD5;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public class SDKUtils {
private static final String a = "SDKUtils";
private static String b = null;
private static String c = null;
private static String d = null;
private static int e = 0;
private static String f = null;
private static Map<String, String> g = null;
private static String h = "";
private static final AtomicInteger i = new AtomicInteger(1);
public class a implements DialogInterface.OnClickListener {
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
}
private static int a() {
AtomicInteger atomicInteger;
int i2;
int i3;
do {
atomicInteger = i;
i2 = atomicInteger.get();
i3 = i2 + 1;
if (i3 > 16777215) {
i3 = 1;
}
} while (!atomicInteger.compareAndSet(i2, i3));
return i2;
}
public static int convertDpToPx(int i2) {
return (int) TypedValue.applyDimension(0, i2, Resources.getSystem().getDisplayMetrics());
}
public static int convertPxToDp(int i2) {
return (int) TypedValue.applyDimension(1, i2, Resources.getSystem().getDisplayMetrics());
}
public static String decodeString(String str) {
try {
return URLDecoder.decode(str, "UTF-8");
} catch (UnsupportedEncodingException e2) {
i9.d().a(e2);
Logger.d(a, "Failed decoding string " + e2.getMessage());
return "";
}
}
public static int dpToPx(long j) {
return (int) ((j * Resources.getSystem().getDisplayMetrics().density) + 0.5f);
}
public static String encodeString(String str) {
try {
return URLEncoder.encode(str, "UTF-8").replace("+", "%20");
} catch (UnsupportedEncodingException e2) {
i9.d().a(e2);
return "";
}
}
/* JADX WARN: Removed duplicated region for block: B:10:0x0034 A[RETURN] */
/* JADX WARN: Removed duplicated region for block: B:7:0x002f */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static byte[] encrypt(java.lang.String r3) {
/*
r0 = 0
java.lang.String r1 = "SHA-1"
java.security.MessageDigest r1 = java.security.MessageDigest.getInstance(r1) // Catch: java.io.UnsupportedEncodingException -> L18 java.security.NoSuchAlgorithmException -> L1b
r1.reset() // Catch: java.io.UnsupportedEncodingException -> L14 java.security.NoSuchAlgorithmException -> L16
java.lang.String r2 = "UTF-8"
byte[] r3 = r3.getBytes(r2) // Catch: java.io.UnsupportedEncodingException -> L14 java.security.NoSuchAlgorithmException -> L16
r1.update(r3) // Catch: java.io.UnsupportedEncodingException -> L14 java.security.NoSuchAlgorithmException -> L16
goto L2d
L14:
r3 = move-exception
goto L1d
L16:
r3 = move-exception
goto L1d
L18:
r3 = move-exception
L19:
r1 = r0
goto L1d
L1b:
r3 = move-exception
goto L19
L1d:
com.ironsource.i9 r2 = com.ironsource.i9.d()
r2.a(r3)
com.ironsource.mediationsdk.logger.IronLog r2 = com.ironsource.mediationsdk.logger.IronLog.INTERNAL
java.lang.String r3 = r3.toString()
r2.error(r3)
L2d:
if (r1 == 0) goto L34
byte[] r3 = r1.digest()
return r3
L34:
return r0
*/
throw new UnsupportedOperationException("Method not decompiled: com.ironsource.sdk.utils.SDKUtils.encrypt(java.lang.String):byte[]");
}
public static String fetchDemandSourceId(wp wpVar) {
return fetchDemandSourceId(wpVar.a());
}
public static String fetchDemandSourceId(JSONObject jSONObject) {
String optString = jSONObject.optString("demandSourceId");
return !TextUtils.isEmpty(optString) ? optString : jSONObject.optString("demandSourceName");
}
public static String flatMapToJsonAsString(Map<String, String> map) {
JSONObject jSONObject = new JSONObject();
if (map != null) {
Iterator<Map.Entry<String, String>> it = map.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, String> next = it.next();
try {
jSONObject.putOpt(next.getKey(), encodeString(next.getValue()));
} catch (JSONException e2) {
i9.d().a(e2);
Logger.i(a, "flatMapToJsonAsStringfailed " + e2.toString());
}
it.remove();
}
}
return jSONObject.toString();
}
public static int generateViewId() {
return View.generateViewId();
}
public static int getActivityUIFlags(boolean z) {
return z ? 5894 : 1798;
}
public static String getAdvertiserId() {
return b;
}
public static String getControllerConfig() {
return f;
}
public static JSONObject getControllerConfigAsJSONObject() {
try {
return new JSONObject(getControllerConfig());
} catch (Exception e2) {
i9.d().a(e2);
IronLog.INTERNAL.error(e2.toString());
return new JSONObject();
}
}
public static String getControllerUrl() {
return !TextUtils.isEmpty(d) ? d : "";
}
public static int getDebugMode() {
return e;
}
public static String getFileName(String str) {
try {
return URLEncoder.encode(str.split(File.separator)[r1.length - 1].split("\\?")[0], "UTF-8");
} catch (UnsupportedEncodingException e2) {
i9.d().a(e2);
IronLog.INTERNAL.error(e2.toString());
return null;
}
}
public static Map<String, String> getInitSDKParams() {
return g;
}
public static String getLimitAdTracking() {
return c;
}
public static String getMD5(String str) {
try {
String bigInteger = new BigInteger(1, MessageDigest.getInstance(SameMD5.TAG).digest(str.getBytes())).toString(16);
while (bigInteger.length() < 32) {
bigInteger = "0" + bigInteger;
}
return bigInteger;
} catch (NoSuchAlgorithmException e2) {
i9.d().a(e2);
throw new RuntimeException(e2);
}
}
public static int getMinOSVersionSupport() {
return getControllerConfigAsJSONObject().optInt(v8.d.b);
}
public static JSONObject getNetworkConfiguration() {
JSONObject jSONObject = new JSONObject();
try {
return getControllerConfigAsJSONObject().getJSONObject(v8.a.b);
} catch (Exception e2) {
i9.d().a(e2);
IronLog.INTERNAL.error(e2.toString());
return jSONObject;
}
}
public static JSONObject getOrientation(Context context) {
ce f2 = el.N().f();
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("orientation", translateOrientation(f2.E(context)));
} catch (Exception e2) {
i9.d().a(e2);
IronLog.INTERNAL.error(e2.toString());
}
return jSONObject;
}
public static qf.e getProductType(String str) {
qf.e eVar = qf.e.RewardedVideo;
if (str.equalsIgnoreCase(eVar.toString())) {
return eVar;
}
qf.e eVar2 = qf.e.Interstitial;
if (str.equalsIgnoreCase(eVar2.toString())) {
return eVar2;
}
return null;
}
public static String getSDKVersion() {
return "8.4.0";
}
public static String getTesterParameters() {
return h;
}
public static String getValueFromJsonObject(String str, String str2) {
try {
return new JSONObject(str).getString(str2);
} catch (Exception e2) {
i9.d().a(e2);
return null;
}
}
public static boolean isApplicationVisible(Context context) {
String packageName = context.getPackageName();
ActivityManager activityManager = (ActivityManager) context.getSystemService("activity");
if (activityManager == null) {
return false;
}
for (ActivityManager.RunningAppProcessInfo runningAppProcessInfo : activityManager.getRunningAppProcesses()) {
if (runningAppProcessInfo.processName.equalsIgnoreCase(packageName) && runningAppProcessInfo.importance == 100) {
return true;
}
}
return false;
}
public static boolean isExternalStorageAvailable() {
try {
String externalStorageState = Environment.getExternalStorageState();
if (!"mounted".equals(externalStorageState)) {
if (!"mounted_ro".equals(externalStorageState)) {
return false;
}
}
return true;
} catch (Exception e2) {
i9.d().a(e2);
return false;
}
}
public static boolean isIronSourceActivity(Activity activity) {
return (activity instanceof ControllerActivity) || (activity instanceof OpenUrlActivity);
}
public static void loadGoogleAdvertiserInfo(Context context) {
ce f2 = el.N().f();
String p = f2.p(context);
String a2 = f2.a(context);
if (!TextUtils.isEmpty(p)) {
b = p;
}
if (TextUtils.isEmpty(a2)) {
return;
}
c = a2;
}
public static Map<String, String> mergeHashMaps(Map<String, String>[] mapArr) {
HashMap hashMap = new HashMap();
if (mapArr == null) {
return hashMap;
}
for (Map<String, String> map : mapArr) {
if (map != null) {
hashMap.putAll(map);
}
}
return hashMap;
}
public static JSONObject mergeJSONObjects(JSONObject jSONObject, JSONObject jSONObject2) throws Exception {
JSONObject jSONObject3 = new JSONObject();
JSONArray jSONArray = new JSONArray();
if (jSONObject != null) {
jSONObject3 = new JSONObject(jSONObject.toString());
}
if (jSONObject2 != null) {
jSONArray = jSONObject2.names();
}
if (jSONArray != null) {
for (int i2 = 0; i2 < jSONArray.length(); i2++) {
String string = jSONArray.getString(i2);
jSONObject3.putOpt(string, jSONObject2.opt(string));
}
}
return jSONObject3;
}
public static int pxToDp(long j) {
return (int) ((j / Resources.getSystem().getDisplayMetrics().density) + 0.5f);
}
public static String requireNonEmptyOrNull(String str, String str2) {
if (str != null) {
return str;
}
throw new NullPointerException(str2);
}
public static <T> T requireNonNull(T t, String str) {
if (t != null) {
return t;
}
throw new NullPointerException(str);
}
public static void setControllerConfig(String str) {
f = str;
}
public static void setControllerUrl(String str) {
d = str;
}
public static void setDebugMode(int i2) {
e = i2;
}
public static void setInitSDKParams(Map<String, String> map) {
g = map;
}
public static void setTesterParameters(String str) {
h = str;
}
public static void showNoInternetDialog(Context context) {
new AlertDialog.Builder(context).setMessage("No Internet Connection").setPositiveButton("Ok", new a()).show();
}
public static String translateDeviceOrientation(int i2) {
return i2 != 1 ? i2 != 2 ? "none" : "landscape" : "portrait";
}
public static String translateOrientation(int i2) {
return i2 != 1 ? i2 != 2 ? "none" : "landscape" : "portrait";
}
public static String translateRequestedOrientation(int i2) {
if (i2 != 0) {
if (i2 != 1) {
if (i2 != 11) {
if (i2 != 12) {
switch (i2) {
case 6:
case 8:
break;
case 7:
case 9:
break;
default:
return "none";
}
}
}
}
return "portrait";
}
return "landscape";
}
public static void updateControllerConfig(String str, JSONObject jSONObject) {
try {
JSONObject jSONObject2 = new JSONObject(f);
jSONObject2.put(str, jSONObject);
f = jSONObject2.toString();
} catch (JSONException e2) {
i9.d().a(e2);
Logger.i(a, "Unable to update controllerConfigs: " + e2.toString());
}
}
}