GoooBet v1.0版本的 MD5 值为:ff9748f16167bfd7735b669c0a9931c5
以下内容为反编译后的 bw.java 源代码,内容仅作参考
package com.appodeal.ads;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.Shader;
import android.graphics.drawable.BitmapDrawable;
import android.media.MediaMetadataRetriever;
import android.net.Uri;
import android.os.Build;
import android.os.Process;
import android.security.NetworkSecurityPolicy;
import android.text.TextUtils;
import android.util.Base64;
import android.util.Pair;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import com.appodeal.ads.utils.EventsTracker;
import com.appodeal.ads.utils.Log;
import com.appodeal.ads.utils.LogConstants;
import com.google.android.exoplayer2.C;
import com.my.tracker.ads.AdFormat;
import com.unity3d.ads.metadata.MediationMetaData;
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.File;
import java.io.FileOutputStream;
import java.io.Flushable;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.math.BigInteger;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.net.URLDecoder;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.UUID;
import java.util.concurrent.Executor;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class bw {
static final boolean f1127a = !bw.class.desiredAssertionStatus();
private static Boolean b = null;
private static final char[] c = "0123456789abcdef".toCharArray();
public static ComponentName a(Context context, Intent intent) {
List<ResolveInfo> queryIntentActivities = context.getPackageManager().queryIntentActivities(intent, 0);
if (queryIntentActivities.isEmpty()) {
return null;
}
for (ResolveInfo resolveInfo : queryIntentActivities) {
if (resolveInfo.activityInfo.packageName.equals("com.android.vending")) {
return new ComponentName(resolveInfo.activityInfo.packageName, resolveInfo.activityInfo.name);
}
}
return new ComponentName(queryIntentActivities.get(0).activityInfo.packageName, queryIntentActivities.get(0).activityInfo.name);
}
private static Bitmap a(Bitmap bitmap, float f) {
Matrix matrix = new Matrix();
matrix.postRotate(f);
try {
return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
} finally {
bitmap.recycle();
}
}
public static BitmapDrawable a(Context context, String str, boolean z, int i) {
return a(context, str, z, i, 0.0f);
}
public static BitmapDrawable a(Context context, String str, boolean z, int i, float f) {
byte[] decode = Base64.decode(str, 0);
Bitmap decodeByteArray = BitmapFactory.decodeByteArray(decode, 0, decode.length);
if (f != 0.0f) {
decodeByteArray = a(decodeByteArray, f);
}
BitmapDrawable bitmapDrawable = new BitmapDrawable(context.getResources(), decodeByteArray);
if (z) {
bitmapDrawable.setTileModeXY(Shader.TileMode.MIRROR, Shader.TileMode.MIRROR);
}
if (i > 0) {
bitmapDrawable.setAlpha(i);
}
return bitmapDrawable;
}
public static Object a(Class cls, String str) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
Field declaredField = cls.getDeclaredField(str);
declaredField.setAccessible(true);
if (declaredField.isAccessible()) {
return declaredField.get(null);
}
return null;
}
@SafeVarargs
public static Object a(Object obj, Class<?> cls, String str, Pair<Class, Object>... pairArr) throws Exception {
Class<?>[] clsArr;
Object[] objArr;
if (pairArr != null) {
clsArr = new Class[pairArr.length];
objArr = new Object[pairArr.length];
for (int i = 0; i < pairArr.length; i++) {
clsArr[i] = (Class) pairArr[i].first;
objArr[i] = pairArr[i].second;
}
} else {
clsArr = null;
objArr = null;
}
for (int i2 = 10; i2 > 0 && cls != null; i2--) {
try {
Method declaredMethod = cls.getDeclaredMethod(str, clsArr);
declaredMethod.setAccessible(true);
return declaredMethod.invoke(obj, objArr);
} catch (IllegalAccessException | InvocationTargetException unused) {
} catch (NoSuchMethodException unused2) {
cls = cls.getSuperclass();
}
}
return null;
}
public static Object a(Object obj, String str) throws Exception {
Class<?> cls = obj.getClass();
for (int i = 10; i > 0 && cls != null; i--) {
try {
Field declaredField = cls.getDeclaredField(str);
declaredField.setAccessible(true);
return declaredField.get(obj);
} catch (IllegalAccessException unused) {
return null;
} catch (NoSuchFieldException unused2) {
cls = cls.getSuperclass();
}
}
return null;
}
@SafeVarargs
public static Object a(Object obj, String str, Pair<Class, Object>... pairArr) throws Exception {
return a(obj, obj.getClass(), str, pairArr);
}
public static String a(int i) {
StringBuilder sb = new StringBuilder();
if ((i & 1) > 0) {
sb.append(LogConstants.KEY_INTERSTITIAL);
}
if ((i & 2) > 0) {
if (sb.length() > 0) {
sb.append(", ");
}
sb.append("Video");
}
if ((i & 128) > 0) {
if (sb.length() > 0) {
sb.append(", ");
}
sb.append("Rewarded video");
}
if ((i & 3164) > 0) {
if (sb.length() > 0) {
sb.append(", ");
}
sb.append(LogConstants.KEY_BANNER);
}
if ((i & 256) > 0) {
if (sb.length() > 0) {
sb.append(", ");
}
sb.append("MREC");
}
if ((i & 512) > 0) {
if (sb.length() > 0) {
sb.append(", ");
}
sb.append("NativeAd");
}
return sb.toString();
}
public static String a(Context context, JSONArray jSONArray, Runnable runnable) {
if (jSONArray != null) {
try {
if (jSONArray.length() != 0) {
String str = "";
boolean z = false;
for (int i = 0; i < jSONArray.length() && !z; i++) {
str = jSONArray.getString(i);
z = a(context, str, runnable);
}
return str;
}
} catch (Exception e) {
Log.log(e);
bt.a(runnable);
return "";
}
}
bt.a(runnable);
return "";
}
public static String a(Uri uri, String str) {
FileOutputStream fileOutputStream;
MediaMetadataRetriever mediaMetadataRetriever = new MediaMetadataRetriever();
mediaMetadataRetriever.setDataSource(bo.e, uri);
Bitmap frameAtTime = mediaMetadataRetriever.getFrameAtTime(Long.parseLong(mediaMetadataRetriever.extractMetadata(9)), 2);
?? r1 = 0;
try {
if (frameAtTime != null) {
try {
File file = new File(e(bo.e, str), g(uri.toString()));
fileOutputStream = new FileOutputStream(file);
try {
frameAtTime.compress(Bitmap.CompressFormat.JPEG, 100, fileOutputStream);
String absolutePath = file.getAbsolutePath();
a((Flushable) fileOutputStream);
a((Closeable) fileOutputStream);
return absolutePath;
} catch (Exception e) {
e = e;
Log.log(e);
a((Flushable) fileOutputStream);
a((Closeable) fileOutputStream);
return null;
}
} catch (Exception e2) {
e = e2;
fileOutputStream = null;
} catch (Throwable th) {
th = th;
a((Flushable) r1);
a((Closeable) r1);
throw th;
}
}
return null;
} catch (Throwable th2) {
th = th2;
r1 = uri;
}
}
public static String a(InputStream inputStream) {
BufferedReader bufferedReader;
BufferedReader bufferedReader2 = null;
try {
StringBuilder sb = new StringBuilder(inputStream.available());
bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
while (true) {
try {
try {
String readLine = bufferedReader.readLine();
if (readLine == null) {
break;
}
sb.append(readLine);
sb.append('\n');
} catch (Exception e) {
e = e;
Log.log(e);
if (bufferedReader != null) {
try {
bufferedReader.close();
} catch (Exception e2) {
Log.log(e2);
}
}
return null;
}
} catch (Throwable th) {
th = th;
bufferedReader2 = bufferedReader;
if (bufferedReader2 != null) {
try {
bufferedReader2.close();
} catch (Exception e3) {
Log.log(e3);
}
}
throw th;
}
}
if (sb.length() > 0) {
sb.setLength(sb.length() - 1);
}
String sb2 = sb.toString();
try {
bufferedReader.close();
} catch (Exception e4) {
Log.log(e4);
}
return sb2;
} catch (Exception e5) {
e = e5;
bufferedReader = null;
} catch (Throwable th2) {
th = th2;
if (bufferedReader2 != null) {
}
throw th;
}
}
public static String a(JSONObject jSONObject, String str) {
return a(jSONObject, str, (String) null);
}
public static String a(JSONObject jSONObject, String str, String str2) {
return (jSONObject == null || str == null || jSONObject.isNull(str)) ? str2 : jSONObject.optString(str, str2);
}
public static void a(Context context, String str) {
bp.a(context).a().putString("appKey", str).apply();
}
public static void a(final Context context, final String str, final String str2) {
if (aa.a(context) && l(context)) {
bt.a(new Runnable() {
@Override
public void run() {
new AlertDialog.Builder(context).setTitle(str).setMessage(str2).setCancelable(true).setNegativeButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.cancel();
}
}).create().show();
}
});
Log.log(LogConstants.KEY_SDK, LogConstants.EVENT_SHOW_DIALOG, str2);
}
}
public static void a(AdType adType, com.appodeal.ads.b.a aVar) {
a(adType.getDisplayName(), aVar.a(), aVar.b());
}
public static void a(Closeable closeable) {
if (closeable != null) {
try {
closeable.close();
} catch (Exception e) {
Log.log(e);
}
}
}
public static void a(File file) {
if (file.isDirectory()) {
for (File file2 : file.listFiles()) {
a(file2);
}
}
file.delete();
}
public static void a(Flushable flushable) {
if (flushable != null) {
try {
flushable.flush();
} catch (Exception e) {
Log.log(e);
}
}
}
public static void a(Object obj, String str, Object obj2) throws Exception {
Class<?> cls = obj.getClass();
for (int i = 10; i > 0 && cls != null; i--) {
try {
Field declaredField = cls.getDeclaredField(str);
declaredField.setAccessible(true);
declaredField.set(obj, obj2);
} catch (IllegalAccessException unused) {
} catch (NoSuchFieldException unused2) {
cls = cls.getSuperclass();
}
}
}
private static void a(String str, List<JSONObject> list, List<JSONObject> list2) {
if (bo.q() == Log.LogLevel.none) {
return;
}
StringBuilder sb = new StringBuilder();
sb.append(String.format("%s waterfall:", c(str)));
int i = 3;
if (list != null && !list.isEmpty()) {
ArrayList<JSONObject> arrayList = new ArrayList(list);
sb.append("\n Precache:\n ");
for (JSONObject jSONObject : arrayList) {
if (jSONObject.has(MediationMetaData.KEY_NAME)) {
Locale locale = Locale.ENGLISH;
Object[] objArr = new Object[i];
objArr[0] = c(jSONObject.optString(MediationMetaData.KEY_NAME));
objArr[1] = c(jSONObject.optString("status"));
objArr[2] = Double.valueOf(jSONObject.optDouble("ecpm", 0.0d));
sb.append(String.format(locale, "%s (%s), eCPM: %.2f; ", objArr));
} else {
sb.append(String.format(Locale.ENGLISH, "%s, eCPM: %.2f; ", c(jSONObject.optString("status")), Double.valueOf(jSONObject.optDouble("ecpm", 0.0d))));
}
i = 3;
}
}
if (list2 == null || list2.isEmpty()) {
sb.append("\n Ads: Empty");
} else {
ArrayList<JSONObject> arrayList2 = new ArrayList(list2);
sb.append("\n Ads:");
int i2 = 100;
int i3 = 100;
for (JSONObject jSONObject2 : arrayList2) {
if (i3 >= i2) {
sb.append("\n ");
i3 = 0;
}
String format = jSONObject2.has(MediationMetaData.KEY_NAME) ? String.format(Locale.ENGLISH, "%s (%s), eCPM: %.2f; ", c(jSONObject2.optString(MediationMetaData.KEY_NAME)), c(jSONObject2.optString("status")), Double.valueOf(jSONObject2.optDouble("ecpm", 0.0d))) : String.format(Locale.ENGLISH, "%s, eCPM: %.2f; ", c(jSONObject2.optString("status")), Double.valueOf(jSONObject2.optDouble("ecpm", 0.0d)));
sb.append(format);
i3 += format.length();
i2 = 100;
}
}
Log.log(LogConstants.KEY_SDK, LogConstants.EVENT_DUMP, sb.toString());
}
public static void a(final String str, Executor executor) {
if (TextUtils.isEmpty(str) || executor == null) {
return;
}
executor.execute(new Runnable() {
@Override
public void run() {
HttpURLConnection httpURLConnection;
Exception e;
try {
} catch (Throwable th) {
th = th;
}
try {
try {
httpURLConnection = (HttpURLConnection) new URL(str).openConnection();
} catch (Exception e2) {
Log.log(e2);
}
try {
httpURLConnection.setConnectTimeout(5000);
httpURLConnection.setInstanceFollowRedirects(true);
httpURLConnection.setRequestProperty("Connection", "close");
httpURLConnection.setRequestMethod("GET");
httpURLConnection.getResponseCode();
} catch (Exception e3) {
e = e3;
Log.log(e);
if (httpURLConnection != null) {
httpURLConnection.getInputStream().close();
httpURLConnection.disconnect();
}
}
} catch (Exception e4) {
httpURLConnection = null;
e = e4;
} catch (Throwable th2) {
httpURLConnection = null;
th = th2;
if (httpURLConnection != null) {
try {
httpURLConnection.getInputStream().close();
httpURLConnection.disconnect();
} catch (Exception e5) {
Log.log(e5);
}
}
throw th;
}
if (httpURLConnection != null) {
httpURLConnection.getInputStream().close();
httpURLConnection.disconnect();
}
}
});
}
public static void a(final String str, Executor executor, final Runnable runnable) {
if (TextUtils.isEmpty(str) || executor == null) {
return;
}
executor.execute(new Runnable() {
@Override
public void run() {
Throwable th;
HttpURLConnection httpURLConnection;
Exception e;
HttpURLConnection httpURLConnection2 = null;
try {
try {
try {
httpURLConnection = (HttpURLConnection) new URL(str).openConnection();
try {
httpURLConnection.setConnectTimeout(5000);
httpURLConnection.setInstanceFollowRedirects(true);
httpURLConnection.setRequestProperty("Connection", "close");
httpURLConnection.setRequestMethod("GET");
if ((httpURLConnection.getResponseCode() >= 300 || httpURLConnection.getResponseCode() < 200) && runnable != null) {
runnable.run();
}
} catch (Exception e2) {
e = e2;
if (runnable != null) {
runnable.run();
}
Log.log(e);
if (httpURLConnection != null) {
httpURLConnection.getInputStream().close();
httpURLConnection.disconnect();
}
return;
}
} catch (Throwable th2) {
th = th2;
if (0 != 0) {
try {
httpURLConnection2.getInputStream().close();
httpURLConnection2.disconnect();
} catch (Exception e3) {
Log.log(e3);
}
}
throw th;
}
} catch (Exception e4) {
httpURLConnection = null;
e = e4;
} catch (Throwable th3) {
th = th3;
if (0 != 0) {
}
throw th;
}
if (httpURLConnection != null) {
httpURLConnection.getInputStream().close();
httpURLConnection.disconnect();
}
} catch (Exception e5) {
Log.log(e5);
}
}
});
}
public static boolean a() {
return a("android.support.multidex.MultiDex") || a("androidx.multidex.MultiDex");
}
public static boolean a(Activity activity) {
return (activity == null || activity.getWindow() == null || !activity.getWindow().isActive() || activity.getWindow().getDecorView().getWindowToken() == null) ? false : true;
}
public static boolean a(Context context) {
return bp.a(context).b().contains("appKey");
}
public static boolean a(Context context, int i, int i2) {
try {
TypedArray obtainStyledAttributes = context.getTheme().obtainStyledAttributes(i, new int[]{i2});
boolean hasValue = obtainStyledAttributes.hasValue(0);
obtainStyledAttributes.recycle();
return hasValue;
} catch (Exception e) {
Log.log(e);
return false;
}
}
public static boolean a(final Context context, String str, final Runnable runnable) {
if (TextUtils.isEmpty(str)) {
if (runnable == null) {
return false;
}
bt.a(runnable);
return false;
}
if (!f1127a && str == null) {
throw new AssertionError();
}
final String d = d(str);
if (v.i && a(d)) {
com.appodeal.ads.utils.s.f1302a.execute(new Runnable() {
@Override
public void run() {
bw.i(context, bw.b(d));
Runnable runnable2 = runnable;
if (runnable2 != null) {
bt.a(runnable2);
}
}
});
return true;
}
if (runnable != null) {
bt.a(runnable);
}
return i(context, d);
}
public static boolean a(Rect rect, View view) {
return rect.contains(c(view));
}
public static boolean a(View view) {
return view.getAlpha() == 0.0f;
}
public static boolean a(String str) {
return str.startsWith("http://") || str.startsWith("https://");
}
public static boolean a(String... strArr) {
try {
for (String str : strArr) {
Class.forName(str, false, bo.class.getClassLoader());
}
return true;
} catch (ClassNotFoundException | NoClassDefFoundError unused) {
return false;
}
}
private static byte[] a(String str, byte[] bArr) {
try {
MessageDigest messageDigest = MessageDigest.getInstance(str);
messageDigest.update(bArr);
return messageDigest.digest();
} catch (NoSuchAlgorithmException e) {
Log.log(e);
return null;
}
}
public static byte[] a(byte[] bArr) {
return a("MD5", bArr);
}
public static String b(Context context) {
return bp.a(context).b().getString("appKey", null);
}
static String b(String str) {
URL url;
HttpURLConnection httpURLConnection;
HttpURLConnection httpURLConnection2 = null;
try {
try {
url = new URL(str);
httpURLConnection = (HttpURLConnection) url.openConnection();
} catch (Exception e) {
e = e;
}
try {
try {
httpURLConnection.setInstanceFollowRedirects(false);
httpURLConnection.setConnectTimeout(500);
httpURLConnection.setReadTimeout(500);
switch (httpURLConnection.getResponseCode()) {
case 301:
case 302:
case 303:
case 305:
case 307:
String headerField = httpURLConnection.getHeaderField(LogConstants.EVENT_LOCATION);
if (headerField == null) {
String url2 = url.toString();
if (httpURLConnection != null) {
try {
httpURLConnection.getInputStream().close();
httpURLConnection.disconnect();
} catch (Exception e2) {
Log.log(e2);
}
}
return url2;
}
if (a(headerField)) {
String b2 = b(httpURLConnection.getHeaderField(LogConstants.EVENT_LOCATION));
if (httpURLConnection != null) {
try {
httpURLConnection.getInputStream().close();
httpURLConnection.disconnect();
} catch (Exception e3) {
Log.log(e3);
}
}
return b2;
}
if (new URI(headerField).getScheme() != null) {
if (httpURLConnection != null) {
try {
httpURLConnection.getInputStream().close();
httpURLConnection.disconnect();
} catch (Exception e4) {
Log.log(e4);
}
}
return headerField;
}
try {
String url3 = new URL(url, headerField).toString();
if (url3.trim().length() <= 0) {
if (httpURLConnection != null) {
try {
httpURLConnection.getInputStream().close();
httpURLConnection.disconnect();
} catch (Exception e5) {
Log.log(e5);
}
}
return headerField;
}
String b3 = b(url3);
if (httpURLConnection != null) {
try {
httpURLConnection.getInputStream().close();
httpURLConnection.disconnect();
} catch (Exception e6) {
Log.log(e6);
}
}
return b3;
} catch (Exception e7) {
Log.log(e7);
if (httpURLConnection != null) {
try {
httpURLConnection.getInputStream().close();
httpURLConnection.disconnect();
} catch (Exception e8) {
Log.log(e8);
}
}
return headerField;
}
case 304:
case 306:
default:
String url4 = url.toString();
if (httpURLConnection != null) {
try {
httpURLConnection.getInputStream().close();
httpURLConnection.disconnect();
} catch (Exception e9) {
Log.log(e9);
}
}
return url4;
}
} catch (Throwable th) {
th = th;
httpURLConnection2 = httpURLConnection;
if (httpURLConnection2 != null) {
try {
httpURLConnection2.getInputStream().close();
httpURLConnection2.disconnect();
} catch (Exception e10) {
Log.log(e10);
}
}
throw th;
}
} catch (Exception e11) {
e = e11;
httpURLConnection2 = httpURLConnection;
Log.log(e);
if (httpURLConnection2 != null) {
try {
httpURLConnection2.getInputStream().close();
httpURLConnection2.disconnect();
} catch (Exception e12) {
Log.log(e12);
}
}
return str;
}
} catch (Throwable th2) {
th = th2;
}
}
public static boolean b() {
return Build.VERSION.SDK_INT < 23 || NetworkSecurityPolicy.getInstance().isCleartextTrafficPermitted();
}
public static boolean b(Context context, int i, int i2) {
try {
TypedArray obtainStyledAttributes = context.getTheme().obtainStyledAttributes(i, new int[]{i2});
boolean z = obtainStyledAttributes.getBoolean(0, false);
obtainStyledAttributes.recycle();
return z;
} catch (Exception e) {
Log.log(e);
return false;
}
}
public static boolean b(Context context, String str) {
try {
context.getPackageManager().getApplicationInfo(str, 0);
return true;
} catch (PackageManager.NameNotFoundException unused) {
return false;
}
}
public static boolean b(View view) {
return view.getMeasuredHeight() > 0 && view.getMeasuredWidth() > 0;
}
public static byte[] b(byte[] bArr) {
return a("SHA-224", bArr);
}
public static Activity c() {
Activity a2 = a.a();
return a2 == null ? bo.d : a2;
}
public static Rect c(View view) {
int[] iArr = new int[2];
view.getLocationInWindow(iArr);
return new Rect(iArr[0], iArr[1], view.getWidth() + iArr[0], view.getHeight() + iArr[1]);
}
public static String c(String str) {
if (str == null) {
return "";
}
Matcher matcher = Pattern.compile("_(.)").matcher(str);
StringBuffer stringBuffer = new StringBuffer(str.length());
while (matcher.find()) {
matcher.appendReplacement(stringBuffer, matcher.group(1).toUpperCase(Locale.ENGLISH));
}
matcher.appendTail(stringBuffer);
stringBuffer.setCharAt(0, Character.toUpperCase(str.charAt(0)));
return stringBuffer.toString();
}
public static String c(byte[] bArr) {
char[] cArr = new char[bArr.length * 2];
for (int i = 0; i < bArr.length; i++) {
int i2 = i * 2;
char[] cArr2 = c;
cArr[i2] = cArr2[(bArr[i] >> 4) & 15];
cArr[i2 + 1] = cArr2[bArr[i] & 15];
}
return new String(cArr);
}
public static void c(Context context) {
SharedPreferences b2 = bp.a(context).b();
String string = b2.getString("appodealVersion", null);
if (string == null || !string.equals(bo.k())) {
SharedPreferences.Editor edit = b2.edit();
edit.putString("appodealVersion", bo.k());
edit.apply();
com.appodeal.ads.utils.k.b(context);
}
}
public static boolean c(Context context, String str) {
try {
if (com.appodeal.ads.utils.k.b == null) {
com.appodeal.ads.utils.k.b = Arrays.asList(context.getResources().getAssets().list("dex"));
}
return com.appodeal.ads.utils.k.b.contains(String.format("%s.dx", str));
} catch (Exception e) {
Log.log(e);
return false;
}
}
public static String d(Context context) {
SharedPreferences b2 = bp.a(context).b();
String string = b2.contains("uuid") ? b2.getString("uuid", null) : null;
if (string != null) {
return string;
}
String uuid = UUID.randomUUID().toString();
SharedPreferences.Editor edit = b2.edit();
edit.putString("uuid", uuid);
edit.apply();
return uuid;
}
public static String d(String str) {
try {
try {
new URL(str);
return str;
} catch (UnsupportedEncodingException | IllegalArgumentException unused) {
return str;
}
} catch (MalformedURLException unused2) {
return URLDecoder.decode(str, C.UTF8_NAME);
}
}
public static void d(final Context context, final String str) {
if (aa.a(context) && l(context)) {
bt.a(new Runnable() {
@Override
public void run() {
Toast.makeText(context, str, 1).show();
Log.log(LogConstants.KEY_SDK, LogConstants.EVENT_SHOW_TOAST, str);
}
});
}
}
public static void d(View view) {
if (view.getParent() == null || !(view.getParent() instanceof ViewGroup)) {
return;
}
((ViewGroup) view.getParent()).removeView(view);
}
public static File e(Context context, String str) {
File externalFilesDir = context.getExternalFilesDir(null);
if (externalFilesDir != null) {
File file = new File(externalFilesDir.getPath() + "/" + str + "/");
if (file.exists() || file.mkdirs()) {
return file;
}
}
return null;
}
public static String e(Context context) {
Object a2;
try {
int intValue = (!a("com.google.android.gms.common.GoogleApiAvailabilityLight") || (a2 = a((Class) Class.forName("com.google.android.gms.common.GoogleApiAvailabilityLight"), "GOOGLE_PLAY_SERVICES_VERSION_CODE")) == null) ? -1 : ((Integer) a2).intValue();
if (intValue == -1) {
intValue = context.getPackageManager().getApplicationInfo(context.getPackageName(), 128).metaData.getInt("com.google.android.gms.version");
}
return String.valueOf(intValue);
} catch (Throwable th) {
Log.log(th);
return "not-found";
}
}
public static void e(String str) {
a(str, com.appodeal.ads.utils.s.f1302a);
}
public static String f(Context context) {
try {
PackageInfo packageInfo = context.getPackageManager().getPackageInfo("com.google.android.webview", 0);
if (packageInfo != null) {
return packageInfo.versionName;
}
return null;
} catch (Exception unused) {
return null;
}
}
public static String f(String str) {
char c2;
switch (str.hashCode()) {
case -1907025354:
if (str.equals("banner_mrec")) {
c2 = 4;
break;
}
c2 = 65535;
break;
case -1840422033:
if (str.equals("debug_mrec")) {
c2 = 5;
break;
}
c2 = 65535;
break;
case -1396342996:
if (str.equals(AdFormat.BANNER)) {
c2 = 0;
break;
}
c2 = 65535;
break;
case -1210465393:
if (str.equals("debug_video")) {
c2 = '\t';
break;
}
c2 = 65535;
break;
case -1052618729:
if (str.equals("native")) {
c2 = 6;
break;
}
c2 = 65535;
break;
case -1031406050:
if (str.equals("banner_320")) {
c2 = 2;
break;
}
c2 = 65535;
break;
case 95458899:
if (str.equals("debug")) {
c2 = 1;
break;
}
c2 = 65535;
break;
case 112202875:
if (str.equals("video")) {
c2 = '\b';
break;
}
c2 = 65535;
break;
case 624073610:
if (str.equals("debug_banner_320")) {
c2 = 3;
break;
}
c2 = 65535;
break;
case 894337923:
if (str.equals("debug_native")) {
c2 = 7;
break;
}
c2 = 65535;
break;
default:
c2 = 65535;
break;
}
switch (c2) {
case 0:
case 1:
return "http://herokuapp.appodeal.com/android_waterfall_interstitial";
case 2:
case 3:
return "http://herokuapp.appodeal.com/android_waterfall_banner";
case 4:
case 5:
return "http://herokuapp.appodeal.com/android_waterfall_mrec";
case 6:
case 7:
return "http://herokuapp.appodeal.com/android_waterfall_native";
case '\b':
case '\t':
return "http://herokuapp.appodeal.com/android_waterfall_video";
default:
return "http://herokuapp.appodeal.com/android_waterfall_rewarded_video";
}
}
public static boolean f(Context context, String str) {
return g(context, str) == 0;
}
public static int g(Context context, String str) {
if (str != null) {
return context.checkPermission(str, Process.myPid(), Process.myUid());
}
throw new IllegalArgumentException("permission is null");
}
@Deprecated
public static UserData g(Context context) {
return bu.a();
}
public static String g(String str) {
return new BigInteger(a(str.getBytes())).abs().toString(36);
}
public static JSONObject h(Context context) {
JSONObject jSONObject = new JSONObject();
try {
com.appodeal.ads.utils.x u = bo.u();
jSONObject.put("session_id", u.c());
jSONObject.put("session_uptime", u.f());
jSONObject.put("session_uptime_m", u.g());
jSONObject.put("app_uptime", u.e(context));
jSONObject.put("app_uptime_m", u.f(context));
jSONObject.put("sdk", "2.10.3");
EventsTracker eventsTracker = EventsTracker.get();
jSONObject.put("imp_count", eventsTracker.a(EventsTracker.EventType.Impression));
jSONObject.put("click_count", eventsTracker.a(EventsTracker.EventType.Click));
jSONObject.put("finish_count", eventsTracker.a(EventsTracker.EventType.Finish));
jSONObject.put("imp", eventsTracker.b(EventsTracker.EventType.Impression));
jSONObject.put("click", eventsTracker.b(EventsTracker.EventType.Click));
jSONObject.put("finish", eventsTracker.b(EventsTracker.EventType.Finish));
jSONObject.put("timp", eventsTracker.a(context, EventsTracker.EventType.Impression));
jSONObject.put("tclick", eventsTracker.a(context, EventsTracker.EventType.Click));
jSONObject.put("tfinish", eventsTracker.a(context, EventsTracker.EventType.Finish));
if (v.g != null) {
Iterator<String> keys = v.g.keys();
while (keys.hasNext()) {
String next = keys.next();
jSONObject.put(next, v.g.get(next));
}
}
} catch (JSONException unused) {
}
return jSONObject;
}
public static boolean i(Context context) {
return (Build.VERSION.SDK_INT >= 19 || com.appodeal.ads.utils.c.d(context)) && aj.h();
}
public static boolean i(Context context, String str) {
try {
Log.log(LogConstants.KEY_SDK, "Launch", String.format("url - %s", str), Log.LogLevel.verbose);
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
intent.setFlags(268435456);
ComponentName a2 = a(context, intent);
if (a2 != null) {
intent.setComponent(a2);
} else {
String decode = URLDecoder.decode(str, C.UTF8_NAME);
intent = new Intent("android.intent.action.VIEW", Uri.parse(decode));
intent.setFlags(268435456);
ComponentName a3 = a(context, intent);
if (a3 != null) {
intent.setComponent(a3);
} else {
Log.log(LogConstants.KEY_SDK, LogConstants.EVENT_LAUNCH_ERROR, String.format("component not found to handle intent: %s", decode));
}
}
context.startActivity(intent);
return true;
} catch (Exception e) {
Log.log(e);
return false;
}
}
public static boolean j(Context context) {
Object a2;
try {
if (a("com.google.android.gms.common.GoogleApiAvailability")) {
Object a3 = a((Object) null, Class.forName("com.google.android.gms.common.GoogleApiAvailability"), "getInstance", (Pair<Class, Object>[]) new Pair[0]);
if (a3 == null) {
return false;
}
Object a4 = a(a3, "isGooglePlayServicesAvailable", (Pair<Class, Object>[]) new Pair[]{new Pair(Context.class, context)});
if (a4 instanceof Integer) {
return ((Integer) a4).intValue() == 0;
}
}
} catch (Throwable th) {
Log.log(th);
}
try {
} catch (Throwable th2) {
Log.log(th2);
}
if (!a("com.google.android.gms.common.GoogleApiAvailabilityLight") || (a2 = a((Object) null, Class.forName("com.google.android.gms.common.GoogleApiAvailabilityLight"), "getInstance", (Pair<Class, Object>[]) new Pair[0])) == null) {
return false;
}
Object a5 = a(a2, "isGooglePlayServicesAvailable", (Pair<Class, Object>[]) new Pair[]{new Pair(Context.class, context)});
if (a5 instanceof Integer) {
return ((Integer) a5).intValue() == 0;
}
return false;
}
public static boolean k(Context context) {
int i;
Boolean bool = b;
if (bool != null) {
return bool.booleanValue();
}
try {
String[] strArr = context.getPackageManager().getPackageInfo(context.getPackageName(), 1024).applicationInfo.sharedLibraryFiles;
if (strArr != null) {
int length = strArr.length;
while (i < length) {
String str = strArr[i];
i = (str.equalsIgnoreCase("/system/framework/org.apache.http.legacy.boot.jar") || str.equalsIgnoreCase("/system/framework/org.apache.http.legacy.jar")) ? 0 : i + 1;
b = true;
return true;
}
}
} catch (Exception e) {
Log.log(e);
}
b = false;
return false;
}
public static boolean l(Context context) {
try {
try {
Object a2 = a((Class) Class.forName(context.getPackageName() + ".BuildConfig"), "DEBUG");
if (a2 instanceof Boolean) {
return ((Boolean) a2).booleanValue();
}
} catch (Throwable th) {
Log.log(th);
}
return true;
} catch (Throwable unused) {
return (context.getApplicationInfo().flags & 2) != 0;
}
}
}