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,27 @@
package com.firemint.realracing;
import android.app.Activity;
import android.content.Context;
/* loaded from: classes2.dex */
public class AppProxy {
private static Activity m_activity;
private static Context m_context;
public static Activity GetActivity() {
return m_activity;
}
public static Context GetContext() {
return m_context;
}
public static void SetActivity(Activity activity) {
m_activity = activity;
m_context = activity;
}
public static void SetContext(Context context) {
m_context = context;
}
}

View File

@@ -0,0 +1,48 @@
package com.firemint.realracing;
import android.media.AudioManager;
/* loaded from: classes2.dex */
class AudioStreamManager implements AudioManager.OnAudioFocusChangeListener {
private static AudioStreamManager m_instance;
private AudioManager m_audioManager = null;
private boolean m_hasMusicFocus = false;
@Override // android.media.AudioManager.OnAudioFocusChangeListener
public void onAudioFocusChange(int i) {
this.m_hasMusicFocus = i == 1;
}
public AudioStreamManager() {
m_instance = this;
}
private void requestMusicFocus() {
if (this.m_hasMusicFocus) {
return;
}
this.m_hasMusicFocus = this.m_audioManager.requestAudioFocus(this, 3, 1) == 1;
}
public void setAudioManager(AudioManager audioManager) {
this.m_audioManager = audioManager;
if (audioManager.isMusicActive()) {
return;
}
requestMusicFocus();
}
public static boolean staticIsUserMusicPlaying() {
if (m_instance != null) {
return !r0.m_hasMusicFocus;
}
return false;
}
public static void staticRequestMusicFocus() {
AudioStreamManager audioStreamManager = m_instance;
if (audioStreamManager != null) {
audioStreamManager.requestMusicFocus();
}
}
}

View File

@@ -0,0 +1,25 @@
package com.firemint.realracing;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
/* loaded from: classes2.dex */
public class BootReceiver extends BroadcastReceiver {
public static void Log(String str) {
}
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
Log("onReceive");
if (AppProxy.GetContext() == null) {
Log("resumeNotification");
AppProxy.SetContext(context);
LocalNotificationsCenter.LoadNotifications(true);
AppProxy.SetContext(null);
} else {
Log("gameHasStarted, aborting");
}
Log("onReceive done");
}
}

View File

@@ -0,0 +1,11 @@
package com.firemint.realracing;
import android.opengl.ETC1Util;
import java.nio.ByteBuffer;
/* loaded from: classes2.dex */
public class CarLiveryBaker {
public static ByteBuffer compressTextureToETC1(ByteBuffer byteBuffer, int i, int i2, int i3, int i4) {
return ETC1Util.compressTexture(byteBuffer, i, i2, i3, i4).getData();
}
}

View File

@@ -0,0 +1,162 @@
package com.firemint.realracing;
import android.annotation.TargetApi;
import android.content.Context;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.ironsource.v8;
import com.mbridge.msdk.playercommon.exoplayer2.text.ttml.TtmlNode;
/* loaded from: classes2.dex */
class CheatView extends FrameLayout implements TextView.OnEditorActionListener {
boolean m_bEnableLogging;
LinearLayout m_layout;
CheatListener m_listener;
CheatEditText m_text;
boolean touchOffToClose;
public interface CheatListener {
void onInputDone(boolean z, CharSequence charSequence);
CharSequence onInputUpdate(boolean z, CharSequence charSequence);
}
public class CheatEditText extends EditText {
private CheatListener m_cheatListener;
public CheatEditText(Context context, CheatListener cheatListener) {
super(context);
this.m_cheatListener = cheatListener;
}
@Override // android.widget.TextView, android.view.View
public boolean onKeyPreIme(int i, KeyEvent keyEvent) {
if (i == 4) {
CheatView.this.Log("Consume the back key before it gets to the keyboard");
this.m_cheatListener.onInputDone(false, "");
return true;
}
if (i == 82) {
CheatView.this.Log("Consume the menu key before it gets to the keyboard");
return true;
}
return super.onKeyPreIme(i, keyEvent);
}
}
public void Log(String str) {
if (this.m_bEnableLogging) {
str.length();
}
}
public CheatView(Context context, CheatListener cheatListener, boolean z) {
super(context);
this.m_bEnableLogging = false;
this.m_listener = cheatListener;
CheatEditText cheatEditText = new CheatEditText(context, this.m_listener);
this.m_text = cheatEditText;
cheatEditText.setWidth(0);
this.m_text.setHeight(0);
LinearLayout linearLayout = new LinearLayout(context);
this.m_layout = linearLayout;
linearLayout.addView(this.m_text);
addView(this.m_layout);
this.touchOffToClose = true;
this.m_layout.setVisibility(4);
this.m_text.setRawInputType(z ? 129 : 1);
this.m_text.setImeOptions(268435462);
this.m_text.setOnEditorActionListener(this);
this.m_text.addTextChangedListener(new TextWatcher() { // from class: com.firemint.realracing.CheatView.1
@Override // android.text.TextWatcher
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
CheatView cheatView = CheatView.this;
CharSequence onInputUpdate = cheatView.m_listener.onInputUpdate(true, cheatView.m_text.getText());
String trim = onInputUpdate.toString().trim();
String trim2 = CheatView.this.m_text.getText().toString().trim();
CheatView.this.Log("onTextChanged: " + CheatView.this.m_text.getText().toString() + " to: " + onInputUpdate.toString());
if (!trim.equals(trim2)) {
CheatView.this.m_text.setText(onInputUpdate);
}
CheatEditText cheatEditText2 = CheatView.this.m_text;
cheatEditText2.setSelection(cheatEditText2.getText().length());
}
@Override // android.text.TextWatcher
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
CheatView.this.Log("beforeTextChanged: " + charSequence.toString());
}
@Override // android.text.TextWatcher
public void afterTextChanged(Editable editable) {
CheatView.this.Log("afterTextChanged: " + editable.toString());
}
});
}
@Override // android.view.View
public boolean onTouchEvent(MotionEvent motionEvent) {
if (this.touchOffToClose) {
if (motionEvent.getActionMasked() != 0) {
return true;
}
Log("cancel");
this.m_listener.onInputDone(false, "");
return true;
}
onResume();
return false;
}
@Override // android.widget.TextView.OnEditorActionListener
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
if (i != 6) {
return false;
}
Log("IME_ACTION_DONE");
this.m_listener.onInputDone(true, textView.getText());
return false;
}
public void onResume() {
MainActivity.instance.runOnUiThread(new Runnable() { // from class: com.firemint.realracing.CheatView.2
@Override // java.lang.Runnable
public void run() {
CheatView.this.Log(v8.h.u0);
CheatView.this.m_text.requestFocus();
((InputMethodManager) CheatView.this.getContext().getSystemService("input_method")).showSoftInput(CheatView.this.m_text, MainActivity.getIsAmazon() ? 1 : 2);
}
});
}
public void onPause() {
end();
}
@TargetApi(11)
public void begin(String str) {
Log("begin");
MainActivity.instance.getWindow().setSoftInputMode(48);
this.m_text.setText(str);
onResume();
}
public void end() {
MainActivity.instance.runOnUiThread(new Runnable() { // from class: com.firemint.realracing.CheatView.3
@Override // java.lang.Runnable
public void run() {
CheatView.this.Log(TtmlNode.END);
((InputMethodManager) CheatView.this.getContext().getSystemService("input_method")).hideSoftInputFromWindow(CheatView.this.m_text.getWindowToken(), MainActivity.getIsAmazon() ? 1 : 0);
MainActivity.instance.getWindow().setSoftInputMode(0);
MainActivity.HideSystemKeys(MainActivity.instance.getWindow().getDecorView());
}
});
}
}

View File

