- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
201 lines
7.7 KiB
Java
201 lines
7.7 KiB
Java
package com.applovin.impl.sdk.utils;
|
|
|
|
import android.graphics.Bitmap;
|
|
import android.graphics.BitmapFactory;
|
|
import android.graphics.Point;
|
|
import android.graphics.drawable.BitmapDrawable;
|
|
import android.net.Uri;
|
|
import android.os.StrictMode;
|
|
import android.webkit.URLUtil;
|
|
import android.widget.ImageView;
|
|
import com.applovin.impl.sdk.j;
|
|
import com.applovin.impl.sdk.n;
|
|
import com.applovin.impl.sj;
|
|
import com.applovin.impl.yp;
|
|
import com.applovin.impl.z3;
|
|
import com.applovin.sdk.AppLovinSdkUtils;
|
|
import com.google.firebase.perf.network.FirebasePerfUrlConnection;
|
|
import java.io.InputStream;
|
|
import java.net.URL;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class ImageViewUtils {
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static /* synthetic */ void a(final j jVar, String str, final ImageView imageView, Uri uri) {
|
|
if (!((Boolean) jVar.a(sj.D)).booleanValue()) {
|
|
InputStream inputStream = null;
|
|
try {
|
|
inputStream = FirebasePerfUrlConnection.openStream(new URL(str));
|
|
final Bitmap decodeStream = BitmapFactory.decodeStream(inputStream);
|
|
AppLovinSdkUtils.runOnUiThread(new Runnable() { // from class: com.applovin.impl.sdk.utils.ImageViewUtils$$ExternalSyntheticLambda1
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
ImageViewUtils.b(j.this, decodeStream, imageView);
|
|
}
|
|
});
|
|
return;
|
|
} catch (Throwable th) {
|
|
try {
|
|
jVar.J();
|
|
if (n.a()) {
|
|
jVar.J().a("ImageViewUtils", "Failed to fetch image: " + uri, th);
|
|
}
|
|
return;
|
|
} finally {
|
|
yp.a(inputStream, jVar);
|
|
}
|
|
}
|
|
}
|
|
try {
|
|
InputStream openStream = FirebasePerfUrlConnection.openStream(new URL(str));
|
|
try {
|
|
final Bitmap decodeStream2 = BitmapFactory.decodeStream(openStream);
|
|
AppLovinSdkUtils.runOnUiThread(new Runnable() { // from class: com.applovin.impl.sdk.utils.ImageViewUtils$$ExternalSyntheticLambda0
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
ImageViewUtils.a(j.this, decodeStream2, imageView);
|
|
}
|
|
});
|
|
if (openStream != null) {
|
|
openStream.close();
|
|
}
|
|
} finally {
|
|
}
|
|
} catch (Throwable th2) {
|
|
jVar.J();
|
|
if (n.a()) {
|
|
jVar.J().a("ImageViewUtils", "Failed to fetch image: " + uri, th2);
|
|
}
|
|
jVar.J().a("ImageViewUtils", th2);
|
|
jVar.E().a("ImageViewUtils", "setImageUri", th2);
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static /* synthetic */ void b(ImageView imageView, Uri uri) {
|
|
StrictMode.ThreadPolicy allowThreadDiskReads = StrictMode.allowThreadDiskReads();
|
|
imageView.setImageURI(uri);
|
|
StrictMode.setThreadPolicy(allowThreadDiskReads);
|
|
}
|
|
|
|
public static void setAndDownscaleBitmap(final ImageView imageView, final Uri uri) {
|
|
if (uri == null || imageView == null) {
|
|
return;
|
|
}
|
|
j jVar = j.v0;
|
|
if (jVar == null) {
|
|
n.h("ImageViewUtils", "SDK has not been initialized");
|
|
} else {
|
|
jVar.j0().b().execute(new Runnable() { // from class: com.applovin.impl.sdk.utils.ImageViewUtils$$ExternalSyntheticLambda2
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
ImageViewUtils.a(uri, imageView);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
public static void setAndDownscaleImageUri(final ImageView imageView, final Uri uri) {
|
|
if (uri == null || imageView == null) {
|
|
return;
|
|
}
|
|
if (imageView.getHeight() <= 0 || imageView.getWidth() <= 0) {
|
|
imageView.post(new Runnable() { // from class: com.applovin.impl.sdk.utils.ImageViewUtils$$ExternalSyntheticLambda3
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
ImageViewUtils.setAndDownscaleBitmap(imageView, uri);
|
|
}
|
|
});
|
|
} else {
|
|
setAndDownscaleBitmap(imageView, uri);
|
|
}
|
|
}
|
|
|
|
public static void setImageUri(final ImageView imageView, final Uri uri, final j jVar) {
|
|
if (imageView == null || uri == null) {
|
|
return;
|
|
}
|
|
final String uri2 = uri.toString();
|
|
if (URLUtil.isFileUrl(uri2) || URLUtil.isContentUrl(uri2)) {
|
|
AppLovinSdkUtils.runOnUiThread(new Runnable() { // from class: com.applovin.impl.sdk.utils.ImageViewUtils$$ExternalSyntheticLambda6
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
ImageViewUtils.b(imageView, uri);
|
|
}
|
|
});
|
|
return;
|
|
}
|
|
if (jVar == null) {
|
|
return;
|
|
}
|
|
jVar.J();
|
|
if (n.a()) {
|
|
jVar.J().a("ImageViewUtils", "Fetching image: " + uri);
|
|
}
|
|
jVar.j0().b().execute(new Runnable() { // from class: com.applovin.impl.sdk.utils.ImageViewUtils$$ExternalSyntheticLambda5
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
ImageViewUtils.a(j.this, uri2, imageView, uri);
|
|
}
|
|
});
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static /* synthetic */ void b(j jVar, Bitmap bitmap, ImageView imageView) {
|
|
jVar.J();
|
|
if (n.a()) {
|
|
jVar.J().a("ImageViewUtils", "Image fetched");
|
|
}
|
|
imageView.setImageDrawable(new BitmapDrawable(j.l().getResources(), bitmap));
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static /* synthetic */ void a(j jVar, Bitmap bitmap, ImageView imageView) {
|
|
jVar.J();
|
|
if (n.a()) {
|
|
jVar.J().a("ImageViewUtils", "Image fetched");
|
|
}
|
|
imageView.setImageDrawable(new BitmapDrawable(j.l().getResources(), bitmap));
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static /* synthetic */ void a(Uri uri, final ImageView imageView) {
|
|
BitmapFactory.Options options = new BitmapFactory.Options();
|
|
int i = 1;
|
|
options.inJustDecodeBounds = true;
|
|
BitmapFactory.decodeFile(uri.getPath(), options);
|
|
int height = imageView.getHeight();
|
|
int width = imageView.getWidth();
|
|
if (height <= 0 || width <= 0) {
|
|
Point b = z3.b(imageView.getContext());
|
|
height = Math.min(b.x, b.y);
|
|
width = height;
|
|
}
|
|
int i2 = options.outHeight;
|
|
int i3 = options.outWidth;
|
|
if (i2 > height || i3 > width) {
|
|
while (true) {
|
|
int i4 = i * 2;
|
|
if (i2 / i4 < height && i3 / i4 < width) {
|
|
break;
|
|
} else {
|
|
i = i4;
|
|
}
|
|
}
|
|
}
|
|
options.inSampleSize = i;
|
|
options.inJustDecodeBounds = false;
|
|
j.v0.J();
|
|
if (n.a()) {
|
|
j.v0.J().a("ImageViewUtils", "Loading image: " + uri.getLastPathSegment() + "...");
|
|
}
|
|
final Bitmap decodeFile = BitmapFactory.decodeFile(uri.getPath(), options);
|
|
AppLovinSdkUtils.runOnUiThread(new Runnable() { // from class: com.applovin.impl.sdk.utils.ImageViewUtils$$ExternalSyntheticLambda4
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
imageView.setImageBitmap(decodeFile);
|
|
}
|
|
});
|
|
}
|
|
}
|