- 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
116 lines
3.6 KiB
Java
116 lines
3.6 KiB
Java
package com.applovin.impl;
|
|
|
|
import android.content.Context;
|
|
import android.opengl.EGL14;
|
|
import android.opengl.GLES20;
|
|
import android.opengl.GLU;
|
|
import android.text.TextUtils;
|
|
import androidx.work.Data;
|
|
import java.nio.ByteBuffer;
|
|
import java.nio.ByteOrder;
|
|
import java.nio.FloatBuffer;
|
|
import java.nio.IntBuffer;
|
|
|
|
/* loaded from: classes.dex */
|
|
public abstract class ba {
|
|
public static boolean a;
|
|
|
|
public static boolean c() {
|
|
String eglQueryString;
|
|
return xp.a >= 17 && (eglQueryString = EGL14.eglQueryString(EGL14.eglGetDisplay(0), 12373)) != null && eglQueryString.contains("EGL_KHR_surfaceless_context");
|
|
}
|
|
|
|
public static final class a extends RuntimeException {
|
|
public a(String str) {
|
|
super(str);
|
|
}
|
|
}
|
|
|
|
public static int b() {
|
|
int[] iArr = new int[1];
|
|
GLES20.glGenTextures(1, IntBuffer.wrap(iArr));
|
|
GLES20.glBindTexture(36197, iArr[0]);
|
|
GLES20.glTexParameteri(36197, 10241, 9729);
|
|
GLES20.glTexParameteri(36197, Data.MAX_DATA_BYTES, 9729);
|
|
GLES20.glTexParameteri(36197, 10242, 33071);
|
|
GLES20.glTexParameteri(36197, 10243, 33071);
|
|
a();
|
|
return iArr[0];
|
|
}
|
|
|
|
private static void a(int i, String str, int i2) {
|
|
int glCreateShader = GLES20.glCreateShader(i);
|
|
GLES20.glShaderSource(glCreateShader, str);
|
|
GLES20.glCompileShader(glCreateShader);
|
|
int[] iArr = {0};
|
|
GLES20.glGetShaderiv(glCreateShader, 35713, iArr, 0);
|
|
if (iArr[0] != 1) {
|
|
a(GLES20.glGetShaderInfoLog(glCreateShader) + ", source: " + str);
|
|
}
|
|
GLES20.glAttachShader(i2, glCreateShader);
|
|
GLES20.glDeleteShader(glCreateShader);
|
|
a();
|
|
}
|
|
|
|
public static void a() {
|
|
int i = 0;
|
|
while (true) {
|
|
int glGetError = GLES20.glGetError();
|
|
if (glGetError == 0) {
|
|
break;
|
|
}
|
|
pc.b("GlUtil", "glError " + GLU.gluErrorString(glGetError));
|
|
i = glGetError;
|
|
}
|
|
if (i != 0) {
|
|
a("glError " + GLU.gluErrorString(i));
|
|
}
|
|
}
|
|
|
|
public static FloatBuffer a(int i) {
|
|
return ByteBuffer.allocateDirect(i * 4).order(ByteOrder.nativeOrder()).asFloatBuffer();
|
|
}
|
|
|
|
public static FloatBuffer a(float[] fArr) {
|
|
return (FloatBuffer) a(fArr.length).put(fArr).flip();
|
|
}
|
|
|
|
public static boolean a(Context context) {
|
|
String eglQueryString;
|
|
int i = xp.a;
|
|
if (i < 24) {
|
|
return false;
|
|
}
|
|
if (i >= 26 || !("samsung".equals(xp.c) || "XT1650".equals(xp.d))) {
|
|
return (i >= 26 || context.getPackageManager().hasSystemFeature("android.hardware.vr.high_performance")) && (eglQueryString = EGL14.eglQueryString(EGL14.eglGetDisplay(0), 12373)) != null && eglQueryString.contains("EGL_EXT_protected_content");
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public static int a(String[] strArr, String[] strArr2) {
|
|
return a(TextUtils.join("\n", strArr), TextUtils.join("\n", strArr2));
|
|
}
|
|
|
|
public static int a(String str, String str2) {
|
|
int glCreateProgram = GLES20.glCreateProgram();
|
|
a();
|
|
a(35633, str, glCreateProgram);
|
|
a(35632, str2, glCreateProgram);
|
|
GLES20.glLinkProgram(glCreateProgram);
|
|
int[] iArr = {0};
|
|
GLES20.glGetProgramiv(glCreateProgram, 35714, iArr, 0);
|
|
if (iArr[0] != 1) {
|
|
a("Unable to link shader program: \n" + GLES20.glGetProgramInfoLog(glCreateProgram));
|
|
}
|
|
a();
|
|
return glCreateProgram;
|
|
}
|
|
|
|
private static void a(String str) {
|
|
pc.b("GlUtil", str);
|
|
if (a) {
|
|
throw new a(str);
|
|
}
|
|
}
|
|
}
|