@@ -0,0 +1,455 @@
package com.firemint.realracing;
import android.annotation.TargetApi;
import android.hardware.input.InputManager;
import android.util.Log;
import android.view.InputDevice;
import android.view.KeyEvent;
import android.view.MotionEvent;
import androidx.core.view.InputDeviceCompat;
import com.ironsource.v8;
/* loaded from: classes2.dex */
public class ControllerManager {
public static final int BUTTON_A = 64;
public static final int BUTTON_B = 128;
public static final int BUTTON_L1 = 1;
public static final int BUTTON_L2 = 2;
public static final int BUTTON_R1 = 8;
public static final int BUTTON_R2 = 16;
public static final int BUTTON_X = 256;
public static final int BUTTON_Y = 512;
public static final int LTRIGGER = 4;
public static final int RTRIGGER = 32;
private boolean m_bEnableLogging = false;
private ControllerManager_Moga m_controllerManager_Moga;
protected ControllerInputListener m_inputListener;
protected MainActivity m_mainActivity;
public enum ControllerAxis {
AXIS_LTHUMB_X,
AXIS_LTHUMB_Y,
AXIS_RTHUMB_X,
AXIS_RTHUMB_Y,
AXIS_LTRIGGER,
AXIS_RTRIGGER,
AXIS_MOTION_X,
AXIS_MOTION_Y,
AXIS_COUNT
}
public enum ControllerButtons {
BTN_A,
BTN_B,
BTN_X,
BTN_Y,
BTN_L1,
BTN_R1,
BTN_L2,
BTN_R2,
BTN_DPAD_LEFT,
BTN_DPAD_RIGHT,
BTN_DPAD_UP,
BTN_DPAD_DOWN,
BTN_SELECT,
BTN_START,
BTN_DPAD_CENTER,
BTN_MEIDA_PLAY_PAUSE,
BTN_LEFT_THUMB_LEFT,
BTN_LEFT_THUMB_RIGHT,
BTN_LEFT_THUMB_UP,
BTN_LEFT_THUMB_DOWN,
BTN_LEFT_THUMB_PRESS,
BTN_RIGHT_THUMB_LEFT,
BTN_RIGHT_THUMB_RIGHT,
BTN_RIGHT_THUMB_UP,
BTN_RIGHT_THUMB_DOWN,
BTN_RIGHT_THUMB_PRESS,
BTN_COUNT
}
public native void ControllerConnectedJNI(String str, String str2, int i, int i2);
public native void ControllerDisconnectedJNI(int i);
public boolean IsControllerEvent(int i) {
return (i & 1025) == 1025;
}
public boolean IsDpadEvent(int i) {
return (i & InputDeviceCompat.SOURCE_DPAD) == 513;
}
public boolean IsJoystickEvent(int i) {
return (i & InputDeviceCompat.SOURCE_JOYSTICK) == 16777232;
}
public native void SetButtonValueJNI(int i, boolean z, int i2);
public native void SetJoystickValueJNI(int i, float f, int i2);
@TargetApi(16)
public class ControllerInputListener implements InputManager.InputDeviceListener {
ControllerManager m_controllerManager;
InputManager m_inputManager;
@Override // android.hardware.input.InputManager.InputDeviceListener
public void onInputDeviceChanged(int i) {
}
public ControllerInputListener(ControllerManager controllerManager) {
this.m_inputManager = null;
this.m_controllerManager = controllerManager;
InputManager inputManager = (InputManager) ControllerManager.this.m_mainActivity.getSystemService("input");
this.m_inputManager = inputManager;
inputManager.registerInputDeviceListener(this, ControllerManager.this.m_mainActivity.handler);
this.m_inputManager.getInputDevice(-1);
CheckExistingControllers();
}
public void onDestroy() {
this.m_inputManager.unregisterInputDeviceListener(this);
}
public boolean IsDeviceBlacklisted(InputDevice inputDevice) {
return inputDevice.getName().equals("uinput-fpc") || inputDevice.getName().equals("uinput-fortsense");
}
public boolean IsInputDeviceAllowed(InputDevice inputDevice) {
if (inputDevice.isVirtual()) {
return false;
}
return ((inputDevice.getSources() & 1025) == 1025) && ((inputDevice.getSources() & InputDeviceCompat.SOURCE_JOYSTICK) == 16777232) && !IsDeviceBlacklisted(inputDevice);
}
@Override // android.hardware.input.InputManager.InputDeviceListener
public void onInputDeviceAdded(int i) {
InputDevice inputDevice = this.m_inputManager.getInputDevice(i);
if (inputDevice != null) {
if (IsInputDeviceAllowed(inputDevice)) {
ControllerManager.this.Log("onInputDeviceAdded::" + inputDevice.toString());
this.m_controllerManager.ControllerConnected(inputDevice.getName(), inputDevice.getDescriptor(), i, GetOptionalButtonFlags(inputDevice));
return;
}
ControllerManager.this.Log("onInputDeviceAdded::Input device ignored: " + inputDevice.toString());
}
}
@Override // android.hardware.input.InputManager.InputDeviceListener
public void onInputDeviceRemoved(int i) {
ControllerManager.this.Log("onInputDeviceRemoved::Id(" + i + ")");
this.m_controllerManager.ControllerDisconnected(i);
}
public void CheckExistingControllers() {
for (int i : this.m_inputManager.getInputDeviceIds()) {
InputDevice inputDevice = this.m_inputManager.getInputDevice(i);
if (IsInputDeviceAllowed(inputDevice)) {
ControllerManager.this.Log("CheckExistingControllers::" + inputDevice.toString());
this.m_controllerManager.ControllerConnected(inputDevice.getName(), inputDevice.getDescriptor(), i, GetOptionalButtonFlags(inputDevice));
} else {
ControllerManager.this.Log("CheckExistingControllers::Input device ignored: " + inputDevice.toString());
}
}
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r1v10, types: [int] */
/* JADX WARN: Type inference failed for: r1v13 */
/* JADX WARN: Type inference failed for: r1v14 */
/* JADX WARN: Type inference failed for: r1v15 */
/* JADX WARN: Type inference failed for: r1v16 */
/* JADX WARN: Type inference failed for: r1v17 */
/* JADX WARN: Type inference failed for: r1v18 */
/* JADX WARN: Type inference failed for: r1v19 */
/* JADX WARN: Type inference failed for: r1v42 */
/* JADX WARN: Type inference failed for: r1v43 */
public int GetOptionalButtonFlags(InputDevice inputDevice) {
boolean[] hasKeys = ControllerManager.this.IsAtLeastKitKat() ? inputDevice.hasKeys(102, 104, 103, 105, 96, 97, 99, 100) : new boolean[]{true, false, true, false, true, true, true, true};
boolean z = hasKeys[0];
boolean z2 = z;
if (hasKeys[1]) {
z2 = (z ? 1 : 0) | 2;
}
boolean z3 = z2;
if (hasKeys[2]) {
z3 = (z2 ? 1 : 0) | '\b';
}
boolean z4 = z3;
if (hasKeys[3]) {
z4 = (z3 ? 1 : 0) | 16;
}
boolean z5 = z4;
if (hasKeys[4]) {
z5 = (z4 ? 1 : 0) | '@';
}
boolean z6 = z5;
if (hasKeys[5]) {
z6 = (z5 ? 1 : 0) | 128;
}
boolean z7 = z6;
if (hasKeys[6]) {
z7 = (z6 ? 1 : 0) | 256;
}
boolean z8 = z7;
if (hasKeys[7]) {
z8 = (z7 ? 1 : 0) | 512;
}
?? r1 = z8;
if (ControllerManager.this.HasLTrigger(inputDevice)) {
r1 = (z8 ? 1 : 0) | 4;
}
return ControllerManager.this.HasRTrigger(inputDevice) ? r1 | 32 : r1;
}
}
public boolean HasLTrigger(InputDevice inputDevice) {
return (inputDevice.getMotionRange(17) == null && inputDevice.getMotionRange(23) == null) ? false : true;
}
public boolean HasRTrigger(InputDevice inputDevice) {
return (inputDevice.getMotionRange(18) == null && inputDevice.getMotionRange(22) == null && inputDevice.getMotionRange(19) == null) ? false : true;
}
public void Log(String str) {
if (this.m_bEnableLogging) {
str.length();
}
}
public void LogError(String str) {
Log.e("RR3ControllerManager", str);
}
public ControllerManager(MainActivity mainActivity) {
this.m_controllerManager_Moga = null;
this.m_mainActivity = null;
this.m_inputListener = null;
Log("onCreate");
this.m_mainActivity = mainActivity;
try {
this.m_controllerManager_Moga = new ControllerManager_Moga(mainActivity, this);
} catch (Exception e) {
LogError("Failed to create MOGA controller manager: " + e.toString());
this.m_controllerManager_Moga = null;
}
if (IsAtLeastJellyBean()) {
this.m_inputListener = new ControllerInputListener(this);
}
}
public void onDestroy() {
Log("onDestroy");
ControllerManager_Moga controllerManager_Moga = this.m_controllerManager_Moga;
if (controllerManager_Moga != null) {
controllerManager_Moga.onDestroy();
}
ControllerInputListener controllerInputListener = this.m_inputListener;
if (controllerInputListener != null) {
controllerInputListener.onDestroy();
}
}
public void onPause() {
Log(v8.h.t0);
ControllerManager_Moga controllerManager_Moga = this.m_controllerManager_Moga;
if (controllerManager_Moga != null) {
controllerManager_Moga.onPause();
}
}
public void onResume() {
Log(v8.h.u0);
ControllerManager_Moga controllerManager_Moga = this.m_controllerManager_Moga;
if (controllerManager_Moga != null) {
controllerManager_Moga.onResume();
}
ControllerInputListener controllerInputListener = this.m_inputListener;
if (controllerInputListener != null) {
controllerInputListener.CheckExistingControllers();
}
}
public boolean IsAtLeastJellyBean() {
return MainActivity.IsAtLeastAPI(16);
}
public boolean IsAtLeastKitKat() {
return MainActivity.IsAtLeastAPI(19);
}
public void PrintButtonString(String str, int i) {
StringBuilder sb = new StringBuilder();
sb.append(str);
sb.append(" ");
sb.append(i == 0 ? "pressed" : "released");
Log(sb.toString());
}
@TargetApi(16)
public boolean HandleKeyEvents(KeyEvent keyEvent) {
if (keyEvent == null || keyEvent.getDevice() == null || !IsAtLeastJellyBean() || keyEvent.getAction() == 2) {
return false;
}
int keyCode = keyEvent.getKeyCode();
if ((keyCode == 104 && HasLTrigger(keyEvent.getDevice())) || (keyCode == 105 && HasRTrigger(keyEvent.getDevice()))) {
return false;
}
return HandleKeyEvents(keyEvent.getDevice().getId(), keyCode, keyEvent.getAction());
}
/* JADX WARN: Failed to find 'out' block for switch in B:13:0x001c. Please report as an issue. */
/* JADX WARN: Removed duplicated region for block: B:19:0x010e */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public boolean HandleKeyEvents(final int r6, int r7, int r8) {
/*
Method dump skipped, instructions count: 320
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.firemint.realracing.ControllerManager.HandleKeyEvents(int, int, int):boolean");
}
public boolean HandleMotionEvents(MotionEvent motionEvent) {
if (motionEvent == null || motionEvent.getDevice() == null || !IsAtLeastJellyBean()) {
return false;
}
if (IsControllerEvent(motionEvent.getSource())) {
Log("Got motion input from a gamepad??");
return false;
}
if (IsJoystickEvent(motionEvent.getSource())) {
return HandleJoystick(motionEvent);
}
if (IsDpadEvent(motionEvent.getSource())) {
return HandleDpad(motionEvent);
}
return false;
}
public float GetJoystickAxisValue(int i, MotionEvent motionEvent) {
InputDevice device = motionEvent.getDevice();
if (device != null) {
float axisValue = motionEvent.getAxisValue(i);
float abs = Math.abs(axisValue);
InputDevice.MotionRange motionRange = device.getMotionRange(i);
if (motionRange == null || abs >= motionRange.getFlat()) {
return axisValue;
}
return 0.0f;
}
Log("Input device was null!!!!!");
return 0.0f;
}
@TargetApi(16)
public boolean HandleJoystick(MotionEvent motionEvent) {
float GetJoystickAxisValue;
boolean HandleDpad = HandleDpad(motionEvent);
if (motionEvent.getAction() != 2) {
return HandleDpad;
}
float GetJoystickAxisValue2 = GetJoystickAxisValue(0, motionEvent);
float GetJoystickAxisValue3 = GetJoystickAxisValue(1, motionEvent);
float GetJoystickAxisValue4 = GetJoystickAxisValue(11, motionEvent);
float GetJoystickAxisValue5 = GetJoystickAxisValue(14, motionEvent);
float GetJoystickAxisValue6 = GetJoystickAxisValue4 + GetJoystickAxisValue(12, motionEvent);
float GetJoystickAxisValue7 = GetJoystickAxisValue5 + GetJoystickAxisValue(13, motionEvent);
InputDevice device = motionEvent.getDevice();
float f = 0.0f;
if (device.getMotionRange(17) != null) {
GetJoystickAxisValue = GetJoystickAxisValue(17, motionEvent);
} else {
GetJoystickAxisValue = device.getMotionRange(23) != null ? GetJoystickAxisValue(23, motionEvent) : 0.0f;
}
if (device.getMotionRange(18) != null) {
f = GetJoystickAxisValue(18, motionEvent);
} else if (device.getMotionRange(22) != null) {
f = GetJoystickAxisValue(22, motionEvent);
} else if (device.getMotionRange(19) != null) {
f = GetJoystickAxisValue(19, motionEvent);
}
int id = motionEvent.getDevice().getId();
SetJoystickValues(id, GetJoystickAxisValue2, ControllerAxis.AXIS_LTHUMB_X);
SetJoystickValues(id, GetJoystickAxisValue3, ControllerAxis.AXIS_LTHUMB_Y);
SetJoystickValues(id, GetJoystickAxisValue6, ControllerAxis.AXIS_RTHUMB_X);
SetJoystickValues(id, GetJoystickAxisValue7, ControllerAxis.AXIS_RTHUMB_Y);
SetJoystickValues(id, GetJoystickAxisValue, ControllerAxis.AXIS_LTRIGGER);
SetJoystickValues(id, f, ControllerAxis.AXIS_RTRIGGER);
return true;
}
public void SetJoystickValues(final int i, final float f, final ControllerAxis controllerAxis) {
this.m_mainActivity.getGLView().queueEvent(new Runnable() { // from class: com.firemint.realracing.ControllerManager.2
@Override // java.lang.Runnable
public void run() {
ControllerManager.this.SetJoystickValueJNI(i, f, controllerAxis.ordinal());
}
});
}
/* JADX WARN: Code restructure failed: missing block: B:15:0x00c1, code lost:
if (HandleKeyEvents(r11.getDevice().getId(), 20, 1) != false) goto L32;
*/
/* JADX WARN: Code restructure failed: missing block: B:16:0x00c3, code lost:
r1 = true;
*/
/* JADX WARN: Code restructure failed: missing block: B:26:0x00ea, code lost:
if (HandleKeyEvents(r11.getDevice().getId(), 20, 0) != false) goto L32;
*/
/* JADX WARN: Code restructure failed: missing block: B:32:0x0112, code lost:
if (HandleKeyEvents(r11.getDevice().getId(), 20, 1) != false) goto L32;
*/
/* JADX WARN: Code restructure failed: missing block: B:40:0x006c, code lost:
if (HandleKeyEvents(r11.getDevice().getId(), 22, 0) != false) goto L10;
*/
/* JADX WARN: Code restructure failed: missing block: B:46:0x0094, code lost:
if (HandleKeyEvents(r11.getDevice().getId(), 22, 1) != false) goto L10;
*/
/* JADX WARN: Code restructure failed: missing block: B:8:0x0043, code lost:
if (HandleKeyEvents(r11.getDevice().getId(), 22, 1) != false) goto L10;
*/
/* JADX WARN: Code restructure failed: missing block: B:9:0x0045, code lost:
r2 = true;
*/
@android.annotation.TargetApi(16)
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public boolean HandleDpad(android.view.InputEvent r11) {
/*
Method dump skipped, instructions count: 313
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.firemint.realracing.ControllerManager.HandleDpad(android.view.InputEvent):boolean");
}
public void ControllerConnected(final String str, final String str2, final int i, final int i2) {
this.m_mainActivity.getGLView().queueEvent(new Runnable() { // from class: com.firemint.realracing.ControllerManager.3
@Override // java.lang.Runnable
public void run() {
ControllerManager.this.ControllerConnectedJNI(str, str2, i, i2);
}
});
}
public void ControllerDisconnected(final int i) {
this.m_mainActivity.getGLView().queueEvent(new Runnable() { // from class: com.firemint.realracing.ControllerManager.4
@Override // java.lang.Runnable
public void run() {
ControllerManager.this.ControllerDisconnectedJNI(i);
}
});
}
}

View File

@@ -0,0 +1,112 @@
package com.firemint.realracing;
import com.bda.controller.Controller;
import com.bda.controller.ControllerListener;
import com.bda.controller.KeyEvent;
import com.bda.controller.MotionEvent;
import com.bda.controller.StateEvent;
import com.firemint.realracing.ControllerManager;
/* loaded from: classes2.dex */
public class ControllerManager_Moga implements ControllerListener {
Controller m_controller;
ControllerManager m_controllerManager;
MainActivity m_mainActivity;
final String m_strDescriptor = "Moga";
final int m_DeviceIdOffset = 10000;
public ControllerManager_Moga(MainActivity mainActivity, ControllerManager controllerManager) {
this.m_controller = null;
this.m_mainActivity = mainActivity;
this.m_controllerManager = controllerManager;
Controller controller = Controller.getInstance(mainActivity);
this.m_controller = controller;
if (controller != null) {
controller.init();
this.m_controller.setListener(this, this.m_mainActivity.handler);
}
}
public void onDestroy() {
if (this.m_controller != null) {
this.m_controllerManager.Log("Moga::onDestroy");
this.m_controller.exit();
}
}
public void onPause() {
if (this.m_controller != null) {
this.m_controllerManager.Log("Moga::onPause");
this.m_controller.onPause();
}
}
public void onResume() {
if (this.m_controller != null) {
this.m_controllerManager.Log("Moga::onResume");
this.m_controller.onResume();
}
}
@Override // com.bda.controller.ControllerListener
public void onKeyEvent(KeyEvent keyEvent) {
int keyCode = keyEvent.getKeyCode();
if ((keyCode == 104 || keyCode == 105) && this.m_controller.getState(4) == 1) {
return;
}
this.m_controllerManager.HandleKeyEvents(keyEvent.getControllerId() + 10000, keyEvent.getKeyCode(), keyEvent.getAction());
}
@Override // com.bda.controller.ControllerListener
public void onStateEvent(StateEvent stateEvent) {
int i;
String str;
int state = stateEvent.getState();
if (state != 1) {
if (state == 2) {
if (stateEvent.getAction() == 1) {
this.m_controllerManager.Log("Moga::STATE_POWER_LOW (TRUE)");
return;
} else {
this.m_controllerManager.Log("Moga::STATE_POWER_LOW (FALSE)");
return;
}
}
this.m_controllerManager.Log("Moga::Unhandled state event:");
return;
}
int action = stateEvent.getAction();
if (action == 0) {
this.m_controllerManager.Log("Moga::ACTION_DISCONNECTED");
this.m_controllerManager.ControllerDisconnected(stateEvent.getControllerId() + 10000);
return;
}
if (action == 1) {
this.m_controllerManager.Log("Moga::ACTION_CONNECTED");
if (this.m_controller.getState(4) == 1) {
str = "MOGA Pro";
i = 45;
} else {
i = 9;
str = "MOGA Pocket";
}
this.m_controllerManager.ControllerConnected(str, "Moga", stateEvent.getControllerId() + 10000, i);
return;
}
if (action == 2) {
this.m_controllerManager.Log("Moga::ACTION_CONNECTING");
return;
}
this.m_controllerManager.Log("Moga::Unhandled action in STATE_CONNECTION::" + stateEvent.getAction());
}
@Override // com.bda.controller.ControllerListener
public void onMotionEvent(MotionEvent motionEvent) {
this.m_controllerManager.SetJoystickValues(motionEvent.getControllerId() + 10000, motionEvent.getAxisValue(0), ControllerManager.ControllerAxis.AXIS_LTHUMB_X);
this.m_controllerManager.SetJoystickValues(motionEvent.getControllerId() + 10000, motionEvent.getAxisValue(1), ControllerManager.ControllerAxis.AXIS_LTHUMB_Y);
this.m_controllerManager.SetJoystickValues(motionEvent.getControllerId() + 10000, motionEvent.getAxisValue(11), ControllerManager.ControllerAxis.AXIS_RTHUMB_X);
this.m_controllerManager.SetJoystickValues(motionEvent.getControllerId() + 10000, motionEvent.getAxisValue(14), ControllerManager.ControllerAxis.AXIS_RTHUMB_Y);
this.m_controllerManager.SetJoystickValues(motionEvent.getControllerId() + 10000, motionEvent.getAxisValue(17), ControllerManager.ControllerAxis.AXIS_LTRIGGER);
this.m_controllerManager.SetJoystickValues(motionEvent.getControllerId() + 10000, motionEvent.getAxisValue(18), ControllerManager.ControllerAxis.AXIS_RTRIGGER);
}
}

View File

@@ -0,0 +1,217 @@
package com.firemint.realracing;
import android.app.AlarmManager;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.SystemClock;
import androidx.core.app.JobIntentService;
import androidx.core.app.NotificationCompat;
/* loaded from: classes2.dex */
public class DelayedNotificationService extends JobIntentService {
private static final String ACTION_NOTIFICATION_DISMISSED = "ACTION_NOTIFICATION_DISMISSED";
private static final int JOB_ID = 9999;
private static final boolean LOG_ERROR_ENABLED = false;
private static final boolean LOG_INFO_ENABLED = false;
private static final String LOG_TAG = "RR3_DelayedNotifSvc";
private static final int SUMMARY_NOTIFICATION_ID = 999;
private static int m_currentNotificationId = -2;
private static int m_pendingIntentRequestCode;
private static void LogError(String str) {
}
private static void LogInfo(String str) {
}
public boolean ShouldNotificationPlaySound(int i) {
return i != 2;
}
public static void enqueueWork(Context context, Intent intent) {
LogInfo("DelayedNotificationService - enqueueWork");
try {
JobIntentService.enqueueWork(context, (Class<?>) DelayedNotificationService.class, JOB_ID, intent);
} catch (Exception e) {
e.printStackTrace();
}
}
public void NotificationDismissed() {
SerialiseNotificationsHelper.ClearAll(getApplicationContext());
}
public String GetNotificationGroupKey(Context context) {
return "NOTIF_GROUP_" + context.getResources().getString(R.string.cc_game_id);
}
@Override // androidx.core.app.JobIntentService
public void onHandleWork(Intent intent) {
String str;
Notification notification;
int i;
Notification CreateBigTextNotification;
LogInfo("DelayedNotificationService - onHandleWork");
if (intent == null) {
return;
}
LogInfo("DelayedNotificationService: onHandleWork");
if (intent.getAction() != null && intent.getAction().equals(ACTION_NOTIFICATION_DISMISSED)) {
NotificationDismissed();
return;
}
int intExtra = intent.getIntExtra("id", -2);
String stringExtra = intent.getStringExtra("message");
String stringExtra2 = intent.getStringExtra("deepLinkUrl");
boolean z = stringExtra2 != null && (stringExtra2.contains("MultiplayerInvite") || stringExtra2.contains("RaceTeamsAdmin"));
MainActivity mainActivity = MainActivity.instance;
if (mainActivity != null && mainActivity.hasWindowFocus() && stringExtra != null && stringExtra2 != null) {
MainActivity.instance.HandleDeepLink(stringExtra, stringExtra2);
return;
}
if (intExtra == 1) {
if (!IsConnectedToNetwork()) {
showDelayedNotification(intent, Platform.INTERNET_CONNECTION_DELAY);
return;
} else if (intent.getIntExtra("reminder", 0) >= 1) {
showDelayedNotification(intent, 172800);
}
}
Context applicationContext = getApplicationContext();
NotificationManager notificationManager = (NotificationManager) getSystemService("notification");
SerialisedNotificationInfo GetSavedInfo = SerialiseNotificationsHelper.GetSavedInfo(applicationContext);
int GetNotificationCount = GetSavedInfo.GetNotificationCount();
long currentTimeMillis = System.currentTimeMillis();
int i2 = m_pendingIntentRequestCode + 1;
m_pendingIntentRequestCode = i2;
Intent intent2 = new Intent(this, (Class<?>) UnpackAssetsActivity.class);
if (stringExtra2 != null) {
intent2.putExtra("deepLinkUrl", stringExtra2);
}
PendingIntent activity = PendingIntent.getActivity(this, i2, intent2, 335544320);
Notification.Builder autoCancel = new Notification.Builder(applicationContext).setContentTitle(GetNotificationContentTitle(applicationContext, intExtra)).setContentText(stringExtra).setSmallIcon(R.mipmap.icon_notification).setContentIntent(activity).setAutoCancel(true);
if (intExtra == 2) {
currentTimeMillis = 0;
}
Notification.Builder when = autoCancel.setWhen(currentTimeMillis);
if (MainActivity.IsAtLeastAPI(21)) {
when.setColor(applicationContext.getResources().getColor(R.color.NotificationColor));
}
if (MainActivity.IsAtLeastAPI(20)) {
when.setGroup(GetNotificationGroupKey(applicationContext));
}
if (MainActivity.IsAtLeastAPI(26)) {
str = new NotificationChannelHelper(applicationContext).NotificationToChannelId(intExtra);
when.setChannelId(str);
} else {
str = null;
}
String str2 = str;
if (ShouldNotificationPlaySound(intExtra)) {
when.setSound(GetNotificationSoundUri(applicationContext));
}
if (z) {
when.setTicker(stringExtra);
}
Intent intent3 = new Intent(this, (Class<?>) DelayedNotificationService.class);
intent3.setAction(ACTION_NOTIFICATION_DISMISSED);
when.setDeleteIntent(PendingIntent.getService(this, i2, intent3, 201326592));
if (MainActivity.IsAtLeastAPI(16)) {
if (MainActivity.IsAtLeastAPI(24) || GetNotificationCount == 0) {
CreateBigTextNotification = CreateBigTextNotification(when, stringExtra);
} else {
CreateBigTextNotification = CreateStackedNotification(GetSavedInfo, when, stringExtra);
}
notification = CreateBigTextNotification;
if (MainActivity.IsAtLeastAPI(24) && GetNotificationCount >= 1) {
PostSummaryNotification(notificationManager, applicationContext, activity, "", str2);
}
} else {
notification = when.getNotification();
}
if (intExtra != 2) {
SerialiseNotificationsHelper.AddNotification(getApplicationContext(), stringExtra);
}
LogInfo("DelayedNotificationService: showing notification id: " + intExtra + " msg: " + stringExtra);
try {
if (ShouldGenerateUniqueNotificationId(intExtra)) {
i = m_currentNotificationId + 1;
m_currentNotificationId = i;
} else {
i = -2;
}
MainActivity.logi("Posting notification with id: " + i);
notificationManager.notify(i, notification);
} catch (Exception e) {
LogInfo("DelayedNotificationService: Notification Exception: " + e.toString());
}
}
public String GetNotificationContentTitle(Context context, int i) {
return context.getResources().getString(R.string.app_name);
}
public boolean ShouldGenerateUniqueNotificationId(int i) {
return MainActivity.IsAtLeastAPI(24) && i != 2;
}
public Notification CreateStackedNotification(SerialisedNotificationInfo serialisedNotificationInfo, Notification.Builder builder, String str) {
String str2;
Notification.InboxStyle inboxStyle = new Notification.InboxStyle(builder);
inboxStyle.addLine(str);
int i = 0;
for (int GetNotificationCount = serialisedNotificationInfo.GetNotificationCount() - 1; GetNotificationCount >= 0; GetNotificationCount--) {
try {
str2 = serialisedNotificationInfo.GetNotificationString(GetNotificationCount);
} catch (Exception e) {
LogError("Error getting notification string: " + e.toString());
str2 = "";
}
inboxStyle.addLine(str2);
i++;
if (i >= 4) {
break;
}
}
return inboxStyle.build();
}
public void PostSummaryNotification(NotificationManager notificationManager, Context context, PendingIntent pendingIntent, String str, String str2) {
Notification.Builder groupSummary = new Notification.Builder(getApplicationContext()).setSmallIcon(R.mipmap.icon_notification).setColor(context.getResources().getColor(R.color.NotificationColor)).setStyle(new Notification.BigTextStyle().setSummaryText(str)).setContentIntent(pendingIntent).setGroup(GetNotificationGroupKey(context)).setGroupSummary(true);
if (MainActivity.IsAtLeastAPI(26)) {
groupSummary.setChannelId(str2);
}
notificationManager.notify(999, groupSummary.build());
}
public Notification CreateBigTextNotification(Notification.Builder builder, String str) {
return new Notification.BigTextStyle(builder).bigText(str).build();
}
public static Uri GetNotificationSoundUri(Context context) {
return Uri.parse("android.resource://" + context.getPackageName() + "/" + R.raw.push_notification);
}
private boolean IsConnectedToNetwork() {
NetworkInfo activeNetworkInfo;
ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService("connectivity");
return connectivityManager != null && (activeNetworkInfo = connectivityManager.getActiveNetworkInfo()) != null && activeNetworkInfo.isAvailable() && activeNetworkInfo.isConnected();
}
public void showDelayedNotification(Intent intent, int i) {
int intExtra;
long elapsedRealtime = SystemClock.elapsedRealtime() + (i * 1000);
int intExtra2 = intent.getIntExtra("id", -2);
LogInfo("Notifications : showDelayedNotification: " + intent.getStringExtra("message") + " " + i);
if (intExtra2 == 1 && (intExtra = intent.getIntExtra("reminder", 0)) >= 1 && i == 172800) {
intent.putExtra("reminder", intExtra - 1);
}
((AlarmManager) getSystemService(NotificationCompat.CATEGORY_ALARM)).set(3, elapsedRealtime, PendingIntent.getService(this, 0, intent, 335544320));
}
}

View File

@@ -0,0 +1,175 @@
package com.firemint.realracing;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Typeface;
import java.nio.ByteBuffer;
/* loaded from: classes2.dex */
class Font {
public static final int OUTLINE_INSIDE = 2;
public static final int OUTLINE_NONE = 0;
public static final int OUTLINE_OUTSIDE = 3;
public static final int OUTLINE_STROKE = 1;
private Typeface m_typeface;
private float m_size = 0.0f;
private float m_widthScale = 1.0f;
public Paint defaultPaint = null;
public float ascent = 0.0f;
public float descent = 0.0f;
public float height = 0.0f;
public float top = 0.0f;
public float bottom = 0.0f;
public float leading = 0.0f;
public float glyphOffX = 0.0f;
public float glyphOffY = 0.0f;
public float glyphWidth = 0.0f;
public float glyphHeight = 0.0f;
public float glyphAdvance = 0.0f;
public int bmpLeft = 0;
public int bmpTop = 0;
public int bmpWidth = 0;
public int bmpHeight = 0;
public int bmpPitch = 0;
byte[] bmpData = null;
public float getSize() {
return this.m_size;
}
public Typeface getTypeface() {
return this.m_typeface;
}
public float getWidthScale() {
return this.m_widthScale;
}
public boolean init(String str, boolean z, boolean z2, float f, float f2) {
Typeface createFromFile = Typeface.createFromFile(str);
if (createFromFile == null) {
return false;
}
Typeface create = Typeface.create(createFromFile, (z && z2) ? 3 : z ? 1 : z2 ? 2 : 0);
this.m_typeface = create;
if (create == null) {
return false;
}
this.m_size = f;
if (f2 > 0.0f) {
this.m_widthScale = f2;
}
Paint paint = new Paint();
this.defaultPaint = paint;
paint.setColor(-1);
this.defaultPaint.setTypeface(this.m_typeface);
this.defaultPaint.setTextSize(this.m_size);
this.defaultPaint.setTextScaleX(this.m_widthScale);
this.defaultPaint.setAntiAlias(true);
this.defaultPaint.setTextAlign(Paint.Align.LEFT);
Paint.FontMetrics fontMetrics = this.defaultPaint.getFontMetrics();
float f3 = -fontMetrics.ascent;
this.ascent = f3;
float f4 = fontMetrics.descent;
this.descent = f4;
this.height = f3 + f4;
this.top = -fontMetrics.top;
this.bottom = fontMetrics.bottom;
this.leading = fontMetrics.leading;
return true;
}
public boolean loadGlyph(int i) {
if (this.defaultPaint == null) {
return false;
}
try {
String str = new String(new int[]{i}, 0, 1);
this.defaultPaint.getTextBounds(str, 0, str.length(), new Rect());
this.glyphOffX = r6.left;
this.glyphOffY = -r6.top;
this.glyphWidth = r6.width();
this.glyphHeight = r6.height();
float[] fArr = new float[str.length()];
this.defaultPaint.getTextWidths(str, fArr);
this.glyphAdvance = fArr[0];
return true;
} catch (IllegalArgumentException unused) {
return false;
}
}
public boolean loadBitmap(int i, float f, float f2, float f3, int i2) {
if (this.defaultPaint == null) {
return false;
}
try {
String str = new String(new int[]{i}, 0, 1);
this.defaultPaint.getTextBounds(str, 0, str.length(), new Rect());
float f4 = (i2 == 1 || i2 == 3) ? 1.0f + f3 : 1.0f;
float floor = (float) Math.floor((r7.left + f) - f4);
float ceil = (float) Math.ceil(r7.right + f + f4);
float floor2 = (float) Math.floor(f4);
float ceil2 = (float) Math.ceil((r7.bottom - r7.top) + f4);
this.bmpLeft = (int) floor;
this.bmpTop = -((int) floor2);
int i3 = (int) (ceil - floor);
this.bmpWidth = i3;
int i4 = (int) (ceil2 - floor2);
this.bmpHeight = i4;
if (i3 > 0 && i4 > 0) {
Bitmap createBitmap = Bitmap.createBitmap(i3, i4, Bitmap.Config.ALPHA_8);
Canvas canvas = new Canvas(createBitmap);
createBitmap.eraseColor(Color.argb(0, 0, 0, 0));
canvas.drawText(str, f - floor, 0.0f, this.defaultPaint);
byte[] bArr = new byte[createBitmap.getWidth() * createBitmap.getHeight()];
this.bmpData = bArr;
createBitmap.copyPixelsToBuffer(ByteBuffer.wrap(bArr));
this.bmpPitch = createBitmap.getRowBytes();
createBitmap.recycle();
return true;
}
} catch (IllegalArgumentException unused) {
}
return false;
}
public boolean loadBitmapDynamic(int i, float f, float f2, float f3, int i2) {
if (this.defaultPaint == null) {
return false;
}
try {
String str = new String(new int[]{i}, 0, 1);
this.defaultPaint.getTextBounds(str, 0, str.length(), new Rect());
float f4 = (i2 == 1 || i2 == 3) ? 1.0f + f3 : 1.0f;
float f5 = -f2;
float floor = (float) Math.floor((r8.left + f) - f4);
float ceil = (float) Math.ceil(r8.right + f + f4);
float floor2 = (float) Math.floor((r8.top + f5) - f4);
float ceil2 = (float) Math.ceil(r8.bottom + f5 + f4);
this.bmpLeft = (int) floor;
this.bmpTop = -((int) floor2);
int i3 = (int) (ceil - floor);
this.bmpWidth = i3;
int i4 = (int) (ceil2 - floor2);
this.bmpHeight = i4;
if (i3 > 0 && i4 > 0) {
Bitmap createBitmap = Bitmap.createBitmap(i3, i4, Bitmap.Config.ALPHA_8);
Canvas canvas = new Canvas(createBitmap);
createBitmap.eraseColor(Color.argb(0, 0, 0, 0));
canvas.drawText(str, f - floor, f5 - floor2, this.defaultPaint);
byte[] bArr = new byte[createBitmap.getWidth() * createBitmap.getHeight()];
this.bmpData = bArr;
createBitmap.copyPixelsToBuffer(ByteBuffer.wrap(bArr));
this.bmpPitch = createBitmap.getRowBytes();
createBitmap.recycle();
return true;
}
} catch (IllegalArgumentException unused) {
}
return false;
}
}

View File

@@ -0,0 +1,28 @@
package com.firemint.realracing;
import android.opengl.GLSurfaceView;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
/* loaded from: classes2.dex */
class GLRenderer implements GLSurfaceView.Renderer {
@Override // android.opengl.GLSurfaceView.Renderer
public void onSurfaceCreated(GL10 gl10, EGLConfig eGLConfig) {
MainActivity.instance.onViewCreatedJNI();
}
@Override // android.opengl.GLSurfaceView.Renderer
public void onSurfaceChanged(GL10 gl10, int i, int i2) {
MainActivity mainActivity = MainActivity.instance;
mainActivity.OnViewChanged(i, i2, mainActivity.getScreenOrientation(), MainActivity.instance.getScreenRotation());
}
@Override // android.opengl.GLSurfaceView.Renderer
public void onDrawFrame(GL10 gl10) {
if (MainActivity.getGameState() == 5) {
return;
}
MainActivity mainActivity = MainActivity.instance;
mainActivity.onViewRenderJNI(mainActivity.getScreenOrientation(), MainActivity.instance.getScreenRotation());
}
}

View File

@@ -0,0 +1,331 @@
package com.firemint.realracing;
import android.annotation.TargetApi;
import android.content.Context;
import android.opengl.GLSurfaceView;
import android.util.Log;
import android.view.MotionEvent;
import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.egl.EGLContext;
import javax.microedition.khronos.egl.EGLDisplay;
/* loaded from: classes2.dex */
public class GLView extends GLSurfaceView {
private static final int EGL_CONTEXT_CLIENT_VERSION = 12440;
private static final int EGL_COVERAGE_BUFFERS_NV = 12512;
private static final int EGL_COVERAGE_SAMPLES_NV = 12513;
private static final int EGL_DEPTH_ENCODING_NONLINEAR_NV = 12515;
private static final int EGL_DEPTH_ENCODING_NV = 12514;
private static final int EGL_OPENGL_ES2_BIT = 4;
private EGLContext m_glContext;
public EGLContext getGLContext() {
return this.m_glContext;
}
/* JADX WARN: Multi-variable type inference failed */
@TargetApi(11)
public GLView(Context context) {
super(context);
this.m_glContext = null;
setImportantForAccessibility(2);
setPreserveEGLContextOnPause(true);
setFocusable(true);
setFocusableInTouchMode(true);
setEGLConfigChooser(new ConfigChooser());
setEGLContextFactory(new ContextFactory());
setRenderer(new GLRenderer());
}
public class ConfigChooser implements GLSurfaceView.EGLConfigChooser {
static final /* synthetic */ boolean $assertionsDisabled = false;
private ConfigChooser() {
}
@Override // android.opengl.GLSurfaceView.EGLConfigChooser
public EGLConfig chooseConfig(EGL10 egl10, EGLDisplay eGLDisplay) {
ConfigAttribs configAttribs = GLView.this.new ConfigAttribs();
configAttribs.redBits = 8;
configAttribs.greenBits = 8;
configAttribs.blueBits = 8;
configAttribs.alphaBits = 0;
configAttribs.stencilBits = 8;
configAttribs.depthBits = 24;
configAttribs.samples = 0;
configAttribs.nvSamples = 0;
int[] iArr = new int[1];
egl10.eglGetConfigs(eGLDisplay, null, 0, iArr);
int i = iArr[0];
if (i > 0) {
EGLConfig[] eGLConfigArr = new EGLConfig[i];
egl10.eglGetConfigs(eGLDisplay, eGLConfigArr, i, iArr);
int i2 = -1;
int i3 = -1;
for (int i4 = 0; i4 < i; i4++) {
ConfigAttribs configAttribs2 = GLView.this.new ConfigAttribs(egl10, eGLDisplay, eGLConfigArr[i4]);
configAttribs2.print(false);
int scoreConfig = scoreConfig(configAttribs2, configAttribs);
if (scoreConfig != -1 && (scoreConfig < i3 || i3 == -1)) {
i2 = i4;
i3 = scoreConfig;
}
}
StringBuilder sb = new StringBuilder();
sb.append("found config = ");
sb.append(i2);
if (i2 == -1) {
configAttribs.depthBits = 16;
for (int i5 = 0; i5 < i; i5++) {
ConfigAttribs configAttribs3 = GLView.this.new ConfigAttribs(egl10, eGLDisplay, eGLConfigArr[i5]);
configAttribs3.print(false);
int scoreConfig2 = scoreConfig(configAttribs3, configAttribs);
if (scoreConfig2 != -1 && (scoreConfig2 < i3 || i3 == -1)) {
i2 = i5;
i3 = scoreConfig2;
}
}
}
GLView.this.new ConfigAttribs(egl10, eGLDisplay, eGLConfigArr[i2]).print(true);
return eGLConfigArr[i2];
}
Log.e("GLView", "Failed to find acceptable EGLConfig!");
return null;
}
private int scoreConfig(ConfigAttribs configAttribs, ConfigAttribs configAttribs2) {
int i;
int i2;
if ((configAttribs.surfaceType & 4) == 0 || (configAttribs.renderableType & 4) == 0 || configAttribs.redBits < configAttribs2.redBits || configAttribs.greenBits < configAttribs2.greenBits || configAttribs.blueBits < configAttribs2.blueBits || configAttribs.stencilBits < configAttribs2.stencilBits || (i = configAttribs.depthBits) < (i2 = configAttribs2.depthBits)) {
return -1;
}
int abs = Math.abs(i - i2);
int abs2 = Math.abs(configAttribs.redBits - configAttribs2.redBits);
int i3 = (abs * abs) + (abs2 * abs2);
int abs3 = Math.abs(configAttribs.greenBits - configAttribs2.greenBits);
int i4 = i3 + (abs3 * abs3);
int abs4 = Math.abs(configAttribs.blueBits - configAttribs2.blueBits);
int i5 = i4 + (abs4 * abs4);
int abs5 = Math.abs(configAttribs.alphaBits - configAttribs2.alphaBits);
int i6 = i5 + (abs5 * abs5);
int abs6 = Math.abs(configAttribs.stencilBits - configAttribs2.stencilBits);
int i7 = i6 + (abs6 * abs6);
int abs7 = Math.abs(configAttribs.samples - configAttribs2.samples);
int i8 = i7 + (abs7 * abs7);
int abs8 = Math.abs(configAttribs.nvSamples - configAttribs2.nvSamples);
int i9 = i8 + (abs8 * abs8);
if (configAttribs.nv_depthEncoding != GLView.EGL_DEPTH_ENCODING_NONLINEAR_NV) {
i9++;
}
return (configAttribs2.nvSamples <= 0 || configAttribs.nvSamples <= 0) ? i9 : i9 + 1;
}
}
public class ConfigAttribs {
int alphaBits;
int blueBits;
int caveat;
int depthBits;
int greenBits;
int level;
int nvSamples;
int nv_depthEncoding;
int redBits;
int renderableType;
int samples;
int stencilBits;
int surfaceType;
int transparentType;
public ConfigAttribs() {
this.redBits = 0;
this.greenBits = 0;
this.blueBits = 0;
this.alphaBits = 0;
this.depthBits = 0;
this.stencilBits = 0;
this.samples = 0;
this.nvSamples = 0;
this.level = 0;
this.caveat = 0;
this.surfaceType = 0;
this.renderableType = 0;
this.transparentType = 0;
this.nv_depthEncoding = 0;
}
public ConfigAttribs(EGL10 egl10, EGLDisplay eGLDisplay, EGLConfig eGLConfig) {
this.redBits = 0;
this.greenBits = 0;
this.blueBits = 0;
this.alphaBits = 0;
this.depthBits = 0;
this.stencilBits = 0;
this.samples = 0;
this.nvSamples = 0;
this.level = 0;
this.caveat = 0;
this.surfaceType = 0;
this.renderableType = 0;
this.transparentType = 0;
this.nv_depthEncoding = 0;
this.redBits = getEGLConfigAttrib(egl10, eGLDisplay, eGLConfig, 12324);
this.greenBits = getEGLConfigAttrib(egl10, eGLDisplay, eGLConfig, 12323);
this.blueBits = getEGLConfigAttrib(egl10, eGLDisplay, eGLConfig, 12322);
this.alphaBits = getEGLConfigAttrib(egl10, eGLDisplay, eGLConfig, 12321);
this.depthBits = getEGLConfigAttrib(egl10, eGLDisplay, eGLConfig, 12325);
this.stencilBits = getEGLConfigAttrib(egl10, eGLDisplay, eGLConfig, 12326);
this.samples = getEGLConfigAttrib(egl10, eGLDisplay, eGLConfig, 12337);
this.nvSamples = getEGLConfigAttrib(egl10, eGLDisplay, eGLConfig, GLView.EGL_COVERAGE_SAMPLES_NV);
this.level = getEGLConfigAttrib(egl10, eGLDisplay, eGLConfig, 12329);
this.caveat = getEGLConfigAttrib(egl10, eGLDisplay, eGLConfig, 12327);
this.surfaceType = getEGLConfigAttrib(egl10, eGLDisplay, eGLConfig, 12339);
this.renderableType = getEGLConfigAttrib(egl10, eGLDisplay, eGLConfig, 12352);
this.transparentType = getEGLConfigAttrib(egl10, eGLDisplay, eGLConfig, 12340);
this.nv_depthEncoding = getEGLConfigAttrib(egl10, eGLDisplay, eGLConfig, GLView.EGL_DEPTH_ENCODING_NV);
}
private int getEGLConfigAttrib(EGL10 egl10, EGLDisplay eGLDisplay, EGLConfig eGLConfig, int i) {
int[] iArr = {0};
egl10.eglGetConfigAttrib(eGLDisplay, eGLConfig, i, iArr);
return iArr[0];
}
/* JADX INFO: Access modifiers changed from: private */
public void print(boolean z) {
String str = (this.surfaceType & 4) != 0 ? "true" : "false";
String str2 = (this.renderableType & 4) != 0 ? "true" : "false";
int i = this.caveat;
String str3 = i != 12368 ? i != 12369 ? "none" : "bad" : "slow";
String str4 = this.nv_depthEncoding == GLView.EGL_DEPTH_ENCODING_NONLINEAR_NV ? "nonlinear" : "none";
String str5 = this.transparentType == 12370 ? "rgb" : "none";
if (z) {
StringBuilder sb = new StringBuilder();
sb.append("EGL_RED_SIZE: ");
sb.append(this.redBits);
StringBuilder sb2 = new StringBuilder();
sb2.append("EGL_GREEN_SIZE: ");
sb2.append(this.greenBits);
StringBuilder sb3 = new StringBuilder();
sb3.append("EGL_BLUE_SIZE: ");
sb3.append(this.blueBits);
StringBuilder sb4 = new StringBuilder();
sb4.append("EGL_ALPHA_SIZE: ");
sb4.append(this.alphaBits);
StringBuilder sb5 = new StringBuilder();
sb5.append("EGL_DEPTH_SIZE: ");
sb5.append(this.depthBits);
StringBuilder sb6 = new StringBuilder();
sb6.append("EGL_STENCIL_SIZE: ");
sb6.append(this.stencilBits);
StringBuilder sb7 = new StringBuilder();
sb7.append("EGL_SAMPLES: ");
sb7.append(this.samples);
StringBuilder sb8 = new StringBuilder();
sb8.append("EGL_COVERAGE_SAMPLES_NV: ");
sb8.append(this.nvSamples);
StringBuilder sb9 = new StringBuilder();
sb9.append("EGL_LEVEL: ");
sb9.append(this.level);
StringBuilder sb10 = new StringBuilder();
sb10.append("EGL_TRANSPARENT_TYPE: ");
sb10.append(str5);
StringBuilder sb11 = new StringBuilder();
sb11.append("EGL_WINDOW_BIT: ");
sb11.append(str);
StringBuilder sb12 = new StringBuilder();
sb12.append("EGL_OPENGL_ES2_BIT: ");
sb12.append(str2);
StringBuilder sb13 = new StringBuilder();
sb13.append("EGL_CONFIG_CAVEAT: ");
sb13.append(str3);
StringBuilder sb14 = new StringBuilder();
sb14.append("EGL_DEPTH_ENCODING_NV: ");
sb14.append(str4);
return;
}
String.format("EGLConfig r:%d g:%d b:%d a:%d d:%d s:%d aa:%d nvaa:%d level:%d trans:%s gles2:%s window:%s caveat:%s nvDepthEnc:%s", Integer.valueOf(this.redBits), Integer.valueOf(this.greenBits), Integer.valueOf(this.blueBits), Integer.valueOf(this.alphaBits), Integer.valueOf(this.depthBits), Integer.valueOf(this.stencilBits), Integer.valueOf(this.samples), Integer.valueOf(this.nvSamples), Integer.valueOf(this.level), str5, str2, str, str3, str4);
}
}
public class ContextFactory implements GLSurfaceView.EGLContextFactory {
private ContextFactory() {
}
@Override // android.opengl.GLSurfaceView.EGLContextFactory
public EGLContext createContext(EGL10 egl10, EGLDisplay eGLDisplay, EGLConfig eGLConfig) {
Log.w("RealRacing3", "creating OpenGL ES 2.0 context");
int[] iArr = {GLView.EGL_CONTEXT_CLIENT_VERSION, 2, 12344};
GLView.this.m_glContext = egl10.eglCreateContext(eGLDisplay, eGLConfig, EGL10.EGL_NO_CONTEXT, iArr);
GLView.this.new ConfigAttribs(egl10, eGLDisplay, eGLConfig).print(true);
return GLView.this.m_glContext;
}
@Override // android.opengl.GLSurfaceView.EGLContextFactory
public void destroyContext(EGL10 egl10, EGLDisplay eGLDisplay, EGLContext eGLContext) {
egl10.eglDestroyContext(eGLDisplay, eGLContext);
GLView.this.m_glContext = null;
}
}
@Override // android.view.View
public boolean onTouchEvent(MotionEvent motionEvent) {
if (MainActivity.instance.getPaused()) {
return true;
}
int actionMasked = motionEvent.getActionMasked();
if (actionMasked == 0 || actionMasked == 5) {
int actionIndex = motionEvent.getActionIndex();
queueEvent(new TouchEvent(actionMasked, motionEvent.getPointerId(actionIndex), motionEvent.getX(actionIndex), motionEvent.getY(actionIndex), false));
} else if (actionMasked == 2) {
for (int i = 0; i < motionEvent.getPointerCount(); i++) {
queueEvent(new TouchEvent(actionMasked, motionEvent.getPointerId(i), motionEvent.getX(i), motionEvent.getY(i), false));
}
} else if (actionMasked == 1 || actionMasked == 6) {
int actionIndex2 = motionEvent.getActionIndex();
queueEvent(new TouchEvent(actionMasked, motionEvent.getPointerId(actionIndex2), motionEvent.getX(actionIndex2), motionEvent.getY(actionIndex2), motionEvent.getActionMasked() == 1));
} else if (actionMasked == 3) {
queueEvent(new TouchEvent(actionMasked, 0, 0.0f, 0.0f, false));
}
return true;
}
public class TouchEvent implements Runnable {
int m_action;
int m_id;
boolean m_last;
float m_x;
float m_y;
public TouchEvent(int i, int i2, float f, float f2, boolean z) {
this.m_action = i;
this.m_id = i2;
this.m_x = f;
this.m_y = f2;
this.m_last = z;
}
@Override // java.lang.Runnable
public void run() {
try {
int i = this.m_action;
if (i != 0 && i != 5) {
if (i == 2) {
MainActivity.instance.onTouchMoveJNI(this.m_id, this.m_x, this.m_y);
} else {
if (i != 1 && i != 6) {
if (i == 3) {
MainActivity.instance.onTouchCancelJNI();
}
}
MainActivity.instance.onTouchEndJNI(this.m_id, this.m_x, this.m_y, this.m_last);
}
}
MainActivity.instance.onTouchBeginJNI(this.m_id, this.m_x, this.m_y);
} catch (UnsatisfiedLinkError e) {
Log.e("RealRacing3", "UnsatisfiedLinkError when processing touch input: " + e.getMessage());
}
}
}
}

View File

@@ -0,0 +1,5 @@
package com.firemint.realracing;
/* loaded from: classes2.dex */
public abstract /* synthetic */ class GlyphVector$$ExternalSyntheticApiModelOutline0 {
}

View File

@@ -0,0 +1,389 @@
package com.firemint.realracing;
import android.annotation.TargetApi;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.opengl.GLUtils;
import android.text.BoringLayout;
import android.text.Layout;
import android.text.StaticLayout;
import android.text.TextPaint;
import android.text.TextUtils;
import android.util.Log;
import androidx.work.Data;
import javax.microedition.khronos.opengles.GL10;
/* loaded from: classes2.dex */
class GlyphVector {
public static final int fmParagraphAlignCentered = 2;
public static final int fmParagraphAlignJustified = 3;
public static final int fmParagraphAlignLeft = 0;
public static final int fmParagraphAlignNatural = 4;
public static final int fmParagraphAlignRight = 1;
public static final int fmParagraphCharWrap = 1;
public static final int fmParagraphClip = 2;
public static final int fmParagraphTruncateHead = 3;
public static final int fmParagraphTruncateMiddle = 5;
public static final int fmParagraphTruncateTail = 4;
public static final int fmParagraphWordWrap = 0;
public static final int fmParagraphWordWrapTruncate = 6;
public float offsetX = 0.0f;
public float offsetY = 0.0f;
public float boundsW = 0.0f;
public float boundsH = 0.0f;
public float pixelBoundsW = 0.0f;
public float pixelBoundsH = 0.0f;
public float pixelTopOffset = 0.0f;
public int numLines = 0;
public int texId = -1;
public int texWidth = 0;
public int texHeight = 0;
private String m_text = null;
private TextPaint m_paint = null;
private Rect m_bounds = null;
private Layout m_layout = null;
private int m_ellipsisOffset = 0;
private StaticLayout m_ellipsisLayout = null;
private String sanitize(String str) {
return str;
}
public void init(Font font, String str) {
String sanitize = sanitize(str);
this.m_text = sanitize;
TextPaint textPaint = new TextPaint();
this.m_paint = textPaint;
textPaint.setColor(-1);
this.m_paint.setTypeface(font.getTypeface());
this.m_paint.setTextSize(font.getSize());
this.m_paint.setTextScaleX(font.getWidthScale());
this.m_paint.setTextAlign(Paint.Align.LEFT);
this.m_paint.setAntiAlias(true);
this.m_bounds = new Rect();
this.m_paint.getTextBounds(sanitize, 0, sanitize.length(), this.m_bounds);
Rect rect = this.m_bounds;
rect.top--;
rect.bottom = rect.bottom + 1;
this.offsetX = -rect.left;
this.offsetY = -r6;
this.boundsW = rect.width();
this.boundsH = this.m_bounds.height();
this.pixelBoundsW = this.m_bounds.width();
this.pixelBoundsH = this.m_bounds.height();
this.pixelTopOffset = 0.0f;
this.numLines = 1;
}
@TargetApi(29)
public void initWithParagraph(Font font, String str, float f, float f2, int i, int i2) {
int i3;
int i4;
int i5;
float f3;
float f4;
int i6;
float f5;
String sanitize = sanitize(str);
this.m_text = sanitize;
TextPaint textPaint = new TextPaint();
this.m_paint = textPaint;
textPaint.setColor(-1);
this.m_paint.setTypeface(font.getTypeface());
this.m_paint.setTextSize(font.getSize());
this.m_paint.setTextScaleX(font.getWidthScale());
this.m_paint.setAntiAlias(true);
float f6 = f < 0.0f ? 0.0f : f;
float f7 = f2 < 0.0f ? 0.0f : f2;
Layout.Alignment alignment = Layout.Alignment.ALIGN_NORMAL;
if (i2 != 0) {
if (i2 == 1) {
alignment = Layout.Alignment.ALIGN_OPPOSITE;
} else if (i2 == 2) {
alignment = Layout.Alignment.ALIGN_CENTER;
}
}
Layout.Alignment alignment2 = alignment;
if (i == 1) {
Log.e("RealRacing3", "Using unsupported text break style: fmParagraphCharWrap! Falling back to WordWrap.");
i3 = 0;
} else {
i3 = i;
}
if (i3 == 0 || i3 == 1 || i3 == 2 || i3 == 6) {
i4 = i3;
i5 = 0;
f3 = f7;
f4 = f6;
this.m_layout = new StaticLayout(sanitize, this.m_paint, (int) f4, alignment2, 1.0f, 0.0f, false);
} else {
TextUtils.TruncateAt truncateAt = TextUtils.TruncateAt.START;
if (i3 != 3) {
if (i3 == 4) {
truncateAt = TextUtils.TruncateAt.END;
} else if (i3 == 5) {
truncateAt = TextUtils.TruncateAt.MIDDLE;
}
}
TextUtils.TruncateAt truncateAt2 = truncateAt;
sanitize.replace('\n', ' ');
BoringLayout.Metrics isBoring = BoringLayout.isBoring(sanitize, this.m_paint);
if (isBoring != null) {
i4 = i3;
f3 = f7;
this.m_layout = new BoringLayout(sanitize, this.m_paint, (int) (2.0f * f6), alignment2, 1.0f, 0.0f, isBoring, false, truncateAt2, (int) f6);
f5 = f6;
} else {
i4 = i3;
f3 = f7;
f5 = f6;
this.m_layout = new StaticLayout(sanitize, 0, sanitize.length(), this.m_paint, (int) (2.0f * f6), alignment2, 1.0f, 0.0f, false, truncateAt2, (int) f6);
}
int i7 = 0;
while (true) {
if (i7 >= this.m_layout.getLineCount()) {
f4 = f5;
i5 = 0;
break;
} else {
if (this.m_layout.getEllipsisCount(i7) > 0) {
i5 = 0;
sanitize = this.m_layout.getText().toString().substring(0, this.m_layout.getLineStart(i7) + this.m_layout.getEllipsisStart(i7) + 1);
f4 = f5;
this.m_layout = new StaticLayout(sanitize, 0, sanitize.length(), this.m_paint, (int) f4, alignment2, 1.0f, 0.0f, false);
break;
}
i7++;
}
}
}
this.m_bounds = findLayoutBounds(this.m_layout);
this.numLines = this.m_layout.getLineCount();
int i8 = i4;
float f8 = f3;
if (i8 == 2 && f8 > 0.0f) {
int i9 = i5;
while (true) {
if (i9 >= this.numLines) {
break;
}
if (this.m_layout.getLineBottom(i9) - this.m_bounds.top > ((int) f8)) {
int i10 = i9 - 1;
if (i10 < 0) {
i10 = i5;
}
Layout staticLayout = new StaticLayout(sanitize, 0, this.m_layout.getLineVisibleEnd(i10), this.m_paint, (int) f4, alignment2, 1.0f, 0.0f, false);
this.m_layout = staticLayout;
this.m_bounds = findLayoutBounds(staticLayout);
this.numLines = this.m_layout.getLineCount();
} else {
i9++;
}
}
}
if (i8 == 6 && f8 > 0.0f) {
int i11 = i5;
while (true) {
if (i11 >= this.numLines) {
break;
}
if (this.m_layout.getLineBottom(i11) - this.m_bounds.top > ((int) f8)) {
int i12 = i11 - 1;
if (i12 < 0) {
i12 = i5;
}
int lineStart = this.m_layout.getLineStart(i12);
int length = sanitize.length();
TextPaint textPaint2 = this.m_paint;
int i13 = (int) f4;
TextUtils.TruncateAt truncateAt3 = TextUtils.TruncateAt.END;
StaticLayout staticLayout2 = new StaticLayout(sanitize, lineStart, length, textPaint2, i13, alignment2, 1.0f, 0.0f, false, truncateAt3, i13);
this.m_ellipsisLayout = staticLayout2;
Rect findLayoutBounds = findLayoutBounds(staticLayout2);
if (this.m_ellipsisLayout.getLineCount() > 1) {
String substring = sanitize.substring(this.m_ellipsisLayout.getLineStart(i5), this.m_ellipsisLayout.getLineVisibleEnd(i5));
if (!substring.endsWith("")) {
substring = substring + "";
}
String str2 = substring;
StaticLayout staticLayout3 = new StaticLayout(str2, 0, str2.length(), this.m_paint, i13, alignment2, 1.0f, 0.0f, false, truncateAt3, i13);
this.m_ellipsisLayout = staticLayout3;
findLayoutBounds = findLayoutBounds(staticLayout3);
}
if (i12 > 0) {
Layout staticLayout4 = new StaticLayout(sanitize, 0, this.m_layout.getLineVisibleEnd(i12 - 1), this.m_paint, i13, alignment2, 1.0f, 0.0f, false);
this.m_layout = staticLayout4;
Rect findLayoutBounds2 = findLayoutBounds(staticLayout4);
this.m_bounds = findLayoutBounds2;
int height = findLayoutBounds2.height();
this.m_ellipsisOffset = height;
findLayoutBounds.offset(i5, height);
this.m_bounds.union(findLayoutBounds);
this.numLines = this.m_layout.getLineCount() + this.m_ellipsisLayout.getLineCount();
} else {
StaticLayout staticLayout5 = this.m_ellipsisLayout;
this.m_layout = staticLayout5;
this.m_ellipsisLayout = null;
this.m_bounds = findLayoutBounds;
this.numLines = staticLayout5.getLineCount();
}
} else {
i11++;
}
}
}
Rect rect = new Rect();
rect.left = 10000000;
rect.right = -10000000;
rect.top = 10000000;
rect.bottom = -10000000;
this.pixelTopOffset = 0.0f;
int i14 = i5;
while (true) {
i6 = this.numLines;
if (i14 >= i6) {
break;
}
Rect rect2 = new Rect();
this.m_paint.getTextBounds(sanitize, this.m_layout.getLineStart(i14), this.m_layout.getLineEnd(i14), rect2);
float lineBaseline = this.m_layout.getLineBaseline(i14);
if (i14 == 0) {
this.pixelTopOffset = (rect2.top + lineBaseline) - this.m_layout.getLineTop(i14);
}
int i15 = (int) (rect2.top + lineBaseline);
rect2.top = i15;
int i16 = (int) (rect2.bottom + lineBaseline);
rect2.bottom = i16;
int i17 = rect2.left;
if (i17 < rect.left) {
rect.left = i17;
}
int i18 = rect2.right;
if (i18 > rect.right) {
rect.right = i18;
}
if (i15 < rect.top) {
rect.top = i15;
}
if (i16 > rect.bottom) {
rect.bottom = i16;
}
i14++;
}
if (i6 > 0) {
this.offsetX = 0.0f;
Rect rect3 = new Rect();
int lineCount = this.m_layout.getLineCount() - 1;
this.m_paint.getTextBounds(sanitize, this.m_layout.getLineStart(lineCount), this.m_layout.getLineEnd(lineCount), rect3);
this.offsetY = Math.max(rect3.bottom - (MainActivity.IsAtLeastAPI(29) ? this.m_paint.getUnderlinePosition() : 0.0f), 0.0f);
}
this.boundsW = this.m_bounds.width();
this.boundsH = this.m_bounds.height();
this.pixelBoundsW = rect.right - rect.left;
this.pixelBoundsH = rect.bottom - rect.top;
}
public Rect findLayoutBounds(Layout layout) {
int lineCount = layout.getLineCount();
Rect rect = new Rect();
for (int i = 0; i < lineCount; i++) {
Rect rect2 = new Rect();
if (layout.getEllipsisCount(i) > 0) {
int floor = (int) Math.floor(layout.getLineLeft(i));
rect2.left = floor;
rect2.right = floor + layout.getEllipsizedWidth();
} else {
rect2.left = (int) Math.floor(layout.getLineLeft(i));
rect2.right = (int) Math.ceil(layout.getLineRight(i));
}
rect2.top = layout.getLineTop(i);
int lineBottom = layout.getLineBottom(i);
rect2.bottom = lineBottom;
if (i == 0 || rect2.left < rect.left) {
rect.left = rect2.left;
}
if (i == 0 || rect2.top < rect.top) {
rect.top = rect2.top;
}
if (i == 0 || rect2.right > rect.right) {
rect.right = rect2.right;
}
if (i == 0 || lineBottom > rect.bottom) {
rect.bottom = lineBottom;
}
}
return rect;
}
public boolean createTexture() {
if (this.m_text == null || this.m_paint == null || this.m_bounds == null) {
return false;
}
this.texWidth = 1;
while (this.texWidth < this.m_bounds.width()) {
this.texWidth *= 2;
}
this.texHeight = 1;
while (this.texHeight < this.m_bounds.height()) {
this.texHeight *= 2;
}
Bitmap createBitmap = Bitmap.createBitmap(this.texWidth, this.texHeight, Bitmap.Config.ARGB_4444);
Canvas canvas = new Canvas(createBitmap);
createBitmap.eraseColor(Color.argb(0, 0, 0, 0));
if (this.m_layout == null) {
String str = this.m_text;
Rect rect = this.m_bounds;
canvas.drawText(str, -rect.left, -rect.top, this.m_paint);
} else {
canvas.translate(-this.m_bounds.left, -this.pixelTopOffset);
this.m_layout.draw(canvas);
if (this.m_ellipsisLayout != null) {
canvas.translate(0.0f, this.m_ellipsisOffset);
this.m_ellipsisLayout.draw(canvas);
}
}
int[] iArr = new int[1];
GL10 gl10 = (GL10) MainActivity.instance.getGLView().getGLContext().getGL();
gl10.glGenTextures(1, iArr, 0);
int i = iArr[0];
this.texId = i;
if (i < 0) {
createBitmap.recycle();
return false;
}
gl10.glBindTexture(3553, i);
gl10.glTexParameterf(3553, 10241, 9729.0f);
gl10.glTexParameterf(3553, Data.MAX_DATA_BYTES, 9729.0f);
gl10.glTexParameterf(3553, 10242, 33071.0f);
gl10.glTexParameterf(3553, 10243, 33071.0f);
gl10.glPixelStorei(3317, 1);
GLUtils.texImage2D(3553, 0, createBitmap, 0);
createBitmap.recycle();
return true;
}
public boolean renderToTexture(int i, int i2, int i3, float f) {
if (this.m_text == null || this.m_paint == null || this.m_bounds == null) {
return false;
}
Bitmap createBitmap = Bitmap.createBitmap(i2, i3, Bitmap.Config.ALPHA_8);
Canvas canvas = new Canvas(createBitmap);
createBitmap.eraseColor(Color.argb(0, 0, 0, 0));
float f2 = i3;
canvas.translate(0.0f, f2);
canvas.scale(1.0f, -1.0f);
Rect rect = this.m_bounds;
canvas.translate(((i2 - (this.m_bounds.width() * f)) * 0.5f) - (rect.left * f), ((f2 - (rect.height() * f)) * 0.5f) - (this.m_bounds.top * f));
canvas.scale(f, f);
canvas.drawText(this.m_text, 0.0f, 0.0f, this.m_paint);
GL10 gl10 = (GL10) MainActivity.instance.getGLView().getGLContext().getGL();
gl10.glBindTexture(3553, i);
gl10.glPixelStorei(3317, 1);
GLUtils.texSubImage2D(3553, 0, 0, 0, createBitmap, 6409, 5121);
createBitmap.recycle();
return true;
}
}

View File

@@ -0,0 +1,181 @@
package com.firemint.realracing;
import android.os.Bundle;
import android.util.Log;
import androidx.annotation.NonNull;
import com.google.ads.mediation.admob.AdMobAdapter;
import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdLoader;
import com.google.android.gms.ads.LoadAdError;
import com.google.android.gms.ads.MobileAds;
import com.google.android.gms.ads.RequestConfiguration;
import com.google.android.gms.ads.admanager.AdManagerAdRequest;
import com.google.android.gms.ads.nativead.NativeAd;
import com.google.android.gms.ads.nativead.NativeAdOptions;
import com.google.android.gms.ads.nativead.NativeCustomFormatAd;
import java.util.List;
/* loaded from: classes2.dex */
public class GoogleNativeAdManager extends AdListener implements NativeCustomFormatAd.OnCustomFormatAdLoadedListener {
public static final String TAG = "GoogleNativeAdManager";
private static boolean s_AllowTargetedMarketing = false;
private static boolean s_GDPRCountry = false;
private static String s_LanguageId = null;
private static boolean s_UnderAge = false;
private long m_Listener;
/* JADX INFO: Access modifiers changed from: private */
public static native void adLoadedCallback(long j, NativeCustomFormatAd nativeCustomFormatAd, int i);
private static native void onCustomClickCallback(long j, NativeCustomFormatAd nativeCustomFormatAd, String str);
public void Initialise(long j, boolean z, boolean z2, boolean z3) {
this.m_Listener = j;
s_AllowTargetedMarketing = z;
s_UnderAge = z2;
s_GDPRCountry = z3;
}
public static void SetAdLanguageId(String str) {
if (str == null || str.isEmpty()) {
Log.e(TAG, "Invalid language specified for Native Ads");
}
s_LanguageId = str;
}
public class Loader implements Runnable {
private String m_AdUnitId;
private GoogleNativeAdManager m_Listener;
private String m_TemplatedId;
public Loader(String str, String str2, GoogleNativeAdManager googleNativeAdManager) {
this.m_AdUnitId = str;
this.m_TemplatedId = str2;
this.m_Listener = googleNativeAdManager;
}
@Override // java.lang.Runnable
public void run() {
StringBuilder sb = new StringBuilder();
sb.append("Load ad unit (adUnitId = ");
sb.append(this.m_AdUnitId);
sb.append(", templateId = ");
sb.append(this.m_TemplatedId);
sb.append(", languageId = ");
sb.append(GoogleNativeAdManager.s_LanguageId);
sb.append(", allowTargetedMarketing = ");
sb.append(GoogleNativeAdManager.s_AllowTargetedMarketing);
sb.append(", underAge = ");
sb.append(GoogleNativeAdManager.s_UnderAge);
sb.append(", gdprCountry = ");
sb.append(GoogleNativeAdManager.s_GDPRCountry);
sb.append(")");
AdLoader.Builder builder = new AdLoader.Builder(MainActivity.instance, this.m_AdUnitId);
builder.forCustomFormatAd(this.m_TemplatedId, this.m_Listener, null);
builder.withAdListener(this.m_Listener);
NativeAdOptions.Builder builder2 = new NativeAdOptions.Builder();
builder2.setReturnUrlsForImageAssets(true);
builder.withNativeAdOptions(builder2.build());
AdManagerAdRequest.Builder builder3 = new AdManagerAdRequest.Builder();
builder3.addCustomTargeting2("rr3_language", GoogleNativeAdManager.s_LanguageId);
Bundle bundle = new Bundle();
bundle.putString("npa", GoogleNativeAdManager.s_AllowTargetedMarketing ? "0" : "1");
builder3.addCustomTargeting2("optout", GoogleNativeAdManager.s_AllowTargetedMarketing ? "no" : "yes");
builder3.addCustomTargeting2("underage", GoogleNativeAdManager.s_UnderAge ? "yes" : "no");
builder3.addCustomTargeting2("coppa", GoogleNativeAdManager.s_UnderAge ? "yes" : "no");
builder3.addNetworkExtrasBundle(AdMobAdapter.class, bundle);
MobileAds.setRequestConfiguration(new RequestConfiguration.Builder().setTagForChildDirectedTreatment((!GoogleNativeAdManager.s_UnderAge || GoogleNativeAdManager.s_GDPRCountry) ? 0 : 1).setTagForUnderAgeOfConsent((GoogleNativeAdManager.s_UnderAge && GoogleNativeAdManager.s_GDPRCountry) ? 1 : 0).build());
builder.build().loadAd(builder3.build());
}
}
public void loadAd(String str, String str2) {
if (str.isEmpty() || str2.isEmpty()) {
Log.e(TAG, "Empty adUnitId or templateId invalid!");
onAdFailedToLoad(new LoadAdError(1, "", "", null, null));
} else {
MainActivity.instance.runOnUiThread(new Loader(str, str2, this));
}
}
@Override // com.google.android.gms.ads.AdListener
public void onAdFailedToLoad(final LoadAdError loadAdError) {
Log.e(TAG, "onAdFailedToLoad: " + loadAdError.getCode());
MainActivity.instance.RunOnGlThread(new Runnable() { // from class: com.firemint.realracing.GoogleNativeAdManager.1
@Override // java.lang.Runnable
public void run() {
GoogleNativeAdManager.adLoadedCallback(GoogleNativeAdManager.this.m_Listener, null, loadAdError.getCode());
}
});
}
@Override // com.google.android.gms.ads.nativead.NativeCustomFormatAd.OnCustomFormatAdLoadedListener
public void onCustomFormatAdLoaded(@NonNull final NativeCustomFormatAd nativeCustomFormatAd) {
StringBuilder sb = new StringBuilder();
sb.append("onCustomFormatAdLoaded: ");
sb.append(nativeCustomFormatAd.getCustomFormatId());
MainActivity.instance.RunOnGlThread(new Runnable() { // from class: com.firemint.realracing.GoogleNativeAdManager.2
@Override // java.lang.Runnable
public void run() {
GoogleNativeAdManager.adLoadedCallback(GoogleNativeAdManager.this.m_Listener, nativeCustomFormatAd, -1);
}
});
}
public static int getAssetKeyCount(NativeCustomFormatAd nativeCustomFormatAd) {
return nativeCustomFormatAd.getAvailableAssetNames().size();
}
public static String getAssetKey(NativeCustomFormatAd nativeCustomFormatAd, int i) {
List<String> availableAssetNames = nativeCustomFormatAd.getAvailableAssetNames();
return (i < 0 || i > availableAssetNames.size()) ? "" : availableAssetNames.get(i);
}
public static String getText(NativeCustomFormatAd nativeCustomFormatAd, String str) {
CharSequence text = nativeCustomFormatAd.getText(str);
if (text == null) {
Log.w(TAG, "No asset found for key '" + str + "'!");
return "";
}
return text.toString();
}
public static String getImageAssetUri(NativeCustomFormatAd nativeCustomFormatAd, String str) {
NativeAd.Image image = nativeCustomFormatAd.getImage(str);
if (image == null) {
Log.w(TAG, "Image for key '" + str + "' not found!");
return "";
}
if (image.getDrawable() != null) {
Log.w(TAG, "Drawable data downloaded for Image with key '" + str + "'!");
}
return image.getUri().toString();
}
public static void performClick(final NativeCustomFormatAd nativeCustomFormatAd, final String str) {
MainActivity.instance.runOnUiThread(new Runnable() { // from class: com.firemint.realracing.GoogleNativeAdManager.3
@Override // java.lang.Runnable
public void run() {
NativeCustomFormatAd nativeCustomFormatAd2 = NativeCustomFormatAd.this;
if (nativeCustomFormatAd2 != null) {
nativeCustomFormatAd2.performClick(str);
StringBuilder sb = new StringBuilder();
sb.append("performClick: on assetName = ");
sb.append(str);
}
}
});
}
public static void recordImpression(final NativeCustomFormatAd nativeCustomFormatAd) {
MainActivity.instance.runOnUiThread(new Runnable() { // from class: com.firemint.realracing.GoogleNativeAdManager.4
@Override // java.lang.Runnable
public void run() {
NativeCustomFormatAd nativeCustomFormatAd2 = NativeCustomFormatAd.this;
if (nativeCustomFormatAd2 != null) {
nativeCustomFormatAd2.recordImpression();
}
}
});
}
}

View File

@@ -0,0 +1,52 @@
package com.firemint.realracing;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioManager;
/* loaded from: classes2.dex */
public class HeadphoneBroadcastReceiver extends BroadcastReceiver {
private MainActivity m_activity;
private boolean m_registeredReceiver = false;
private boolean m_wiredHeadphonesConnected = false;
private boolean m_wirelessHeadphonesConnected = false;
public boolean AreHeadphonesConnected() {
return this.m_wiredHeadphonesConnected || this.m_wirelessHeadphonesConnected;
}
public HeadphoneBroadcastReceiver(MainActivity mainActivity) {
this.m_activity = mainActivity;
RegisterReceiver();
}
private void RegisterReceiver() {
if (this.m_registeredReceiver) {
return;
}
this.m_activity.registerReceiver(this, new IntentFilter("android.intent.action.HEADSET_PLUG"), 2);
this.m_registeredReceiver = true;
}
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
if (intent == null || intent.getAction() == null || !intent.getAction().equals("android.intent.action.HEADSET_PLUG")) {
return;
}
this.m_wiredHeadphonesConnected = intent.getIntExtra("state", -1) == 1;
}
public void onPause() {
if (this.m_registeredReceiver) {
this.m_activity.unregisterReceiver(this);
this.m_registeredReceiver = false;
}
}
public void onResume() {
RegisterReceiver();
this.m_wirelessHeadphonesConnected = ((AudioManager) this.m_activity.getSystemService("audio")).isBluetoothA2dpOn();
}
}

View File

@@ -0,0 +1,188 @@
package com.firemint.realracing;
import android.util.Log;
import com.google.firebase.perf.network.FirebasePerfUrlConnection;
import com.mbridge.msdk.newreward.function.common.MBridgeCommon;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.protocol.HTTP;
/* loaded from: classes2.dex */
public class Http {
static final /* synthetic */ boolean $assertionsDisabled = false;
private static boolean s_sslContextInit = false;
private static String s_userAgent;
String m_url = "";
byte[] m_data = null;
int m_readCapacity = 0;
long m_callbackPointer = 0;
Thread m_thread = null;
/* JADX INFO: Access modifiers changed from: private */
public native void completeCallback(long j);
/* JADX INFO: Access modifiers changed from: private */
public native void dataCallback(long j, byte[] bArr, int i);
/* JADX INFO: Access modifiers changed from: private */
public native void errorCallback(long j);
/* JADX INFO: Access modifiers changed from: private */
public native void headerCallback(long j, int i);
public void close() {
this.m_callbackPointer = 0L;
this.m_thread = null;
}
public void init(String str, byte[] bArr, int i, long j) {
this.m_url = str;
this.m_data = bArr;
this.m_readCapacity = i;
this.m_callbackPointer = j;
}
public boolean isClosed() {
return this.m_callbackPointer == 0;
}
public Http() {
initUserAgent();
initSSLContext();
}
public void post() {
HttpThread httpThread = new HttpThread();
this.m_thread = httpThread;
httpThread.start();
}
public class HttpThread extends Thread {
private HttpThread() {
}
@Override // java.lang.Thread, java.lang.Runnable
public void run() {
try {
URL url = new URL(Http.this.m_url);
StringBuilder sb = new StringBuilder();
sb.append("URL: ");
sb.append(Http.this.m_url);
HttpURLConnection httpURLConnection = (HttpURLConnection) ((URLConnection) FirebasePerfUrlConnection.instrument(url.openConnection()));
httpURLConnection.setConnectTimeout(MBridgeCommon.DEFAULT_LOAD_TIMEOUT);
int i = 0;
httpURLConnection.setUseCaches(false);
httpURLConnection.setDoInput(true);
httpURLConnection.setRequestProperty("User-Agent", Http.s_userAgent);
if (Http.this.m_data.length > 0) {
httpURLConnection.setDoOutput(true);
httpURLConnection.setFixedLengthStreamingMode(Http.this.m_data.length);
httpURLConnection.setRequestMethod("POST");
httpURLConnection.setRequestProperty(HTTP.CONTENT_LEN, Integer.toString(Http.this.m_data.length));
httpURLConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
}
try {
StringBuilder sb2 = new StringBuilder();
sb2.append("HTTP OUTPUT ");
sb2.append(Integer.toString(Http.this.m_data.length));
if (Http.this.m_data.length > 0) {
OutputStream outputStream = httpURLConnection.getOutputStream();
outputStream.write(Http.this.m_data);
outputStream.flush();
outputStream.close();
}
Http.this.m_data = null;
String headerField = httpURLConnection.getHeaderField(HTTP.CONTENT_LEN);
StringBuilder sb3 = new StringBuilder();
sb3.append("HTTP Content-Length: ");
sb3.append(headerField);
int parseInt = headerField != null ? Integer.parseInt(headerField) : 0;
Http http = Http.this;
http.headerCallback(http.m_callbackPointer, parseInt);
InputStream inputStream = httpURLConnection.getInputStream();
byte[] bArr = new byte[Http.this.m_readCapacity];
while (true) {
int read = inputStream.read(bArr);
if (read != -1) {
Http http2 = Http.this;
http2.dataCallback(http2.m_callbackPointer, bArr, read);
i += read;
} else {
StringBuilder sb4 = new StringBuilder();
sb4.append("HTTP DONE ");
sb4.append(Integer.toString(i));
inputStream.close();
httpURLConnection.disconnect();
Http http3 = Http.this;
http3.completeCallback(http3.m_callbackPointer);
return;
}
}
} catch (Throwable th) {
httpURLConnection.disconnect();
throw th;
}
} catch (MalformedURLException e) {
Log.e("RealRacing3", "HTTP MalformedURLException: " + e.getMessage());
Http http4 = Http.this;
http4.errorCallback(http4.m_callbackPointer);
} catch (IOException e2) {
Log.e("RealRacing3", "HTTP IOException: " + e2.getMessage());
Http http42 = Http.this;
http42.errorCallback(http42.m_callbackPointer);
} catch (Throwable th2) {
Log.e("RealRacing3", "Other Exception: " + th2.getMessage());
Http http422 = Http.this;
http422.errorCallback(http422.m_callbackPointer);
}
}
}
private static void initUserAgent() {
if (s_userAgent != null) {
return;
}
s_userAgent = (Platform.getAppName() + "/" + Platform.getAppVersion()) + " " + System.getProperty("http.agent");
}
private static void initSSLContext() {
if (s_sslContextInit) {
return;
}
try {
TrustManager[] trustManagerArr = {new X509TrustManager() { // from class: com.firemint.realracing.Http.1
@Override // javax.net.ssl.X509TrustManager
public void checkClientTrusted(X509Certificate[] x509CertificateArr, String str) {
}
@Override // javax.net.ssl.X509TrustManager
public void checkServerTrusted(X509Certificate[] x509CertificateArr, String str) {
}
@Override // javax.net.ssl.X509TrustManager
public X509Certificate[] getAcceptedIssuers() {
return null;
}
}};
SSLContext sSLContext = SSLContext.getInstance("TLS");
sSLContext.init(null, trustManagerArr, new SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sSLContext.getSocketFactory());
HttpsURLConnection.setDefaultHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
} catch (Exception unused) {
Log.e("RealRacing3", "Exception when trying to init SSLContext!");
}
s_sslContextInit = true;
}
}

View File

@@ -0,0 +1,82 @@
package com.firemint.realracing;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
/* loaded from: classes2.dex */
public class Input implements SensorEventListener {
private Sensor m_accelerometer;
private Sensor m_gyroscope;
private SensorManager m_sensorManager;
private native void updateAccelValues(float f, float f2, float f3);
private native void updateGyroValues(float f, float f2, float f3);
public boolean isAccelerometerAvailable() {
return this.m_accelerometer != null;
}
public boolean isGyroscopeAvailable() {
return this.m_gyroscope != null;
}
public Input() {
this.m_sensorManager = null;
this.m_accelerometer = null;
this.m_gyroscope = null;
SensorManager sensorManager = (SensorManager) MainActivity.instance.getSystemService("sensor");
this.m_sensorManager = sensorManager;
this.m_accelerometer = sensorManager.getDefaultSensor(1);
this.m_gyroscope = this.m_sensorManager.getDefaultSensor(9);
}
public void enableAccelerometer(boolean z) {
Sensor sensor = this.m_accelerometer;
if (sensor != null) {
if (z) {
this.m_sensorManager.registerListener(this, sensor, 1);
} else {
this.m_sensorManager.unregisterListener(this, sensor);
}
}
}
public void enableGyroscope(boolean z) {
Sensor sensor = this.m_gyroscope;
if (sensor != null) {
if (z) {
this.m_sensorManager.registerListener(this, sensor, 1);
} else {
this.m_sensorManager.unregisterListener(this, sensor);
}
}
}
@Override // android.hardware.SensorEventListener
public void onAccuracyChanged(Sensor sensor, int i) {
String str = sensor == this.m_gyroscope ? "gyro" : "unknown";
if (sensor == this.m_accelerometer) {
str = "accel";
}
StringBuilder sb = new StringBuilder();
sb.append("ACCURACY CHANGED! sensor = ");
sb.append(str);
sb.append(", accuracy = ");
sb.append(i);
}
@Override // android.hardware.SensorEventListener
public void onSensorChanged(SensorEvent sensorEvent) {
Sensor sensor = sensorEvent.sensor;
if (sensor == this.m_accelerometer) {
float[] fArr = sensorEvent.values;
updateAccelValues(fArr[0], fArr[1], fArr[2]);
} else if (sensor == this.m_gyroscope) {
float[] fArr2 = sensorEvent.values;
updateGyroValues(fArr2[0], fArr2[1], fArr2[2]);
}
}
}

View File

@@ -0,0 +1,14 @@
package com.firemint.realracing;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
/* loaded from: classes2.dex */
public class LocalNotificationBroadcastReceiver extends BroadcastReceiver {
@Override // android.content.BroadcastReceiver
public final void onReceive(Context context, Intent intent) {
intent.setClass(context, DelayedNotificationService.class);
DelayedNotificationService.enqueueWork(context, intent);
}
}

View File

@@ -0,0 +1,5 @@
package com.firemint.realracing;
/* loaded from: classes2.dex */
public abstract /* synthetic */ class LocalNotificationsCenter$$ExternalSyntheticApiModelOutline0 {
}

View File

@@ -0,0 +1,293 @@
package com.firemint.realracing;
import android.annotation.TargetApi;
import android.app.AlarmManager;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import androidx.core.app.NotificationCompat;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import org.json.JSONArray;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public class LocalNotificationsCenter {
public static final String EXTRA_FIRE_TIME = "firetime";
public static final String EXTRA_ID = "id";
public static final String EXTRA_LAUNCH_URL = "deepLinkUrl";
public static final String EXTRA_LAUNCH_URL_MP_INVITE = "MultiplayerInvite";
public static final String EXTRA_LAUNCH_URL_RT_ADMIN = "RaceTeamsAdmin";
public static final String EXTRA_MESSAGE = "message";
public static final String EXTRA_REMINDER = "reminder";
private static final String FILENAME = "notifications.dat";
private static final boolean LOG_ENABLED = false;
private static final String LOG_TAG = "LocalNotificationsCntr";
private static HashMap<LocalNotification, PendingIntent> mNotificationsIntent = new HashMap<>();
/* JADX INFO: Access modifiers changed from: private */
public static void LogError(String str) {
}
private static void LogInfo(String str) {
}
public static class LocalNotification {
public long mDelayTime;
public int mId;
public String mMessage;
public int mReminderRemain = -1;
public String mURL;
public JSONObject Serialise() {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("id", this.mId);
jSONObject.put("firetime", this.mDelayTime);
jSONObject.put("message", this.mMessage);
jSONObject.put("deepLinkUrl", this.mURL);
jSONObject.put("reminder", this.mReminderRemain);
} catch (Exception e) {
LocalNotificationsCenter.LogError(e.getMessage());
}
return jSONObject;
}
public void Serialise(JSONObject jSONObject) {
try {
this.mId = jSONObject.optInt("id");
this.mDelayTime = jSONObject.optLong("firetime");
this.mMessage = jSONObject.optString("message");
this.mURL = jSONObject.optString("deepLinkUrl");
this.mReminderRemain = jSONObject.optInt("reminder");
} catch (Exception e) {
LocalNotificationsCenter.LogError(e.getMessage());
}
}
public LocalNotification(JSONObject jSONObject) {
Serialise(jSONObject);
}
public LocalNotification(int i, String str, String str2) {
this.mId = i;
this.mMessage = str;
this.mURL = str2;
}
}
public static boolean AreNotificationsSupported() {
if (MainActivity.instance != null) {
return !MainActivity.getIsAndroidTv();
}
return false;
}
@TargetApi(19)
public static PendingIntent CreateNotificationIntent(LocalNotification localNotification) {
Context GetContext = AppProxy.GetContext();
Intent intent = new Intent(GetContext, (Class<?>) LocalNotificationBroadcastReceiver.class);
intent.setType("type" + localNotification.mMessage + "-" + localNotification.mDelayTime);
intent.putExtra("message", localNotification.mMessage);
intent.putExtra("id", localNotification.mId);
int i = localNotification.mReminderRemain;
if (i != -1) {
intent.putExtra("reminder", i);
}
if (localNotification.mURL.length() > 0) {
intent.putExtra("deepLinkUrl", localNotification.mURL);
}
return PendingIntent.getBroadcast(GetContext, 0, intent, 201326592);
}
@TargetApi(19)
public static void showNotification(int i, String str, long j, String str2) {
if (str2 == null) {
str2 = "";
}
LocalNotification localNotification = new LocalNotification(i, str, str2);
localNotification.mDelayTime = System.currentTimeMillis() + (1000 * j);
LogInfo("showNotification id: " + i + " delay: " + j + " msg: " + str);
StringBuilder sb = new StringBuilder();
sb.append("showNotification current time: ");
sb.append(System.currentTimeMillis());
LogInfo(sb.toString());
LogInfo("showNotification fire time: " + localNotification.mDelayTime);
LogInfo("showNotification url: " + str2);
if (i == 1) {
localNotification.mReminderRemain = 2 - ((int) Math.floor((System.currentTimeMillis() - Platform.getAppInstallTime()) / 172800000));
}
showNotification(localNotification);
}
/* JADX WARN: Removed duplicated region for block: B:14:0x0051 */
/* JADX WARN: Removed duplicated region for block: B:17:? A[RETURN, SYNTHETIC] */
@android.annotation.TargetApi(19)
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static void showNotification(com.firemint.realracing.LocalNotificationsCenter.LocalNotification r5) {
/*
boolean r0 = AreNotificationsSupported()
if (r0 == 0) goto L56
if (r5 != 0) goto L9
goto L56
L9:
android.app.PendingIntent r0 = CreateNotificationIntent(r5)
android.content.Context r1 = com.firemint.realracing.AppProxy.GetContext() // Catch: java.lang.Exception -> L2c
java.lang.String r2 = "alarm"
java.lang.Object r1 = r1.getSystemService(r2) // Catch: java.lang.Exception -> L2c
android.app.AlarmManager r1 = (android.app.AlarmManager) r1 // Catch: java.lang.Exception -> L2c
int r2 = android.os.Build.VERSION.SDK_INT // Catch: java.lang.Exception -> L2c
r3 = 33
r4 = 1
if (r2 < r3) goto L2e
boolean r2 = com.firemint.realracing.LocalNotificationsCenter$$ExternalSyntheticApiModelOutline0.m(r1) // Catch: java.lang.Exception -> L2c
if (r2 != 0) goto L2e
long r2 = r5.mDelayTime // Catch: java.lang.Exception -> L2c
r1.set(r4, r2, r0) // Catch: java.lang.Exception -> L2c
goto L4c
L2c:
r1 = move-exception
goto L34
L2e:
long r2 = r5.mDelayTime // Catch: java.lang.Exception -> L2c
r1.setExact(r4, r2, r0) // Catch: java.lang.Exception -> L2c
goto L4c
L34:
java.lang.StringBuilder r2 = new java.lang.StringBuilder
r2.<init>()
java.lang.String r3 = "showNotification: failed to set alarm: "
r2.append(r3)
java.lang.String r1 = r1.toString()
r2.append(r1)
java.lang.String r1 = r2.toString()
LogError(r1)
L4c:
int r1 = r5.mId
r2 = 2
if (r1 == r2) goto L56
java.util.HashMap<com.firemint.realracing.LocalNotificationsCenter$LocalNotification, android.app.PendingIntent> r1 = com.firemint.realracing.LocalNotificationsCenter.mNotificationsIntent
r1.put(r5, r0)
L56:
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.firemint.realracing.LocalNotificationsCenter.showNotification(com.firemint.realracing.LocalNotificationsCenter$LocalNotification):void");
}
public static void CancelAllNotifications() {
LogInfo("CancelAllNotifications: start");
if (mNotificationsIntent.size() <= 0) {
LoadNotifications(false);
}
Context GetContext = AppProxy.GetContext();
((NotificationManager) GetContext.getSystemService("notification")).cancelAll();
Iterator<T> it = mNotificationsIntent.keySet().iterator();
while (it.hasNext()) {
CancelNotification((LocalNotification) it.next());
}
mNotificationsIntent.clear();
SaveNotifications();
LogInfo("CancelAllNotifications: end");
SerialiseNotificationsHelper.ClearAll(GetContext);
}
public static void CancelNotification(LocalNotification localNotification) {
Context GetContext = AppProxy.GetContext();
NotificationManager notificationManager = (NotificationManager) GetContext.getSystemService("notification");
AlarmManager alarmManager = (AlarmManager) GetContext.getSystemService(NotificationCompat.CATEGORY_ALARM);
PendingIntent pendingIntent = mNotificationsIntent.get(localNotification);
if (pendingIntent == null) {
pendingIntent = CreateNotificationIntent(localNotification);
}
try {
LogInfo("Cancelling notification: " + localNotification.mId);
notificationManager.cancel(localNotification.mId);
if (pendingIntent != null) {
alarmManager.cancel(pendingIntent);
pendingIntent.cancel();
}
} catch (Exception e) {
LogError("CancelNotification: failed to cancel alarm: " + e.toString());
}
}
public static void CancelNotification(int i, String str) {
Context GetContext = AppProxy.GetContext();
AlarmManager alarmManager = (AlarmManager) GetContext.getSystemService(NotificationCompat.CATEGORY_ALARM);
Intent intent = new Intent(GetContext, (Class<?>) LocalNotificationBroadcastReceiver.class);
intent.setType("type" + str);
PendingIntent broadcast = PendingIntent.getBroadcast(GetContext, 0, intent, 335544320);
try {
((NotificationManager) GetContext.getSystemService("notification")).cancel(i);
alarmManager.cancel(broadcast);
} catch (Exception e) {
LogError("CancelNotification: failed to cancel alarm: " + e.toString());
}
}
public static void SaveNotifications() {
SaveNotifications(mNotificationsIntent.keySet());
}
public static void SaveNotifications(Iterable<LocalNotification> iterable) {
LogInfo("SaveNotifications() Num:" + mNotificationsIntent.size());
try {
JSONArray jSONArray = new JSONArray();
Iterator<LocalNotification> it = iterable.iterator();
while (it.hasNext()) {
jSONArray.put(it.next().Serialise());
}
FileOutputStream fileOutputStream = new FileOutputStream(new File(Platform.getExternalStorageDir(AppProxy.GetContext()), FILENAME));
ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);
objectOutputStream.writeObject(jSONArray.toString());
objectOutputStream.close();
fileOutputStream.close();
} catch (Exception e) {
LogError("SaveNotifications failed: " + e.toString());
}
}
public static void LoadNotifications(boolean z) {
for (LocalNotification localNotification : LoadNotifications()) {
if (z) {
showNotification(localNotification);
} else {
mNotificationsIntent.put(localNotification, null);
}
}
}
public static Iterable<LocalNotification> LoadNotifications() {
ArrayList arrayList = new ArrayList();
LogInfo("LoadNotifications()");
try {
File file = new File(Platform.getExternalStorageDir(AppProxy.GetContext()), FILENAME);
if (file.exists()) {
LogInfo("Found saved file. Loading information");
FileInputStream fileInputStream = new FileInputStream(file);
ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream);
String str = (String) objectInputStream.readObject();
objectInputStream.close();
fileInputStream.close();
JSONArray jSONArray = new JSONArray(str);
for (int i = 0; i < jSONArray.length(); i++) {
arrayList.add(new LocalNotification(jSONArray.getJSONObject(i)));
}
} else {
LogError("File not found");
}
} catch (Exception e) {
LogError("LoadNotifications failed: " + e.toString());
}
return arrayList;
}
}

View File

@@ -0,0 +1,5 @@
package com.firemint.realracing;
/* loaded from: classes2.dex */
public abstract /* synthetic */ class MainActivity$$ExternalSyntheticApiModelOutline0 {
}

View File

@@ -0,0 +1,5 @@
package com.firemint.realracing;
/* loaded from: classes2.dex */
public abstract /* synthetic */ class MainActivity$$ExternalSyntheticApiModelOutline1 {
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,6 @@
package com.firemint.realracing;
/* loaded from: classes2.dex */
public interface MessageCallback {
void onMessage(int i);
}

View File

@@ -0,0 +1,290 @@
package com.firemint.realracing;
import android.app.Activity;
import android.content.Context;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Handler;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
/* loaded from: classes2.dex */
public class MoviePlayer implements MediaPlayer.OnCompletionListener {
public static Activity mActivity;
public static Handler mUIThreadHandler;
public static ViewGroup mViewGroup;
public static MPHelper msMPHelper;
public RelativeLayout mLayout;
private long mThat;
public static void startup(Activity activity, ViewGroup viewGroup, Handler handler) {
mActivity = activity;
mViewGroup = viewGroup;
mUIThreadHandler = handler;
}
public native void OnCompletionNative(long j);
public class MPHelper extends SurfaceView implements SurfaceHolder.Callback, MediaPlayer.OnPreparedListener, MediaPlayer.OnErrorListener, MediaPlayer.OnVideoSizeChangedListener {
public MediaPlayer.OnCompletionListener mCompletionListener;
public MediaPlayer mMediaPlayer;
public boolean mStartAfterCreating;
public SurfaceHolder mSurfaceHolder;
public Uri mUri;
public void setOnCompletionListener(MediaPlayer.OnCompletionListener onCompletionListener) {
this.mCompletionListener = onCompletionListener;
}
public MPHelper(Context context) {
super(context);
this.mSurfaceHolder = null;
this.mCompletionListener = null;
this.mStartAfterCreating = false;
this.mMediaPlayer = null;
getHolder().addCallback(this);
getHolder().setType(3);
setFocusable(true);
setFocusableInTouchMode(true);
requestFocus();
}
private void openVideo() {
if (this.mUri == null || this.mSurfaceHolder == null) {
return;
}
destroy();
try {
this.mMediaPlayer = new MediaPlayer();
StringBuilder sb = new StringBuilder();
sb.append("opening video ");
sb.append(this.mUri);
this.mMediaPlayer.setDataSource(getContext(), this.mUri);
this.mMediaPlayer.setOnPreparedListener(this);
this.mMediaPlayer.setOnVideoSizeChangedListener(this);
this.mMediaPlayer.setOnCompletionListener(this.mCompletionListener);
this.mMediaPlayer.setOnErrorListener(this);
this.mMediaPlayer.setDisplay(this.mSurfaceHolder);
this.mMediaPlayer.setAudioStreamType(3);
this.mMediaPlayer.setScreenOnWhilePlaying(true);
this.mMediaPlayer.prepare();
} catch (Exception e) {
Log.w("RealRacing3", "error opening video " + this.mUri + " exception: " + e);
}
}
@Override // android.view.SurfaceHolder.Callback
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
this.mSurfaceHolder = null;
pause();
}
@Override // android.view.SurfaceHolder.Callback
public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i2, int i3) {
StringBuilder sb = new StringBuilder();
sb.append("MPHelper surfaceChanged: ");
sb.append(i2);
sb.append(", ");
sb.append(i3);
MediaPlayer mediaPlayer = this.mMediaPlayer;
if (mediaPlayer != null) {
mediaPlayer.setDisplay(surfaceHolder);
resume();
}
}
@Override // android.view.SurfaceHolder.Callback
public void surfaceCreated(SurfaceHolder surfaceHolder) {
this.mSurfaceHolder = surfaceHolder;
MediaPlayer mediaPlayer = this.mMediaPlayer;
if (mediaPlayer != null) {
mediaPlayer.setDisplay(surfaceHolder);
} else {
openVideo();
}
}
public void start() {
MediaPlayer mediaPlayer = this.mMediaPlayer;
if (mediaPlayer != null) {
mediaPlayer.start();
} else {
this.mStartAfterCreating = true;
}
}
@Override // android.media.MediaPlayer.OnPreparedListener
public void onPrepared(MediaPlayer mediaPlayer) {
if (this.mStartAfterCreating) {
start();
this.mStartAfterCreating = false;
}
}
public void setVideoURL(String str) {
setVideoURI(Uri.parse(str));
}
public void setVideoURI(Uri uri) {
this.mUri = uri;
setup();
}
public void resume() {
MediaPlayer mediaPlayer = this.mMediaPlayer;
if (mediaPlayer == null) {
Log.e("MoviePlayer", "MPHelper.resume() Media Player is null");
return;
}
if (this.mSurfaceHolder == null) {
Log.e("MoviePlayer", "MPHelper.resume() surface is null");
return;
}
if (mediaPlayer.isPlaying()) {
Log.e("MoviePlayer", "MPHelper.resume() Media player is already playing");
} else if (this.mMediaPlayer.getCurrentPosition() <= 0) {
Log.e("MoviePlayer", "MPHelper.resume() Media player has not started");
} else {
this.mMediaPlayer.start();
}
}
public void pause() {
if (this.mMediaPlayer != null) {
this.mMediaPlayer.pause();
}
}
private void setup() {
openVideo();
requestLayout();
invalidate();
}
public void destroy() {
MediaPlayer mediaPlayer = this.mMediaPlayer;
if (mediaPlayer != null) {
mediaPlayer.reset();
this.mMediaPlayer.release();
this.mMediaPlayer = null;
}
}
@Override // android.media.MediaPlayer.OnErrorListener
public boolean onError(MediaPlayer mediaPlayer, int i, int i2) {
StringBuilder sb = new StringBuilder();
sb.append("onError what: ");
sb.append(i);
sb.append(" extra: ");
sb.append(i2);
return true;
}
@Override // android.media.MediaPlayer.OnVideoSizeChangedListener
public void onVideoSizeChanged(MediaPlayer mediaPlayer, int i, int i2) {
StringBuilder sb = new StringBuilder();
sb.append("onVideoSizeChanged. videoWidth (");
sb.append(i);
sb.append(") videoHeight (");
sb.append(i2);
sb.append(")");
if (mediaPlayer != null) {
int screenWidth = Platform.getScreenWidth();
Platform.getScreenHeight();
float f = screenWidth;
float f2 = (i2 / i) * f;
ViewGroup.LayoutParams layoutParams = getLayoutParams();
layoutParams.width = (int) f;
layoutParams.height = (int) f2;
setLayoutParams(layoutParams);
}
}
}
public void play(final String str, long j) {
if (msMPHelper != null) {
Log.e("RealRacing3", "MoviePlayer Cannot play multiple movies simultaneously");
OnCompletionNative(j);
} else {
this.mThat = j;
mActivity.runOnUiThread(new Runnable() { // from class: com.firemint.realracing.MoviePlayer.1
@Override // java.lang.Runnable
public void run() {
MoviePlayer.this.mLayout = new RelativeLayout(MoviePlayer.mActivity);
MoviePlayer.this.mLayout.setGravity(17);
MoviePlayer.mViewGroup.addView(MoviePlayer.this.mLayout);
MPHelper mPHelper = MoviePlayer.this.new MPHelper(MoviePlayer.mActivity);
MoviePlayer.msMPHelper = mPHelper;
mPHelper.setOnCompletionListener(this);
MoviePlayer.msMPHelper.requestFocus();
MoviePlayer.msMPHelper.setZOrderOnTop(true);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(Platform.getScreenWidth(), Platform.getScreenHeight());
layoutParams.leftMargin = 0;
layoutParams.topMargin = 0;
MoviePlayer.this.mLayout.addView(MoviePlayer.msMPHelper, layoutParams);
MoviePlayer.msMPHelper.setVideoURL(str);
MoviePlayer.msMPHelper.start();
}
});
}
}
public void stop() {
mActivity.runOnUiThread(new Runnable() { // from class: com.firemint.realracing.MoviePlayer.2
@Override // java.lang.Runnable
public void run() {
MoviePlayer.this.clear();
}
});
}
public static void pause() {
mActivity.runOnUiThread(new Runnable() { // from class: com.firemint.realracing.MoviePlayer.3
@Override // java.lang.Runnable
public void run() {
MPHelper mPHelper = MoviePlayer.msMPHelper;
if (mPHelper != null) {
mPHelper.pause();
}
}
});
}
public static void resume() {
mActivity.runOnUiThread(new Runnable() { // from class: com.firemint.realracing.MoviePlayer.4
@Override // java.lang.Runnable
public void run() {
MPHelper mPHelper = MoviePlayer.msMPHelper;
if (mPHelper != null) {
mPHelper.resume();
}
}
});
}
public void clear() {
MPHelper mPHelper = msMPHelper;
if (mPHelper != null) {
mPHelper.destroy();
this.mLayout.removeView(msMPHelper);
mViewGroup.removeView(this.mLayout);
this.mLayout = null;
msMPHelper = null;
}
}
@Override // android.media.MediaPlayer.OnCompletionListener
public void onCompletion(MediaPlayer mediaPlayer) {
clear();
MainActivity.instance.getGLView().queueEvent(new Runnable() { // from class: com.firemint.realracing.MoviePlayer.5
@Override // java.lang.Runnable
public void run() {
MoviePlayer moviePlayer = MoviePlayer.this;
moviePlayer.OnCompletionNative(moviePlayer.mThat);
}
});
}
}

View File

@@ -0,0 +1,178 @@
package com.firemint.realracing;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import com.ea.nimble.ApplicationLifecycle;
import com.ea.nimble.SynergyEnvironment;
import com.ea.nimble.tracking.Tracking;
import java.util.HashMap;
/* loaded from: classes2.dex */
public class NimbleManager {
Activity m_activity = null;
boolean m_initialised = false;
public void initialise(Activity activity) {
this.m_activity = activity;
this.m_initialised = true;
}
public void onCreate(Bundle bundle) {
if (this.m_initialised) {
try {
ApplicationLifecycle.onActivityCreate(bundle, this.m_activity);
} catch (Throwable th) {
Log.e("RealRacing3", "Nimble Error: " + th.getMessage());
}
}
}
public void onStart() {
if (this.m_initialised) {
try {
ApplicationLifecycle.onActivityStart(this.m_activity);
} catch (Throwable th) {
Log.e("RealRacing3", "Nimble Error: " + th.getMessage());
}
}
}
public void onRestoreInstanceState(Bundle bundle) {
if (this.m_initialised) {
ApplicationLifecycle.onActivityRestoreInstanceState(bundle, this.m_activity);
}
}
public void onResume() {
if (this.m_initialised) {
try {
ApplicationLifecycle.onActivityResume(this.m_activity);
} catch (Throwable th) {
Log.e("RealRacing3", "Nimble Error: " + th.getMessage());
}
}
}
public void onRestart() {
if (this.m_initialised) {
try {
ApplicationLifecycle.onActivityRestart(this.m_activity);
} catch (Throwable th) {
Log.e("RealRacing3", "Nimble Error: " + th.getMessage());
}
}
}
public void onPause() {
if (this.m_initialised) {
try {
ApplicationLifecycle.onActivityPause(this.m_activity);
} catch (Throwable th) {
Log.e("RealRacing3", "Nimble Error: " + th.getMessage());
}
}
}
public void onStop() {
if (this.m_initialised) {
try {
ApplicationLifecycle.onActivityStop(this.m_activity);
} catch (Throwable th) {
Log.e("RealRacing3", "Nimble Error: " + th.getMessage());
}
}
}
public void onDestroy() {
if (this.m_initialised) {
try {
ApplicationLifecycle.onActivityDestroy(this.m_activity);
} catch (Throwable th) {
Log.e("RealRacing3", "Nimble Error: " + th.getMessage());
}
}
}
public void onSaveInstanceState(Bundle bundle) {
if (this.m_initialised) {
try {
ApplicationLifecycle.onActivitySaveInstanceState(bundle, this.m_activity);
} catch (Throwable th) {
Log.e("RealRacing3", "Nimble Error: " + th.getMessage());
}
}
}
public void onActivityResult(int i, int i2, Intent intent) {
if (this.m_initialised) {
try {
ApplicationLifecycle.onActivityResult(i, i2, intent, this.m_activity);
} catch (Throwable th) {
Log.e("RealRacing3", "Nimble Error: " + th.getMessage());
}
}
}
public void onWindowFocusChanged(boolean z) {
if (this.m_initialised) {
ApplicationLifecycle.onActivityWindowFocusChanged(z, this.m_activity);
}
}
public Object onRetainNonConfigurationInstance() {
ApplicationLifecycle.onActivityRetainNonConfigurationInstance();
return null;
}
public boolean onBackPressed() {
if (this.m_initialised) {
try {
return ApplicationLifecycle.onBackPressed();
} catch (Throwable th) {
Log.e("RealRacing3", "Nimble Error: " + th.getMessage());
}
}
return true;
}
public static void setEnableTracking(boolean z) {
try {
if (Tracking.getComponent() != null) {
Tracking.getComponent().setEnable(z);
}
} catch (Throwable th) {
Log.e("RealRacing3", "Nimble Tracking Error: " + th.getMessage());
}
}
public static void uploadMtxEvent(String str, String str2) {
try {
if (Tracking.getComponent() != null) {
HashMap hashMap = new HashMap();
hashMap.put(Tracking.KEY_MTX_CURRENCY, str);
hashMap.put(Tracking.KEY_MTX_PRICE, str2);
Tracking.getComponent().logEvent(Tracking.EVENT_MTX_ITEM_PURCHASED, hashMap);
}
} catch (Throwable th) {
Log.e("RealRacing3", "Nimble MTX Error: " + th.getMessage());
}
}
public static String getEADeviceID() {
if (SynergyEnvironment.getComponent() != null && SynergyEnvironment.getComponent().isDataAvailable()) {
return SynergyEnvironment.getComponent().getEADeviceId();
}
Log.e("RealRacing3", "getEADeviceID: Failed to retrieve ID");
return "";
}
public static String getSynergyID() {
if (SynergyEnvironment.getComponent() != null && SynergyEnvironment.getComponent().isDataAvailable()) {
return SynergyEnvironment.getComponent().getSynergyId();
}
Log.e("RealRacing3", "getSynergyID: Failed to retrieve ID");
return "";
}
}

View File

@@ -0,0 +1,93 @@
package com.firemint.realracing;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.Context;
import android.media.AudioAttributes;
import android.util.Log;
/* loaded from: classes2.dex */
public class NotificationChannelHelper {
private String CHANNEL_ID_CARS;
private String CHANNEL_ID_DOWNLOADS;
private String CHANNEL_ID_GENERAL;
private String CHANNEL_ID_SPECIAL_EVENTS;
public NotificationChannelHelper(Context context) {
InitialiseNotificationChannels(context);
}
private void CacheChannelNames(Context context) {
this.CHANNEL_ID_GENERAL = context.getString(R.string.NOTIFICATION_CHANNEL_GENERAL_ID);
this.CHANNEL_ID_CARS = context.getString(R.string.NOTIFICATION_CHANNEL_CARS_ID);
this.CHANNEL_ID_SPECIAL_EVENTS = context.getString(R.string.NOTIFICATION_CHANNEL_SPECIAL_EVENTS_ID);
this.CHANNEL_ID_DOWNLOADS = context.getString(R.string.NOTIFICATION_CHANNEL_DOWNLOADS_ID);
}
public class NotificationChannelContainer {
private String m_id;
private int m_importance;
private String m_localisedName;
private NotificationChannelContainer(String str, String str2, int i) {
this.m_id = str;
this.m_localisedName = str2;
this.m_importance = i;
}
public void CreateNotificationChannel(NotificationManager notificationManager, Context context) {
NotificationChannel notificationChannel = new NotificationChannel(this.m_id, this.m_localisedName, this.m_importance);
boolean z = this.m_importance > 2;
notificationChannel.setShowBadge(z);
notificationChannel.enableLights(z);
notificationChannel.enableVibration(z);
notificationChannel.setLightColor(context.getResources().getColor(R.color.NotificationColor));
notificationChannel.setSound(DelayedNotificationService.GetNotificationSoundUri(context), new AudioAttributes.Builder().setUsage(5).setContentType(4).build());
notificationManager.createNotificationChannel(notificationChannel);
}
}
public String NotificationToChannelId(int i) {
switch (i) {
case -2:
case 7:
case 9:
case 10:
return this.CHANNEL_ID_GENERAL;
case -1:
case 0:
case 12:
default:
Log.e("RR3_Notif_Channel_Mgr", "Failed to find a channel for id: " + i);
return this.CHANNEL_ID_GENERAL;
case 1:
case 2:
return this.CHANNEL_ID_DOWNLOADS;
case 3:
case 8:
case 11:
return this.CHANNEL_ID_SPECIAL_EVENTS;
case 4:
case 5:
case 6:
case 13:
case 14:
return this.CHANNEL_ID_CARS;
}
}
private void InitialiseNotificationChannels(Context context) {
if (MainActivity.IsAtLeastAPI(26)) {
CacheChannelNames(context);
CreateNotificationChannels((NotificationManager) context.getSystemService("notification"), context);
}
}
private void CreateNotificationChannels(NotificationManager notificationManager, Context context) {
int i = 3;
NotificationChannelContainer[] notificationChannelContainerArr = {new NotificationChannelContainer(this.CHANNEL_ID_GENERAL, context.getString(R.string.NOTIFICATION_CHANNEL_GENERAL_TITLE), i), new NotificationChannelContainer(this.CHANNEL_ID_CARS, context.getString(R.string.NOTIFICATION_CHANNEL_CARS_TITLE), i), new NotificationChannelContainer(this.CHANNEL_ID_SPECIAL_EVENTS, context.getString(R.string.NOTIFICATION_CHANNEL_SPECIAL_EVENTS_TITLE), i), new NotificationChannelContainer(this.CHANNEL_ID_DOWNLOADS, context.getString(R.string.NOTIFICATION_CHANNEL_DOWNLOADS), 2)};
for (int i2 = 0; i2 < 4; i2++) {
notificationChannelContainerArr[i2].CreateNotificationChannel(notificationManager, context);
}
}
}

View File

@@ -0,0 +1,36 @@
package com.firemint.realracing;
import android.util.Log;
/* loaded from: classes2.dex */
public class PauseRunnable implements Runnable {
public boolean m_finished = false;
public MainActivity m_mainActivity;
public PauseRunnable(MainActivity mainActivity) {
this.m_mainActivity = mainActivity;
}
@Override // java.lang.Runnable
public void run() {
this.m_mainActivity.onPauseJNI();
synchronized (this) {
this.m_finished = true;
notify();
}
}
public static void waitUntilFinished(PauseRunnable pauseRunnable) {
if (pauseRunnable != null) {
synchronized (pauseRunnable) {
try {
if (!pauseRunnable.m_finished) {
pauseRunnable.wait();
}
} catch (InterruptedException unused) {
Log.e("RealRacing3", "PauseRunnable: InterruptedException");
}
}
}
}
}

View File

@@ -0,0 +1,64 @@
package com.firemint.realracing;
import android.content.Intent;
import android.os.ParcelFileDescriptor;
import androidx.documentfile.provider.DocumentFile;
import com.google.android.gms.drive.DriveFile;
import java.io.File;
/* loaded from: classes2.dex */
public class PendingImageToSave {
private int m_dataSize;
private String m_filename;
private int m_height;
private File m_picturesFolder;
private int[] m_pixelData;
private int m_width;
public PendingImageToSave(int[] iArr, int i, int i2, int i3, String str, File file) {
this.m_pixelData = iArr;
this.m_dataSize = i;
this.m_width = i2;
this.m_height = i3;
this.m_filename = str;
this.m_picturesFolder = file;
}
public String GetFileExtension() {
int length = this.m_filename.length();
return this.m_filename.substring(length - 3, length);
}
public boolean SaveImage(Intent intent) {
ParcelFileDescriptor open;
MainActivity mainActivity = MainActivity.instance;
String string = mainActivity.getString(R.string.screenshot_folder_name);
try {
if (MainActivity.IsBelowAPI(29)) {
if (MainActivity.IsAtLeastAPI(24)) {
DocumentFile fromTreeUri = DocumentFile.fromTreeUri(mainActivity, intent.getData());
DocumentFile findFile = fromTreeUri.findFile(string);
if (findFile == null) {
findFile = fromTreeUri.createDirectory(string);
}
open = mainActivity.getContentResolver().openFileDescriptor(findFile.createFile("image/" + GetFileExtension(), this.m_filename).getUri(), "w");
} else {
File file = new File(this.m_picturesFolder, string);
if (!file.exists()) {
file.mkdirs();
}
File file2 = new File(file, this.m_filename);
file2.createNewFile();
open = ParcelFileDescriptor.open(file2, DriveFile.MODE_WRITE_ONLY);
}
boolean saveToImageGalleryImpl = Platform.saveToImageGalleryImpl(this.m_pixelData, this.m_dataSize, this.m_width, this.m_height, this.m_filename, open.getFileDescriptor());
open.close();
return saveToImageGalleryImpl;
}
return Platform.saveToImageGalleryImpl(this.m_pixelData, this.m_dataSize, this.m_width, this.m_height, this.m_filename, null);
} catch (Exception e) {
MainActivity.loge("Error: " + e.toString());
return false;
}
}
}

View File

@@ -0,0 +1,5 @@
package com.firemint.realracing;
/* loaded from: classes2.dex */
public abstract /* synthetic */ class Platform$$ExternalSyntheticApiModelOutline0 {
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,172 @@
package com.firemint.realracing;
/* loaded from: classes2.dex */
public final class R {
public static final class array {
public static int com_google_firebase_crashlytics_build_ids_arch = 0x7f030003;
public static int com_google_firebase_crashlytics_build_ids_build_id = 0x7f030004;
public static int com_google_firebase_crashlytics_build_ids_lib = 0x7f030005;
private array() {
}
}
public static final class color {
public static int NotificationColor = 0x7f060000;
public static int RecentsWindowColor = 0x7f060001;
public static int colorAccent = 0x7f060054;
public static int colorPrimary = 0x7f060055;
public static int colorPrimaryDark = 0x7f060056;
private color() {
}
}
public static final class drawable {
public static int banner = 0x7f0800de;
public static int banner_na = 0x7f0800df;
public static int ic_ea_logo = 0x7f080195;
public static int ic_launcher_background = 0x7f080197;
public static int ic_launcher_foreground = 0x7f080198;
public static int pn_icon = 0x7f080250;
public static int r3_logo = 0x7f080251;
public static int splash_background = 0x7f080252;
private drawable() {
}
}
public static final class id {
public static int background = 0x7f0a008b;
public static int ea_logo = 0x7f0a00c4;
private id() {
}
}
public static final class layout {
public static int unpacking_assets = 0x7f0d00b4;
private layout() {
}
}
public static final class mipmap {
public static int ic_launcher = 0x7f0f0000;
public static int ic_launcher_background = 0x7f0f0001;
public static int ic_launcher_foreground = 0x7f0f0002;
public static int ic_launcher_foreground_na = 0x7f0f0003;
public static int ic_launcher_na = 0x7f0f0004;
public static int ic_launcher_round = 0x7f0f0005;
public static int ic_launcher_round_na = 0x7f0f0006;
public static int icon_notification = 0x7f0f0007;
private mipmap() {
}
}
public static final class raw {
public static int checksum = 0x7f110003;
public static int push_notification = 0x7f110009;
public static int res = 0x7f11000a;
private raw() {
}
}
public static final class string {
public static int BTN_OK = 0x7f120000;
public static int CONTINUE = 0x7f120001;
public static int IMAGE_SAVE_FAILURE_MESSAGE = 0x7f120002;
public static int IMAGE_SAVE_FAILURE_TITLE = 0x7f120003;
public static int NOTIFICATION_CHANNEL_CARS_ID = 0x7f120004;
public static int NOTIFICATION_CHANNEL_CARS_TITLE = 0x7f120005;
public static int NOTIFICATION_CHANNEL_DOWNLOADS = 0x7f120006;
public static int NOTIFICATION_CHANNEL_DOWNLOADS_ID = 0x7f120007;
public static int NOTIFICATION_CHANNEL_GENERAL_ID = 0x7f120008;
public static int NOTIFICATION_CHANNEL_GENERAL_TITLE = 0x7f120009;
public static int NOTIFICATION_CHANNEL_SPECIAL_EVENTS_ID = 0x7f12000a;
public static int NOTIFICATION_CHANNEL_SPECIAL_EVENTS_TITLE = 0x7f12000b;
public static int STORAGE_ERROR_DESC = 0x7f12000c;
public static int STORAGE_ERROR_NEG_BTN = 0x7f12000d;
public static int STORAGE_ERROR_POS_BTN = 0x7f12000e;
public static int STORAGE_ERROR_TITLE = 0x7f12000f;
public static int UNPACK_ERROR_MESSAGE = 0x7f120010;
public static int UNPACK_ERROR_TITLE = 0x7f120011;
public static int app_full_name = 0x7f12006b;
public static int app_id = 0x7f12006c;
public static int app_name = 0x7f12006d;
public static int carrier = 0x7f120084;
public static int cc_game_id = 0x7f120085;
public static int cc_server_env = 0x7f120086;
public static int com_google_firebase_crashlytics_mapping_file_id = 0x7f120087;
public static int default_web_client_id = 0x7f1200b6;
public static int facebook_client_token = 0x7f1200fd;
public static int fb_app_id = 0x7f120104;
public static int fb_login_protocol_scheme = 0x7f120105;
public static int firebase_database_url = 0x7f12010e;
public static int gcm_defaultSenderId = 0x7f120111;
public static int google_api_key = 0x7f120116;
public static int google_app_id = 0x7f120117;
public static int google_crash_reporting_api_key = 0x7f120118;
public static int google_storage_bucket = 0x7f120119;
public static int icon_name_azn_na = 0x7f120125;
public static int icon_name_azn_row = 0x7f120126;
public static int icon_name_cn = 0x7f120127;
public static int icon_name_na = 0x7f120128;
public static int icon_name_round_azn_na = 0x7f120129;
public static int icon_name_round_azn_row = 0x7f12012a;
public static int icon_name_round_cn = 0x7f12012b;
public static int icon_name_round_na = 0x7f12012c;
public static int icon_name_round_row = 0x7f12012d;
public static int icon_name_row = 0x7f12012e;
public static int icon_name_tv_azn_na = 0x7f12012f;
public static int icon_name_tv_azn_row = 0x7f120130;
public static int icon_name_tv_cn = 0x7f120131;
public static int icon_name_tv_na = 0x7f120132;
public static int icon_name_tv_row = 0x7f120133;
public static int nimble_api_key_live = 0x7f12015a;
public static int nimble_api_key_stage = 0x7f12015b;
public static int nimble_api_secret_live = 0x7f12015c;
public static int nimble_api_secret_stage = 0x7f12015d;
public static int nimble_mtx_enableVerification = 0x7f12015e;
public static int nimble_mtx_reportingEnabled = 0x7f12015f;
public static int nimble_trackingEnableFlag = 0x7f120160;
public static int project_id = 0x7f120170;
public static int screenshot_folder_name = 0x7f12017f;
public static int starlight_env = 0x7f120186;
private string() {
}
}
public static final class style {
public static int AppTheme = 0x7f130027;
public static int Theme_R3_Icon_exporter = 0x7f13016d;
public static int baseSplashScreenTheme = 0x7f1301c4;
public static int splashScreenTheme = 0x7f1301fd;
private style() {
}
}
public static final class xml {
public static int backup_android12 = 0x7f150000;
public static int backup_legacy = 0x7f150001;
public static int backup_rules = 0x7f150002;
public static int components = 0x7f150003;
public static int data_extraction_rules = 0x7f150004;
public static int file_paths = 0x7f150005;
public static int locale_config = 0x7f150009;
public static int network_security_config = 0x7f15000a;
public static int network_security_config_ad_tech = 0x7f15000b;
public static int nimble_log = 0x7f15000c;
private xml() {
}
}
private R() {
}
}

View File

@@ -0,0 +1,34 @@
package com.firemint.realracing;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import com.helpshift.Helpshift;
import csdk.glucustomersupport.impl.GluHelpshift;
import java.util.Map;
/* loaded from: classes2.dex */
public class RRHelpshiftService extends FirebaseMessagingService {
@Override // com.google.firebase.messaging.FirebaseMessagingService
public void onNewToken(String str) {
super.onNewToken(str);
Helpshift.registerPushToken(str);
}
@Override // android.app.Service
public void onCreate() {
GluHelpshift.internal_Install(getApplication());
}
@Override // com.google.firebase.messaging.FirebaseMessagingService
public void onMessageReceived(RemoteMessage remoteMessage) {
super.onMessageReceived(remoteMessage);
if (remoteMessage != null) {
Map data = remoteMessage.getData();
String str = (String) data.get("origin");
if (str == null || !str.equals("helpshift")) {
return;
}
Helpshift.handlePush(data);
}
}
}

View File

@@ -0,0 +1,94 @@
package com.firemint.realracing;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/* loaded from: classes2.dex */
public class RRPushService extends FirebaseMessagingService {
private List<FirebaseMessagingService> messagingServices;
public interface GCAction1<T> {
void run(T t);
}
public RRPushService() {
ArrayList arrayList = new ArrayList(2);
this.messagingServices = arrayList;
arrayList.add(new RRPushTNGBroadcastReceiver());
this.messagingServices.add(new RRHelpshiftService());
}
@Override // com.google.firebase.messaging.FirebaseMessagingService
public void onNewToken(final String str) {
delegate(new GCAction1() { // from class: com.firemint.realracing.RRPushService$$ExternalSyntheticLambda0
@Override // com.firemint.realracing.RRPushService.GCAction1
public final void run(Object obj) {
RRPushService.this.lambda$onNewToken$0(str, (FirebaseMessagingService) obj);
}
});
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void lambda$onNewToken$0(String str, FirebaseMessagingService firebaseMessagingService) {
injectContext(firebaseMessagingService);
firebaseMessagingService.onNewToken(str);
}
@Override // com.google.firebase.messaging.FirebaseMessagingService
public void onMessageReceived(final RemoteMessage remoteMessage) {
delegate(new GCAction1() { // from class: com.firemint.realracing.RRPushService$$ExternalSyntheticLambda1
@Override // com.firemint.realracing.RRPushService.GCAction1
public final void run(Object obj) {
RRPushService.this.lambda$onMessageReceived$1(remoteMessage, (FirebaseMessagingService) obj);
}
});
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void lambda$onMessageReceived$1(RemoteMessage remoteMessage, FirebaseMessagingService firebaseMessagingService) {
injectContext(firebaseMessagingService);
firebaseMessagingService.onMessageReceived(remoteMessage);
}
private void delegate(GCAction1<FirebaseMessagingService> gCAction1) {
Iterator<FirebaseMessagingService> it = this.messagingServices.iterator();
while (it.hasNext()) {
gCAction1.run(it.next());
}
}
private void injectContext(FirebaseMessagingService firebaseMessagingService) {
setField(firebaseMessagingService, "mBase", this);
}
private boolean setField(Object obj, String str, Object obj2) {
Field field;
try {
field = obj.getClass().getDeclaredField(str);
} catch (NoSuchFieldException unused) {
field = null;
}
Class<? super Object> superclass = obj.getClass().getSuperclass();
while (field == null && superclass != null) {
try {
field = superclass.getDeclaredField(str);
} catch (NoSuchFieldException unused2) {
superclass = superclass.getSuperclass();
}
}
if (field == null) {
return false;
}
field.setAccessible(true);
try {
field.set(obj, obj2);
return true;
} catch (IllegalAccessException unused3) {
return false;
}
}
}

View File

@@ -0,0 +1,18 @@
package com.firemint.realracing;
import android.os.Bundle;
import com.ea.eadp.pushnotification.forwarding.FCMMessageService;
import com.ea.nimble.pushtng.NimblePushTNGBroadcastForwarder;
/* loaded from: classes2.dex */
public class RRPushTNGBroadcastForwarder extends NimblePushTNGBroadcastForwarder {
@Override // com.ea.nimble.pushtng.NimblePushTNGBroadcastForwarder
public void showMessage(Bundle bundle) {
String string = bundle.getString(FCMMessageService.PushIntentExtraKeys.ALERT, "");
String string2 = bundle.getString("deepLinkUrl", "");
MainActivity mainActivity = MainActivity.instance;
if (mainActivity != null) {
mainActivity.HandleDeepLink(string, string2);
}
}
}

View File

@@ -0,0 +1,11 @@
package com.firemint.realracing;
import com.ea.nimble.pushtng.NimblePushTNGBroadcastReceiver;
/* loaded from: classes2.dex */
public class RRPushTNGBroadcastReceiver extends NimblePushTNGBroadcastReceiver {
@Override // com.ea.nimble.pushtng.NimblePushTNGBroadcastReceiver, com.ea.eadp.pushnotification.forwarding.FCMMessageReceiver
public String getIntentServiceName() {
return RRPushTNGIntentService.class.getName();
}
}

View File

@@ -0,0 +1,32 @@
package com.firemint.realracing;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.core.app.NotificationCompat;
import com.ea.nimble.pushtng.NimblePushTNGIntentService;
/* loaded from: classes2.dex */
public class RRPushTNGIntentService extends NimblePushTNGIntentService {
@Override // com.ea.nimble.pushtng.NimblePushTNGIntentService, com.ea.eadp.pushnotification.forwarding.FCMMessageService
public void customizeNotification(NotificationCompat.Builder builder, Bundle bundle) {
Context applicationContext = getApplicationContext();
if (applicationContext == null) {
return;
}
builder.setColor(applicationContext.getResources().getColor(R.color.NotificationColor));
Intent intent = new Intent(this, (Class<?>) UnpackAssetsActivity.class);
intent.putExtras(bundle);
builder.setContentIntent(PendingIntent.getActivity(this, 0, intent, 335544320));
if (MainActivity.IsAtLeastAPI(26)) {
builder.setChannelId(applicationContext.getString(R.string.NOTIFICATION_CHANNEL_GENERAL_ID));
}
super.customizeNotification(builder, bundle);
}
@Override // com.ea.nimble.pushtng.NimblePushTNGIntentService, com.ea.eadp.pushnotification.forwarding.FCMMessageService
public boolean isInForeground() {
return Platform.IsInForeground();
}
}

View File

@@ -0,0 +1,79 @@
package com.firemint.realracing;
import android.content.Context;
import android.util.Log;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
/* loaded from: classes2.dex */
public class SerialiseNotificationsHelper {
static final String PATH = "pastNotifications.bin";
static final String TAG = "RR3_NotificationsHelper";
static boolean bLog = false;
public static void Log(String str) {
}
public static void AddNotification(Context context, String str) {
SerialisedNotificationInfo LoadInformation = LoadInformation(context);
LoadInformation.AddNotification(str);
SaveInformation(context, LoadInformation);
}
public static void ClearAll(Context context) {
SerialisedNotificationInfo LoadInformation = LoadInformation(context);
LoadInformation.ClearAll();
SaveInformation(context, LoadInformation);
}
private static void SaveInformation(Context context, SerialisedNotificationInfo serialisedNotificationInfo) {
try {
FileOutputStream fileOutputStream = new FileOutputStream(new File(context.getFilesDir(), PATH));
ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);
objectOutputStream.writeObject(serialisedNotificationInfo);
objectOutputStream.close();
fileOutputStream.close();
} catch (Exception e) {
Log.e("RealRacing3", "Caught exception: " + e.getMessage());
}
serialisedNotificationInfo.Print("Saved Information");
}
private static SerialisedNotificationInfo LoadInformation(Context context) {
Log("Attempting to load saved information");
SerialisedNotificationInfo serialisedNotificationInfo = new SerialisedNotificationInfo();
try {
File file = new File(context.getFilesDir(), PATH);
if (file.exists()) {
Log("Found saved file. Loading information");
FileInputStream fileInputStream = new FileInputStream(file);
ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream);
SerialisedNotificationInfo serialisedNotificationInfo2 = (SerialisedNotificationInfo) objectInputStream.readObject();
try {
objectInputStream.close();
fileInputStream.close();
serialisedNotificationInfo = serialisedNotificationInfo2;
} catch (Exception e) {
e = e;
serialisedNotificationInfo = serialisedNotificationInfo2;
Log.e("RealRacing3", "Caught exception: " + e.getMessage());
serialisedNotificationInfo.Print("Loaded Information");
return serialisedNotificationInfo;
}
} else {
Log("Saved file doesn't exist. Returning new file");
}
} catch (Exception e2) {
e = e2;
}
serialisedNotificationInfo.Print("Loaded Information");
return serialisedNotificationInfo;
}
public static SerialisedNotificationInfo GetSavedInfo(Context context) {
return LoadInformation(context);
}
}

View File

@@ -0,0 +1,46 @@
package com.firemint.realracing;
import java.io.Serializable;
import java.util.Vector;
/* loaded from: classes2.dex */
public class SerialisedNotificationInfo implements Serializable {
static final boolean s_bLog = false;
int nVersion = 3;
private Vector<String> m_vsNotifications = new Vector<>();
public void LOG(String str) {
}
public void Print(String str) {
LOG(str);
LOG("Notification count = " + this.m_vsNotifications);
for (int i = 0; i < this.m_vsNotifications.size(); i++) {
LOG("Notification (" + i + ") = " + this.m_vsNotifications.get(i));
}
LOG("-----");
}
public final int GetNotificationCount() {
LOG("Notification size = " + this.m_vsNotifications.size());
return this.m_vsNotifications.size();
}
public final String GetNotificationString(int i) throws Exception {
if (i >= 0 && i < this.m_vsNotifications.size()) {
LOG("Notification at index (" + i + ") = " + this.m_vsNotifications.get(i));
return this.m_vsNotifications.get(i);
}
throw new Exception("Trying to get a notification form an invalid index!");
}
public void AddNotification(String str) {
LOG("Add notification to the vector (" + str + ")");
this.m_vsNotifications.add(str);
}
public void ClearAll() {
LOG("Clear all notifications from vector");
this.m_vsNotifications.clear();
}
}

View File

@@ -0,0 +1,194 @@
package com.firemint.realracing;
import android.content.Context;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.TextView;
/* loaded from: classes2.dex */
public class TextField extends RelativeLayout {
final long m_callbackptr;
EditText m_text;
public static void logm(String str) {
}
public native String onTextInputChanged(String str, long j);
public TextField(final Context context, long j, final String str) {
super(context);
logm("TextField() cachecallback ptr");
this.m_callbackptr = j;
MainActivity.instance.runOnUiThread(new Runnable() { // from class: com.firemint.realracing.TextField.1
@Override // java.lang.Runnable
public void run() {
TextField.logm("TextField() create text");
TextField.this.m_text = new EditText(context);
TextField.this.m_text.setMinimumHeight(0);
TextField.this.m_text.setMinimumWidth(0);
TextField.this.m_text.setPadding(0, 0, 0, 0);
TextField.this.m_text.setGravity(17);
StringBuilder sb = new StringBuilder();
sb.append("TextField() configure text");
String str2 = str;
if (str2 == null) {
str2 = "null";
}
sb.append(str2);
TextField.logm(sb.toString());
TextField.this.m_text.setText(str);
TextField.this.m_text.setImeOptions(6);
TextField.this.m_text.setRawInputType(262145);
TextField.logm("TextField() add change listener");
TextField.this.m_text.addTextChangedListener(new TextWatcher() { // from class: com.firemint.realracing.TextField.1.1
@Override // android.text.TextWatcher
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override // android.text.TextWatcher
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override // android.text.TextWatcher
public void afterTextChanged(Editable editable) {
TextField.this.TextInputChanged(editable.toString());
}
});
TextField.logm("TextField() add action listener");
TextField.this.m_text.setOnEditorActionListener(new TextView.OnEditorActionListener() { // from class: com.firemint.realracing.TextField.1.2
@Override // android.widget.TextView.OnEditorActionListener
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
if (i == 6) {
TextField.logm("User done");
textView.setActivated(false);
textView.setSelected(false);
}
return false;
}
});
TextField.this.setBounds(0, 0, 0, 0);
TextField textField = TextField.this;
textField.addView(textField.m_text);
}
});
}
public void setText(final String str) {
MainActivity.instance.runOnUiThread(new Runnable() { // from class: com.firemint.realracing.TextField.2
@Override // java.lang.Runnable
public void run() {
TextField.logm("start setText: " + str);
EditText editText = TextField.this.m_text;
if (editText == null || str.equals(editText.getText().toString())) {
return;
}
TextField.this.m_text.setText(str);
TextField.logm("end setText: " + str);
}
});
}
public void setHint(final String str) {
MainActivity.instance.runOnUiThread(new Runnable() { // from class: com.firemint.realracing.TextField.3
@Override // java.lang.Runnable
public void run() {
EditText editText = TextField.this.m_text;
if (editText == null) {
return;
}
editText.setHint(str);
}
});
}
public void setVisible(final boolean z) {
MainActivity.instance.runOnUiThread(new Runnable() { // from class: com.firemint.realracing.TextField.4
@Override // java.lang.Runnable
public void run() {
EditText editText = TextField.this.m_text;
if (editText == null) {
return;
}
editText.setVisibility(z ? 0 : 4);
}
});
}
@Override // android.view.View
public void setEnabled(final boolean z) {
MainActivity.instance.runOnUiThread(new Runnable() { // from class: com.firemint.realracing.TextField.5
@Override // java.lang.Runnable
public void run() {
EditText editText = TextField.this.m_text;
if (editText == null) {
return;
}
editText.setFocusable(z);
}
});
}
public void setTextColor(final int i, final int i2, final int i3, final int i4) {
MainActivity.instance.runOnUiThread(new Runnable() { // from class: com.firemint.realracing.TextField.6
@Override // java.lang.Runnable
public void run() {
int argb = Color.argb(i4, i, i2, i3);
TextField.logm("start setTextColor(): " + Integer.toHexString(argb));
EditText editText = TextField.this.m_text;
if (editText == null) {
return;
}
editText.setTextColor(argb);
TextField.logm("end setTextColor(): " + Integer.toHexString(argb));
}
});
}
public void setBackgroundColor(final int i, final int i2, final int i3, final int i4) {
MainActivity.instance.runOnUiThread(new Runnable() { // from class: com.firemint.realracing.TextField.7
@Override // java.lang.Runnable
public void run() {
int argb = Color.argb(i4, i, i2, i3);
TextField.logm("start setBackgroundColor(): " + Integer.toHexString(argb));
EditText editText = TextField.this.m_text;
if (editText == null) {
return;
}
editText.getBackground().setColorFilter(argb, PorterDuff.Mode.MULTIPLY);
TextField.logm("end setBackgroundColor()" + Integer.toHexString(argb));
}
});
}
public void setBounds(final int i, final int i2, final int i3, final int i4) {
MainActivity.instance.runOnUiThread(new Runnable() { // from class: com.firemint.realracing.TextField.8
@Override // java.lang.Runnable
public void run() {
EditText editText = TextField.this.m_text;
if (editText == null || editText.isSelected()) {
return;
}
TextField.this.m_text.setX(i);
TextField.this.m_text.setY(i2);
TextField.this.m_text.setWidth(i3);
TextField.this.m_text.setHeight(i4);
TextField.this.m_text.requestLayout();
TextField.this.requestLayout();
}
});
}
public void TextInputChanged(String str) {
logm("textInputChanged. UserText: " + str);
if (onTextInputChanged(str, this.m_callbackptr).equals(str)) {
return;
}
logm("textInputChanged. ValidatedText: " + str);
this.m_text.setText(str);
}
}

View File

@@ -0,0 +1,10 @@
package com.firemint.realracing;
/* loaded from: classes2.dex */
class TextureInfo {
public int texId = 0;
public int width = 0;
public int height = 0;
public int texWidth = 0;
public int texHeight = 0;
}

View File

@@ -0,0 +1,146 @@
package com.firemint.realracing;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
import android.view.KeyEvent;
import com.github.anrwatchdog.ANRError;
import com.github.anrwatchdog.ANRWatchDog;
import com.google.firebase.crashlytics.FirebaseCrashlytics;
/* loaded from: classes2.dex */
public class UnpackAssetsActivity extends Activity {
Intent m_startupIntent;
UnpackAssetsAsyncTask m_unpackTask = null;
boolean m_displayingStorageError = false;
@Override // android.app.Activity
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
new ANRWatchDog().setIgnoreDebugger(true).setANRListener(new ANRWatchDog.ANRListener() { // from class: com.firemint.realracing.UnpackAssetsActivity.1
@Override // com.github.anrwatchdog.ANRWatchDog.ANRListener
public void onAppNotResponding(ANRError aNRError) {
FirebaseCrashlytics.getInstance().recordException(aNRError);
}
}).start();
this.m_startupIntent = getIntent();
if (CheckStorage()) {
ExtractAndLaunch();
}
}
@Override // android.app.Activity
public void onResume() {
super.onResume();
}
@Override // android.app.Activity
public void onNewIntent(Intent intent) {
super.onNewIntent(intent);
this.m_startupIntent = intent;
}
public boolean IsGameRunning() {
return MainActivity.instance != null;
}
private void SetContentLayout() {
setContentView(R.layout.unpacking_assets);
}
public boolean CheckStorage() {
if (IsGameRunning() || IsStorageMounted()) {
return true;
}
if (!this.m_displayingStorageError) {
DisplayStorageError();
}
return false;
}
public boolean IsStorageMounted() {
return Environment.getExternalStorageState().equals("mounted");
}
public void DisplayStorageError() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setCancelable(false);
builder.setTitle(getString(R.string.STORAGE_ERROR_TITLE));
builder.setMessage(getString(R.string.STORAGE_ERROR_DESC));
builder.setNegativeButton(getString(R.string.STORAGE_ERROR_NEG_BTN), new DialogInterface.OnClickListener() { // from class: com.firemint.realracing.UnpackAssetsActivity.2
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
UnpackAssetsActivity.this.finish();
}
});
builder.setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.firemint.realracing.UnpackAssetsActivity.3
@Override // android.content.DialogInterface.OnKeyListener
public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
if (i != 4) {
return false;
}
UnpackAssetsActivity.this.finish();
return true;
}
});
builder.setOnDismissListener(new DialogInterface.OnDismissListener() { // from class: com.firemint.realracing.UnpackAssetsActivity.4
@Override // android.content.DialogInterface.OnDismissListener
public void onDismiss(DialogInterface dialogInterface) {
UnpackAssetsActivity.this.m_displayingStorageError = false;
}
});
builder.show();
this.m_displayingStorageError = true;
}
public void ExtractAndLaunch() {
if (IsGameRunning()) {
TransitionToGameActivity();
return;
}
if (this.m_unpackTask == null) {
MainActivity.HideSystemKeys(getWindow().getDecorView());
SetContentLayout();
String externalStorageDir = Platform.getExternalStorageDir(this);
if (externalStorageDir != "") {
UnpackAssetsAsyncTask unpackAssetsAsyncTask = new UnpackAssetsAsyncTask(this, externalStorageDir);
this.m_unpackTask = unpackAssetsAsyncTask;
unpackAssetsAsyncTask.execute(new Void[0]);
return;
}
ShowExtractError();
}
}
public void OnExtractionComplete(Integer num) {
if (num == UnpackAssetsAsyncTask.AssetExtractSuccess) {
TransitionToGameActivity();
} else {
ShowExtractError();
}
}
public void ShowExtractError() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setCancelable(false);
builder.setTitle(getString(R.string.UNPACK_ERROR_TITLE));
builder.setMessage(getString(R.string.UNPACK_ERROR_MESSAGE));
builder.setNegativeButton(getString(R.string.BTN_OK), new DialogInterface.OnClickListener() { // from class: com.firemint.realracing.UnpackAssetsActivity.5
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
UnpackAssetsActivity.this.finish();
}
});
builder.show();
}
public void TransitionToGameActivity() {
this.m_startupIntent.setClass(this, MainActivity.class);
startActivity(this.m_startupIntent);
overridePendingTransition(0, 0);
finish();
}
}

View File

@@ -0,0 +1,29 @@
package com.firemint.realracing;
import android.os.AsyncTask;
/* loaded from: classes2.dex */
class UnpackAssetsAsyncTask extends AsyncTask<Void, Void, Integer> {
public static Integer AssetExtractFailure = 0;
public static Integer AssetExtractSuccess = 1;
private String m_ExternalStorageDir;
private String m_ExtractPath;
private UnpackAssetsActivity m_OwningActivity;
public UnpackAssetsAsyncTask(UnpackAssetsActivity unpackAssetsActivity, String str) {
this.m_ExtractPath = "";
this.m_OwningActivity = unpackAssetsActivity;
this.m_ExternalStorageDir = str;
this.m_ExtractPath = str + "/apk/";
}
@Override // android.os.AsyncTask
public Integer doInBackground(Void... voidArr) {
return Platform.extractRes(this.m_ExternalStorageDir, this.m_ExtractPath, this.m_OwningActivity) ? AssetExtractSuccess : AssetExtractFailure;
}
@Override // android.os.AsyncTask
public void onPostExecute(Integer num) {
this.m_OwningActivity.OnExtractionComplete(num);
}
}

View File

@@ -0,0 +1,38 @@
package com.firemint.realracing;
import java.io.Serializable;
import java.nio.ByteBuffer;
/* loaded from: classes2.dex */
public class fmNfcData implements Serializable {
byte[] m_data;
public byte[] Compress(byte[] bArr) {
return bArr;
}
public byte[] Uncompress(byte[] bArr) {
return bArr;
}
public fmNfcData() {
this.m_data = null;
}
public fmNfcData(byte[] bArr) {
this.m_data = bArr;
}
public void Import(byte[] bArr) {
ByteBuffer wrap = ByteBuffer.wrap(Uncompress(bArr));
byte[] bArr2 = new byte[wrap.remaining()];
this.m_data = bArr2;
wrap.get(bArr2, 0, wrap.remaining());
}
public byte[] GetByteArray() {
ByteBuffer allocate = ByteBuffer.allocate(this.m_data.length);
allocate.put(this.m_data);
return Compress(allocate.array());
}
}

View File

@@ -0,0 +1,277 @@
package com.firemint.realracing;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.nfc.FormatException;
import android.nfc.NdefMessage;
import android.nfc.NdefRecord;
import android.nfc.NfcAdapter;
import android.nfc.NfcEvent;
import android.nfc.Tag;
import android.nfc.TagLostException;
import android.nfc.tech.Ndef;
import android.nfc.tech.NdefFormatable;
import android.os.Parcelable;
import com.google.android.gms.drive.DriveFile;
import java.io.IOException;
/* loaded from: classes2.dex */
public class fmNfcManager implements NfcAdapter.CreateNdefMessageCallback {
static boolean m_bLog = true;
NdefMessage m_ndefMessage = null;
fmNfcData m_fmNfcData = null;
NfcMode m_eNfcMode = NfcMode.NfcMode_Read;
MainActivity m_activity = null;
NfcAdapter m_nfcAdapter = null;
boolean m_bForegroundDispatchEnabled = false;
public enum NfcMode {
NfcMode_Read,
NfcMode_Write
}
public native byte[] GetNfcDataToTransmitJNI();
public native void NfcMessageReceivedJNI(byte[] bArr, int i);
public void SetNfcMode(NfcMode nfcMode) {
this.m_eNfcMode = nfcMode;
if (nfcMode == NfcMode.NfcMode_Read) {
Log("Setting mode to read");
} else if (nfcMode == NfcMode.NfcMode_Write) {
Log("Setting mode to write");
}
}
public static void Log(String str) {
if (m_bLog) {
str.length();
}
}
public static void LogSeparator() {
Log("--------------------");
}
public boolean IsNfcAvailable() {
if (this.m_nfcAdapter == null) {
this.m_nfcAdapter = NfcAdapter.getDefaultAdapter(this.m_activity);
}
return this.m_nfcAdapter != null;
}
public void Initalise(Object obj) {
if (!(obj instanceof Activity)) {
Log("Failed to cast object to activity :(");
} else {
this.m_activity = (MainActivity) obj;
}
NfcAdapter defaultAdapter = NfcAdapter.getDefaultAdapter(this.m_activity);
this.m_nfcAdapter = defaultAdapter;
if (defaultAdapter != null) {
EnableForegroundDispatch();
}
}
@Override // android.nfc.NfcAdapter.CreateNdefMessageCallback
public NdefMessage createNdefMessage(NfcEvent nfcEvent) {
Log("createNdefMessage callback");
NdefMessage CreateNdefMessage = CreateNdefMessage(GetNfcDataToTransmitJNI());
this.m_ndefMessage = CreateNdefMessage;
return CreateNdefMessage;
}
public void onPause() {
DisableForegroundDispatch();
}
public void onResume() {
EnableForegroundDispatch();
}
public void HandleIntent(Intent intent) {
Log("HandleIntent");
if (intent != null) {
if (intent.getAction() != null) {
Log("Intent action: " + intent.getAction());
}
if (IsNfcAvailable()) {
if (this.m_eNfcMode == NfcMode.NfcMode_Read) {
Log("Read NFC message");
ReadNfcMessage(intent);
} else {
Log("Write NFC message");
WriteNfcMessage(intent);
}
}
}
}
public void ReadNfcMessage(Intent intent) {
Parcelable[] parcelableArrayExtra = intent.getParcelableArrayExtra("android.nfc.extra.NDEF_MESSAGES");
if (parcelableArrayExtra != null) {
Log("Received a message :)");
if (parcelableArrayExtra.length > 0) {
for (Parcelable parcelable : parcelableArrayExtra) {
NdefMessage ndefMessage = (NdefMessage) parcelable;
if (ndefMessage != null) {
NdefRecord[] records = ndefMessage.getRecords();
if (records.length > 0) {
NdefRecord ndefRecord = records[0];
if (ndefRecord != null) {
fmNfcData fmnfcdata = new fmNfcData();
fmnfcdata.Import(ndefRecord.getPayload());
byte[] bArr = fmnfcdata.m_data;
Log("NfcMessageReceivedJNI");
NfcMessageReceivedJNI(bArr, bArr.length);
} else {
Log("NdefRecord record was null");
}
} else {
Log("NdefRecord[] records length = 0");
}
} else {
Log("Parcelable parcelableMessage was null");
}
}
return;
}
Log("Parcelable[] messages length = 0");
return;
}
Log("Parcelable[] messages was null");
}
public void WriteNfcMessage(Intent intent) {
Tag tag = (Tag) intent.getParcelableExtra("android.nfc.extra.TAG");
if (tag != null) {
fmNfcData fmnfcdata = this.m_fmNfcData;
if (fmnfcdata != null) {
WriteTag(this.m_activity, tag, fmnfcdata.GetByteArray());
} else {
Log("fmNfcData was null. Skip writing the tag");
}
}
}
@TargetApi(16)
public void WriteTag(Context context, Tag tag, byte[] bArr) {
NdefMessage ndefMessage = this.m_ndefMessage;
if (ndefMessage == null) {
ndefMessage = new NdefMessage(new NdefRecord[]{NdefRecord.createExternal("com.ea.games.r3_na", "r3.data", bArr), NdefRecord.createApplicationRecord(context.getPackageName())});
}
Ndef ndef = Ndef.get(tag);
if (ndef != null) {
try {
ndef.connect();
if (ndef.isWritable()) {
int length = ndefMessage.toByteArray().length;
int maxSize = ndef.getMaxSize();
Log("Message size is (" + length + ")");
Log("Tag size is (" + maxSize + ")");
if (maxSize >= length) {
try {
try {
ndef.writeNdefMessage(ndefMessage);
} catch (FormatException unused) {
Log("Format exception :(");
}
} catch (TagLostException unused2) {
Log("Tag has been lost :(");
} catch (IOException unused3) {
Log("IOException :(");
}
} else {
Log("The message is too big for the tag");
}
} else {
Log("Tag is read only");
}
return;
} catch (Exception unused4) {
Log("Failed to connect to the tag");
return;
}
}
NdefFormatable ndefFormatable = NdefFormatable.get(tag);
if (ndefFormatable != null) {
try {
ndefFormatable.connect();
ndefFormatable.format(ndefMessage);
} catch (FormatException unused5) {
Log("Format exception :(");
} catch (TagLostException unused6) {
Log("Tag has been lost :(");
} catch (IOException unused7) {
Log("IOException :(");
}
}
}
public void EnableForegroundDispatch() {
if (!IsNfcAvailable() || this.m_bForegroundDispatchEnabled) {
return;
}
this.m_activity.runOnUiThread(new Runnable() { // from class: com.firemint.realracing.fmNfcManager.1
@Override // java.lang.Runnable
public void run() {
fmNfcManager.Log("Enable Foreground Dispatch");
PendingIntent activity = PendingIntent.getActivity(fmNfcManager.this.m_activity, 0, new Intent(fmNfcManager.this.m_activity, (Class<?>) MainActivity.class).addFlags(DriveFile.MODE_WRITE_ONLY), 335544320);
try {
new IntentFilter[]{new IntentFilter("android.nfc.action.TAG_DISCOVERED"), new IntentFilter("android.nfc.action.NDEF_DISCOVERED")}[0].addDataType("application/vnd.r3.data");
} catch (Exception e) {
fmNfcManager.Log("Failed to add data to intent filter. e = " + e.toString());
}
fmNfcManager fmnfcmanager = fmNfcManager.this;
fmnfcmanager.m_nfcAdapter.enableForegroundDispatch(fmnfcmanager.m_activity, activity, null, null);
fmNfcManager.this.m_bForegroundDispatchEnabled = true;
}
});
}
public void DisableForegroundDispatch() {
if (IsNfcAvailable() && this.m_bForegroundDispatchEnabled) {
this.m_activity.runOnUiThread(new Runnable() { // from class: com.firemint.realracing.fmNfcManager.2
@Override // java.lang.Runnable
public void run() {
fmNfcManager.Log("Disable Foreground Dispatch");
fmNfcManager fmnfcmanager = fmNfcManager.this;
fmnfcmanager.m_nfcAdapter.disableForegroundDispatch(fmnfcmanager.m_activity);
fmNfcManager.this.m_bForegroundDispatchEnabled = false;
}
});
}
}
@TargetApi(16)
public void SetNfcDataJNI(final byte[] bArr) {
this.m_activity.runOnUiThread(new Runnable() { // from class: com.firemint.realracing.fmNfcManager.3
@Override // java.lang.Runnable
public void run() {
fmNfcManager.Log("SetNfcDataJNI!");
fmNfcManager fmnfcmanager = fmNfcManager.this;
fmnfcmanager.m_ndefMessage = fmnfcmanager.CreateNdefMessage(bArr);
}
});
}
public NdefMessage CreateNdefMessage(byte[] bArr) {
fmNfcData fmnfcdata = new fmNfcData(bArr);
this.m_fmNfcData = fmnfcdata;
return new NdefMessage(new NdefRecord[]{NdefRecord.createExternal("com.ea.games.r3_na", "externaltype", fmnfcdata.GetByteArray()), NdefRecord.createApplicationRecord(this.m_activity.getPackageName())});
}
public void SetNfcMode(int i) {
if (i == 0) {
Log("Undefined mode!");
} else if (i == 1) {
SetNfcMode(NfcMode.NfcMode_Read);
} else if (i == 2) {
SetNfcMode(NfcMode.NfcMode_Write);
}
}
}