Перенос с маленькими правками
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
OK
|
||||
Diese Anwendung ist nicht für den Gebrauch auf deinem Android-Gerät autorisiert.
|
||||
Bitte warten
|
||||
Check-Lizenz
|
||||
@@ -0,0 +1,4 @@
|
||||
OK
|
||||
This application is not authorized for use on your Android device.
|
||||
Please wait
|
||||
Checking license
|
||||
@@ -0,0 +1,4 @@
|
||||
ACEPTAR
|
||||
El uso de esta aplicación no está autorizado en tu dispositivo Android.
|
||||
Por favor espere
|
||||
Verificación de licencia
|
||||
@@ -0,0 +1,4 @@
|
||||
ACEPTAR
|
||||
El uso de esta aplicación en su dispositivo Android no está autorizado.
|
||||
Por favor espere
|
||||
Verificación de licencia
|
||||
@@ -0,0 +1,4 @@
|
||||
OK
|
||||
L'utilisation de cette application sur votre appareil Android n'est pas autorisée.
|
||||
Patientez s'il vous plaît
|
||||
Permis de vérifier
|
||||
@@ -0,0 +1,4 @@
|
||||
OK
|
||||
L'applicazione non dispone dell'autorizzazione necessaria per l'utilizzo sul tuo dispositivo Android.
|
||||
Si prega di attendere
|
||||
Controllo di licenza
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
OK
|
||||
Esta aplicação não está autorizada para utilização no seu dispositivo Android.
|
||||
Por favor, aguarde
|
||||
Verifique licença
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
623470192
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
@@ -0,0 +1,57 @@
|
||||
package com.bda.controller;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class BaseEvent implements Parcelable {
|
||||
public static final Parcelable.Creator<BaseEvent> CREATOR = new ParcelableCreator();
|
||||
final int mControllerId;
|
||||
final long mEventTime;
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public BaseEvent(long j, int i) {
|
||||
this.mEventTime = j;
|
||||
this.mControllerId = i;
|
||||
}
|
||||
|
||||
BaseEvent(Parcel parcel) {
|
||||
this.mEventTime = parcel.readLong();
|
||||
this.mControllerId = parcel.readInt();
|
||||
}
|
||||
|
||||
public final int getControllerId() {
|
||||
return this.mControllerId;
|
||||
}
|
||||
|
||||
public final long getEventTime() {
|
||||
return this.mEventTime;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
parcel.writeLong(this.mEventTime);
|
||||
parcel.writeInt(this.mControllerId);
|
||||
}
|
||||
|
||||
static class ParcelableCreator implements Parcelable.Creator<BaseEvent> {
|
||||
ParcelableCreator() {
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public BaseEvent createFromParcel(Parcel parcel) {
|
||||
return new BaseEvent(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public BaseEvent[] newArray(int i) {
|
||||
return new BaseEvent[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.bda.controller;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class Constants {
|
||||
public static final int MSG_SET_ACTIVITY_EVENT = 1;
|
||||
|
||||
private Constants() {
|
||||
}
|
||||
|
||||
public static final class ActivityEvent {
|
||||
public static final int CREATE = 1;
|
||||
public static final int DESTROY = 2;
|
||||
public static final int PAUSE = 6;
|
||||
public static final int RESUME = 5;
|
||||
public static final int SERVICE_CONNECTED = 7;
|
||||
public static final int START = 3;
|
||||
public static final int STOP = 4;
|
||||
|
||||
private ActivityEvent() {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,381 @@
|
||||
package com.bda.controller;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import com.bda.controller.IControllerListener;
|
||||
import com.bda.controller.IControllerMonitor;
|
||||
import com.bda.controller.IControllerService;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class Controller {
|
||||
public static final int ACTION_CONNECTED = 1;
|
||||
public static final int ACTION_CONNECTING = 2;
|
||||
public static final int ACTION_DISCONNECTED = 0;
|
||||
public static final int ACTION_DOWN = 0;
|
||||
public static final int ACTION_FALSE = 0;
|
||||
public static final int ACTION_TRUE = 1;
|
||||
public static final int ACTION_UP = 1;
|
||||
public static final int ACTION_VERSION_MOGA = 0;
|
||||
public static final int ACTION_VERSION_MOGAPRO = 1;
|
||||
public static final int AXIS_LTRIGGER = 17;
|
||||
public static final int AXIS_RTRIGGER = 18;
|
||||
public static final int AXIS_RZ = 14;
|
||||
public static final int AXIS_X = 0;
|
||||
public static final int AXIS_Y = 1;
|
||||
public static final int AXIS_Z = 11;
|
||||
static final int CONTROLLER_ID = 1;
|
||||
public static final int INFO_ACTIVE_DEVICE_COUNT = 2;
|
||||
public static final int INFO_KNOWN_DEVICE_COUNT = 1;
|
||||
public static final int INFO_UNKNOWN = 0;
|
||||
public static final int KEYCODE_BUTTON_A = 96;
|
||||
public static final int KEYCODE_BUTTON_B = 97;
|
||||
public static final int KEYCODE_BUTTON_L1 = 102;
|
||||
public static final int KEYCODE_BUTTON_L2 = 104;
|
||||
public static final int KEYCODE_BUTTON_R1 = 103;
|
||||
public static final int KEYCODE_BUTTON_R2 = 105;
|
||||
public static final int KEYCODE_BUTTON_SELECT = 109;
|
||||
public static final int KEYCODE_BUTTON_START = 108;
|
||||
public static final int KEYCODE_BUTTON_THUMBL = 106;
|
||||
public static final int KEYCODE_BUTTON_THUMBR = 107;
|
||||
public static final int KEYCODE_BUTTON_X = 99;
|
||||
public static final int KEYCODE_BUTTON_Y = 100;
|
||||
public static final int KEYCODE_DPAD_DOWN = 20;
|
||||
public static final int KEYCODE_DPAD_LEFT = 21;
|
||||
public static final int KEYCODE_DPAD_RIGHT = 22;
|
||||
public static final int KEYCODE_DPAD_UP = 19;
|
||||
public static final int KEYCODE_UNKNOWN = 0;
|
||||
static final int LEGACY_KEYCODE_BUTTON_X = 98;
|
||||
static final int LEGACY_KEYCODE_BUTTON_Y = 99;
|
||||
public static final int STATE_CONNECTION = 1;
|
||||
public static final int STATE_CURRENT_PRODUCT_VERSION = 4;
|
||||
public static final int STATE_POWER_LOW = 2;
|
||||
|
||||
@Deprecated
|
||||
public static final int STATE_SELECTED_VERSION = 4;
|
||||
public static final int STATE_SUPPORTED_PRODUCT_VERSION = 3;
|
||||
|
||||
@Deprecated
|
||||
public static final int STATE_SUPPORTED_VERSION = 3;
|
||||
public static final int STATE_UNKNOWN = 0;
|
||||
final Context mContext;
|
||||
boolean mIsBound = false;
|
||||
IControllerService mService = null;
|
||||
final IControllerListener.Stub mListenerStub = new IControllerListenerStub();
|
||||
final IControllerMonitor.Stub mMonitorStub = new IControllerMonitorStub();
|
||||
final ServiceConnection mServiceConnection = new ServiceConnection();
|
||||
int mActivityEvent = 6;
|
||||
Handler mHandler = null;
|
||||
ControllerListener mListener = null;
|
||||
ControllerMonitor mMonitor = null;
|
||||
|
||||
public static final Controller getInstance(Context context) {
|
||||
return new Controller(context);
|
||||
}
|
||||
|
||||
Controller(Context context) {
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
public final void exit() {
|
||||
setListener(null, null);
|
||||
setMonitor(null);
|
||||
if (this.mIsBound) {
|
||||
this.mContext.unbindService(this.mServiceConnection);
|
||||
this.mIsBound = false;
|
||||
}
|
||||
}
|
||||
|
||||
public final float getAxisValue(int i) {
|
||||
if (this.mService == null) {
|
||||
return 0.0f;
|
||||
}
|
||||
try {
|
||||
return this.mService.getAxisValue(1, i);
|
||||
} catch (RemoteException unused) {
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
public final int getInfo(int i) {
|
||||
if (this.mService == null) {
|
||||
return 0;
|
||||
}
|
||||
try {
|
||||
return this.mService.getInfo(i);
|
||||
} catch (RemoteException unused) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public final int getKeyCode(int i) {
|
||||
if (this.mService != null) {
|
||||
try {
|
||||
return this.mService.getKeyCode2(1, i);
|
||||
} catch (RemoteException unused) {
|
||||
switch (i) {
|
||||
case 99:
|
||||
i = 98;
|
||||
break;
|
||||
case 100:
|
||||
i = 99;
|
||||
break;
|
||||
}
|
||||
try {
|
||||
return this.mService.getKeyCode(1, i);
|
||||
} catch (RemoteException unused2) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
public final int getState(int i) {
|
||||
if (this.mService == null) {
|
||||
return 0;
|
||||
}
|
||||
try {
|
||||
return this.mService.getState(1, i);
|
||||
} catch (RemoteException unused) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean init() {
|
||||
if (!this.mIsBound) {
|
||||
Intent intent = new Intent(IControllerService.class.getName());
|
||||
this.mContext.startService(intent);
|
||||
this.mContext.bindService(intent, this.mServiceConnection, 1);
|
||||
this.mIsBound = true;
|
||||
}
|
||||
return this.mIsBound;
|
||||
}
|
||||
|
||||
public final void onPause() {
|
||||
this.mActivityEvent = 6;
|
||||
sendMessage(1, this.mActivityEvent);
|
||||
registerListener();
|
||||
}
|
||||
|
||||
public final void onResume() {
|
||||
this.mActivityEvent = 5;
|
||||
sendMessage(1, this.mActivityEvent);
|
||||
registerListener();
|
||||
}
|
||||
|
||||
void registerListener() {
|
||||
if (this.mListener == null || this.mService == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
try {
|
||||
this.mService.registerListener2(this.mListenerStub, this.mActivityEvent);
|
||||
} catch (RemoteException ignored) {
|
||||
}
|
||||
this.mService.registerListener(this.mListenerStub, this.mActivityEvent);
|
||||
} catch (RemoteException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
void registerMonitor() {
|
||||
if (this.mMonitor == null || this.mService == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.mService.registerMonitor(this.mMonitorStub, this.mActivityEvent);
|
||||
} catch (RemoteException unused) {
|
||||
}
|
||||
}
|
||||
|
||||
void sendMessage(int i, int i2) {
|
||||
if (this.mService != null) {
|
||||
try {
|
||||
this.mService.sendMessage(i, i2);
|
||||
} catch (RemoteException unused) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final void setListener(ControllerListener controllerListener, Handler handler) {
|
||||
unregisterListener();
|
||||
this.mListener = controllerListener;
|
||||
this.mHandler = handler;
|
||||
registerListener();
|
||||
}
|
||||
|
||||
public final void setMonitor(ControllerMonitor controllerMonitor) {
|
||||
unregisterMonitor();
|
||||
this.mMonitor = controllerMonitor;
|
||||
registerMonitor();
|
||||
}
|
||||
|
||||
void unregisterListener() {
|
||||
if (this.mService != null) {
|
||||
try {
|
||||
this.mService.unregisterListener(this.mListenerStub, this.mActivityEvent);
|
||||
} catch (RemoteException unused) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void unregisterMonitor() {
|
||||
if (this.mService != null) {
|
||||
try {
|
||||
this.mService.unregisterMonitor(this.mMonitorStub, this.mActivityEvent);
|
||||
} catch (RemoteException unused) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void allowNewConnections() {
|
||||
if (this.mService != null) {
|
||||
try {
|
||||
this.mService.allowNewConnections();
|
||||
} catch (RemoteException unused) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void disallowNewConnections() {
|
||||
if (this.mService != null) {
|
||||
try {
|
||||
this.mService.disallowNewConnections();
|
||||
} catch (RemoteException unused) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void isAllowingNewConnections() {
|
||||
if (this.mService != null) {
|
||||
try {
|
||||
this.mService.isAllowingNewConnections();
|
||||
} catch (RemoteException unused) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class IControllerListenerStub extends IControllerListener.Stub {
|
||||
IControllerListenerStub() {
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.IControllerListener
|
||||
public void onKeyEvent(KeyEvent keyEvent) throws RemoteException {
|
||||
if (keyEvent.getControllerId() != 1 || Controller.this.mListener == null) {
|
||||
return;
|
||||
}
|
||||
KeyRunnable keyRunnable = Controller.this.new KeyRunnable(keyEvent);
|
||||
if (Controller.this.mHandler != null) {
|
||||
Controller.this.mHandler.post(keyRunnable);
|
||||
} else {
|
||||
keyRunnable.run();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.IControllerListener
|
||||
public void onMotionEvent(MotionEvent motionEvent) throws RemoteException {
|
||||
if (motionEvent.getControllerId() != 1 || Controller.this.mListener == null) {
|
||||
return;
|
||||
}
|
||||
MotionRunnable motionRunnable = Controller.this.new MotionRunnable(motionEvent);
|
||||
if (Controller.this.mHandler != null) {
|
||||
Controller.this.mHandler.post(motionRunnable);
|
||||
} else {
|
||||
motionRunnable.run();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.IControllerListener
|
||||
public void onStateEvent(StateEvent stateEvent) throws RemoteException {
|
||||
if (stateEvent.getControllerId() != 1 || Controller.this.mListener == null) {
|
||||
return;
|
||||
}
|
||||
StateRunnable stateRunnable = Controller.this.new StateRunnable(stateEvent);
|
||||
if (Controller.this.mHandler != null) {
|
||||
Controller.this.mHandler.post(stateRunnable);
|
||||
} else {
|
||||
stateRunnable.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class IControllerMonitorStub extends IControllerMonitor.Stub {
|
||||
IControllerMonitorStub() {
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.IControllerMonitor
|
||||
public void onLog(int i, int i2, String str) throws RemoteException {
|
||||
if (Controller.this.mMonitor != null) {
|
||||
Controller.this.mMonitor.onLog(i, i2, str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class KeyRunnable implements Runnable {
|
||||
final KeyEvent mEvent;
|
||||
|
||||
public KeyRunnable(KeyEvent keyEvent) {
|
||||
this.mEvent = keyEvent;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
if (Controller.this.mListener != null) {
|
||||
Controller.this.mListener.onKeyEvent(this.mEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MotionRunnable implements Runnable {
|
||||
final MotionEvent mEvent;
|
||||
|
||||
public MotionRunnable(MotionEvent motionEvent) {
|
||||
this.mEvent = motionEvent;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
if (Controller.this.mListener != null) {
|
||||
Controller.this.mListener.onMotionEvent(this.mEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ServiceConnection implements android.content.ServiceConnection {
|
||||
ServiceConnection() {
|
||||
}
|
||||
|
||||
@Override // android.content.ServiceConnection
|
||||
public final void onServiceConnected(ComponentName componentName, IBinder iBinder) {
|
||||
Controller.this.mService = IControllerService.Stub.asInterface(iBinder);
|
||||
Controller.this.registerListener();
|
||||
Controller.this.registerMonitor();
|
||||
if (Controller.this.mActivityEvent == 5) {
|
||||
Controller.this.sendMessage(1, 5);
|
||||
Controller.this.sendMessage(1, 7);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.content.ServiceConnection
|
||||
public final void onServiceDisconnected(ComponentName componentName) {
|
||||
Controller.this.mService = null;
|
||||
}
|
||||
}
|
||||
|
||||
class StateRunnable implements Runnable {
|
||||
final StateEvent mEvent;
|
||||
|
||||
public StateRunnable(StateEvent stateEvent) {
|
||||
this.mEvent = stateEvent;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
if (Controller.this.mListener != null) {
|
||||
Controller.this.mListener.onStateEvent(this.mEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.bda.controller;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ControllerListener {
|
||||
void onKeyEvent(KeyEvent keyEvent);
|
||||
|
||||
void onMotionEvent(MotionEvent motionEvent);
|
||||
|
||||
void onStateEvent(StateEvent stateEvent);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.bda.controller;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ControllerMonitor {
|
||||
void onLog(int i, int i2, String str);
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
package com.bda.controller;
|
||||
|
||||
import android.os.Binder;
|
||||
import android.os.IBinder;
|
||||
import android.os.IInterface;
|
||||
import android.os.Parcel;
|
||||
import android.os.RemoteException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IControllerListener extends IInterface {
|
||||
void onKeyEvent(KeyEvent keyEvent) throws RemoteException;
|
||||
|
||||
void onMotionEvent(MotionEvent motionEvent) throws RemoteException;
|
||||
|
||||
void onStateEvent(StateEvent stateEvent) throws RemoteException;
|
||||
|
||||
public static abstract class Stub extends Binder implements IControllerListener {
|
||||
private static final String DESCRIPTOR = "com.bda.controller.IControllerListener";
|
||||
static final int TRANSACTION_onKeyEvent = 1;
|
||||
static final int TRANSACTION_onMotionEvent = 2;
|
||||
static final int TRANSACTION_onStateEvent = 3;
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Stub() {
|
||||
attachInterface(this, DESCRIPTOR);
|
||||
}
|
||||
|
||||
public static IControllerListener asInterface(IBinder iBinder) {
|
||||
if (iBinder == null) {
|
||||
return null;
|
||||
}
|
||||
IInterface queryLocalInterface = iBinder.queryLocalInterface(DESCRIPTOR);
|
||||
if (queryLocalInterface != null && (queryLocalInterface instanceof IControllerListener)) {
|
||||
return (IControllerListener) queryLocalInterface;
|
||||
}
|
||||
return new Proxy(iBinder);
|
||||
}
|
||||
|
||||
@Override // android.os.Binder
|
||||
public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException {
|
||||
if (i == 1598968902) {
|
||||
parcel2.writeString(DESCRIPTOR);
|
||||
return true;
|
||||
}
|
||||
switch (i) {
|
||||
case 1:
|
||||
parcel.enforceInterface(DESCRIPTOR);
|
||||
onKeyEvent(parcel.readInt() != 0 ? KeyEvent.CREATOR.createFromParcel(parcel) : null);
|
||||
parcel2.writeNoException();
|
||||
return true;
|
||||
case 2:
|
||||
parcel.enforceInterface(DESCRIPTOR);
|
||||
onMotionEvent(parcel.readInt() != 0 ? MotionEvent.CREATOR.createFromParcel(parcel) : null);
|
||||
parcel2.writeNoException();
|
||||
return true;
|
||||
case 3:
|
||||
parcel.enforceInterface(DESCRIPTOR);
|
||||
onStateEvent(parcel.readInt() != 0 ? StateEvent.CREATOR.createFromParcel(parcel) : null);
|
||||
parcel2.writeNoException();
|
||||
return true;
|
||||
default:
|
||||
return super.onTransact(i, parcel, parcel2, i2);
|
||||
}
|
||||
}
|
||||
|
||||
private static class Proxy implements IControllerListener {
|
||||
private IBinder mRemote;
|
||||
|
||||
public String getInterfaceDescriptor() {
|
||||
return Stub.DESCRIPTOR;
|
||||
}
|
||||
|
||||
Proxy(IBinder iBinder) {
|
||||
this.mRemote = iBinder;
|
||||
}
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this.mRemote;
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.IControllerListener
|
||||
public void onKeyEvent(KeyEvent keyEvent) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
Parcel obtain2 = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
if (keyEvent != null) {
|
||||
obtain.writeInt(1);
|
||||
keyEvent.writeToParcel(obtain, 0);
|
||||
} else {
|
||||
obtain.writeInt(0);
|
||||
}
|
||||
this.mRemote.transact(1, obtain, obtain2, 0);
|
||||
obtain2.readException();
|
||||
} finally {
|
||||
obtain2.recycle();
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.IControllerListener
|
||||
public void onMotionEvent(MotionEvent motionEvent) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
Parcel obtain2 = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
if (motionEvent != null) {
|
||||
obtain.writeInt(1);
|
||||
motionEvent.writeToParcel(obtain, 0);
|
||||
} else {
|
||||
obtain.writeInt(0);
|
||||
}
|
||||
this.mRemote.transact(2, obtain, obtain2, 0);
|
||||
obtain2.readException();
|
||||
} finally {
|
||||
obtain2.recycle();
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.IControllerListener
|
||||
public void onStateEvent(StateEvent stateEvent) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
Parcel obtain2 = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
if (stateEvent != null) {
|
||||
obtain.writeInt(1);
|
||||
stateEvent.writeToParcel(obtain, 0);
|
||||
} else {
|
||||
obtain.writeInt(0);
|
||||
}
|
||||
this.mRemote.transact(3, obtain, obtain2, 0);
|
||||
obtain2.readException();
|
||||
} finally {
|
||||
obtain2.recycle();
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.bda.controller;
|
||||
|
||||
import android.os.Binder;
|
||||
import android.os.IBinder;
|
||||
import android.os.IInterface;
|
||||
import android.os.Parcel;
|
||||
import android.os.RemoteException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IControllerMonitor extends IInterface {
|
||||
void onLog(int i, int i2, String str) throws RemoteException;
|
||||
|
||||
public static abstract class Stub extends Binder implements IControllerMonitor {
|
||||
private static final String DESCRIPTOR = "com.bda.controller.IControllerMonitor";
|
||||
static final int TRANSACTION_onLog = 1;
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Stub() {
|
||||
attachInterface(this, DESCRIPTOR);
|
||||
}
|
||||
|
||||
public static IControllerMonitor asInterface(IBinder iBinder) {
|
||||
if (iBinder == null) {
|
||||
return null;
|
||||
}
|
||||
IInterface queryLocalInterface = iBinder.queryLocalInterface(DESCRIPTOR);
|
||||
if (queryLocalInterface != null && (queryLocalInterface instanceof IControllerMonitor)) {
|
||||
return (IControllerMonitor) queryLocalInterface;
|
||||
}
|
||||
return new Proxy(iBinder);
|
||||
}
|
||||
|
||||
@Override // android.os.Binder
|
||||
public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException {
|
||||
if (i != 1) {
|
||||
if (i == 1598968902) {
|
||||
parcel2.writeString(DESCRIPTOR);
|
||||
return true;
|
||||
}
|
||||
return super.onTransact(i, parcel, parcel2, i2);
|
||||
}
|
||||
parcel.enforceInterface(DESCRIPTOR);
|
||||
onLog(parcel.readInt(), parcel.readInt(), parcel.readString());
|
||||
parcel2.writeNoException();
|
||||
return true;
|
||||
}
|
||||
|
||||
private static class Proxy implements IControllerMonitor {
|
||||
private IBinder mRemote;
|
||||
|
||||
public String getInterfaceDescriptor() {
|
||||
return Stub.DESCRIPTOR;
|
||||
}
|
||||
|
||||
Proxy(IBinder iBinder) {
|
||||
this.mRemote = iBinder;
|
||||
}
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this.mRemote;
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.IControllerMonitor
|
||||
public void onLog(int i, int i2, String str) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
Parcel obtain2 = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
obtain.writeInt(i);
|
||||
obtain.writeInt(i2);
|
||||
obtain.writeString(str);
|
||||
this.mRemote.transact(1, obtain, obtain2, 0);
|
||||
obtain2.readException();
|
||||
} finally {
|
||||
obtain2.recycle();
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,406 @@
|
||||
package com.bda.controller;
|
||||
|
||||
import android.os.Binder;
|
||||
import android.os.IBinder;
|
||||
import android.os.IInterface;
|
||||
import android.os.Parcel;
|
||||
import android.os.RemoteException;
|
||||
import com.bda.controller.IControllerListener;
|
||||
import com.bda.controller.IControllerMonitor;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IControllerService extends IInterface {
|
||||
void allowNewConnections() throws RemoteException;
|
||||
|
||||
void disallowNewConnections() throws RemoteException;
|
||||
|
||||
float getAxisValue(int i, int i2) throws RemoteException;
|
||||
|
||||
int getInfo(int i) throws RemoteException;
|
||||
|
||||
int getKeyCode(int i, int i2) throws RemoteException;
|
||||
|
||||
int getKeyCode2(int i, int i2) throws RemoteException;
|
||||
|
||||
int getState(int i, int i2) throws RemoteException;
|
||||
|
||||
boolean isAllowingNewConnections() throws RemoteException;
|
||||
|
||||
void registerListener(IControllerListener iControllerListener, int i) throws RemoteException;
|
||||
|
||||
void registerListener2(IControllerListener iControllerListener, int i) throws RemoteException;
|
||||
|
||||
void registerMonitor(IControllerMonitor iControllerMonitor, int i) throws RemoteException;
|
||||
|
||||
void sendMessage(int i, int i2) throws RemoteException;
|
||||
|
||||
void unregisterListener(IControllerListener iControllerListener, int i) throws RemoteException;
|
||||
|
||||
void unregisterMonitor(IControllerMonitor iControllerMonitor, int i) throws RemoteException;
|
||||
|
||||
public static abstract class Stub extends Binder implements IControllerService {
|
||||
private static final String DESCRIPTOR = "com.bda.controller.IControllerService";
|
||||
static final int TRANSACTION_allowNewConnections = 12;
|
||||
static final int TRANSACTION_disallowNewConnections = 13;
|
||||
static final int TRANSACTION_getAxisValue = 7;
|
||||
static final int TRANSACTION_getInfo = 5;
|
||||
static final int TRANSACTION_getKeyCode = 6;
|
||||
static final int TRANSACTION_getKeyCode2 = 11;
|
||||
static final int TRANSACTION_getState = 8;
|
||||
static final int TRANSACTION_isAllowingNewConnections = 14;
|
||||
static final int TRANSACTION_registerListener = 1;
|
||||
static final int TRANSACTION_registerListener2 = 10;
|
||||
static final int TRANSACTION_registerMonitor = 3;
|
||||
static final int TRANSACTION_sendMessage = 9;
|
||||
static final int TRANSACTION_unregisterListener = 2;
|
||||
static final int TRANSACTION_unregisterMonitor = 4;
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Stub() {
|
||||
attachInterface(this, DESCRIPTOR);
|
||||
}
|
||||
|
||||
public static IControllerService asInterface(IBinder iBinder) {
|
||||
if (iBinder == null) {
|
||||
return null;
|
||||
}
|
||||
IInterface queryLocalInterface = iBinder.queryLocalInterface(DESCRIPTOR);
|
||||
if (queryLocalInterface != null && (queryLocalInterface instanceof IControllerService)) {
|
||||
return (IControllerService) queryLocalInterface;
|
||||
}
|
||||
return new Proxy(iBinder);
|
||||
}
|
||||
|
||||
@Override // android.os.Binder
|
||||
public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException {
|
||||
if (i == 1598968902) {
|
||||
parcel2.writeString(DESCRIPTOR);
|
||||
return true;
|
||||
}
|
||||
switch (i) {
|
||||
case 1:
|
||||
parcel.enforceInterface(DESCRIPTOR);
|
||||
registerListener(IControllerListener.Stub.asInterface(parcel.readStrongBinder()), parcel.readInt());
|
||||
parcel2.writeNoException();
|
||||
return true;
|
||||
case 2:
|
||||
parcel.enforceInterface(DESCRIPTOR);
|
||||
unregisterListener(IControllerListener.Stub.asInterface(parcel.readStrongBinder()), parcel.readInt());
|
||||
parcel2.writeNoException();
|
||||
return true;
|
||||
case 3:
|
||||
parcel.enforceInterface(DESCRIPTOR);
|
||||
registerMonitor(IControllerMonitor.Stub.asInterface(parcel.readStrongBinder()), parcel.readInt());
|
||||
parcel2.writeNoException();
|
||||
return true;
|
||||
case 4:
|
||||
parcel.enforceInterface(DESCRIPTOR);
|
||||
unregisterMonitor(IControllerMonitor.Stub.asInterface(parcel.readStrongBinder()), parcel.readInt());
|
||||
parcel2.writeNoException();
|
||||
return true;
|
||||
case 5:
|
||||
parcel.enforceInterface(DESCRIPTOR);
|
||||
int info = getInfo(parcel.readInt());
|
||||
parcel2.writeNoException();
|
||||
parcel2.writeInt(info);
|
||||
return true;
|
||||
case 6:
|
||||
parcel.enforceInterface(DESCRIPTOR);
|
||||
int keyCode = getKeyCode(parcel.readInt(), parcel.readInt());
|
||||
parcel2.writeNoException();
|
||||
parcel2.writeInt(keyCode);
|
||||
return true;
|
||||
case 7:
|
||||
parcel.enforceInterface(DESCRIPTOR);
|
||||
float axisValue = getAxisValue(parcel.readInt(), parcel.readInt());
|
||||
parcel2.writeNoException();
|
||||
parcel2.writeFloat(axisValue);
|
||||
return true;
|
||||
case 8:
|
||||
parcel.enforceInterface(DESCRIPTOR);
|
||||
int state = getState(parcel.readInt(), parcel.readInt());
|
||||
parcel2.writeNoException();
|
||||
parcel2.writeInt(state);
|
||||
return true;
|
||||
case 9:
|
||||
parcel.enforceInterface(DESCRIPTOR);
|
||||
sendMessage(parcel.readInt(), parcel.readInt());
|
||||
parcel2.writeNoException();
|
||||
return true;
|
||||
case 10:
|
||||
parcel.enforceInterface(DESCRIPTOR);
|
||||
registerListener2(IControllerListener.Stub.asInterface(parcel.readStrongBinder()), parcel.readInt());
|
||||
parcel2.writeNoException();
|
||||
return true;
|
||||
case 11:
|
||||
parcel.enforceInterface(DESCRIPTOR);
|
||||
int keyCode2 = getKeyCode2(parcel.readInt(), parcel.readInt());
|
||||
parcel2.writeNoException();
|
||||
parcel2.writeInt(keyCode2);
|
||||
return true;
|
||||
case 12:
|
||||
parcel.enforceInterface(DESCRIPTOR);
|
||||
allowNewConnections();
|
||||
parcel2.writeNoException();
|
||||
return true;
|
||||
case 13:
|
||||
parcel.enforceInterface(DESCRIPTOR);
|
||||
disallowNewConnections();
|
||||
parcel2.writeNoException();
|
||||
return true;
|
||||
case 14:
|
||||
parcel.enforceInterface(DESCRIPTOR);
|
||||
boolean isAllowingNewConnections = isAllowingNewConnections();
|
||||
parcel2.writeNoException();
|
||||
parcel2.writeInt(isAllowingNewConnections ? 1 : 0);
|
||||
return true;
|
||||
default:
|
||||
return super.onTransact(i, parcel, parcel2, i2);
|
||||
}
|
||||
}
|
||||
|
||||
private static class Proxy implements IControllerService {
|
||||
private IBinder mRemote;
|
||||
|
||||
public String getInterfaceDescriptor() {
|
||||
return Stub.DESCRIPTOR;
|
||||
}
|
||||
|
||||
Proxy(IBinder iBinder) {
|
||||
this.mRemote = iBinder;
|
||||
}
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this.mRemote;
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.IControllerService
|
||||
public void registerListener(IControllerListener iControllerListener, int i) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
Parcel obtain2 = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
obtain.writeStrongBinder(iControllerListener != null ? iControllerListener.asBinder() : null);
|
||||
obtain.writeInt(i);
|
||||
this.mRemote.transact(1, obtain, obtain2, 0);
|
||||
obtain2.readException();
|
||||
} finally {
|
||||
obtain2.recycle();
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.IControllerService
|
||||
public void unregisterListener(IControllerListener iControllerListener, int i) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
Parcel obtain2 = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
obtain.writeStrongBinder(iControllerListener != null ? iControllerListener.asBinder() : null);
|
||||
obtain.writeInt(i);
|
||||
this.mRemote.transact(2, obtain, obtain2, 0);
|
||||
obtain2.readException();
|
||||
} finally {
|
||||
obtain2.recycle();
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.IControllerService
|
||||
public void registerMonitor(IControllerMonitor iControllerMonitor, int i) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
Parcel obtain2 = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
obtain.writeStrongBinder(iControllerMonitor != null ? iControllerMonitor.asBinder() : null);
|
||||
obtain.writeInt(i);
|
||||
this.mRemote.transact(3, obtain, obtain2, 0);
|
||||
obtain2.readException();
|
||||
} finally {
|
||||
obtain2.recycle();
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.IControllerService
|
||||
public void unregisterMonitor(IControllerMonitor iControllerMonitor, int i) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
Parcel obtain2 = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
obtain.writeStrongBinder(iControllerMonitor != null ? iControllerMonitor.asBinder() : null);
|
||||
obtain.writeInt(i);
|
||||
this.mRemote.transact(4, obtain, obtain2, 0);
|
||||
obtain2.readException();
|
||||
} finally {
|
||||
obtain2.recycle();
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.IControllerService
|
||||
public int getInfo(int i) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
Parcel obtain2 = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
obtain.writeInt(i);
|
||||
this.mRemote.transact(5, obtain, obtain2, 0);
|
||||
obtain2.readException();
|
||||
return obtain2.readInt();
|
||||
} finally {
|
||||
obtain2.recycle();
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.IControllerService
|
||||
public int getKeyCode(int i, int i2) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
Parcel obtain2 = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
obtain.writeInt(i);
|
||||
obtain.writeInt(i2);
|
||||
this.mRemote.transact(6, obtain, obtain2, 0);
|
||||
obtain2.readException();
|
||||
return obtain2.readInt();
|
||||
} finally {
|
||||
obtain2.recycle();
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.IControllerService
|
||||
public float getAxisValue(int i, int i2) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
Parcel obtain2 = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
obtain.writeInt(i);
|
||||
obtain.writeInt(i2);
|
||||
this.mRemote.transact(7, obtain, obtain2, 0);
|
||||
obtain2.readException();
|
||||
return obtain2.readFloat();
|
||||
} finally {
|
||||
obtain2.recycle();
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.IControllerService
|
||||
public int getState(int i, int i2) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
Parcel obtain2 = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
obtain.writeInt(i);
|
||||
obtain.writeInt(i2);
|
||||
this.mRemote.transact(8, obtain, obtain2, 0);
|
||||
obtain2.readException();
|
||||
return obtain2.readInt();
|
||||
} finally {
|
||||
obtain2.recycle();
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.IControllerService
|
||||
public void sendMessage(int i, int i2) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
Parcel obtain2 = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
obtain.writeInt(i);
|
||||
obtain.writeInt(i2);
|
||||
this.mRemote.transact(9, obtain, obtain2, 0);
|
||||
obtain2.readException();
|
||||
} finally {
|
||||
obtain2.recycle();
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.IControllerService
|
||||
public void registerListener2(IControllerListener iControllerListener, int i) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
Parcel obtain2 = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
obtain.writeStrongBinder(iControllerListener != null ? iControllerListener.asBinder() : null);
|
||||
obtain.writeInt(i);
|
||||
this.mRemote.transact(10, obtain, obtain2, 0);
|
||||
obtain2.readException();
|
||||
} finally {
|
||||
obtain2.recycle();
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.IControllerService
|
||||
public int getKeyCode2(int i, int i2) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
Parcel obtain2 = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
obtain.writeInt(i);
|
||||
obtain.writeInt(i2);
|
||||
this.mRemote.transact(11, obtain, obtain2, 0);
|
||||
obtain2.readException();
|
||||
return obtain2.readInt();
|
||||
} finally {
|
||||
obtain2.recycle();
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.IControllerService
|
||||
public void allowNewConnections() throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
Parcel obtain2 = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
this.mRemote.transact(12, obtain, obtain2, 0);
|
||||
obtain2.readException();
|
||||
} finally {
|
||||
obtain2.recycle();
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.IControllerService
|
||||
public void disallowNewConnections() throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
Parcel obtain2 = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
this.mRemote.transact(13, obtain, obtain2, 0);
|
||||
obtain2.readException();
|
||||
} finally {
|
||||
obtain2.recycle();
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.IControllerService
|
||||
public boolean isAllowingNewConnections() throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
Parcel obtain2 = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
this.mRemote.transact(14, obtain, obtain2, 0);
|
||||
obtain2.readException();
|
||||
return obtain2.readInt() != 0;
|
||||
} finally {
|
||||
obtain2.recycle();
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.bda.controller;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class KeyEvent extends BaseEvent implements Parcelable {
|
||||
public static final int ACTION_DOWN = 0;
|
||||
public static final int ACTION_UP = 1;
|
||||
public static final Parcelable.Creator<KeyEvent> CREATOR = new ParcelableCreator();
|
||||
public static final int KEYCODE_BUTTON_A = 96;
|
||||
public static final int KEYCODE_BUTTON_B = 97;
|
||||
public static final int KEYCODE_BUTTON_L1 = 102;
|
||||
public static final int KEYCODE_BUTTON_L2 = 104;
|
||||
public static final int KEYCODE_BUTTON_R1 = 103;
|
||||
public static final int KEYCODE_BUTTON_R2 = 105;
|
||||
public static final int KEYCODE_BUTTON_SELECT = 109;
|
||||
public static final int KEYCODE_BUTTON_START = 108;
|
||||
public static final int KEYCODE_BUTTON_THUMBL = 106;
|
||||
public static final int KEYCODE_BUTTON_THUMBR = 107;
|
||||
public static final int KEYCODE_BUTTON_X = 99;
|
||||
public static final int KEYCODE_BUTTON_Y = 100;
|
||||
public static final int KEYCODE_DPAD_DOWN = 20;
|
||||
public static final int KEYCODE_DPAD_LEFT = 21;
|
||||
public static final int KEYCODE_DPAD_RIGHT = 22;
|
||||
public static final int KEYCODE_DPAD_UP = 19;
|
||||
public static final int KEYCODE_UNKNOWN = 0;
|
||||
final int mAction;
|
||||
final int mKeyCode;
|
||||
|
||||
@Override // com.bda.controller.BaseEvent, android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public KeyEvent(long j, int i, int i2, int i3) {
|
||||
super(j, i);
|
||||
this.mKeyCode = i2;
|
||||
this.mAction = i3;
|
||||
}
|
||||
|
||||
KeyEvent(Parcel parcel) {
|
||||
super(parcel);
|
||||
this.mKeyCode = parcel.readInt();
|
||||
this.mAction = parcel.readInt();
|
||||
}
|
||||
|
||||
public final int getAction() {
|
||||
return this.mAction;
|
||||
}
|
||||
|
||||
public final int getKeyCode() {
|
||||
return this.mKeyCode;
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.BaseEvent, android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
super.writeToParcel(parcel, i);
|
||||
parcel.writeInt(this.mKeyCode);
|
||||
parcel.writeInt(this.mAction);
|
||||
}
|
||||
|
||||
static class ParcelableCreator implements Parcelable.Creator<KeyEvent> {
|
||||
ParcelableCreator() {
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public KeyEvent createFromParcel(Parcel parcel) {
|
||||
return new KeyEvent(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public KeyEvent[] newArray(int i) {
|
||||
return new KeyEvent[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
package com.bda.controller;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.util.SparseArray;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class MotionEvent extends BaseEvent implements Parcelable {
|
||||
public static final int AXIS_LTRIGGER = 17;
|
||||
public static final int AXIS_RTRIGGER = 18;
|
||||
public static final int AXIS_RZ = 14;
|
||||
public static final int AXIS_X = 0;
|
||||
public static final int AXIS_Y = 1;
|
||||
public static final int AXIS_Z = 11;
|
||||
public static final Parcelable.Creator<MotionEvent> CREATOR = new ParcelableCreator();
|
||||
final SparseArray<Float> mAxis;
|
||||
final SparseArray<Float> mPrecision;
|
||||
|
||||
@Override // com.bda.controller.BaseEvent, android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public final int findPointerIndex(int i) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
public final int getPointerCount() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public final int getPointerId(int i) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public MotionEvent(long j, int i, float f, float f2, float f3, float f4, float f5, float f6) {
|
||||
super(j, i);
|
||||
this.mAxis = new SparseArray<>(4);
|
||||
this.mAxis.put(0, Float.valueOf(f));
|
||||
this.mAxis.put(1, Float.valueOf(f2));
|
||||
this.mAxis.put(11, Float.valueOf(f3));
|
||||
this.mAxis.put(14, Float.valueOf(f4));
|
||||
this.mPrecision = new SparseArray<>(2);
|
||||
this.mPrecision.put(0, Float.valueOf(f5));
|
||||
this.mPrecision.put(1, Float.valueOf(f6));
|
||||
}
|
||||
|
||||
public MotionEvent(long j, int i, int[] iArr, float[] fArr, int[] iArr2, float[] fArr2) {
|
||||
super(j, i);
|
||||
int length = iArr.length;
|
||||
this.mAxis = new SparseArray<>(length);
|
||||
for (int i2 = 0; i2 < length; i2++) {
|
||||
this.mAxis.put(iArr[i2], Float.valueOf(fArr[i2]));
|
||||
}
|
||||
int length2 = iArr2.length;
|
||||
this.mPrecision = new SparseArray<>(length2);
|
||||
for (int i3 = 0; i3 < length2; i3++) {
|
||||
this.mPrecision.put(iArr2[i3], Float.valueOf(fArr2[i3]));
|
||||
}
|
||||
}
|
||||
|
||||
MotionEvent(Parcel parcel) {
|
||||
super(parcel);
|
||||
int readInt = parcel.readInt();
|
||||
this.mAxis = new SparseArray<>(readInt);
|
||||
for (int i = 0; i < readInt; i++) {
|
||||
this.mAxis.put(parcel.readInt(), Float.valueOf(parcel.readFloat()));
|
||||
}
|
||||
this.mPrecision = new SparseArray<>(parcel.readInt());
|
||||
for (int i2 = 0; i2 < readInt; i2++) {
|
||||
this.mPrecision.put(parcel.readInt(), Float.valueOf(parcel.readFloat()));
|
||||
}
|
||||
}
|
||||
|
||||
public final float getAxisValue(int i) {
|
||||
return getAxisValue(i, 0);
|
||||
}
|
||||
|
||||
public final float getAxisValue(int i, int i2) {
|
||||
if (i2 == 0) {
|
||||
return this.mAxis.get(i, Float.valueOf(0.0f)).floatValue();
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
public final float getRawX() {
|
||||
return getX();
|
||||
}
|
||||
|
||||
public final float getRawY() {
|
||||
return getY();
|
||||
}
|
||||
|
||||
public final float getX() {
|
||||
return getAxisValue(0, 0);
|
||||
}
|
||||
|
||||
public final float getX(int i) {
|
||||
return getAxisValue(0, i);
|
||||
}
|
||||
|
||||
public final float getXPrecision() {
|
||||
return this.mPrecision.get(0, Float.valueOf(0.0f)).floatValue();
|
||||
}
|
||||
|
||||
public final float getY() {
|
||||
return getAxisValue(1, 0);
|
||||
}
|
||||
|
||||
public final float getY(int i) {
|
||||
return getAxisValue(1, i);
|
||||
}
|
||||
|
||||
public final float getYPrecision() {
|
||||
return this.mPrecision.get(1, Float.valueOf(0.0f)).floatValue();
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.BaseEvent, android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
super.writeToParcel(parcel, i);
|
||||
int size = this.mAxis.size();
|
||||
parcel.writeInt(size);
|
||||
for (int i2 = 0; i2 < size; i2++) {
|
||||
parcel.writeInt(this.mAxis.keyAt(i2));
|
||||
parcel.writeFloat(this.mAxis.valueAt(i2).floatValue());
|
||||
}
|
||||
int size2 = this.mPrecision.size();
|
||||
parcel.writeInt(size2);
|
||||
for (int i3 = 0; i3 < size2; i3++) {
|
||||
parcel.writeInt(this.mPrecision.keyAt(i3));
|
||||
parcel.writeFloat(this.mPrecision.valueAt(i3).floatValue());
|
||||
}
|
||||
}
|
||||
|
||||
static class ParcelableCreator implements Parcelable.Creator<MotionEvent> {
|
||||
ParcelableCreator() {
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public MotionEvent createFromParcel(Parcel parcel) {
|
||||
return new MotionEvent(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public MotionEvent[] newArray(int i) {
|
||||
return new MotionEvent[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.bda.controller;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class StateEvent extends BaseEvent implements Parcelable {
|
||||
public static final int ACTION_CONNECTED = 1;
|
||||
public static final int ACTION_CONNECTING = 2;
|
||||
public static final int ACTION_DISCONNECTED = 0;
|
||||
public static final int ACTION_FALSE = 0;
|
||||
public static final int ACTION_TRUE = 1;
|
||||
public static final int ACTION_VERSION_MOGA = 0;
|
||||
public static final int ACTION_VERSION_MOGAPRO = 1;
|
||||
public static final Parcelable.Creator<StateEvent> CREATOR = new ParcelableCreator();
|
||||
public static final int STATE_CONNECTION = 1;
|
||||
public static final int STATE_CURRENT_PRODUCT_VERSION = 4;
|
||||
public static final int STATE_POWER_LOW = 2;
|
||||
|
||||
@Deprecated
|
||||
public static final int STATE_SELECTED_VERSION = 4;
|
||||
public static final int STATE_SUPPORTED_PRODUCT_VERSION = 3;
|
||||
|
||||
@Deprecated
|
||||
public static final int STATE_SUPPORTED_VERSION = 3;
|
||||
public static final int STATE_UNKNOWN = 0;
|
||||
final int mAction;
|
||||
final int mState;
|
||||
|
||||
@Override // com.bda.controller.BaseEvent, android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public StateEvent(long j, int i, int i2, int i3) {
|
||||
super(j, i);
|
||||
this.mState = i2;
|
||||
this.mAction = i3;
|
||||
}
|
||||
|
||||
StateEvent(Parcel parcel) {
|
||||
super(parcel);
|
||||
this.mState = parcel.readInt();
|
||||
this.mAction = parcel.readInt();
|
||||
}
|
||||
|
||||
public final int getAction() {
|
||||
return this.mAction;
|
||||
}
|
||||
|
||||
public final int getState() {
|
||||
return this.mState;
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.BaseEvent, android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
super.writeToParcel(parcel, i);
|
||||
parcel.writeInt(this.mState);
|
||||
parcel.writeInt(this.mAction);
|
||||
}
|
||||
|
||||
static class ParcelableCreator implements Parcelable.Creator<StateEvent> {
|
||||
ParcelableCreator() {
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public StateEvent createFromParcel(Parcel parcel) {
|
||||
return new StateEvent(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public StateEvent[] newArray(int i) {
|
||||
return new StateEvent[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.bda.controller;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class VersionInfo {
|
||||
public static final String VERSION = "1.3.0.130130";
|
||||
|
||||
private VersionInfo() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.ea.EAIO;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.res.AssetManager;
|
||||
import android.os.Environment;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class EAIO {
|
||||
public static native void Shutdown();
|
||||
|
||||
private static native void StartupNativeImpl(AssetManager assetManager, String str, String str2, String str3);
|
||||
|
||||
public static void Startup(Activity activity) {
|
||||
StartupNativeImpl(activity.getAssets(), Environment.getDataDirectory().getAbsolutePath(), activity.getFilesDir().getAbsolutePath(), Environment.getExternalStorageDirectory().getAbsolutePath());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.ea.EAMIO;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Environment;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class StorageDirectory {
|
||||
public static Activity sActivity;
|
||||
|
||||
private static native void ShutdownNativeImpl();
|
||||
|
||||
private static native void StartupNativeImpl();
|
||||
|
||||
public static void Startup(Activity activity) {
|
||||
sActivity = activity;
|
||||
StartupNativeImpl();
|
||||
}
|
||||
|
||||
public static void Shutdown() {
|
||||
ShutdownNativeImpl();
|
||||
}
|
||||
|
||||
public static String GetInternalStorageDirectory() {
|
||||
return sActivity.getFilesDir().getAbsolutePath();
|
||||
}
|
||||
|
||||
public static String GetPrimaryExternalStorageDirectory() {
|
||||
return sActivity.getExternalFilesDir(null).getAbsolutePath();
|
||||
}
|
||||
|
||||
public static String GetPrimaryExternalStorageDirectoryRoot() {
|
||||
return Environment.getExternalStorageDirectory().getAbsolutePath();
|
||||
}
|
||||
|
||||
public static int GetPrimaryExternalStorageState() {
|
||||
String externalStorageState = Environment.getExternalStorageState();
|
||||
if ("mounted".equals(externalStorageState)) {
|
||||
return 2;
|
||||
}
|
||||
return "mounted_ro".equals(externalStorageState) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
package com.ea.InAppWebBrowser;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.graphics.Paint;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.RelativeLayout;
|
||||
import java.util.UUID;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class BrowserAndroid {
|
||||
public static int gInstanceCount;
|
||||
public static Activity mActivity;
|
||||
public static ViewGroup mViewGroup;
|
||||
public RelativeLayout mLayout;
|
||||
public WebView mWebView;
|
||||
public InAppWebBrowserWebViewClient mWebViewClient;
|
||||
public final int SCROLLBAR_VISIBLE = 0;
|
||||
public final int SCROLLBAR_INVISIBLE = 1;
|
||||
public final int JAVASCRIPT_DISABLE = 0;
|
||||
public final int JAVASCRIPT_ENABLE = 1;
|
||||
public final int SCROLLBARSTYLE_DEFAULT = 0;
|
||||
public final int SCROLLBARSTYLE_INSIDE_OVERLAY = 1;
|
||||
public final int SCROLLBARSTYLE_INSIDE_INSET = 2;
|
||||
public final int SCROLLBARSTYLE_OUTSIDE_OVERLAY = 3;
|
||||
public final int SCROLLBARSTYLE_OUTSIDE_INSET = 4;
|
||||
public int mInstanceID = 0;
|
||||
|
||||
private static native void ShutdownNativeImpl();
|
||||
|
||||
private static native void StartupNativeImpl();
|
||||
|
||||
public void BrowserAndroid() {
|
||||
}
|
||||
|
||||
public static void Startup(Activity activity, ViewGroup viewGroup) {
|
||||
mActivity = activity;
|
||||
mViewGroup = viewGroup;
|
||||
StartupNativeImpl();
|
||||
}
|
||||
|
||||
public static void Shutdown() {
|
||||
ShutdownNativeImpl();
|
||||
}
|
||||
|
||||
public void init(final int i, final int i2, final int i3, final int i4, final int i5, final int i6, final int i7, final boolean z, final boolean z2) {
|
||||
int i8 = gInstanceCount;
|
||||
gInstanceCount = i8 + 1;
|
||||
this.mInstanceID = i8;
|
||||
mActivity.runOnUiThread(new Runnable() { // from class: com.ea.InAppWebBrowser.BrowserAndroid.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
BrowserAndroid.this.mLayout = new RelativeLayout(BrowserAndroid.mActivity);
|
||||
BrowserAndroid.this.mWebView = new WebView(BrowserAndroid.mActivity);
|
||||
BrowserAndroid.this.mWebViewClient = new InAppWebBrowserWebViewClient();
|
||||
BrowserAndroid.this.mWebViewClient.mInstanceID = BrowserAndroid.this.mInstanceID;
|
||||
BrowserAndroid.this.mWebView.setWebViewClient(BrowserAndroid.this.mWebViewClient);
|
||||
if (z2) {
|
||||
BrowserAndroid.this.mWebView.setBackgroundColor(0);
|
||||
Class<?> cls = BrowserAndroid.this.mWebView.getClass();
|
||||
try {
|
||||
cls.getMethod("setLayerType", Integer.TYPE, Paint.class).invoke(BrowserAndroid.this.mWebView, Integer.valueOf(((Integer) cls.getField("LAYER_TYPE_SOFTWARE").get(BrowserAndroid.this.mWebView)).intValue()), null);
|
||||
} catch (Exception unused) {
|
||||
}
|
||||
}
|
||||
if (!z) {
|
||||
Class<?> cls2 = BrowserAndroid.this.mWebView.getClass();
|
||||
try {
|
||||
cls2.getMethod("setOverScrollMode", Integer.TYPE).invoke(BrowserAndroid.this.mWebView, Integer.valueOf(((Integer) cls2.getField("OVER_SCROLL_NEVER").get(BrowserAndroid.this.mWebView)).intValue()));
|
||||
} catch (Exception unused2) {
|
||||
}
|
||||
}
|
||||
BrowserAndroid.this.mWebView.requestFocus(130);
|
||||
BrowserAndroid.this.mWebView.setOnTouchListener(new View.OnTouchListener() { // from class: com.ea.InAppWebBrowser.BrowserAndroid.1.1
|
||||
@Override // android.view.View.OnTouchListener
|
||||
public boolean onTouch(View view, MotionEvent motionEvent) {
|
||||
switch (motionEvent.getAction()) {
|
||||
case 0:
|
||||
case 1:
|
||||
if (!view.hasFocus()) {
|
||||
view.requestFocus();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (i5 == 1) {
|
||||
BrowserAndroid.this.mWebView.getSettings().setJavaScriptEnabled(true);
|
||||
}
|
||||
BrowserAndroid.this.mWebView.setVerticalScrollBarEnabled(i6 == 0);
|
||||
BrowserAndroid.this.mWebView.setHorizontalScrollBarEnabled(i6 == 0);
|
||||
BrowserAndroid.this.mWebView.addJavascriptInterface(new JavascriptInterface(BrowserAndroid.this.mWebViewClient), "JavascriptCallback");
|
||||
switch (i7) {
|
||||
case 1:
|
||||
BrowserAndroid.this.mWebView.setScrollBarStyle(0);
|
||||
break;
|
||||
case 2:
|
||||
BrowserAndroid.this.mWebView.setScrollBarStyle(16777216);
|
||||
break;
|
||||
case 3:
|
||||
BrowserAndroid.this.mWebView.setScrollBarStyle(33554432);
|
||||
break;
|
||||
case 4:
|
||||
BrowserAndroid.this.mWebView.setScrollBarStyle(50331648);
|
||||
break;
|
||||
}
|
||||
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(i3, i4);
|
||||
layoutParams.leftMargin = i;
|
||||
layoutParams.topMargin = i2;
|
||||
BrowserAndroid.this.mLayout.addView(BrowserAndroid.this.mWebView, layoutParams);
|
||||
BrowserAndroid.mViewGroup.addView(BrowserAndroid.this.mLayout);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void OpenUrl(final String str) {
|
||||
mActivity.runOnUiThread(new Runnable() { // from class: com.ea.InAppWebBrowser.BrowserAndroid.2
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
BrowserAndroid.this.mWebView.loadUrl(str);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void LoadHTML(final String str) {
|
||||
mActivity.runOnUiThread(new Runnable() { // from class: com.ea.InAppWebBrowser.BrowserAndroid.3
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
BrowserAndroid.this.mWebView.loadData(str, "text/html", null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void SetViewFrame(final int i, final int i2, final int i3, final int i4) {
|
||||
if (this.mWebView == null) {
|
||||
return;
|
||||
}
|
||||
mActivity.runOnUiThread(new Runnable() { // from class: com.ea.InAppWebBrowser.BrowserAndroid.4
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(i3, i4);
|
||||
layoutParams.leftMargin = i;
|
||||
layoutParams.topMargin = i2;
|
||||
BrowserAndroid.this.mLayout.updateViewLayout(BrowserAndroid.this.mWebView, layoutParams);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void EvaluateJavaScript(final String str) {
|
||||
mActivity.runOnUiThread(new Runnable() { // from class: com.ea.InAppWebBrowser.BrowserAndroid.5
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
UUID randomUUID;
|
||||
do {
|
||||
randomUUID = UUID.randomUUID();
|
||||
} while (!BrowserAndroid.this.mWebViewClient.addUUID(randomUUID));
|
||||
BrowserAndroid.this.mWebView.loadUrl("javascript: JavascriptCallback.ReceiveResult(eval(" + str + "), '" + randomUUID.toString() + "');");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
mActivity.runOnUiThread(new Runnable() { // from class: com.ea.InAppWebBrowser.BrowserAndroid.6
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
BrowserAndroid.this.mWebView.stopLoading();
|
||||
BrowserAndroid.this.mWebView.setWebViewClient(null);
|
||||
BrowserAndroid.this.mWebViewClient = null;
|
||||
BrowserAndroid.this.mLayout.removeView(BrowserAndroid.this.mWebView);
|
||||
BrowserAndroid.mViewGroup.removeView(BrowserAndroid.this.mLayout);
|
||||
BrowserAndroid.this.mWebView = null;
|
||||
BrowserAndroid.this.mLayout = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.ea.InAppWebBrowser;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.util.Log;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import java.util.Collections;
|
||||
import java.util.SortedSet;
|
||||
import java.util.TreeSet;
|
||||
import java.util.UUID;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class InAppWebBrowserWebViewClient extends WebViewClient {
|
||||
public int mInstanceID = 0;
|
||||
private SortedSet<UUID> mJavascriptIds = Collections.synchronizedSortedSet(new TreeSet());
|
||||
|
||||
public native void OnJavascriptResult(String str, int i);
|
||||
|
||||
public native void OnLoadError(String str, int i);
|
||||
|
||||
public native void OnLoadFinished(String str, int i);
|
||||
|
||||
public native void OnLoadStarted(String str, int i);
|
||||
|
||||
public native boolean ShouldLoadURL(String str, int i);
|
||||
|
||||
@Override // android.webkit.WebViewClient
|
||||
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
|
||||
Log.e("InAppWebBrowserWebViewClient", "shouldOverrideUrlLoading: " + str);
|
||||
return !ShouldLoadURL(str, this.mInstanceID);
|
||||
}
|
||||
|
||||
@Override // android.webkit.WebViewClient
|
||||
public void onLoadResource(WebView webView, String str) {
|
||||
Log.e("InAppWebBrowserWebViewClient", "onLoadResource: " + str);
|
||||
OnLoadStarted(str, this.mInstanceID);
|
||||
}
|
||||
|
||||
@Override // android.webkit.WebViewClient
|
||||
public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
|
||||
Log.e("InAppWebBrowserWebViewClient", "onPageStarted: " + str);
|
||||
OnLoadStarted(str, this.mInstanceID);
|
||||
}
|
||||
|
||||
@Override // android.webkit.WebViewClient
|
||||
public void onPageFinished(WebView webView, String str) {
|
||||
Log.e("InAppWebBrowserWebViewClient", "onPageFinished: " + str);
|
||||
OnLoadFinished(str, this.mInstanceID);
|
||||
}
|
||||
|
||||
@Override // android.webkit.WebViewClient
|
||||
public void onReceivedError(WebView webView, int i, String str, String str2) {
|
||||
Log.e("InAppWebBrowserWebViewClient", "onReceivedError");
|
||||
OnLoadError("Loading Error. URL: " + str2 + " ErrorCode: " + i + " Description: " + str, this.mInstanceID);
|
||||
}
|
||||
|
||||
public void onJavascriptResult(String str, String str2) throws Exception {
|
||||
UUID fromString = UUID.fromString(str2);
|
||||
if (fromString != null && this.mJavascriptIds.contains(fromString)) {
|
||||
this.mJavascriptIds.remove(fromString);
|
||||
OnJavascriptResult(str, this.mInstanceID);
|
||||
return;
|
||||
}
|
||||
throw new Exception("Unable to verify validity of script result.");
|
||||
}
|
||||
|
||||
public boolean addUUID(UUID uuid) {
|
||||
if (this.mJavascriptIds.contains(uuid)) {
|
||||
return false;
|
||||
}
|
||||
this.mJavascriptIds.add(uuid);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ea.InAppWebBrowser;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class JavascriptInterface {
|
||||
private InAppWebBrowserWebViewClient mWebViewClient;
|
||||
|
||||
public JavascriptInterface(InAppWebBrowserWebViewClient inAppWebBrowserWebViewClient) {
|
||||
this.mWebViewClient = inAppWebBrowserWebViewClient;
|
||||
}
|
||||
|
||||
public void ReceiveResult(String str, String str2) throws Exception {
|
||||
this.mWebViewClient.onJavascriptResult(str, str2);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.ea.InputMan;
|
||||
|
||||
import android.view.MotionEvent;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class InputMan {
|
||||
private boolean gbMotionEvent_GetSource;
|
||||
|
||||
private static int GetEventType(int i) {
|
||||
switch (i) {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static native boolean InputMan_OnMotionEvent(int i, int i2, float f, float f2, int i3, float f3);
|
||||
|
||||
public InputMan() {
|
||||
this.gbMotionEvent_GetSource = false;
|
||||
try {
|
||||
MotionEvent.class.getMethod("getSource", new Class[0]);
|
||||
this.gbMotionEvent_GetSource = true;
|
||||
} catch (Exception unused) {
|
||||
}
|
||||
}
|
||||
|
||||
private int GetSource(MotionEvent motionEvent) {
|
||||
if (!this.gbMotionEvent_GetSource) {
|
||||
return 0;
|
||||
}
|
||||
int source = motionEvent.getSource();
|
||||
if ((source & 2) != 0) {
|
||||
return (source == 8194 || source != 1048584) ? 0 : 10;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public boolean onTouchEvent(int i, MotionEvent motionEvent) {
|
||||
int historySize = motionEvent.getHistorySize();
|
||||
int pointerCount = motionEvent.getPointerCount();
|
||||
int GetSource = GetSource(motionEvent);
|
||||
int GetEventType = GetEventType(motionEvent.getAction() & 255);
|
||||
if (GetSource < 0) {
|
||||
return false;
|
||||
}
|
||||
for (int i2 = 0; i2 < historySize; i2++) {
|
||||
for (int i3 = 0; i3 < pointerCount; i3++) {
|
||||
InputMan_OnMotionEvent(i, motionEvent.getPointerId(i3), motionEvent.getHistoricalX(i3, i2), motionEvent.getHistoricalY(i3, i2), GetEventType, motionEvent.getHistoricalPressure(i3, i2));
|
||||
}
|
||||
}
|
||||
boolean z = false;
|
||||
for (int i4 = 0; i4 < pointerCount; i4++) {
|
||||
z = InputMan_OnMotionEvent(i, motionEvent.getPointerId(i4), motionEvent.getX(i4), motionEvent.getY(i4), GetEventType, motionEvent.getPressure(i4));
|
||||
}
|
||||
return z;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.ea.eadp.deviceid;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface DeviceIdService {
|
||||
String getDeviceId();
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.ea.eadp.http.models;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface HttpRequest {
|
||||
HttpResponse delete();
|
||||
|
||||
void deleteAsync(HttpRequestListener httpRequestListener);
|
||||
|
||||
HttpResponse get();
|
||||
|
||||
void getAsync(HttpRequestListener httpRequestListener);
|
||||
|
||||
URL getResource();
|
||||
|
||||
String getValueForHeader(String str);
|
||||
|
||||
HttpResponse post();
|
||||
|
||||
void postAsync(HttpRequestListener httpRequestListener);
|
||||
|
||||
HttpResponse put();
|
||||
|
||||
void putAsync(HttpRequestListener httpRequestListener);
|
||||
|
||||
HttpRequest setBody(String str);
|
||||
|
||||
HttpRequest setBody(String str, String str2);
|
||||
|
||||
HttpRequest setHeader(String str, String str2);
|
||||
|
||||
HttpRequest setJsonBody(String str);
|
||||
|
||||
HttpRequest setJsonBody(String str, String str2);
|
||||
|
||||
HttpRequest setResource(URL url);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.ea.eadp.http.models;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface HttpRequestListener {
|
||||
void onComplete(HttpResponse httpResponse);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.ea.eadp.http.models;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface HttpResponse {
|
||||
String getBody();
|
||||
|
||||
int getCode();
|
||||
|
||||
Map<String, String> getHeaders();
|
||||
|
||||
String getMessage();
|
||||
|
||||
String getUrl();
|
||||
|
||||
void setBody(String str);
|
||||
|
||||
void setCode(int i);
|
||||
|
||||
void setHeaders(Map<String, String> map);
|
||||
|
||||
void setMessage(String str);
|
||||
|
||||
void setUrl(String str);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.ea.eadp.http.services;
|
||||
|
||||
import com.ea.eadp.http.models.HttpRequest;
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface HttpService {
|
||||
HttpRequest getResource(String str) throws MalformedURLException, IOException;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.ea.eadp.pushnotification.forwarding;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class GcmBroadcastReceiver extends BroadcastReceiver {
|
||||
@Override // android.content.BroadcastReceiver
|
||||
public final void onReceive(Context context, Intent intent) {
|
||||
intent.setComponent(new ComponentName(context.getPackageName(), getIntentServiceName()));
|
||||
GcmIntentService.enqueueWork(context, getIntentServiceName(), intent);
|
||||
}
|
||||
|
||||
protected String getIntentServiceName() {
|
||||
return GcmIntentService.class.getName();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
package com.ea.eadp.pushnotification.forwarding;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.JobIntentService;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
import com.ea.eadp.http.services.HttpService;
|
||||
import com.ea.eadp.pushnotification.lifecycles.PushLifecycleCallbacks;
|
||||
import com.ea.eadp.pushnotification.services.AndroidPushService;
|
||||
import com.ea.eadp.pushnotification.services.IPushService;
|
||||
import com.ea.nimble.ApplicationEnvironment;
|
||||
import com.ea.nimble.Global;
|
||||
import com.ea.nimble.Log;
|
||||
import com.facebook.internal.NativeProtocol;
|
||||
import com.google.android.gms.gcm.GoogleCloudMessaging;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class GcmIntentService extends JobIntentService {
|
||||
protected static final int JOB_ID = 5566;
|
||||
private static final String LOG_TAG = "GcmIntentService";
|
||||
private IPushService pushManager;
|
||||
|
||||
public interface EnsEventFlags {
|
||||
public static final int ALL_DISABLED = 0;
|
||||
public static final int ALL_ENABLED = 3;
|
||||
public static final int CLICK_ENABLED = 1;
|
||||
public static final int RECEIVED_ENABLED = 2;
|
||||
}
|
||||
|
||||
public interface PushIntentExtraKeys {
|
||||
public static final String ALERT = "alert";
|
||||
public static final String COLLAPSE_KEY = "collapse_key";
|
||||
public static final String DEEP_LINK_URL = "deepLinkUrl";
|
||||
public static final String ENS_EVENTS = "ensEvents";
|
||||
public static final String PN_TYPE = "pnType";
|
||||
public static final String PUSH_ID = "pushId";
|
||||
}
|
||||
|
||||
protected boolean displayNotification(Bundle bundle) {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected HttpService getHttpService() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void enqueueWork(Context context, String str, Intent intent) {
|
||||
try {
|
||||
enqueueWork(context, Class.forName(str), JOB_ID, intent);
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.app.JobIntentService
|
||||
protected void onHandleWork(@NonNull Intent intent) {
|
||||
Bundle extras = intent.getExtras();
|
||||
if (extras == null) {
|
||||
Log.Helper.LOGE(this, "Skipping Push Notification: Incomplete Intent. Missing expected extras bundle.", new Object[0]);
|
||||
return;
|
||||
}
|
||||
String messageType = GoogleCloudMessaging.getInstance(getApplicationContext()).getMessageType(intent);
|
||||
if (extras.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if (GoogleCloudMessaging.MESSAGE_TYPE_SEND_ERROR.equals(messageType)) {
|
||||
Log.Helper.LOGIS(LOG_TAG, "Error received: " + extras.toString(), new Object[0]);
|
||||
return;
|
||||
}
|
||||
if ("deleted_messages".equals(messageType)) {
|
||||
Log.Helper.LOGIS(LOG_TAG, "Deleted messages on server: " + extras.toString(), new Object[0]);
|
||||
return;
|
||||
}
|
||||
if (GoogleCloudMessaging.MESSAGE_TYPE_MESSAGE.equals(messageType)) {
|
||||
onHandleMessage(intent);
|
||||
}
|
||||
}
|
||||
|
||||
protected void onHandleMessage(Intent intent) {
|
||||
Bundle extras = intent.getExtras();
|
||||
if (extras == null) {
|
||||
Log.Helper.LOGE(this, "Skipping Push Notification: Incomplete Intent. Missing expected extras bundle.", new Object[0]);
|
||||
return;
|
||||
}
|
||||
Log.Helper.LOGIS(LOG_TAG, "Message received: " + extras.toString(), new Object[0]);
|
||||
if (displayNotification(extras)) {
|
||||
postNotification(getApplicationContext(), extras);
|
||||
}
|
||||
int i = 3;
|
||||
String string = extras.getString(PushIntentExtraKeys.ENS_EVENTS);
|
||||
if (string != null) {
|
||||
try {
|
||||
i = Integer.parseInt(string);
|
||||
} catch (NumberFormatException unused) {
|
||||
Log.Helper.LOGWS(LOG_TAG, "ensEvents flag found but not parseable as integer", new Object[0]);
|
||||
}
|
||||
}
|
||||
if (extras.containsKey(PushIntentExtraKeys.PUSH_ID)) {
|
||||
if (i >= 2 || i < 0) {
|
||||
if (this.pushManager == null) {
|
||||
this.pushManager = new AndroidPushService(getApplicationContext(), getHttpService());
|
||||
}
|
||||
if (ApplicationEnvironment.isMainApplicationRunning()) {
|
||||
this.pushManager.sendTrackingEvent(extras.getString(PushIntentExtraKeys.PUSH_ID), extras.getString(PushIntentExtraKeys.PN_TYPE), IPushService.NOTIFICATION_TYPE_RECEIVED);
|
||||
} else {
|
||||
this.pushManager.persistTrackingEvent(extras.getString(PushIntentExtraKeys.PUSH_ID), extras.getString(PushIntentExtraKeys.PN_TYPE), IPushService.NOTIFICATION_TYPE_RECEIVED);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint({"InlinedApi"})
|
||||
private void postNotification(Context context, Bundle bundle) {
|
||||
Intent intent = new Intent();
|
||||
if (Build.VERSION.SDK_INT >= 12) {
|
||||
intent.addFlags(32);
|
||||
}
|
||||
intent.putExtras(bundle);
|
||||
intent.setPackage(context.getPackageName());
|
||||
ComponentName broadcastForwarderComponent = getBroadcastForwarderComponent();
|
||||
if (isInForeground()) {
|
||||
if (broadcastForwarderComponent != null) {
|
||||
intent.setComponent(broadcastForwarderComponent);
|
||||
sendBroadcast(intent);
|
||||
return;
|
||||
} else {
|
||||
Log.Helper.LOGW(this, "Broadcast listener for action 'com.ea.eadp.pushnotification.FORWARD_AS_ORDERED_BROADCAST' was not found. Not sending broadcast", new Object[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
String string = bundle.getString(PushIntentExtraKeys.PUSH_ID);
|
||||
int hashCode = string != null ? string.hashCode() : 0;
|
||||
String str = Global.NOTIFICATION_CHANNEL_DEFAULT_ID;
|
||||
try {
|
||||
ApplicationInfo applicationInfo = context.getPackageManager().getApplicationInfo(context.getPackageName(), 128);
|
||||
if (applicationInfo.metaData.containsKey(Global.NOTIFICATION_CHANNEL_PUSHTNG_ID_KEY)) {
|
||||
str = applicationInfo.metaData.getString(Global.NOTIFICATION_CHANNEL_PUSHTNG_ID_KEY);
|
||||
}
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
android.util.Log.e(Global.NIMBLE_ID, String.format("%s>GcmIntentService.postNotification():\n%s", LOG_TAG, e.getMessage()));
|
||||
}
|
||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, str);
|
||||
if (broadcastForwarderComponent != null) {
|
||||
String string2 = bundle.getString(PushIntentExtraKeys.COLLAPSE_KEY);
|
||||
if (string2 != null && !string2.equalsIgnoreCase("do_not_collapse")) {
|
||||
intent.putExtra(PushIntentExtraKeys.COLLAPSE_KEY, string2);
|
||||
}
|
||||
intent.setComponent(broadcastForwarderComponent);
|
||||
builder.setContentIntent(PendingIntent.getBroadcast(context, hashCode, intent, 134217728));
|
||||
} else {
|
||||
Log.Helper.LOGW(this, "Broadcast listener for action 'com.ea.eadp.pushnotification.FORWARD_AS_ORDERED_BROADCAST' was not found. Not setting ContentIntent", new Object[0]);
|
||||
}
|
||||
customizeNotification(builder, bundle);
|
||||
NotificationManager notificationManager = (NotificationManager) context.getSystemService("notification");
|
||||
if (notificationManager != null) {
|
||||
String string3 = bundle.getString(PushIntentExtraKeys.COLLAPSE_KEY);
|
||||
if (string3 != null && !string3.equalsIgnoreCase("do_not_collapse")) {
|
||||
notificationManager.notify(string3, 0, builder.build());
|
||||
return;
|
||||
} else {
|
||||
notificationManager.notify(hashCode, builder.build());
|
||||
return;
|
||||
}
|
||||
}
|
||||
Log.Helper.LOGE(this, "Notification Manager is not available or is inaccessible. Skipping Notification formatting.", new Object[0]);
|
||||
}
|
||||
|
||||
protected boolean isInForeground() {
|
||||
return PushLifecycleCallbacks.inForeground;
|
||||
}
|
||||
|
||||
protected void customizeNotification(NotificationCompat.Builder builder, Bundle bundle) {
|
||||
String string = bundle.getString(PushIntentExtraKeys.ALERT);
|
||||
Resources resources = getApplicationContext().getResources();
|
||||
String packageName = getApplicationContext().getPackageName();
|
||||
String string2 = getApplicationContext().getResources().getString(resources.getIdentifier(NativeProtocol.BRIDGE_ARG_APP_NAME_STRING, "string", packageName));
|
||||
try {
|
||||
builder.setSmallIcon(resources.getIdentifier("pn_icon", "drawable", packageName));
|
||||
} catch (Exception e) {
|
||||
Log.Helper.LOGE(LOG_TAG, "PN NOT DISPLAYED: Unable to set application icon due to exception: " + e.toString(), new Object[0]);
|
||||
}
|
||||
builder.setContentTitle(string2).setStyle(new NotificationCompat.BigTextStyle().bigText(string)).setContentText(string).setAutoCancel(true).setDefaults(getApplicationContext().checkCallingOrSelfPermission("android.permission.VIBRATE") == 0 ? 7 : 5);
|
||||
}
|
||||
|
||||
protected ComponentName getBroadcastForwarderComponent() {
|
||||
Log.Helper.LOGFUNC(this);
|
||||
PackageManager packageManager = getApplicationContext().getPackageManager();
|
||||
Intent intent = new Intent("com.ea.eadp.pushnotification.FORWARD_AS_ORDERED_BROADCAST");
|
||||
intent.setPackage(getApplicationContext().getPackageName());
|
||||
List<ResolveInfo> queryBroadcastReceivers = packageManager.queryBroadcastReceivers(intent, 0);
|
||||
if (queryBroadcastReceivers.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
ActivityInfo activityInfo = queryBroadcastReceivers.get(0).activityInfo;
|
||||
return new ComponentName(activityInfo.packageName, activityInfo.name);
|
||||
}
|
||||
}
|
||||
+139
@@ -0,0 +1,139 @@
|
||||
package com.ea.eadp.pushnotification.forwarding;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import com.ea.eadp.http.services.HttpService;
|
||||
import com.ea.eadp.pushnotification.forwarding.GcmIntentService;
|
||||
import com.ea.eadp.pushnotification.services.IPushService;
|
||||
import com.ea.nimble.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class PushBroadcastForwarder extends BroadcastReceiver {
|
||||
private static final String LOG_TAG = "PushBroadcastForwarder";
|
||||
private IPushService pushManager;
|
||||
|
||||
protected HttpService getHttpService() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX WARN: Removed duplicated region for block: B:17:0x003a */
|
||||
/* JADX WARN: Removed duplicated region for block: B:20:0x004f */
|
||||
/* JADX WARN: Removed duplicated region for block: B:21:0x0063 */
|
||||
@Override // android.content.BroadcastReceiver
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public final void onReceive(android.content.Context r5, android.content.Intent r6) {
|
||||
/*
|
||||
r4 = this;
|
||||
android.os.Bundle r6 = r6.getExtras()
|
||||
r0 = 0
|
||||
if (r6 != 0) goto Lf
|
||||
java.lang.String r5 = "Unable to get extras from Intent"
|
||||
java.lang.Object[] r6 = new java.lang.Object[r0]
|
||||
com.ea.nimble.Log.Helper.LOGE(r4, r5, r6)
|
||||
return
|
||||
Lf:
|
||||
java.lang.String r1 = "ensEvents"
|
||||
java.lang.String r1 = r6.getString(r1)
|
||||
r2 = 3
|
||||
if (r1 == 0) goto L26
|
||||
int r1 = java.lang.Integer.parseInt(r1) // Catch: java.lang.NumberFormatException -> L1d
|
||||
goto L27
|
||||
L1d:
|
||||
java.lang.String r1 = "PushBroadcastForwarder"
|
||||
java.lang.String r3 = "ensEvents flag found but not parseable as integer"
|
||||
java.lang.Object[] r0 = new java.lang.Object[r0]
|
||||
com.ea.nimble.Log.Helper.LOGWS(r1, r3, r0)
|
||||
L26:
|
||||
r1 = 3
|
||||
L27:
|
||||
java.lang.String r0 = "pushId"
|
||||
boolean r0 = r6.containsKey(r0)
|
||||
if (r0 == 0) goto L76
|
||||
if (r1 >= r2) goto L36
|
||||
r0 = 1
|
||||
if (r1 == r0) goto L36
|
||||
if (r1 >= 0) goto L76
|
||||
L36:
|
||||
com.ea.eadp.pushnotification.services.IPushService r0 = r4.pushManager
|
||||
if (r0 != 0) goto L49
|
||||
com.ea.eadp.pushnotification.services.AndroidPushService r0 = new com.ea.eadp.pushnotification.services.AndroidPushService
|
||||
android.content.Context r1 = r5.getApplicationContext()
|
||||
com.ea.eadp.http.services.HttpService r2 = r4.getHttpService()
|
||||
r0.<init>(r1, r2)
|
||||
r4.pushManager = r0
|
||||
L49:
|
||||
boolean r0 = com.ea.nimble.ApplicationEnvironment.isMainApplicationRunning()
|
||||
if (r0 == 0) goto L63
|
||||
com.ea.eadp.pushnotification.services.IPushService r0 = r4.pushManager
|
||||
java.lang.String r1 = "pushId"
|
||||
java.lang.String r1 = r6.getString(r1)
|
||||
java.lang.String r2 = "pnType"
|
||||
java.lang.String r2 = r6.getString(r2)
|
||||
java.lang.String r3 = "NOTIFICATION_OPENED"
|
||||
r0.sendTrackingEvent(r1, r2, r3)
|
||||
goto L76
|
||||
L63:
|
||||
com.ea.eadp.pushnotification.services.IPushService r0 = r4.pushManager
|
||||
java.lang.String r1 = "pushId"
|
||||
java.lang.String r1 = r6.getString(r1)
|
||||
java.lang.String r2 = "pnType"
|
||||
java.lang.String r2 = r6.getString(r2)
|
||||
java.lang.String r3 = "NOTIFICATION_OPENED"
|
||||
r0.persistTrackingEvent(r1, r2, r3)
|
||||
L76:
|
||||
r4.handleNewPushNotification(r5, r6)
|
||||
return
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.ea.eadp.pushnotification.forwarding.PushBroadcastForwarder.onReceive(android.content.Context, android.content.Intent):void");
|
||||
}
|
||||
|
||||
protected void handleNewPushNotification(Context context, Bundle bundle) {
|
||||
Intent intent;
|
||||
String string = bundle.getString(GcmIntentService.PushIntentExtraKeys.DEEP_LINK_URL);
|
||||
if (string != null) {
|
||||
intent = new Intent("android.intent.action.VIEW", Uri.parse(string));
|
||||
Log.Helper.LOGIS(LOG_TAG, "Push notification clicked with URL: " + string, new Object[0]);
|
||||
} else {
|
||||
String pushTargetActivity = getPushTargetActivity(context);
|
||||
Log.Helper.LOGIS(LOG_TAG, "Push notification clicked with target activity: " + pushTargetActivity, new Object[0]);
|
||||
try {
|
||||
intent = new Intent(context, Class.forName(pushTargetActivity));
|
||||
} catch (ClassNotFoundException e) {
|
||||
Log.Helper.LOGES(LOG_TAG, String.format("Could not launch target activity: %s, exception: %s", pushTargetActivity, e.toString()), new Object[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
intent.putExtras(bundle);
|
||||
intent.setFlags(603979776);
|
||||
PendingIntent activity = PendingIntent.getActivity(context, 0, intent, 1073741824);
|
||||
if (activity == null) {
|
||||
Log.Helper.LOGE(LOG_TAG, "Unable to create PendingIntent", new Object[0]);
|
||||
}
|
||||
try {
|
||||
activity.send();
|
||||
} catch (PendingIntent.CanceledException e2) {
|
||||
Log.Helper.LOGE(LOG_TAG, String.format("Could not launch PendingIntent for PN %s", e2.toString()), new Object[0]);
|
||||
}
|
||||
}
|
||||
|
||||
protected String getPushTargetActivity(Context context) {
|
||||
Intent launchIntentForPackage;
|
||||
ComponentName resolveActivity;
|
||||
Context applicationContext = context.getApplicationContext();
|
||||
PackageManager packageManager = applicationContext.getPackageManager();
|
||||
if (packageManager != null && (launchIntentForPackage = packageManager.getLaunchIntentForPackage(applicationContext.getPackageName())) != null && (resolveActivity = launchIntentForPackage.resolveActivity(applicationContext.getPackageManager())) != null) {
|
||||
return resolveActivity.getClassName();
|
||||
}
|
||||
Log.Helper.LOGE(this, "PackageManager service is unable or is inaccessible. Unable to get PushTargetActivity.", new Object[0]);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.ea.eadp.pushnotification.lifecycles;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.os.Bundle;
|
||||
|
||||
@TargetApi(14)
|
||||
/* loaded from: classes.dex */
|
||||
public class PushLifecycleCallbacks implements Application.ActivityLifecycleCallbacks {
|
||||
public static final int LIFECYCLE_API_VERSION = 14;
|
||||
public static boolean inForeground;
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityCreated(Activity activity, Bundle bundle) {
|
||||
inForeground = true;
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityStarted(Activity activity) {
|
||||
inForeground = true;
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityResumed(Activity activity) {
|
||||
inForeground = true;
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityPaused(Activity activity) {
|
||||
inForeground = false;
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityStopped(Activity activity) {
|
||||
inForeground = false;
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityDestroyed(Activity activity) {
|
||||
inForeground = false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.ea.eadp.pushnotification.listeners;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IPushListener {
|
||||
void onConnectionError(int i, String str);
|
||||
|
||||
void onGetInAppSuccess(int i, String str);
|
||||
|
||||
void onRegistrationSuccess(int i, String str);
|
||||
|
||||
void onTrackingSuccess(int i, String str);
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
package com.ea.eadp.pushnotification.models;
|
||||
|
||||
import android.os.Build;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class PushNotificationConfig {
|
||||
private String appId;
|
||||
private String appVersion;
|
||||
private String country;
|
||||
private String dateOfBirth;
|
||||
private String deviceIdentifier;
|
||||
private boolean disabled;
|
||||
private String disabledReason;
|
||||
private String registrationIdentifier;
|
||||
private Integer silentIntervalEnd;
|
||||
private Integer silentIntervalStart;
|
||||
private String userAlias;
|
||||
private String manufacturer = Build.MANUFACTURER;
|
||||
private String operatingSystem = Build.VERSION.RELEASE;
|
||||
private String model = Build.MODEL;
|
||||
private String deviceType = "android";
|
||||
private String locale = Locale.getDefault().toString();
|
||||
private TimeZone timezone = TimeZone.getDefault();
|
||||
|
||||
public String getUserAlias() {
|
||||
return this.userAlias;
|
||||
}
|
||||
|
||||
public void setUserAlias(String str) {
|
||||
this.userAlias = str;
|
||||
}
|
||||
|
||||
public String getDeviceType() {
|
||||
return this.deviceType;
|
||||
}
|
||||
|
||||
public void setDeviceType(String str) {
|
||||
this.deviceType = str;
|
||||
}
|
||||
|
||||
public String getOperatingSystem() {
|
||||
return this.operatingSystem;
|
||||
}
|
||||
|
||||
public void setOperatingSystem(String str) {
|
||||
this.operatingSystem = str;
|
||||
}
|
||||
|
||||
public String getManufacturer() {
|
||||
return this.manufacturer;
|
||||
}
|
||||
|
||||
public void setManufacturer(String str) {
|
||||
this.manufacturer = str;
|
||||
}
|
||||
|
||||
public String getRegistrationIdentifier() {
|
||||
return this.registrationIdentifier;
|
||||
}
|
||||
|
||||
public void setRegistrationIdentifier(String str) {
|
||||
this.registrationIdentifier = str;
|
||||
}
|
||||
|
||||
public String getDeviceIdentifier() {
|
||||
return this.deviceIdentifier;
|
||||
}
|
||||
|
||||
public void setDeviceIdentifier(String str) {
|
||||
this.deviceIdentifier = str;
|
||||
}
|
||||
|
||||
public String getModel() {
|
||||
return this.model;
|
||||
}
|
||||
|
||||
public void setModel(String str) {
|
||||
this.model = str;
|
||||
}
|
||||
|
||||
public String getAppId() {
|
||||
return this.appId;
|
||||
}
|
||||
|
||||
public void setAppId(String str) {
|
||||
this.appId = str;
|
||||
}
|
||||
|
||||
public String getAppVersion() {
|
||||
return this.appVersion;
|
||||
}
|
||||
|
||||
public void setAppVersion(String str) {
|
||||
this.appVersion = str;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
return this.country;
|
||||
}
|
||||
|
||||
public void setCountry(String str) {
|
||||
this.country = str;
|
||||
}
|
||||
|
||||
public String getLocale() {
|
||||
return this.locale;
|
||||
}
|
||||
|
||||
public void setLocale(String str) {
|
||||
this.locale = str;
|
||||
}
|
||||
|
||||
public TimeZone getTimezone() {
|
||||
return this.timezone;
|
||||
}
|
||||
|
||||
public void setTimezone(TimeZone timeZone) {
|
||||
this.timezone = timeZone;
|
||||
}
|
||||
|
||||
public Integer getSilentIntervalStart() {
|
||||
return this.silentIntervalStart;
|
||||
}
|
||||
|
||||
public void setSilentIntervalStart(Integer num) {
|
||||
this.silentIntervalStart = num;
|
||||
}
|
||||
|
||||
public Integer getSilentIntervalEnd() {
|
||||
return this.silentIntervalEnd;
|
||||
}
|
||||
|
||||
public void setSilentIntervalEnd(Integer num) {
|
||||
this.silentIntervalEnd = num;
|
||||
}
|
||||
|
||||
public String getDateOfBirth() {
|
||||
return this.dateOfBirth;
|
||||
}
|
||||
|
||||
public void setDateOfBirth(String str) {
|
||||
this.dateOfBirth = str;
|
||||
}
|
||||
|
||||
public String getDisabledReason() {
|
||||
return this.disabledReason;
|
||||
}
|
||||
|
||||
public void setDisabledReason(String str) {
|
||||
this.disabledReason = str;
|
||||
}
|
||||
|
||||
public boolean isDisabled() {
|
||||
return this.disabled;
|
||||
}
|
||||
|
||||
public void setDisabled(boolean z) {
|
||||
this.disabled = z;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,414 @@
|
||||
package com.ea.eadp.pushnotification.services;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
import android.util.Base64;
|
||||
import com.ea.eadp.deviceid.DeviceIdService;
|
||||
import com.ea.eadp.http.models.HttpRequest;
|
||||
import com.ea.eadp.http.models.HttpRequestListener;
|
||||
import com.ea.eadp.http.models.HttpResponse;
|
||||
import com.ea.eadp.http.services.HttpService;
|
||||
import com.ea.eadp.pushnotification.forwarding.GcmIntentService;
|
||||
import com.ea.eadp.pushnotification.lifecycles.PushLifecycleCallbacks;
|
||||
import com.ea.eadp.pushnotification.listeners.IPushListener;
|
||||
import com.ea.eadp.pushnotification.models.PushNotificationConfig;
|
||||
import com.ea.nimble.Log;
|
||||
import com.ea.nimble.pushtng.PushNotification;
|
||||
import com.google.android.gms.common.GoogleApiAvailability;
|
||||
import com.google.android.gms.gcm.GoogleCloudMessaging;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonPrimitive;
|
||||
import com.google.gson.JsonSerializationContext;
|
||||
import com.google.gson.JsonSerializer;
|
||||
import java.lang.reflect.Type;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TimeZone;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import org.apache.http.protocol.HTTP;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class AndroidPushService implements IPushService {
|
||||
private static final String API_KEY_KEY = "apiKey";
|
||||
private static final String API_SECRET_KEY = "apiSecret";
|
||||
public static final String AUTHORIZATION = "Authorization";
|
||||
private static final String DEVICE_ID_KEY = "deviceId";
|
||||
private static final String EVENT_LIST_KEY = "eventListKey";
|
||||
private static final String GAME_ID_KEY = "gameId";
|
||||
private static final String LOG_TAG = "PushManager";
|
||||
private static final String PUSH_SERVER_URL_KEY = "pushNotificationServerUrl";
|
||||
private static final String SHARED_PREFS_FILENAME = "PushManagerConfigurationData";
|
||||
private static final String TRACKING_PREFS_FILENAME = "PushManagerTrackingData";
|
||||
private static final String TRACKING_STATE_KEY = "state";
|
||||
private String apiKey;
|
||||
private String apiSecret;
|
||||
private String appId;
|
||||
private Context context;
|
||||
private DeviceIdService deviceIdService;
|
||||
private String gameId;
|
||||
private GoogleCloudMessaging googleCloudMessaging;
|
||||
private HttpService httpService;
|
||||
private long inAppNotificationInterval;
|
||||
private Timer inAppTimer;
|
||||
private IPushListener pushListener;
|
||||
private String pushNotificationServerUrl;
|
||||
private String senderId;
|
||||
private String startClientToken;
|
||||
private PushNotificationConfig startConfig;
|
||||
|
||||
public AndroidPushService(GoogleCloudMessaging googleCloudMessaging, HttpService httpService, DeviceIdService deviceIdService, Context context, IPushListener iPushListener, String str, String str2, String str3, String str4, String str5, String str6, int i) {
|
||||
Log.Helper.LOGIS(LOG_TAG, "Instantiating new push mgr", new Object[0]);
|
||||
this.googleCloudMessaging = googleCloudMessaging;
|
||||
this.httpService = httpService;
|
||||
this.deviceIdService = deviceIdService;
|
||||
this.context = context;
|
||||
this.pushListener = iPushListener;
|
||||
this.senderId = str;
|
||||
this.pushNotificationServerUrl = str2;
|
||||
this.gameId = str3;
|
||||
this.appId = str4;
|
||||
this.apiKey = str5;
|
||||
this.apiSecret = str6;
|
||||
this.inAppNotificationInterval = i * 1000;
|
||||
}
|
||||
|
||||
public AndroidPushService(Context context, HttpService httpService) {
|
||||
this.context = context;
|
||||
this.httpService = httpService;
|
||||
this.pushNotificationServerUrl = loadConfigData(PUSH_SERVER_URL_KEY);
|
||||
this.gameId = loadConfigData(GAME_ID_KEY);
|
||||
this.apiKey = loadConfigData(API_KEY_KEY);
|
||||
this.apiSecret = loadConfigData(API_SECRET_KEY);
|
||||
}
|
||||
|
||||
@Override // com.ea.eadp.pushnotification.services.IPushService
|
||||
public IPushListener getPushListener() {
|
||||
return this.pushListener;
|
||||
}
|
||||
|
||||
@Override // com.ea.eadp.pushnotification.services.IPushService
|
||||
public void setPushListener(IPushListener iPushListener) {
|
||||
this.pushListener = iPushListener;
|
||||
}
|
||||
|
||||
@Override // com.ea.eadp.pushnotification.services.IPushService
|
||||
@TargetApi(14)
|
||||
public void startWithConfig(final PushNotificationConfig pushNotificationConfig, final String str) {
|
||||
if (pushNotificationConfig == null) {
|
||||
Log.Helper.LOGES(LOG_TAG, "Error: Config data is null.", new Object[0]);
|
||||
if (this.pushListener != null) {
|
||||
this.pushListener.onConnectionError(0, "Config data is null");
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (this.inAppNotificationInterval > 0) {
|
||||
this.inAppTimer = new Timer();
|
||||
this.inAppTimer.schedule(new TimerTask() { // from class: com.ea.eadp.pushnotification.services.AndroidPushService.1
|
||||
@Override // java.util.TimerTask, java.lang.Runnable
|
||||
public void run() {
|
||||
AndroidPushService.this.getInAppNotifications(pushNotificationConfig.getUserAlias(), str);
|
||||
}
|
||||
}, this.inAppNotificationInterval, this.inAppNotificationInterval);
|
||||
}
|
||||
if (pushNotificationConfig.isDisabled()) {
|
||||
registerDevice(pushNotificationConfig);
|
||||
} else {
|
||||
new Thread(new Runnable() { // from class: com.ea.eadp.pushnotification.services.AndroidPushService.2
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
if (AndroidPushService.this.checkPlayServices()) {
|
||||
Log.Helper.LOGIS(AndroidPushService.LOG_TAG, "Attempt to register device with GCM", new Object[0]);
|
||||
try {
|
||||
String register = AndroidPushService.this.googleCloudMessaging.register(AndroidPushService.this.senderId);
|
||||
pushNotificationConfig.setRegistrationIdentifier(register);
|
||||
pushNotificationConfig.setDisabled(false);
|
||||
pushNotificationConfig.setDisabledReason(null);
|
||||
Log.Helper.LOGIS(AndroidPushService.LOG_TAG, String.format("Device registered on GCM. Registration id: %s", register), new Object[0]);
|
||||
try {
|
||||
if (Build.VERSION.SDK_INT >= 14) {
|
||||
((Application) AndroidPushService.this.context.getApplicationContext()).registerActivityLifecycleCallbacks(new PushLifecycleCallbacks());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.Helper.LOGES(AndroidPushService.LOG_TAG, "Failed to register activity lifecycle callbacks: %s", e.getLocalizedMessage());
|
||||
}
|
||||
} catch (Exception e2) {
|
||||
Log.Helper.LOGES(AndroidPushService.LOG_TAG, "Failed to get registration ID from GCM: %s", e2.getLocalizedMessage());
|
||||
pushNotificationConfig.setDisabled(true);
|
||||
pushNotificationConfig.setDisabledReason(PushNotification.DISABLED_REASON_REGISTER_FAILURE);
|
||||
}
|
||||
} else {
|
||||
Log.Helper.LOGES(AndroidPushService.LOG_TAG, "Failed to find appropriate Google Play Service SDK on device. Registering as disabled", new Object[0]);
|
||||
pushNotificationConfig.setDisabled(true);
|
||||
pushNotificationConfig.setDisabledReason(PushNotification.DISABLED_REASON_REGISTER_FAILURE);
|
||||
}
|
||||
AndroidPushService.this.registerDevice(pushNotificationConfig);
|
||||
}
|
||||
}, "startWithConfig thread").start();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ea.eadp.pushnotification.services.IPushService
|
||||
public void registerDevice(final PushNotificationConfig pushNotificationConfig) {
|
||||
if (pushNotificationConfig == null) {
|
||||
Log.Helper.LOGES(LOG_TAG, "Error: Config data is null.", new Object[0]);
|
||||
if (this.pushListener != null) {
|
||||
this.pushListener.onConnectionError(0, "Config data is null");
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (pushNotificationConfig.getDeviceIdentifier() == null) {
|
||||
pushNotificationConfig.setDeviceIdentifier(this.deviceIdService.getDeviceId());
|
||||
}
|
||||
Log.Helper.LOGIS(LOG_TAG, "Attempt to register device with EADP push notification service", new Object[0]);
|
||||
try {
|
||||
try {
|
||||
HttpRequest resource = this.httpService.getResource(String.format("%s/games/%s/devices", this.pushNotificationServerUrl, this.gameId));
|
||||
resource.setHeader("Authorization", createAuthorizationHeader());
|
||||
pushNotificationConfig.setAppId(this.appId);
|
||||
GsonBuilder gsonBuilder = new GsonBuilder();
|
||||
gsonBuilder.registerTypeAdapter(TimeZone.class, new TimeZoneSerializer());
|
||||
resource.setJsonBody(gsonBuilder.create().toJson(pushNotificationConfig));
|
||||
resource.postAsync(new HttpRequestListener() { // from class: com.ea.eadp.pushnotification.services.AndroidPushService.3
|
||||
@Override // com.ea.eadp.http.models.HttpRequestListener
|
||||
public void onComplete(HttpResponse httpResponse) {
|
||||
int code = httpResponse.getCode();
|
||||
String body = httpResponse.getBody();
|
||||
if (code >= 200 && code < 300) {
|
||||
Log.Helper.LOGIS(AndroidPushService.LOG_TAG, "Registration request successful!", new Object[0]);
|
||||
Log.Helper.LOGDS(AndroidPushService.LOG_TAG, String.format("response: %s", body), new Object[0]);
|
||||
Log.Helper.LOGIS(AndroidPushService.LOG_TAG, String.format("Device registration with server complete. Registered id: %s", pushNotificationConfig.getRegistrationIdentifier()), new Object[0]);
|
||||
if (AndroidPushService.this.pushListener != null) {
|
||||
AndroidPushService.this.pushListener.onRegistrationSuccess(code, body);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
String format = String.format("Registration request failed! Status: %s, Message: %s", Integer.valueOf(code), httpResponse.getMessage());
|
||||
Log.Helper.LOGES(AndroidPushService.LOG_TAG, format, new Object[0]);
|
||||
Log.Helper.LOGDS(AndroidPushService.LOG_TAG, String.format("response: %s", body), new Object[0]);
|
||||
if (AndroidPushService.this.pushListener != null) {
|
||||
AndroidPushService.this.pushListener.onConnectionError(code, format);
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
String format = String.format("Failed to register device with Exception: %s", e.getLocalizedMessage());
|
||||
Log.Helper.LOGES(LOG_TAG, format, new Object[0]);
|
||||
if (this.pushListener != null) {
|
||||
this.pushListener.onConnectionError(0, format);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
saveConfigData(pushNotificationConfig);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ea.eadp.pushnotification.services.IPushService
|
||||
public void sendTrackingEvent(String str, String str2, String str3) {
|
||||
try {
|
||||
HttpRequest resource = this.httpService.getResource(String.format("%s/games/%s/events", this.pushNotificationServerUrl, this.gameId));
|
||||
TrackingEvent trackingEvent = new TrackingEvent(str, str2, str3, loadConfigData(DEVICE_ID_KEY));
|
||||
resource.setHeader("Authorization", createAuthorizationHeader());
|
||||
resource.setJsonBody(new Gson().toJson(trackingEvent));
|
||||
resource.postAsync(new HttpRequestListener() { // from class: com.ea.eadp.pushnotification.services.AndroidPushService.4
|
||||
@Override // com.ea.eadp.http.models.HttpRequestListener
|
||||
public void onComplete(HttpResponse httpResponse) {
|
||||
int code = httpResponse.getCode();
|
||||
if (code >= 200 && code < 300) {
|
||||
Log.Helper.LOGIS(AndroidPushService.LOG_TAG, "Tracking request successful!", new Object[0]);
|
||||
Log.Helper.LOGDS(AndroidPushService.LOG_TAG, String.format("response: %s", httpResponse.getBody()), new Object[0]);
|
||||
if (AndroidPushService.this.pushListener != null) {
|
||||
AndroidPushService.this.pushListener.onTrackingSuccess(code, httpResponse.getBody());
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
String format = String.format("Tracking request failed! Status: %s, Message: %s", Integer.valueOf(httpResponse.getCode()), httpResponse.getMessage());
|
||||
Log.Helper.LOGES(AndroidPushService.LOG_TAG, format, new Object[0]);
|
||||
Log.Helper.LOGDS(AndroidPushService.LOG_TAG, String.format("response: %s", httpResponse.getBody()), new Object[0]);
|
||||
if (AndroidPushService.this.pushListener != null) {
|
||||
AndroidPushService.this.pushListener.onConnectionError(code, format);
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
String format = String.format("Tracking request failed with Exception: %s", e.getMessage());
|
||||
Log.Helper.LOGES(LOG_TAG, format, new Object[0]);
|
||||
if (this.pushListener != null) {
|
||||
this.pushListener.onConnectionError(0, format);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ea.eadp.pushnotification.services.IPushService
|
||||
public void persistTrackingEvent(String str, String str2, String str3) {
|
||||
List arrayList;
|
||||
SharedPreferences sharedPreferences = this.context.getApplicationContext().getSharedPreferences(TRACKING_PREFS_FILENAME, 0);
|
||||
String string = sharedPreferences.getString(EVENT_LIST_KEY, null);
|
||||
if (string != null) {
|
||||
arrayList = (List) new Gson().fromJson(string, List.class);
|
||||
} else {
|
||||
arrayList = new ArrayList();
|
||||
}
|
||||
HashMap hashMap = new HashMap();
|
||||
hashMap.put(GcmIntentService.PushIntentExtraKeys.PUSH_ID, str);
|
||||
hashMap.put(GcmIntentService.PushIntentExtraKeys.PN_TYPE, str2);
|
||||
hashMap.put("state", str3);
|
||||
if (arrayList == null) {
|
||||
Log.Helper.LOGE(this, "Unexpected Event List. Skipping Tracking event persistence.", new Object[0]);
|
||||
return;
|
||||
}
|
||||
arrayList.add(hashMap);
|
||||
SharedPreferences.Editor edit = sharedPreferences.edit();
|
||||
edit.putString(EVENT_LIST_KEY, new Gson().toJson(arrayList));
|
||||
edit.commit();
|
||||
}
|
||||
|
||||
@Override // com.ea.eadp.pushnotification.services.IPushService
|
||||
public void sendPendingTrackingRequests() {
|
||||
Gson gson = new Gson();
|
||||
SharedPreferences sharedPreferences = this.context.getSharedPreferences(TRACKING_PREFS_FILENAME, 0);
|
||||
String string = sharedPreferences.getString(EVENT_LIST_KEY, null);
|
||||
if (string != null) {
|
||||
List<Map> list = (List) gson.fromJson(string, List.class);
|
||||
if (list == null) {
|
||||
Log.Helper.LOGE(this, "Event List from Json is null!", new Object[0]);
|
||||
return;
|
||||
}
|
||||
for (Map map : list) {
|
||||
if (map != null && !map.isEmpty()) {
|
||||
sendTrackingEvent((String) map.get(GcmIntentService.PushIntentExtraKeys.PUSH_ID), (String) map.get(GcmIntentService.PushIntentExtraKeys.PN_TYPE), (String) map.get("state"));
|
||||
}
|
||||
}
|
||||
}
|
||||
SharedPreferences.Editor edit = sharedPreferences.edit();
|
||||
edit.clear();
|
||||
edit.commit();
|
||||
}
|
||||
|
||||
@Override // com.ea.eadp.pushnotification.services.IPushService
|
||||
public void getInAppNotifications(final String str, final String str2) {
|
||||
if (str == null) {
|
||||
if (this.pushListener != null) {
|
||||
this.pushListener.onConnectionError(0, "UserAlias is null");
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
new Thread(new Runnable() { // from class: com.ea.eadp.pushnotification.services.AndroidPushService.5
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
int i;
|
||||
try {
|
||||
HttpRequest resource = AndroidPushService.this.httpService.getResource(String.format("%s/games/%s/users/%s/inapp", AndroidPushService.this.pushNotificationServerUrl, AndroidPushService.this.gameId, str));
|
||||
if (str2 != null) {
|
||||
resource.setHeader("Authorization", "Bearer " + str2);
|
||||
}
|
||||
HttpResponse httpResponse = resource.get();
|
||||
i = httpResponse.getCode();
|
||||
try {
|
||||
if (i >= 200 && i < 300) {
|
||||
Log.Helper.LOGIS(AndroidPushService.LOG_TAG, "Get In-App Notification request successful!", new Object[0]);
|
||||
Log.Helper.LOGDS(AndroidPushService.LOG_TAG, "response: " + httpResponse.getBody(), new Object[0]);
|
||||
if (AndroidPushService.this.pushListener != null) {
|
||||
AndroidPushService.this.pushListener.onGetInAppSuccess(i, httpResponse.getBody());
|
||||
}
|
||||
} else {
|
||||
String format = String.format("Get In-App Notification request failed! Status: %s, Message: %s", Integer.valueOf(httpResponse.getCode()), httpResponse.getMessage());
|
||||
Log.Helper.LOGES(AndroidPushService.LOG_TAG, format, new Object[0]);
|
||||
Log.Helper.LOGDS(AndroidPushService.LOG_TAG, String.format("response: %s", httpResponse.getBody()), new Object[0]);
|
||||
if (AndroidPushService.this.pushListener != null) {
|
||||
AndroidPushService.this.pushListener.onConnectionError(i, format);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e = e;
|
||||
String format2 = String.format("In-App Notification request failed with Exception: %s", e.getMessage());
|
||||
Log.Helper.LOGES(AndroidPushService.LOG_TAG, format2, new Object[0]);
|
||||
if (AndroidPushService.this.pushListener != null) {
|
||||
AndroidPushService.this.pushListener.onConnectionError(i, format2);
|
||||
}
|
||||
}
|
||||
} catch (Exception e2) {
|
||||
e = e2;
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
}, "getInAppNotifications thread").start();
|
||||
}
|
||||
|
||||
@Override // com.ea.eadp.pushnotification.services.IPushService
|
||||
public void onRestart() {
|
||||
if (this.inAppTimer == null || this.inAppNotificationInterval <= 0) {
|
||||
return;
|
||||
}
|
||||
this.inAppTimer = new Timer();
|
||||
this.inAppTimer.schedule(new TimerTask() { // from class: com.ea.eadp.pushnotification.services.AndroidPushService.6
|
||||
@Override // java.util.TimerTask, java.lang.Runnable
|
||||
public void run() {
|
||||
AndroidPushService.this.getInAppNotifications(AndroidPushService.this.startConfig.getUserAlias(), AndroidPushService.this.startClientToken);
|
||||
}
|
||||
}, this.inAppNotificationInterval, this.inAppNotificationInterval);
|
||||
}
|
||||
|
||||
@Override // com.ea.eadp.pushnotification.services.IPushService
|
||||
public void onStop() {
|
||||
if (this.inAppTimer != null) {
|
||||
this.inAppTimer.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public boolean checkPlayServices() {
|
||||
return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(this.context) == 0;
|
||||
}
|
||||
|
||||
private void saveConfigData(PushNotificationConfig pushNotificationConfig) {
|
||||
SharedPreferences.Editor edit = this.context.getApplicationContext().getSharedPreferences(SHARED_PREFS_FILENAME, 0).edit();
|
||||
if (pushNotificationConfig.getDeviceIdentifier() != null && !pushNotificationConfig.getDeviceIdentifier().equals("")) {
|
||||
edit.putString(DEVICE_ID_KEY, pushNotificationConfig.getDeviceIdentifier());
|
||||
}
|
||||
if (this.pushNotificationServerUrl != null && !this.pushNotificationServerUrl.equals("")) {
|
||||
edit.putString(PUSH_SERVER_URL_KEY, this.pushNotificationServerUrl);
|
||||
}
|
||||
if (this.gameId != null && !this.gameId.equals("")) {
|
||||
edit.putString(GAME_ID_KEY, this.gameId);
|
||||
}
|
||||
if (this.apiKey != null && !this.apiKey.equals("")) {
|
||||
edit.putString(API_KEY_KEY, this.apiKey);
|
||||
}
|
||||
if (this.apiSecret != null && !this.apiSecret.equals("")) {
|
||||
edit.putString(API_SECRET_KEY, this.apiSecret);
|
||||
}
|
||||
edit.commit();
|
||||
}
|
||||
|
||||
private String loadConfigData(String str) {
|
||||
return this.context.getApplicationContext().getSharedPreferences(SHARED_PREFS_FILENAME, 0).getString(str, null);
|
||||
}
|
||||
|
||||
private String createAuthorizationHeader() {
|
||||
return String.format("Basic %s", Base64.encodeToString((this.apiKey + ':' + this.apiSecret).getBytes(Charset.forName(HTTP.UTF_8)), 10));
|
||||
}
|
||||
|
||||
private static class TimeZoneSerializer implements JsonSerializer<TimeZone> {
|
||||
private TimeZoneSerializer() {
|
||||
}
|
||||
|
||||
@Override // com.google.gson.JsonSerializer
|
||||
public JsonElement serialize(TimeZone timeZone, Type type, JsonSerializationContext jsonSerializationContext) {
|
||||
return new JsonPrimitive(timeZone.getID());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.ea.eadp.pushnotification.services;
|
||||
|
||||
import com.ea.eadp.pushnotification.listeners.IPushListener;
|
||||
import com.ea.eadp.pushnotification.models.PushNotificationConfig;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IPushService {
|
||||
public static final String NOTIFICATION_TYPE_OPENED = "NOTIFICATION_OPENED";
|
||||
public static final String NOTIFICATION_TYPE_RECEIVED = "NOTIFICATION_RECEIVED";
|
||||
|
||||
void getInAppNotifications(String str, String str2);
|
||||
|
||||
IPushListener getPushListener();
|
||||
|
||||
void onRestart();
|
||||
|
||||
void onStop();
|
||||
|
||||
void persistTrackingEvent(String str, String str2, String str3);
|
||||
|
||||
void registerDevice(PushNotificationConfig pushNotificationConfig);
|
||||
|
||||
void sendPendingTrackingRequests();
|
||||
|
||||
void sendTrackingEvent(String str, String str2, String str3);
|
||||
|
||||
void setPushListener(IPushListener iPushListener);
|
||||
|
||||
void startWithConfig(PushNotificationConfig pushNotificationConfig, String str);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.ea.eadp.pushnotification.services;
|
||||
|
||||
import com.ea.eadp.pushnotification.forwarding.GcmIntentService;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class TrackingEvent {
|
||||
|
||||
@Expose
|
||||
private String name;
|
||||
|
||||
@Expose
|
||||
private Map<String, String> parameters = new HashMap();
|
||||
|
||||
public TrackingEvent(String str, String str2, String str3, String str4) {
|
||||
this.name = str3;
|
||||
this.parameters.put(GcmIntentService.PushIntentExtraKeys.PUSH_ID, str);
|
||||
this.parameters.put(GcmIntentService.PushIntentExtraKeys.PN_TYPE, str2);
|
||||
this.parameters.put("deviceType", "android");
|
||||
this.parameters.put("deviceIdentifier", str4);
|
||||
this.parameters.put("timestamp", new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
package com.ea.ironmonkey;
|
||||
|
||||
import android.hardware.Sensor;
|
||||
import android.hardware.SensorEvent;
|
||||
import android.hardware.SensorEventListener;
|
||||
import android.hardware.SensorManager;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class Accelerometer implements SensorEventListener {
|
||||
private int bufferReadIndex;
|
||||
private int bufferSize;
|
||||
private int[] bufferTimesteps;
|
||||
private float[] bufferValues;
|
||||
private int bufferWriteIndex;
|
||||
private long lastTimestamp = 0;
|
||||
private int naturalOrientation;
|
||||
private boolean registered;
|
||||
private float samplesPerSecond;
|
||||
private Sensor sensor;
|
||||
private SensorManager sensorManager;
|
||||
|
||||
@Override // android.hardware.SensorEventListener
|
||||
public void onAccuracyChanged(Sensor sensor, int i) {
|
||||
}
|
||||
|
||||
public Accelerometer(SensorManager sensorManager, Sensor sensor, int i) {
|
||||
this.sensorManager = sensorManager;
|
||||
this.sensor = sensor;
|
||||
this.naturalOrientation = i;
|
||||
setBufferSize(1);
|
||||
}
|
||||
|
||||
public void setFrequency(float f) {
|
||||
this.samplesPerSecond = f;
|
||||
register();
|
||||
}
|
||||
|
||||
public float getFrequency() {
|
||||
return this.samplesPerSecond;
|
||||
}
|
||||
|
||||
public void setBufferSize(int i) {
|
||||
this.bufferSize = i;
|
||||
this.bufferTimesteps = new int[i];
|
||||
this.bufferValues = new float[i * 3];
|
||||
this.bufferWriteIndex = 0;
|
||||
this.bufferReadIndex = 0;
|
||||
}
|
||||
|
||||
public void updateOrientation(int i) {
|
||||
this.naturalOrientation = i;
|
||||
}
|
||||
|
||||
public int getBufferSize() {
|
||||
return this.bufferSize;
|
||||
}
|
||||
|
||||
public void pause() {
|
||||
unregister();
|
||||
}
|
||||
|
||||
public void resume() {
|
||||
register();
|
||||
}
|
||||
|
||||
private int getSensorDelay() {
|
||||
return this.samplesPerSecond < 20.0f ? 3 : 1;
|
||||
}
|
||||
|
||||
private void register() {
|
||||
if (!this.registered && this.samplesPerSecond > 0.0f) {
|
||||
this.sensorManager.registerListener(this, this.sensor, getSensorDelay());
|
||||
this.registered = true;
|
||||
} else if (this.registered && this.samplesPerSecond == 0.0f) {
|
||||
this.sensorManager.unregisterListener(this);
|
||||
this.registered = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void unregister() {
|
||||
if (this.registered) {
|
||||
this.sensorManager.unregisterListener(this);
|
||||
this.registered = false;
|
||||
}
|
||||
}
|
||||
|
||||
public int getSamples(int i, int[] iArr, float[] fArr) {
|
||||
int i2;
|
||||
synchronized (this) {
|
||||
i2 = 0;
|
||||
while (this.bufferReadIndex != this.bufferWriteIndex) {
|
||||
if (this.bufferReadIndex >= this.bufferSize) {
|
||||
this.bufferReadIndex = 0;
|
||||
}
|
||||
if (i2 >= i) {
|
||||
break;
|
||||
}
|
||||
iArr[i2] = this.bufferTimesteps[this.bufferReadIndex];
|
||||
for (int i3 = 0; i3 < 3; i3++) {
|
||||
fArr[(i2 * 3) + i3] = this.bufferValues[(this.bufferReadIndex * 3) + i3];
|
||||
}
|
||||
i2++;
|
||||
this.bufferReadIndex++;
|
||||
}
|
||||
}
|
||||
return i2;
|
||||
}
|
||||
|
||||
@Override // android.hardware.SensorEventListener
|
||||
public void onSensorChanged(SensorEvent sensorEvent) {
|
||||
int i = (int) ((sensorEvent.timestamp - this.lastTimestamp) / 1000000);
|
||||
this.lastTimestamp = sensorEvent.timestamp;
|
||||
synchronized (this) {
|
||||
this.bufferWriteIndex++;
|
||||
if (this.bufferWriteIndex >= this.bufferSize) {
|
||||
this.bufferWriteIndex = 0;
|
||||
}
|
||||
if (this.bufferWriteIndex == this.bufferReadIndex) {
|
||||
this.bufferReadIndex++;
|
||||
}
|
||||
this.bufferTimesteps[this.bufferWriteIndex] = i;
|
||||
switch (this.naturalOrientation) {
|
||||
case 0:
|
||||
this.bufferValues[(this.bufferWriteIndex * 3) + 0] = -sensorEvent.values[0];
|
||||
this.bufferValues[(this.bufferWriteIndex * 3) + 1] = sensorEvent.values[1];
|
||||
break;
|
||||
case 1:
|
||||
this.bufferValues[(this.bufferWriteIndex * 3) + 0] = sensorEvent.values[1];
|
||||
this.bufferValues[(this.bufferWriteIndex * 3) + 1] = -sensorEvent.values[0];
|
||||
break;
|
||||
case 2:
|
||||
this.bufferValues[(this.bufferWriteIndex * 3) + 0] = sensorEvent.values[0];
|
||||
this.bufferValues[(this.bufferWriteIndex * 3) + 1] = -sensorEvent.values[1];
|
||||
break;
|
||||
case 3:
|
||||
this.bufferValues[(this.bufferWriteIndex * 3) + 0] = -sensorEvent.values[1];
|
||||
this.bufferValues[(this.bufferWriteIndex * 3) + 1] = sensorEvent.values[0];
|
||||
break;
|
||||
}
|
||||
this.bufferValues[(this.bufferWriteIndex * 3) + 2] = sensorEvent.values[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ea.ironmonkey;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.Typeface;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class BitmapGraphics {
|
||||
private Bitmap bitmap;
|
||||
private Canvas canvas = new Canvas();
|
||||
|
||||
public BitmapGraphics(int i, int i2) {
|
||||
this.bitmap = Bitmap.createBitmap(i, i2, Bitmap.Config.ARGB_8888);
|
||||
this.canvas.setBitmap(this.bitmap);
|
||||
}
|
||||
|
||||
public Bitmap getBitmap() {
|
||||
return this.bitmap;
|
||||
}
|
||||
|
||||
public Canvas getCanvas() {
|
||||
return this.canvas;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
this.canvas.drawColor(0, PorterDuff.Mode.CLEAR);
|
||||
}
|
||||
|
||||
private static Paint createPaint(Typeface typeface, float f) {
|
||||
Paint paint = new Paint();
|
||||
paint.setTypeface(typeface);
|
||||
paint.setTextSize(f);
|
||||
paint.setColor(-1);
|
||||
paint.setAntiAlias(true);
|
||||
return paint;
|
||||
}
|
||||
|
||||
public static Paint createPaintFromFamilyName(String str, float f) {
|
||||
return createPaint(Typeface.create(str, 0), f);
|
||||
}
|
||||
|
||||
public static Paint createPaintFromFile(String str, float f) {
|
||||
return createPaint(internalCreateFromFile(str), f);
|
||||
}
|
||||
|
||||
private static Typeface internalCreateFromFile(String str) {
|
||||
if (GameActivityMain.instance.useAssetsFileSystem()) {
|
||||
if (str.startsWith("/")) {
|
||||
str = str.substring(1);
|
||||
}
|
||||
return Typeface.createFromAsset(GameActivityMain.instance.getAssetManager(), str);
|
||||
}
|
||||
return Typeface.createFromFile(str);
|
||||
}
|
||||
|
||||
public void drawString(Paint paint, String str, int i, int i2) {
|
||||
this.canvas.drawText(str, i, i2, paint);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.ea.ironmonkey;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class C2DMConstants {
|
||||
public static final String ACTION_ERROR = "com.ea.ironmonkey.ERROR";
|
||||
public static final String ACTION_MESSAGE = "com.ea.ironmonkey.MESSAGE";
|
||||
public static final String ACTION_REGISTER = "com.ea.ironmonkey.REGISTER";
|
||||
public static final String ACTION_UNREGISTER = "com.ea.ironmonkey.UNREGISTER";
|
||||
public static final String EXTRA_ERROR_ID = "ERROR_ID";
|
||||
public static final String EXTRA_REGISTRATION_ID = "REGISTRATION_ID";
|
||||
public static final String LAUNCH_TYPE_TAG = "app_launch";
|
||||
public static final String SENDER_EMAIL = "927779459434";
|
||||
public static final String SYSTEM_MSG_CLASS_RECIPIENT = "com.ea.ironmonkey.GameActivityMain";
|
||||
public static final String SYSTEM_MSG_PACKAGE_RECIPIENT = "com.ea.games.nfs13_row";
|
||||
public static final String SYSTEM_MSG_TITLE = "NFS Most Wanted";
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.ea.ironmonkey;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DownloaderService extends com.google.android.vending.expansion.downloader.impl.DownloaderService {
|
||||
@Override // com.google.android.vending.expansion.downloader.impl.DownloaderService
|
||||
public String getPublicKey() {
|
||||
return getPackageName().endsWith("_row") ? SkuConfig.ROW_BASE64_PUBLIC_KEY : SkuConfig.NA_BASE64_PUBLIC_KEY;
|
||||
}
|
||||
|
||||
@Override // com.google.android.vending.expansion.downloader.impl.DownloaderService
|
||||
public byte[] getSALT() {
|
||||
return SkuConfig.SALT;
|
||||
}
|
||||
|
||||
@Override // com.google.android.vending.expansion.downloader.impl.DownloaderService
|
||||
public String getAlarmReceiverClassName() {
|
||||
return DownloaderServiceBroadcastReceiver.class.getName();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.ea.ironmonkey;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DownloaderServiceBroadcastReceiver extends BroadcastReceiver {
|
||||
@Override // android.content.BroadcastReceiver
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
try {
|
||||
DownloaderClientMarshaller.startDownloadServiceIfRequired(context, intent, (Class<?>) DownloaderService.class);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.ea.ironmonkey;
|
||||
|
||||
import javax.microedition.khronos.opengles.GL10;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface DrawFrameListener {
|
||||
void onDrawFrame(GL10 gl10);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,223 @@
|
||||
package com.ea.ironmonkey;
|
||||
|
||||
import android.opengl.GLSurfaceView;
|
||||
import android.os.Build;
|
||||
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: classes.dex */
|
||||
public class GameGLSurfaceView extends GLSurfaceView {
|
||||
private static final String TAG = "GameGLSurfaceView";
|
||||
private boolean enableHistoricalEvents;
|
||||
private boolean kMotionEvent_GetSource;
|
||||
private GameActivityMain mActivity;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public native void nativeTouchPadEvent(int i, int i2, float f, float f2);
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public native void nativeTouchScreenEvent(int i, int i2, float f, float f2);
|
||||
|
||||
public GameGLSurfaceView(GameActivityMain gameActivityMain) {
|
||||
super(gameActivityMain);
|
||||
this.enableHistoricalEvents = false;
|
||||
this.kMotionEvent_GetSource = false;
|
||||
this.mActivity = null;
|
||||
this.mActivity = gameActivityMain;
|
||||
try {
|
||||
MotionEvent.class.getMethod("getSource", new Class[0]);
|
||||
this.kMotionEvent_GetSource = true;
|
||||
} catch (Exception unused) {
|
||||
}
|
||||
setGLESVersion2();
|
||||
setFocusable(true);
|
||||
setFocusableInTouchMode(true);
|
||||
if (Build.VERSION.SDK_INT >= 11) {
|
||||
try {
|
||||
Log.i(TAG, "setPreserveEGLContextOnPause");
|
||||
getClass().getMethod("setPreserveEGLContextOnPause", Boolean.TYPE).invoke(this, false);
|
||||
Log.e(TAG, "setPreserveEGLContextOnPause(false) success");
|
||||
} catch (Exception unused2) {
|
||||
Log.e(TAG, "setPreserveEGLContextOnPause failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setEnableHistoricalEvents(boolean z) {
|
||||
this.enableHistoricalEvents = z;
|
||||
}
|
||||
|
||||
private void setGLESVersion2() {
|
||||
setEGLContextFactory(new GLSurfaceView.EGLContextFactory() { // from class: com.ea.ironmonkey.GameGLSurfaceView.1
|
||||
private static final int EGL_CONTEXT_CLIENT_VERSION = 12440;
|
||||
|
||||
@Override // android.opengl.GLSurfaceView.EGLContextFactory
|
||||
public EGLContext createContext(EGL10 egl10, EGLDisplay eGLDisplay, EGLConfig eGLConfig) {
|
||||
return egl10.eglCreateContext(eGLDisplay, eGLConfig, EGL10.EGL_NO_CONTEXT, new int[]{EGL_CONTEXT_CLIENT_VERSION, 2, 12344});
|
||||
}
|
||||
|
||||
@Override // android.opengl.GLSurfaceView.EGLContextFactory
|
||||
public void destroyContext(EGL10 egl10, EGLDisplay eGLDisplay, EGLContext eGLContext) {
|
||||
egl10.eglDestroyContext(eGLDisplay, eGLContext);
|
||||
}
|
||||
});
|
||||
setEGLConfigChooser(new ConfigChooser(5, 6, 5, 0, 24, 0));
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public boolean onTouchEvent(MotionEvent motionEvent) {
|
||||
GameActivityMain gameActivityMain = this.mActivity;
|
||||
int i = GameActivityMain.state;
|
||||
GameActivityMain gameActivityMain2 = this.mActivity;
|
||||
if (i != 8) {
|
||||
return true;
|
||||
}
|
||||
motionEvent.getHistorySize();
|
||||
final int pointerCount = motionEvent.getPointerCount();
|
||||
final MotionEvent obtain = MotionEvent.obtain(motionEvent);
|
||||
queueEvent(new Runnable() { // from class: com.ea.ironmonkey.GameGLSurfaceView.2
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
int i2 = 0;
|
||||
if (GameGLSurfaceView.this.kMotionEvent_GetSource) {
|
||||
if (obtain.getSource() == 4098) {
|
||||
if (obtain.getAction() == 2) {
|
||||
while (i2 < pointerCount) {
|
||||
GameGLSurfaceView.this.nativeTouchScreenEvent(obtain.getAction(), obtain.getPointerId(i2), obtain.getX(i2), obtain.getY(i2));
|
||||
i2++;
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
int actionIndex = obtain.getActionIndex();
|
||||
GameGLSurfaceView.this.nativeTouchScreenEvent(obtain.getAction(), obtain.getPointerId(actionIndex), obtain.getX(actionIndex), obtain.getY(actionIndex));
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (obtain.getSource() == 1048584) {
|
||||
if (obtain.getAction() == 2) {
|
||||
while (i2 < pointerCount) {
|
||||
GameGLSurfaceView.this.nativeTouchPadEvent(obtain.getAction(), obtain.getPointerId(i2), obtain.getX(i2), obtain.getY(i2));
|
||||
i2++;
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
int actionIndex2 = obtain.getActionIndex();
|
||||
GameGLSurfaceView.this.nativeTouchPadEvent(obtain.getAction(), obtain.getPointerId(actionIndex2), obtain.getX(actionIndex2), obtain.getY(actionIndex2));
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (obtain.getAction() == 2) {
|
||||
while (i2 < pointerCount) {
|
||||
GameGLSurfaceView.this.nativeTouchScreenEvent(obtain.getAction(), obtain.getPointerId(i2), obtain.getX(i2), obtain.getY(i2));
|
||||
i2++;
|
||||
}
|
||||
} else {
|
||||
int actionIndex3 = obtain.getActionIndex();
|
||||
GameGLSurfaceView.this.nativeTouchScreenEvent(obtain.getAction(), obtain.getPointerId(actionIndex3), obtain.getX(actionIndex3), obtain.getY(actionIndex3));
|
||||
}
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
private static class ConfigChooser implements GLSurfaceView.EGLConfigChooser {
|
||||
private static final int EGL_DEPTH_ENCODING_NONLINEAR_NV = 12515;
|
||||
private static final int EGL_DEPTH_ENCODING_NV = 12514;
|
||||
protected int mAlphaSize;
|
||||
protected int mBlueSize;
|
||||
protected int mDepthSize;
|
||||
protected int mGreenSize;
|
||||
protected int mRedSize;
|
||||
protected int mStencilSize;
|
||||
private int[] mValue = new int[1];
|
||||
|
||||
public ConfigChooser(int i, int i2, int i3, int i4, int i5, int i6) {
|
||||
this.mRedSize = i;
|
||||
this.mGreenSize = i2;
|
||||
this.mBlueSize = i3;
|
||||
this.mAlphaSize = i4;
|
||||
this.mDepthSize = i5;
|
||||
this.mStencilSize = i6;
|
||||
}
|
||||
|
||||
@Override // android.opengl.GLSurfaceView.EGLConfigChooser
|
||||
public EGLConfig chooseConfig(EGL10 egl10, EGLDisplay eGLDisplay) {
|
||||
int[] iArr = {12352, 4, 12324, 4, 12323, 4, 12322, 4, 12344};
|
||||
int[] iArr2 = new int[1];
|
||||
egl10.eglChooseConfig(eGLDisplay, iArr, null, 0, iArr2);
|
||||
int i = iArr2[0];
|
||||
if (i <= 0) {
|
||||
throw new IllegalArgumentException("No configs match configSpec");
|
||||
}
|
||||
EGLConfig[] eGLConfigArr = new EGLConfig[i];
|
||||
egl10.eglChooseConfig(eGLDisplay, iArr, eGLConfigArr, i, iArr2);
|
||||
return chooseConfig(egl10, eGLDisplay, eGLConfigArr);
|
||||
}
|
||||
|
||||
public EGLConfig chooseConfig(EGL10 egl10, EGLDisplay eGLDisplay, EGLConfig[] eGLConfigArr) {
|
||||
EGLConfig eGLConfig = null;
|
||||
while (true) {
|
||||
int i = 0;
|
||||
if (eGLConfig == null) {
|
||||
int length = eGLConfigArr.length;
|
||||
while (true) {
|
||||
if (i >= length) {
|
||||
break;
|
||||
}
|
||||
EGLConfig eGLConfig2 = eGLConfigArr[i];
|
||||
int findConfigAttrib = findConfigAttrib(egl10, eGLDisplay, eGLConfig2, 12325, 0);
|
||||
int findConfigAttrib2 = findConfigAttrib(egl10, eGLDisplay, eGLConfig2, 12326, 0);
|
||||
if (findConfigAttrib >= this.mDepthSize && findConfigAttrib2 >= this.mStencilSize) {
|
||||
int findConfigAttrib3 = findConfigAttrib(egl10, eGLDisplay, eGLConfig2, 12324, 0);
|
||||
int findConfigAttrib4 = findConfigAttrib(egl10, eGLDisplay, eGLConfig2, 12323, 0);
|
||||
int findConfigAttrib5 = findConfigAttrib(egl10, eGLDisplay, eGLConfig2, 12322, 0);
|
||||
int findConfigAttrib6 = findConfigAttrib(egl10, eGLDisplay, eGLConfig2, 12321, 0);
|
||||
if (findConfigAttrib3 == this.mRedSize && findConfigAttrib4 == this.mGreenSize && findConfigAttrib5 == this.mBlueSize && findConfigAttrib6 == this.mAlphaSize) {
|
||||
if (findConfigAttrib(egl10, eGLDisplay, eGLConfig2, EGL_DEPTH_ENCODING_NV, 0) == 0) {
|
||||
eGLConfig = eGLConfig2;
|
||||
break;
|
||||
}
|
||||
eGLConfig = eGLConfig2;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (eGLConfig == null) {
|
||||
if (this.mDepthSize <= 0) {
|
||||
return null;
|
||||
}
|
||||
this.mDepthSize -= 8;
|
||||
}
|
||||
} else {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("depth=");
|
||||
EGLConfig eGLConfig3 = eGLConfig;
|
||||
sb.append(findConfigAttrib(egl10, eGLDisplay, eGLConfig3, 12325, 0));
|
||||
sb.append(" stencil=");
|
||||
sb.append(findConfigAttrib(egl10, eGLDisplay, eGLConfig3, 12326, 0));
|
||||
sb.append(" red=");
|
||||
sb.append(findConfigAttrib(egl10, eGLDisplay, eGLConfig3, 12324, 0));
|
||||
sb.append(" green=");
|
||||
sb.append(findConfigAttrib(egl10, eGLDisplay, eGLConfig3, 12323, 0));
|
||||
sb.append(" blue=");
|
||||
sb.append(findConfigAttrib(egl10, eGLDisplay, eGLConfig3, 12322, 0));
|
||||
sb.append(" alpha=");
|
||||
sb.append(findConfigAttrib(egl10, eGLDisplay, eGLConfig3, 12321, 0));
|
||||
sb.append(" nonLinear=");
|
||||
sb.append(findConfigAttrib(egl10, eGLDisplay, eGLConfig3, EGL_DEPTH_ENCODING_NV, 0) == EGL_DEPTH_ENCODING_NONLINEAR_NV);
|
||||
Log.i(GameGLSurfaceView.TAG, sb.toString());
|
||||
return eGLConfig;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int findConfigAttrib(EGL10 egl10, EGLDisplay eGLDisplay, EGLConfig eGLConfig, int i, int i2) {
|
||||
return egl10.eglGetConfigAttrib(eGLDisplay, eGLConfig, i, this.mValue) ? this.mValue[0] : i2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.ea.ironmonkey;
|
||||
|
||||
import android.opengl.GLSurfaceView;
|
||||
import javax.microedition.khronos.egl.EGLConfig;
|
||||
import javax.microedition.khronos.opengles.GL10;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class GameRenderer implements GLSurfaceView.Renderer {
|
||||
static GL10 _gl;
|
||||
private int _height;
|
||||
private int _width;
|
||||
private GameActivityMain activity;
|
||||
private DrawFrameListener drawFrameListener;
|
||||
|
||||
public GameRenderer(GameActivityMain gameActivityMain) {
|
||||
this.activity = gameActivityMain;
|
||||
}
|
||||
|
||||
public void setDrawFrameListener(DrawFrameListener drawFrameListener) {
|
||||
this.drawFrameListener = drawFrameListener;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return this._width;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return this._height;
|
||||
}
|
||||
|
||||
@Override // android.opengl.GLSurfaceView.Renderer
|
||||
public void onSurfaceCreated(GL10 gl10, EGLConfig eGLConfig) {
|
||||
this.activity.nativeSurfaceCreated(gl10, eGLConfig);
|
||||
}
|
||||
|
||||
@Override // android.opengl.GLSurfaceView.Renderer
|
||||
public void onSurfaceChanged(GL10 gl10, int i, int i2) {
|
||||
if (gl10 != _gl) {
|
||||
this.activity.nativeSurfaceChanged(gl10, i, i2);
|
||||
_gl = gl10;
|
||||
}
|
||||
this._width = i;
|
||||
this._height = i2;
|
||||
}
|
||||
|
||||
@Override // android.opengl.GLSurfaceView.Renderer
|
||||
public void onDrawFrame(GL10 gl10) {
|
||||
if (this.drawFrameListener != null) {
|
||||
this.drawFrameListener.onDrawFrame(gl10);
|
||||
} else {
|
||||
this.activity.getRunLoop().onRunLoopTick();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.ea.ironmonkey;
|
||||
|
||||
import android.provider.Settings;
|
||||
import com.eamobile.licensing.ILicenseServerActivityCallback;
|
||||
import com.eamobile.licensing.LicenseServerActivity;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class GoogleDrm implements ILicenseServerActivityCallback {
|
||||
private GameActivityMain _activity;
|
||||
private String publicKey;
|
||||
|
||||
public boolean isEnable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public GoogleDrm(GameActivityMain gameActivityMain) {
|
||||
this._activity = gameActivityMain;
|
||||
this.publicKey = SkuConfig.NA_BASE64_PUBLIC_KEY;
|
||||
if (this._activity.getPackageName().endsWith("_row")) {
|
||||
this.publicKey = SkuConfig.ROW_BASE64_PUBLIC_KEY;
|
||||
}
|
||||
}
|
||||
|
||||
public void start() {
|
||||
LicenseServerActivity.getInstance().initLicenseServerActivity(this._activity, this, this._activity, SkuConfig.SALT, this._activity.getPackageName(), this.publicKey, Settings.Secure.getString(this._activity.getContentResolver(), "android_id"));
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
LicenseServerActivity.getInstance().destroyLicenseServerActvity();
|
||||
}
|
||||
|
||||
/* JADX WARN: Unreachable blocks removed: 1, instructions: 2 */
|
||||
@Override // com.eamobile.licensing.ILicenseServerActivityCallback
|
||||
public void onLicenseResultStart() {
|
||||
GameActivityMain gameActivityMain = this._activity;
|
||||
LicenseServerActivity.getInstance().LastCheckPointCheck();
|
||||
GameActivityMain gameActivityMain2 = this._activity;
|
||||
gameActivityMain.onResult("GOOGL_DRM", -1);
|
||||
LicenseServerActivity.getInstance().destroyLicenseServerActvity();
|
||||
}
|
||||
|
||||
@Override // com.eamobile.licensing.ILicenseServerActivityCallback
|
||||
public void onLicenseResultEnd() {
|
||||
GameActivityMain gameActivityMain = this._activity;
|
||||
GameActivityMain gameActivityMain2 = this._activity;
|
||||
gameActivityMain.onResult("GOOGL_DRM", 0);
|
||||
LicenseServerActivity.getInstance().destroyLicenseServerActvity();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.ea.ironmonkey;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class Log {
|
||||
private static boolean enable;
|
||||
|
||||
public static void setEnable(boolean z) {
|
||||
enable = z;
|
||||
}
|
||||
|
||||
public static void i(String str, String str2) {
|
||||
if (enable) {
|
||||
android.util.Log.i(str, str2);
|
||||
}
|
||||
}
|
||||
|
||||
public static void e(String str, String str2) {
|
||||
if (enable) {
|
||||
android.util.Log.e(str, str2);
|
||||
}
|
||||
}
|
||||
|
||||
public static void w(String str, String str2) {
|
||||
if (enable) {
|
||||
android.util.Log.w(str, str2);
|
||||
}
|
||||
}
|
||||
|
||||
public static void d(String str, String str2) {
|
||||
if (enable) {
|
||||
android.util.Log.d(str, str2);
|
||||
}
|
||||
}
|
||||
|
||||
public static void v(String str, String str2) {
|
||||
if (enable) {
|
||||
android.util.Log.v(str, str2);
|
||||
}
|
||||
}
|
||||
|
||||
public static void e(String str, String str2, Exception exc) {
|
||||
if (enable) {
|
||||
android.util.Log.e(str, str2, exc);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.ea.ironmonkey;
|
||||
|
||||
import com.bda.controller.ControllerListener;
|
||||
import com.bda.controller.KeyEvent;
|
||||
import com.bda.controller.MotionEvent;
|
||||
import com.bda.controller.StateEvent;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class MogaController implements ControllerListener {
|
||||
native void nativeOnKeyEvent(KeyEvent keyEvent);
|
||||
|
||||
native void nativeOnMotionEvent(MotionEvent motionEvent);
|
||||
|
||||
native void nativeOnStateEvent(StateEvent stateEvent);
|
||||
|
||||
@Override // com.bda.controller.ControllerListener
|
||||
public void onKeyEvent(KeyEvent keyEvent) {
|
||||
nativeOnKeyEvent(keyEvent);
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.ControllerListener
|
||||
public void onMotionEvent(MotionEvent motionEvent) {
|
||||
nativeOnMotionEvent(motionEvent);
|
||||
}
|
||||
|
||||
@Override // com.bda.controller.ControllerListener
|
||||
public void onStateEvent(StateEvent stateEvent) {
|
||||
nativeOnStateEvent(stateEvent);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,489 @@
|
||||
package com.ea.ironmonkey;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Messenger;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import com.ea.games.nfs13_row.R;
|
||||
import com.google.android.vending.expansion.downloader.DownloadProgressInfo;
|
||||
import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller;
|
||||
import com.google.android.vending.expansion.downloader.DownloaderServiceMarshaller;
|
||||
import com.google.android.vending.expansion.downloader.Helpers;
|
||||
import com.google.android.vending.expansion.downloader.IDownloaderClient;
|
||||
import com.google.android.vending.expansion.downloader.IDownloaderService;
|
||||
import com.google.android.vending.expansion.downloader.IStub;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ObbActivity extends Activity implements IDownloaderClient {
|
||||
static final String LOGTAG = "ObbActivity";
|
||||
static final int NOTIFICATION_ID = LOGTAG.hashCode();
|
||||
public static String PACKAGE_NAME;
|
||||
private View RLayout;
|
||||
private Button mCancel;
|
||||
private IStub mDownloaderClientStub;
|
||||
private TextView mMessageText;
|
||||
private View mMessageView;
|
||||
private Button mOK;
|
||||
private Button mPause;
|
||||
private TextView mProgressText;
|
||||
private TextView mProgressTextSmall;
|
||||
private View mProgressView;
|
||||
private IDownloaderService mRemoteService;
|
||||
private boolean mShowingMessage;
|
||||
private int mState;
|
||||
Bundle m_savedInstanceState;
|
||||
NotificationManager myNotificationManager;
|
||||
private boolean isFirstTime3GCheck = true;
|
||||
private boolean pausedFor3GCheck = false;
|
||||
private ProgressBar mProgressBar = null;
|
||||
private long m_TotalDownloadSize = 0;
|
||||
private boolean mIsDownloading = false;
|
||||
public ObbActivity mInstance = null;
|
||||
private boolean mhasFocus = false;
|
||||
private boolean ENABLE_LOG = true;
|
||||
private final Runnable HideSystemKeys = new Runnable() { // from class: com.ea.ironmonkey.ObbActivity.6
|
||||
@Override // java.lang.Runnable
|
||||
@TargetApi(18)
|
||||
public void run() {
|
||||
if (ObbActivity.this.isAtLeastAPI(19)) {
|
||||
ObbActivity.this.getWindow().getDecorView().setSystemUiVisibility(5894);
|
||||
} else {
|
||||
if (!ObbActivity.this.isAtLeastAPI(14) || (ObbActivity.this.getWindow().getDecorView().getSystemUiVisibility() & 1) == 1) {
|
||||
return;
|
||||
}
|
||||
ObbActivity.this.getWindow().getDecorView().setSystemUiVisibility(1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public void setUpNotification() {
|
||||
}
|
||||
|
||||
public void startGameActivity() {
|
||||
try {
|
||||
startActivity(new Intent(this, (Class<?>) GameActivityMain.class));
|
||||
finish();
|
||||
} catch (Exception e) {
|
||||
logError(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
private void log(String str) {
|
||||
if (this.ENABLE_LOG) {
|
||||
android.util.Log.d(LOGTAG, str);
|
||||
}
|
||||
}
|
||||
|
||||
private void logError(String str) {
|
||||
if (this.ENABLE_LOG) {
|
||||
android.util.Log.e(LOGTAG, str);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onCreate(Bundle bundle) {
|
||||
requestWindowFeature(1);
|
||||
super.onCreate(bundle);
|
||||
log("................onCreate of ObbActivity .............");
|
||||
getWindow().setFlags(1024, 1024);
|
||||
getWindow().addFlags(128);
|
||||
this.mInstance = this;
|
||||
setupUI();
|
||||
checkAndDownloadFilesIfNeeded();
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onStart() {
|
||||
log("obbactivity onStart called ");
|
||||
super.onStart();
|
||||
if (this.mDownloaderClientStub != null) {
|
||||
this.mDownloaderClientStub.connect(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
log("obbactivity onResume called ");
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
log("obbactivity on Pause called");
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onStop() {
|
||||
log("obbactivity onStop called");
|
||||
if (this.mDownloaderClientStub != null) {
|
||||
log("..... disconnected the client stub .....");
|
||||
this.mDownloaderClientStub.disconnect(this);
|
||||
}
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
log("obbactivity on Destroy called ");
|
||||
}
|
||||
|
||||
private void doTerminate(String str) {
|
||||
new AlertDialog.Builder(this.mInstance).setMessage(str).setPositiveButton("Ok", new DialogInterface.OnClickListener() { // from class: com.ea.ironmonkey.ObbActivity.1
|
||||
@Override // android.content.DialogInterface.OnClickListener
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
ObbActivity.this.mInstance.finish();
|
||||
System.exit(0);
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
|
||||
public void checkAndDownloadFilesIfNeeded() {
|
||||
log("obbactivity checkAndDownloadFilesIfNeeded called ");
|
||||
if (expansionFilesDelivered(true)) {
|
||||
log("................Main.obb present and hence launching Game Activity................");
|
||||
startGameActivity();
|
||||
return;
|
||||
}
|
||||
log("................ Expansion files were not delivered ................");
|
||||
this.mDownloaderClientStub = DownloaderClientMarshaller.CreateStub(this, DownloaderService.class);
|
||||
startDownload();
|
||||
if (this.mIsDownloading) {
|
||||
return;
|
||||
}
|
||||
startGameActivity();
|
||||
}
|
||||
|
||||
public void setupUI() {
|
||||
setContentView(R.layout.downloader);
|
||||
this.mProgressBar = (ProgressBar) findViewById(R.id.progressBar);
|
||||
this.mProgressText = (TextView) findViewById(R.id.statusText);
|
||||
this.mProgressTextSmall = (TextView) findViewById(R.id.progressText);
|
||||
this.mMessageText = (TextView) findViewById(R.id.messageText);
|
||||
this.mMessageView = findViewById(R.id.messageView);
|
||||
this.mProgressView = findViewById(R.id.progressView);
|
||||
this.mPause = (Button) findViewById(R.id.pauseButton);
|
||||
this.mOK = (Button) findViewById(R.id.okButton);
|
||||
this.mCancel = (Button) findViewById(R.id.cancelButton);
|
||||
this.mOK.setOnClickListener(new View.OnClickListener() { // from class: com.ea.ironmonkey.ObbActivity.2
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
if (ObbActivity.this.mState == 9 || ObbActivity.this.mState == 8) {
|
||||
ObbActivity.this.mRemoteService.setDownloadFlags(1);
|
||||
}
|
||||
if (ObbActivity.this.mRemoteService != null) {
|
||||
ObbActivity.this.mRemoteService.requestContinueDownload();
|
||||
}
|
||||
}
|
||||
});
|
||||
this.mPause.setOnClickListener(new View.OnClickListener() { // from class: com.ea.ironmonkey.ObbActivity.3
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
if (ObbActivity.this.mRemoteService == null) {
|
||||
return;
|
||||
}
|
||||
if (7 == ObbActivity.this.mState) {
|
||||
ObbActivity.this.mRemoteService.requestContinueDownload();
|
||||
ObbActivity.this.mPause.setText(R.string.downloader_Pause);
|
||||
} else {
|
||||
ObbActivity.this.mRemoteService.requestPauseDownload();
|
||||
}
|
||||
}
|
||||
});
|
||||
this.mCancel.setOnClickListener(new View.OnClickListener() { // from class: com.ea.ironmonkey.ObbActivity.4
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
if (ObbActivity.this.mRemoteService != null) {
|
||||
ObbActivity.this.mRemoteService.requestAbortDownload();
|
||||
}
|
||||
ObbActivity.this.finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // com.google.android.vending.expansion.downloader.IDownloaderClient
|
||||
public void onDownloadProgress(DownloadProgressInfo downloadProgressInfo) {
|
||||
log("Download Progress ...........!");
|
||||
if (this.isFirstTime3GCheck) {
|
||||
try {
|
||||
if (((ConnectivityManager) getSystemService("connectivity")).getNetworkInfo(0).isConnectedOrConnecting()) {
|
||||
this.isFirstTime3GCheck = false;
|
||||
if (this.mRemoteService != null) {
|
||||
this.pausedFor3GCheck = true;
|
||||
this.mRemoteService.requestPauseDownload();
|
||||
showMessage(getString(R.string.downloader_Confirm3GNetwork), R.string.downloader_Continue, R.string.downloader_Quit);
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (Exception unused) {
|
||||
logError(".............................error at 3G check.............................");
|
||||
this.isFirstTime3GCheck = false;
|
||||
this.pausedFor3GCheck = false;
|
||||
}
|
||||
}
|
||||
if (this.m_TotalDownloadSize == 0) {
|
||||
this.m_TotalDownloadSize = downloadProgressInfo.mOverallTotal / 1048576;
|
||||
}
|
||||
this.mProgressBar.setMax((int) (downloadProgressInfo.mOverallTotal >> 8));
|
||||
this.mProgressBar.setProgress((int) (downloadProgressInfo.mOverallProgress >> 8));
|
||||
this.mProgressTextSmall.setText((downloadProgressInfo.mOverallProgress / 1048576) + " MB/ " + this.m_TotalDownloadSize + " MB");
|
||||
int parseInt = Integer.parseInt(Helpers.getDownloadProgressPercent(downloadProgressInfo.mOverallProgress, downloadProgressInfo.mOverallTotal).replaceAll("[\\D]", ""));
|
||||
if (parseInt >= 0 && parseInt < 25) {
|
||||
log("Download Progress 0 .. 25");
|
||||
this.mProgressText.setText(R.string.text_0_24);
|
||||
return;
|
||||
}
|
||||
if (parseInt >= 25 && parseInt < 50) {
|
||||
log("Download Progress 25 .. 49");
|
||||
this.mProgressText.setText(R.string.text_25_49);
|
||||
return;
|
||||
}
|
||||
if (parseInt >= 50 && parseInt < 75) {
|
||||
log("Download Progress 50 .. 75");
|
||||
this.mProgressText.setText(R.string.text_50_74);
|
||||
} else if (parseInt >= 75 && parseInt < 95) {
|
||||
log("Download Progress 75 .. 95");
|
||||
this.mProgressText.setText(R.string.text_75_99);
|
||||
} else {
|
||||
log("Download Progress 100 !");
|
||||
this.mProgressText.setText(R.string.text_100);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.google.android.vending.expansion.downloader.IDownloaderClient
|
||||
public void onDownloadStateChanged(int i) {
|
||||
if (this.mState != i) {
|
||||
log("onDownloadStateChanged newstate = " + i);
|
||||
this.mState = i;
|
||||
this.mProgressText.setText(Helpers.getDownloaderStringResourceIDFromState(i));
|
||||
boolean z = false;
|
||||
switch (i) {
|
||||
case 1:
|
||||
log(".............................STATE_IDLE.............................");
|
||||
hideMessage();
|
||||
z = true;
|
||||
this.mProgressBar.setIndeterminate(z);
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
log(".............................STATE_CONNECTING/STATE_FETCHING_URL.............................");
|
||||
hideMessage();
|
||||
z = true;
|
||||
this.mProgressBar.setIndeterminate(z);
|
||||
break;
|
||||
case 4:
|
||||
log(".............................STATE_DOWNLOADING.............................");
|
||||
hideMessage();
|
||||
this.mProgressBar.setIndeterminate(z);
|
||||
break;
|
||||
case 5:
|
||||
log(".............................STATE_COMPLETED.............................");
|
||||
setUpNotification();
|
||||
this.mProgressTextSmall.setText(this.m_TotalDownloadSize + "/" + this.m_TotalDownloadSize + " MBs");
|
||||
this.mProgressText.setText(R.string.text_100);
|
||||
this.mProgressBar.setMax(1);
|
||||
this.mProgressBar.setProgress(1);
|
||||
disablePauseButton();
|
||||
hideMessage();
|
||||
this.mIsDownloading = false;
|
||||
startGameActivity();
|
||||
break;
|
||||
case 6:
|
||||
case 10:
|
||||
case 11:
|
||||
case 13:
|
||||
case 17:
|
||||
default:
|
||||
hideMessage();
|
||||
z = true;
|
||||
this.mProgressBar.setIndeterminate(z);
|
||||
break;
|
||||
case 7:
|
||||
log(".............................STATE_PAUSED_BY_REQUEST.............................");
|
||||
this.mPause.setText(R.string.downloader_Resume);
|
||||
if (!this.pausedFor3GCheck) {
|
||||
hideMessage();
|
||||
} else {
|
||||
this.pausedFor3GCheck = false;
|
||||
}
|
||||
this.mProgressBar.setIndeterminate(z);
|
||||
break;
|
||||
case 8:
|
||||
case 9:
|
||||
log(".............................STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION.............................");
|
||||
try {
|
||||
if (((ConnectivityManager) getSystemService("connectivity")).getNetworkInfo(0).isConnectedOrConnecting()) {
|
||||
this.isFirstTime3GCheck = false;
|
||||
if (this.mRemoteService != null) {
|
||||
showMessage(getString(R.string.downloader_Confirm3GNetwork), R.string.downloader_Continue, R.string.downloader_Quit);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
showMessage(getString(Helpers.getDownloaderStringResourceIDFromState(i)), R.string.downloader_Retry, R.string.downloader_Quit);
|
||||
}
|
||||
} catch (Exception unused) {
|
||||
this.isFirstTime3GCheck = false;
|
||||
logError(".............................error at 3G check.............................");
|
||||
showMessage(getString(Helpers.getDownloaderStringResourceIDFromState(i)), R.string.downloader_Retry, R.string.downloader_Quit);
|
||||
}
|
||||
this.mProgressBar.setIndeterminate(z);
|
||||
break;
|
||||
case 12:
|
||||
case 14:
|
||||
log("............................STATE_PAUSED_ROAMING/STATE_PAUSED_SDCARD_UNAVAILABLE..............................");
|
||||
showMessage(getString(Helpers.getDownloaderStringResourceIDFromState(i)), R.string.downloader_Retry, R.string.downloader_Quit);
|
||||
this.mProgressBar.setIndeterminate(z);
|
||||
break;
|
||||
case 15:
|
||||
log(".............................License check failed.............................");
|
||||
showMessage(getString(R.string.license_failed), R.string.downloader_Retry, R.string.downloader_Quit);
|
||||
this.mProgressBar.setIndeterminate(z);
|
||||
break;
|
||||
case 16:
|
||||
case 18:
|
||||
case 19:
|
||||
log(".............................STATE_FAILED.............................");
|
||||
showMessage(getString(Helpers.getDownloaderStringResourceIDFromState(i)), R.string.downloader_Retry, R.string.downloader_Quit);
|
||||
this.mProgressBar.setIndeterminate(z);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.google.android.vending.expansion.downloader.IDownloaderClient
|
||||
public void onServiceConnected(Messenger messenger) {
|
||||
this.mRemoteService = DownloaderServiceMarshaller.CreateProxy(messenger);
|
||||
this.mRemoteService.onClientUpdated(this.mDownloaderClientStub.getMessenger());
|
||||
log("............................. onServiceConnected! .............................");
|
||||
}
|
||||
|
||||
boolean expansionFilesDelivered(boolean z) {
|
||||
String expansionAPKFileName = Helpers.getExpansionAPKFileName(this, z, getVersionCode());
|
||||
log("expansionFilesDelivered ... " + expansionAPKFileName + ".............................");
|
||||
long j = 0;
|
||||
try {
|
||||
InputStream open = getResources().getAssets().open("obb.size");
|
||||
if (open != null) {
|
||||
try {
|
||||
j = Long.parseLong(new BufferedReader(new InputStreamReader(open)).readLine());
|
||||
} catch (NumberFormatException e) {
|
||||
logError(e.getMessage());
|
||||
}
|
||||
open.close();
|
||||
}
|
||||
} catch (IOException e2) {
|
||||
logError(e2.getMessage());
|
||||
}
|
||||
log("checking file " + expansionAPKFileName + " of expected size bytes " + Long.toString(j));
|
||||
if (!Helpers.doesFileExist(this, expansionAPKFileName, j, false)) {
|
||||
log("file " + expansionAPKFileName + "of expected size bytes " + j + "was NOT FOUND");
|
||||
return false;
|
||||
}
|
||||
log("EXPANSION FILE DELIVERED!");
|
||||
return true;
|
||||
}
|
||||
|
||||
private void startDownload() {
|
||||
try {
|
||||
Intent intent = new Intent(this, (Class<?>) ObbActivity.class);
|
||||
intent.setFlags(335544320);
|
||||
if (DownloaderClientMarshaller.startDownloadServiceIfRequired(this, PendingIntent.getActivity(this, 0, intent, 134217728), (Class<?>) DownloaderService.class) != 0) {
|
||||
log(".............................Should start downloading!.............................");
|
||||
this.mIsDownloading = true;
|
||||
setRequestedOrientation(0);
|
||||
return;
|
||||
}
|
||||
log(".............................No download required!.............................");
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
logError(".............................Cannot find package " + e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public void showMessage(String str, int i, int i2) {
|
||||
if (!this.mShowingMessage) {
|
||||
this.mMessageView.setVisibility(0);
|
||||
this.mProgressView.setVisibility(8);
|
||||
log("SHOW MESSAGE " + str + " b1: " + i + " b2: " + i2);
|
||||
this.mShowingMessage = true;
|
||||
}
|
||||
this.mMessageText.setText(str);
|
||||
this.mOK.setText(i);
|
||||
this.mCancel.setText(i2);
|
||||
}
|
||||
|
||||
public void hideMessage() {
|
||||
if (this.mShowingMessage) {
|
||||
this.mMessageView.setVisibility(8);
|
||||
this.mProgressView.setVisibility(0);
|
||||
this.mShowingMessage = false;
|
||||
}
|
||||
}
|
||||
|
||||
public int getVersionCode() {
|
||||
try {
|
||||
return getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
logError(".............................Cannot read value in manifest. Expected android:versionCode.............................");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void disablePauseButton() {
|
||||
this.mPause.setClickable(false);
|
||||
}
|
||||
|
||||
@TargetApi(18)
|
||||
private void setupSystemUiVisibility() {
|
||||
if (isAtLeastAPI(19)) {
|
||||
getWindow().addFlags(33554432);
|
||||
getWindow().addFlags(134217728);
|
||||
}
|
||||
if (isAtLeastAPI(14)) {
|
||||
getWindow().getDecorView().setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() { // from class: com.ea.ironmonkey.ObbActivity.5
|
||||
@Override // android.view.View.OnSystemUiVisibilityChangeListener
|
||||
public void onSystemUiVisibilityChange(int i) {
|
||||
if (ObbActivity.this.mhasFocus) {
|
||||
ObbActivity.this.onSystemUiVisibilityChanged();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void onSystemUiVisibilityChanged() {
|
||||
((LinearLayout) findViewById(R.id.OBBLayout)).postDelayed(this.HideSystemKeys, 1000L);
|
||||
}
|
||||
|
||||
public boolean isAtLeastAPI(int i) {
|
||||
return Build.VERSION.SDK_INT >= i;
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.Window.Callback
|
||||
public void onWindowFocusChanged(boolean z) {
|
||||
log("................onWindowFocusChanged to ............." + z);
|
||||
super.onWindowFocusChanged(z);
|
||||
this.mhasFocus = z;
|
||||
if (this.mhasFocus) {
|
||||
onSystemUiVisibilityChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ea.ironmonkey;
|
||||
|
||||
import android.content.Context;
|
||||
import com.google.android.vending.expansion.downloader.Helpers;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class ObbHelper {
|
||||
ObbHelper() {
|
||||
}
|
||||
|
||||
public static String getObbFileName(Context context, int i) {
|
||||
return Helpers.getExpansionAPKFileName(context, true, i);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.ea.ironmonkey;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.ActivityCompat;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.view.KeyEvent;
|
||||
import com.ea.games.nfs13_row.R;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class PermissionsActivity extends Activity {
|
||||
private static final int PERMISSIONS_REQUEST = 3;
|
||||
|
||||
protected void onCreate() {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
checkPermissions();
|
||||
} else {
|
||||
initActivity();
|
||||
}
|
||||
}
|
||||
|
||||
public void checkPermissions() {
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
if (ContextCompat.checkSelfPermission(this, "android.permission.WRITE_EXTERNAL_STORAGE") != 0) {
|
||||
if (ActivityCompat.shouldShowRequestPermissionRationale(this, "android.permission.WRITE_EXTERNAL_STORAGE")) {
|
||||
showPermissionDialog(false);
|
||||
return;
|
||||
} else {
|
||||
requestSecurityPermissions();
|
||||
return;
|
||||
}
|
||||
}
|
||||
initActivity();
|
||||
return;
|
||||
}
|
||||
initActivity();
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
|
||||
if (i != 3) {
|
||||
return;
|
||||
}
|
||||
if (iArr.length == 1 && iArr[0] == 0) {
|
||||
initActivity();
|
||||
} else {
|
||||
showPermissionDialog(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void showPermissionDialog(final boolean z) {
|
||||
runOnUiThread(new Runnable() { // from class: com.ea.ironmonkey.PermissionsActivity.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setMessage(R.string.STR_PERMISSION_TEXT);
|
||||
builder.setPositiveButton(R.string.STR_PERMISSION_OK, new DialogInterface.OnClickListener() { // from class: com.ea.ironmonkey.PermissionsActivity.1.1
|
||||
@Override // android.content.DialogInterface.OnClickListener
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
if (!z) {
|
||||
PermissionsActivity.this.requestSecurityPermissions();
|
||||
return;
|
||||
}
|
||||
Intent intent = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS", Uri.parse("package:" + PermissionsActivity.this.getPackageName()));
|
||||
intent.addFlags(8388608);
|
||||
PermissionsActivity.this.startActivityForResult(intent, 3);
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(R.string.STR_PERMISSION_CANCEL, new DialogInterface.OnClickListener() { // from class: com.ea.ironmonkey.PermissionsActivity.1.2
|
||||
@Override // android.content.DialogInterface.OnClickListener
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
PermissionsActivity.this.finish();
|
||||
}
|
||||
});
|
||||
AlertDialog create = builder.create();
|
||||
create.setCanceledOnTouchOutside(false);
|
||||
create.setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.ea.ironmonkey.PermissionsActivity.1.3
|
||||
@Override // android.content.DialogInterface.OnKeyListener
|
||||
public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
|
||||
if (i != 4) {
|
||||
return true;
|
||||
}
|
||||
PermissionsActivity.this.finish();
|
||||
dialogInterface.dismiss();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
create.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void requestSecurityPermissions() {
|
||||
ActivityCompat.requestPermissions(this, new String[]{"android.permission.WRITE_EXTERNAL_STORAGE"}, 3);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
onCreate();
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void onActivityResult(int i, int i2, Intent intent) {
|
||||
super.onActivityResult(i, i2, intent);
|
||||
if (i == 3) {
|
||||
if (ContextCompat.checkSelfPermission(this, "android.permission.WRITE_EXTERNAL_STORAGE") == 0) {
|
||||
initActivity();
|
||||
return;
|
||||
} else {
|
||||
showPermissionDialog(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
initActivity();
|
||||
}
|
||||
|
||||
private void initActivity() {
|
||||
try {
|
||||
startActivity(new Intent(this, (Class<?>) ObbActivity.class));
|
||||
finish();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.ea.ironmonkey;
|
||||
|
||||
import android.opengl.GLSurfaceView;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class RunLoop {
|
||||
public static final int STATE_RUNNING = 1;
|
||||
public static final int STATE_STOPPED = 0;
|
||||
private GLSurfaceView glSurfaceView;
|
||||
private int state;
|
||||
|
||||
private native void nativeOnRunLoopTick();
|
||||
|
||||
public RunLoop(GLSurfaceView gLSurfaceView) {
|
||||
this.glSurfaceView = gLSurfaceView;
|
||||
updateRenderMode();
|
||||
}
|
||||
|
||||
public int getState() {
|
||||
return this.state;
|
||||
}
|
||||
|
||||
public void start() {
|
||||
setState(1);
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
setState(0);
|
||||
}
|
||||
|
||||
public void join() {
|
||||
setState(0);
|
||||
}
|
||||
|
||||
private void setState(int i) {
|
||||
this.state = i;
|
||||
updateRenderMode();
|
||||
}
|
||||
|
||||
private void updateRenderMode() {
|
||||
Log.v("RunLoop", "RunLoop.state = " + this.state);
|
||||
switch (this.state) {
|
||||
case 0:
|
||||
this.glSurfaceView.setRenderMode(0);
|
||||
break;
|
||||
case 1:
|
||||
this.glSurfaceView.setRenderMode(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onRunLoopTick() {
|
||||
if (this.state == 1) {
|
||||
nativeOnRunLoopTick();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.ea.ironmonkey;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class SkuConfig {
|
||||
public static final String NA_BASE64_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsPSqZyfa7iZ9DOslXqDVPiyjsIjCCCDsp1x4pcuH9gFiivyVWhIAHrfMdLlg+6UmlbUoSyKwNRUKJA+H5N/L792/PewpOe2yXSvsqtdROJ12O34q8DPC2D7ezL8M/Io3bp9x18u/D5lf2PEQq4uBNEV1W1iK3PtsdWdpmNKMvnPDQXT3vciWdKa1R0g2xRHCXEK2Ft1Tlkx38ejAAmYvpvoP2e8IqnlwH2fz89G5nxnKdmGop1mz4KTZ8REmBCnmTb07fRkSd4N7S64W2zu8lktMUUbGvCmRbt4zE48AzXEWmyHNW+mqx+IUKyK5wHObnDM9RSwKLWsDe++rrGgROQIDAQAB";
|
||||
public static final String ROW_BASE64_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjDe1oWKcLp/Rtm1ezKa9G+fHdqKvWExNR1aYuudU5VGX9gTby6w8UPKLHXeWxuOq2mS2hWxjIXVsOanspXWJbnBaqydpXmNz+0qZ0K6VlEiL7YvVL9KHNpVAck1bz4toLrmrjM6E/RyphBl+3W5+XSGOJ4Z3dabuz/TQdgNlYAr9nd1NlLg8S2Pu1FsFygy79kpwKBDZFUiCTDwzmGgLSetFnOfr0NwC+NnF/bEB6gE3REcdtT0zyFj0SR8ZWIKRvRPu5BYXe9nKguLN0AUvshXm/MjhrxKmRWTjTTKZkax+f3zFut/yq8UDxMwGA15Ex60xkCcELgCcNPBrWdFDtQIDAQAB";
|
||||
public static final byte[] SALT = {13, -1, 23, -45, 11, -28, 56, -1, -14, 24, -12, 98, -13, 49, 11, 15, -27, 93, 86, -24};
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.ea.ironmonkey;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.opengl.GLES20;
|
||||
import android.opengl.GLUtils;
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.nio.FloatBuffer;
|
||||
import javax.microedition.khronos.opengles.GL10;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class SplashScreen {
|
||||
private static final String TAG = "SplashScreen";
|
||||
private static final int floatSize = 4;
|
||||
private Activity _activity;
|
||||
private int _attPosition;
|
||||
private int _attSampler;
|
||||
private int _attTexCoord;
|
||||
private int _fragmentShader;
|
||||
private int _program;
|
||||
private int _vertexShader;
|
||||
private FloatBuffer vBuffer;
|
||||
private final String vShaderStr = "attribute vec4 a_position; \nattribute vec4 a_texCoord; \nvarying vec2 v_texCoord; \nvoid main() \n{ \n gl_Position = a_position; \n v_texCoord = a_texCoord.xy; \n} \n";
|
||||
private final String fShaderStr = "precision highp float; \nvarying vec2 v_texCoord; \nuniform sampler2D s_texture; \nvoid main() \n{ \n gl_FragColor = texture2D( s_texture, v_texCoord );\n} \n";
|
||||
private int[] _textureId = new int[1];
|
||||
|
||||
public SplashScreen(Activity activity) {
|
||||
this._activity = activity;
|
||||
}
|
||||
|
||||
public void init(GL10 gl10, int i, int i2) {
|
||||
Bitmap bitmap;
|
||||
if (!initRenderer()) {
|
||||
destroy(gl10);
|
||||
return;
|
||||
}
|
||||
GLES20.glGetError();
|
||||
GLES20.glGenTextures(1, this._textureId, 0);
|
||||
GLES20.glBindTexture(3553, this._textureId[0]);
|
||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
options.inPreferredConfig = Bitmap.Config.ARGB_4444;
|
||||
try {
|
||||
bitmap = BitmapFactory.decodeStream(this._activity.getAssets().open("splash.png"), null, options);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "loadBitmap ", e);
|
||||
bitmap = null;
|
||||
}
|
||||
GLUtils.texImage2D(3553, 0, bitmap, 0);
|
||||
GLES20.glTexParameterf(3553, 10241, 9729.0f);
|
||||
GLES20.glTexParameterf(3553, 10240, 9729.0f);
|
||||
GLES20.glTexParameterf(3553, 10242, 33071.0f);
|
||||
GLES20.glTexParameterf(3553, 10243, 33071.0f);
|
||||
bitmap.recycle();
|
||||
int glGetError = GLES20.glGetError();
|
||||
if (glGetError != 0) {
|
||||
Log.e(TAG, "Texture Load GLError: " + glGetError);
|
||||
destroy(gl10);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean initRenderer() {
|
||||
this._vertexShader = LoadShader(35633, "attribute vec4 a_position; \nattribute vec4 a_texCoord; \nvarying vec2 v_texCoord; \nvoid main() \n{ \n gl_Position = a_position; \n v_texCoord = a_texCoord.xy; \n} \n");
|
||||
this._fragmentShader = LoadShader(35632, "precision highp float; \nvarying vec2 v_texCoord; \nuniform sampler2D s_texture; \nvoid main() \n{ \n gl_FragColor = texture2D( s_texture, v_texCoord );\n} \n");
|
||||
this._program = GLES20.glCreateProgram();
|
||||
if (this._program == 0 || this._vertexShader == 0 || this._fragmentShader == 0) {
|
||||
Log.e(TAG, "InitRender() - fail\n");
|
||||
return false;
|
||||
}
|
||||
GLES20.glAttachShader(this._program, this._vertexShader);
|
||||
GLES20.glAttachShader(this._program, this._fragmentShader);
|
||||
GLES20.glLinkProgram(this._program);
|
||||
int[] iArr = new int[1];
|
||||
GLES20.glGetProgramiv(this._program, 35714, iArr, 0);
|
||||
if (iArr[0] == 0) {
|
||||
Log.e(TAG, "InitRender() - fail link program");
|
||||
Log.e(TAG, GLES20.glGetProgramInfoLog(this._program));
|
||||
GLES20.glDeleteProgram(this._program);
|
||||
this._program = 0;
|
||||
return false;
|
||||
}
|
||||
this._attPosition = GLES20.glGetAttribLocation(this._program, "a_position");
|
||||
this._attTexCoord = GLES20.glGetAttribLocation(this._program, "a_texCoord");
|
||||
this._attSampler = GLES20.glGetAttribLocation(this._program, "s_texture");
|
||||
return true;
|
||||
}
|
||||
|
||||
private int LoadShader(int i, String str) {
|
||||
int glCreateShader = GLES20.glCreateShader(i);
|
||||
if (glCreateShader == 0) {
|
||||
Log.e(TAG, "LoadShader(" + i + ", " + str + " - create shader fail\n");
|
||||
return 0;
|
||||
}
|
||||
GLES20.glShaderSource(glCreateShader, str);
|
||||
GLES20.glCompileShader(glCreateShader);
|
||||
int[] iArr = new int[1];
|
||||
GLES20.glGetShaderiv(glCreateShader, 35713, iArr, 0);
|
||||
if (iArr[0] != 0) {
|
||||
return glCreateShader;
|
||||
}
|
||||
Log.e(TAG, "LoadShader(" + i + ", " + str + ") - compile shader fail\n");
|
||||
GLES20.glDeleteShader(glCreateShader);
|
||||
Log.e(TAG, GLES20.glGetShaderInfoLog(glCreateShader));
|
||||
return 0;
|
||||
}
|
||||
|
||||
public boolean draw(GL10 gl10, int i, int i2) {
|
||||
float f;
|
||||
if (this._textureId[0] == 0) {
|
||||
return false;
|
||||
}
|
||||
float f2 = 0.8f;
|
||||
if (i > i2) {
|
||||
f2 = (i2 / i) * 0.8f;
|
||||
f = 0.8f;
|
||||
} else {
|
||||
f = (i / i2) * 0.8f;
|
||||
}
|
||||
float f3 = -f2;
|
||||
float f4 = -f;
|
||||
float[][] fArr = {new float[]{f3, f4, 0.0f, 1.0f, f2, f4, 1.0f, 1.0f, f3, f, 0.0f, 0.0f, f2, f, 1.0f, 0.0f}, new float[]{f3, f4, 1.0f, 1.0f, f2, f4, 1.0f, 0.0f, f3, f, 0.0f, 1.0f, f2, f, 0.0f, 0.0f}};
|
||||
this.vBuffer = ByteBuffer.allocateDirect(fArr[0].length * 4).order(ByteOrder.nativeOrder()).asFloatBuffer();
|
||||
if (i < i2) {
|
||||
this.vBuffer.put(fArr[1]);
|
||||
} else {
|
||||
this.vBuffer.put(fArr[0]);
|
||||
}
|
||||
GLES20.glViewport(0, 0, i, i2);
|
||||
GLES20.glUseProgram(this._program);
|
||||
GLES20.glEnable(3553);
|
||||
GLES20.glActiveTexture(33984);
|
||||
GLES20.glBindTexture(3553, this._textureId[0]);
|
||||
GLES20.glUniform1i(this._attSampler, 0);
|
||||
this.vBuffer.position(0);
|
||||
GLES20.glVertexAttribPointer(this._attPosition, 2, 5126, false, 16, (Buffer) this.vBuffer);
|
||||
GLES20.glEnableVertexAttribArray(this._attPosition);
|
||||
this.vBuffer.position(2);
|
||||
GLES20.glVertexAttribPointer(this._attTexCoord, 2, 5126, false, 16, (Buffer) this.vBuffer);
|
||||
GLES20.glEnableVertexAttribArray(this._attTexCoord);
|
||||
GLES20.glDrawArrays(5, 0, 4);
|
||||
GLES20.glDisableVertexAttribArray(this._attPosition);
|
||||
GLES20.glDisableVertexAttribArray(this._attTexCoord);
|
||||
GLES20.glUseProgram(0);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void destroy(GL10 gl10) {
|
||||
if (this._textureId[0] != 0) {
|
||||
GLES20.glDeleteTextures(1, this._textureId, 0);
|
||||
this._textureId[0] = 0;
|
||||
}
|
||||
if (this._program != 0) {
|
||||
GLES20.glDeleteProgram(this._program);
|
||||
this._program = 0;
|
||||
}
|
||||
if (this._vertexShader != 0) {
|
||||
GLES20.glDeleteShader(this._vertexShader);
|
||||
this._vertexShader = 0;
|
||||
}
|
||||
if (this._fragmentShader != 0) {
|
||||
GLES20.glDeleteShader(this._fragmentShader);
|
||||
this._fragmentShader = 0;
|
||||
}
|
||||
if (this.vBuffer != null) {
|
||||
this.vBuffer.clear();
|
||||
this.vBuffer = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
package com.ea.ironmonkey;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import com.ea.games.nfs13_row.R;
|
||||
import java.util.Locale;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class WebActivity extends Activity {
|
||||
public static String m_Language;
|
||||
private static volatile Runnable m_RunnableBuildAndShowHTML;
|
||||
public static String m_URL;
|
||||
public static boolean m_bWorkingState;
|
||||
private Bitmap backButton;
|
||||
private Bitmap backButtonPressed;
|
||||
private ImageView backImage;
|
||||
private String m_PageURL = null;
|
||||
private ProgressBar m_progressBar = null;
|
||||
final Handler progressHandler = new Handler() { // from class: com.ea.ironmonkey.WebActivity.1
|
||||
@Override // android.os.Handler
|
||||
public void handleMessage(Message message) {
|
||||
WebActivity.this.setProgress(message.arg1);
|
||||
WebActivity.this.m_progressBar.setProgress(message.arg1);
|
||||
}
|
||||
};
|
||||
private WebView webview;
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void onCreate(Bundle bundle) {
|
||||
m_bWorkingState = true;
|
||||
super.onCreate(bundle);
|
||||
requestWindowFeature(2);
|
||||
getWindow().setFlags(1024, 1024);
|
||||
setRequestedOrientation(0);
|
||||
requestWindowFeature(1);
|
||||
setProgressBarVisibility(true);
|
||||
setContentView(R.layout.webview);
|
||||
this.webview = (WebView) findViewById(R.id.mainWebView);
|
||||
this.webview.getSettings().setJavaScriptEnabled(true);
|
||||
this.m_progressBar = (ProgressBar) findViewById(R.id.progressBarWeb);
|
||||
this.backButton = BitmapFactory.decodeResource(getResources(), R.drawable.btn_back);
|
||||
this.backButtonPressed = BitmapFactory.decodeResource(getResources(), R.drawable.btn_back_pressed);
|
||||
this.backImage = (ImageView) findViewById(R.id.backButton);
|
||||
this.backImage.setOnTouchListener(new View.OnTouchListener() { // from class: com.ea.ironmonkey.WebActivity.2
|
||||
@Override // android.view.View.OnTouchListener
|
||||
public boolean onTouch(View view, MotionEvent motionEvent) {
|
||||
if (motionEvent.getAction() == 0) {
|
||||
WebActivity.this.backImage.setImageBitmap(WebActivity.this.backButtonPressed);
|
||||
return false;
|
||||
}
|
||||
if (motionEvent.getAction() != 1) {
|
||||
return false;
|
||||
}
|
||||
WebActivity.this.backImage.setImageBitmap(WebActivity.this.backButton);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
this.backImage.setOnClickListener(new View.OnClickListener() { // from class: com.ea.ironmonkey.WebActivity.3
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
WebActivity.m_bWorkingState = false;
|
||||
WebActivity.this.finish();
|
||||
}
|
||||
});
|
||||
Bundle extras = getIntent().getExtras();
|
||||
String string = extras.getString("URL");
|
||||
this.m_PageURL = string;
|
||||
m_URL = string;
|
||||
String string2 = extras.getString("Language");
|
||||
m_Language = string2;
|
||||
if (string2 != null) {
|
||||
try {
|
||||
Configuration configuration = new Configuration(getResources().getConfiguration());
|
||||
configuration.locale = new Locale(string2);
|
||||
((TextView) findViewById(R.id.appName)).setText(new Resources(getResources().getAssets(), getResources().getDisplayMetrics(), configuration).getString(R.string.app_full_name));
|
||||
} catch (Throwable unused) {
|
||||
}
|
||||
}
|
||||
this.webview.setWebChromeClient(new WebChromeClient() { // from class: com.ea.ironmonkey.WebActivity.4
|
||||
@Override // android.webkit.WebChromeClient
|
||||
public void onProgressChanged(WebView webView, int i) {
|
||||
Message obtainMessage = WebActivity.this.progressHandler.obtainMessage();
|
||||
obtainMessage.arg1 = i;
|
||||
WebActivity.this.progressHandler.sendMessage(obtainMessage);
|
||||
}
|
||||
});
|
||||
this.webview.setWebViewClient(new WebViewClient() { // from class: com.ea.ironmonkey.WebActivity.5
|
||||
@Override // android.webkit.WebViewClient
|
||||
public void onPageFinished(WebView webView, String str) {
|
||||
WebActivity.this.m_progressBar.setVisibility(8);
|
||||
}
|
||||
|
||||
@Override // android.webkit.WebViewClient
|
||||
public void onReceivedError(WebView webView, int i, String str, String str2) {
|
||||
Toast.makeText(WebActivity.this, "Error ! " + str, 0).show();
|
||||
}
|
||||
});
|
||||
m_RunnableBuildAndShowHTML = new Runnable() { // from class: com.ea.ironmonkey.WebActivity.6
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
WebActivity.this.BuildAndShowHTML();
|
||||
}
|
||||
};
|
||||
runOnUiThread(m_RunnableBuildAndShowHTML);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void BuildAndShowHTML() {
|
||||
if (this.m_PageURL != null) {
|
||||
this.webview.loadUrl(this.m_PageURL);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.KeyEvent.Callback
|
||||
public boolean onKeyDown(int i, KeyEvent keyEvent) {
|
||||
if (i == 4) {
|
||||
this.backImage.setImageBitmap(this.backButtonPressed);
|
||||
return true;
|
||||
}
|
||||
return super.onKeyDown(i, keyEvent);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.KeyEvent.Callback
|
||||
public boolean onKeyUp(int i, KeyEvent keyEvent) {
|
||||
if (i == 4) {
|
||||
this.backImage.setImageBitmap(this.backButton);
|
||||
m_bWorkingState = false;
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
return super.onKeyUp(i, keyEvent);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ApplicationEnvironment {
|
||||
public static final String COMPONENT_ID = "com.ea.nimble.applicationEnvironment";
|
||||
public static final String NIMBLE_PARAMETER_ANDROID_ID = "androidId";
|
||||
public static final String NIMBLE_PARAMETER_ATTRIBUTION_DATA = "attributionData";
|
||||
public static final String NIMBLE_PARAMETER_COUNTRY_CODE = "countryCode";
|
||||
public static final String NIMBLE_PARAMETER_DEVICE_BRAND = "deviceBrand";
|
||||
public static final String NIMBLE_PARAMETER_DEVICE_CODENAME = "deviceCodename";
|
||||
public static final String NIMBLE_PARAMETER_DEVICE_LANGUAGE = "deviceLanguage";
|
||||
public static final String NIMBLE_PARAMETER_DEVICE_LOCALE = "deviceLocale";
|
||||
public static final String NIMBLE_PARAMETER_DEVICE_MODEL = "deviceModel";
|
||||
public static final String NIMBLE_PARAMETER_FB_ATTR_ID = "fbAttrId";
|
||||
public static final String NIMBLE_PARAMETER_GAID = "gaid";
|
||||
public static final String NIMBLE_PARAMETER_IMEI = "imei";
|
||||
public static final String NIMBLE_PARAMETER_LIMIT_AD_TRACKING = "limitAdTracking";
|
||||
public static final String NIMBLE_PARAMETER_PLATFORM = "platform";
|
||||
public static final String NIMBLE_PARAMETER_SYSTEM_NAME = "systemName";
|
||||
public static final String NIMBLE_PARAMETER_SYSTEM_VERSION = "systemVersion";
|
||||
public static final String NOTIFICATION_AGE_COMPLIANCE_REFRESHED = "nimble.notification.age_compliance_refreshed";
|
||||
|
||||
public static IApplicationEnvironment getComponent() {
|
||||
return BaseCore.getInstance().getApplicationEnvironment();
|
||||
}
|
||||
|
||||
public static Activity getCurrentActivity() {
|
||||
return ApplicationEnvironmentImpl.getCurrentActivity();
|
||||
}
|
||||
|
||||
public static void setCurrentActivity(Activity activity) {
|
||||
ApplicationEnvironmentImpl.setCurrentActivity(activity);
|
||||
}
|
||||
|
||||
public static boolean isMainApplicationRunning() {
|
||||
return ApplicationEnvironmentImpl.isMainApplicationRunning();
|
||||
}
|
||||
|
||||
public static boolean isMainApplicationActive() {
|
||||
return ApplicationEnvironmentImpl.isMainApplicationActive();
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,71 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ApplicationLifecycle {
|
||||
public static final String COMPONENT_ID = "com.ea.nimble.applicationlifecycle";
|
||||
|
||||
public static IApplicationLifecycle getComponent() {
|
||||
return BaseCore.getInstance().getApplicationLifecycle();
|
||||
}
|
||||
|
||||
public static void onActivityCreate(Bundle bundle, Activity activity) {
|
||||
ApplicationEnvironment.setCurrentActivity(activity);
|
||||
getComponent().notifyActivityCreate(bundle, activity);
|
||||
}
|
||||
|
||||
public static void onActivityRestart(Activity activity) {
|
||||
getComponent().notifyActivityRestart(activity);
|
||||
}
|
||||
|
||||
public static void onActivityStart(Activity activity) {
|
||||
getComponent().notifyActivityStart(activity);
|
||||
}
|
||||
|
||||
public static void onActivityRestoreInstanceState(Bundle bundle, Activity activity) {
|
||||
getComponent().notifyActivityRestoreInstanceState(bundle, activity);
|
||||
}
|
||||
|
||||
public static void onActivityPause(Activity activity) {
|
||||
getComponent().notifyActivityPause(activity);
|
||||
}
|
||||
|
||||
public static void onActivityResume(Activity activity) {
|
||||
getComponent().notifyActivityResume(activity);
|
||||
}
|
||||
|
||||
public static void onActivitySaveInstanceState(Bundle bundle, Activity activity) {
|
||||
getComponent().notifyActivitySaveInstanceState(bundle, activity);
|
||||
}
|
||||
|
||||
public static void onActivityStop(Activity activity) {
|
||||
getComponent().notifyActivityStop(activity);
|
||||
}
|
||||
|
||||
public static void onActivityDestroy(Activity activity) {
|
||||
getComponent().notifyActivityDestroy(activity);
|
||||
}
|
||||
|
||||
public static void onActivityResult(int i, int i2, Intent intent, Activity activity) {
|
||||
getComponent().notifyActivityResult(i, i2, intent, activity);
|
||||
}
|
||||
|
||||
public static void onActivityWindowFocusChanged(boolean z, Activity activity) {
|
||||
getComponent().notifyActivityWindowFocusChanged(z, activity);
|
||||
}
|
||||
|
||||
public static void onNewIntent(Intent intent, Activity activity) {
|
||||
getComponent().notifyActivityOnNewIntent(intent, activity);
|
||||
}
|
||||
|
||||
public static boolean onBackPressed() {
|
||||
return getComponent().handleBackPressed();
|
||||
}
|
||||
|
||||
public static void onActivityRetainNonConfigurationInstance() {
|
||||
getComponent().notifyActivityRetainNonConfigurationInstance();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,395 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import com.ea.nimble.IApplicationLifecycle;
|
||||
import com.ea.nimble.Log;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class ApplicationLifecycleImpl extends Component implements IApplicationLifecycle, LogSource {
|
||||
private static final boolean RESTART_ON_CONFIG_CHANGE;
|
||||
private BaseCore m_core;
|
||||
private State m_state = State.INIT;
|
||||
private int m_createdActivityCount = 0;
|
||||
private int m_runningActivityCount = 0;
|
||||
private ArrayList<IApplicationLifecycle.ActivityLifecycleCallbacks> m_activityLifecycleCallbacks = new ArrayList<>();
|
||||
private ArrayList<IApplicationLifecycle.ActivityEventCallbacks> m_activityEventCallbacks = new ArrayList<>();
|
||||
private ArrayList<IApplicationLifecycle.ApplicationLifecycleCallbacks> m_applicationLifecycleCallbacks = new ArrayList<>();
|
||||
|
||||
private enum State {
|
||||
INIT,
|
||||
LAUNCH,
|
||||
RESUME,
|
||||
RUN,
|
||||
PAUSE,
|
||||
SUSPEND,
|
||||
QUIT,
|
||||
CONFIG_CHANGE
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.Component
|
||||
public String getComponentId() {
|
||||
return ApplicationLifecycle.COMPONENT_ID;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.LogSource
|
||||
public String getLogSourceTitle() {
|
||||
return "AppLifecycle";
|
||||
}
|
||||
|
||||
static {
|
||||
RESTART_ON_CONFIG_CHANGE = Build.VERSION.SDK_INT < 11;
|
||||
}
|
||||
|
||||
ApplicationLifecycleImpl(BaseCore baseCore) {
|
||||
this.m_core = baseCore;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.Component
|
||||
protected void teardown() {
|
||||
this.m_activityLifecycleCallbacks.clear();
|
||||
this.m_activityEventCallbacks.clear();
|
||||
this.m_applicationLifecycleCallbacks.clear();
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle
|
||||
public void registerActivityLifecycleCallbacks(IApplicationLifecycle.ActivityLifecycleCallbacks activityLifecycleCallbacks) {
|
||||
this.m_activityLifecycleCallbacks.add(activityLifecycleCallbacks);
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle
|
||||
public void unregisterActivityLifecycleCallbacks(IApplicationLifecycle.ActivityLifecycleCallbacks activityLifecycleCallbacks) {
|
||||
this.m_activityLifecycleCallbacks.remove(activityLifecycleCallbacks);
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle
|
||||
public void registerActivityEventCallbacks(IApplicationLifecycle.ActivityEventCallbacks activityEventCallbacks) {
|
||||
this.m_activityEventCallbacks.add(activityEventCallbacks);
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle
|
||||
public void unregisterActivityEventCallbacks(IApplicationLifecycle.ActivityEventCallbacks activityEventCallbacks) {
|
||||
this.m_activityEventCallbacks.remove(activityEventCallbacks);
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle
|
||||
public void registerApplicationLifecycleCallbacks(IApplicationLifecycle.ApplicationLifecycleCallbacks applicationLifecycleCallbacks) {
|
||||
this.m_applicationLifecycleCallbacks.add(applicationLifecycleCallbacks);
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle
|
||||
public void unregisterApplicationLifecycleCallbacks(IApplicationLifecycle.ApplicationLifecycleCallbacks applicationLifecycleCallbacks) {
|
||||
this.m_applicationLifecycleCallbacks.remove(applicationLifecycleCallbacks);
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle
|
||||
public void notifyActivityCreate(Bundle bundle, Activity activity) {
|
||||
Log.Helper.LOGV(this, "Activity %s CREATE", activity.getLocalClassName());
|
||||
if (this.m_state == State.INIT || this.m_state == State.QUIT) {
|
||||
Log.Helper.LOGD(this, "Activity created clearly with state %s", this.m_state.toString());
|
||||
this.m_core.onApplicationLaunch(activity.getIntent());
|
||||
Iterator<IApplicationLifecycle.ActivityLifecycleCallbacks> it = this.m_activityLifecycleCallbacks.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().onActivityCreated(activity, bundle);
|
||||
}
|
||||
notifyApplicationLaunch(activity.getIntent());
|
||||
this.m_createdActivityCount = 1;
|
||||
this.m_state = State.LAUNCH;
|
||||
if (this.m_runningActivityCount != 0) {
|
||||
Log.Helper.LOGE(this, "Invalid running acitivity count %d", Integer.valueOf(this.m_runningActivityCount));
|
||||
this.m_runningActivityCount = 0;
|
||||
}
|
||||
} else if (this.m_state == State.CONFIG_CHANGE) {
|
||||
if (ApplicationEnvironment.getCurrentActivity() != activity) {
|
||||
Log.Helper.LOGE(this, "Activity created with state CONFIG_CHANGE but different activity %s and %s", ApplicationEnvironment.getCurrentActivity().getLocalClassName(), activity.getLocalClassName());
|
||||
} else {
|
||||
Log.Helper.LOGD(this, "Activity created from CONFIG_CHANGE, activity configuration changed", new Object[0]);
|
||||
}
|
||||
if (RESTART_ON_CONFIG_CHANGE) {
|
||||
this.m_core.onApplicationResume();
|
||||
}
|
||||
Iterator<IApplicationLifecycle.ActivityLifecycleCallbacks> it2 = this.m_activityLifecycleCallbacks.iterator();
|
||||
while (it2.hasNext()) {
|
||||
it2.next().onActivityCreated(activity, bundle);
|
||||
}
|
||||
if (this.m_runningActivityCount != 0) {
|
||||
Log.Helper.LOGE(this, "Invalid running acitivity count %d", Integer.valueOf(this.m_runningActivityCount));
|
||||
this.m_runningActivityCount = 0;
|
||||
}
|
||||
} else if (this.m_state == State.PAUSE) {
|
||||
Log.Helper.LOGD(this, "Activity created from PAUSE, normal activity switch", new Object[0]);
|
||||
Iterator<IApplicationLifecycle.ActivityLifecycleCallbacks> it3 = this.m_activityLifecycleCallbacks.iterator();
|
||||
while (it3.hasNext()) {
|
||||
it3.next().onActivityCreated(activity, bundle);
|
||||
}
|
||||
this.m_createdActivityCount++;
|
||||
} else if (this.m_state == State.SUSPEND) {
|
||||
Log.Helper.LOGD(this, "Activity created from SUSPEND, external activity switch; (new) app restart", new Object[0]);
|
||||
this.m_core.onApplicationResume();
|
||||
this.m_state = State.RESUME;
|
||||
Iterator<IApplicationLifecycle.ActivityLifecycleCallbacks> it4 = this.m_activityLifecycleCallbacks.iterator();
|
||||
while (it4.hasNext()) {
|
||||
it4.next().onActivityCreated(activity, bundle);
|
||||
}
|
||||
this.m_createdActivityCount++;
|
||||
if (this.m_runningActivityCount != 0) {
|
||||
Log.Helper.LOGE(this, "Invalid running acitivity count %d", Integer.valueOf(this.m_runningActivityCount));
|
||||
this.m_runningActivityCount = 0;
|
||||
}
|
||||
} else {
|
||||
Log.Helper.LOGE(this, "Activity created with %s state, shouldn't happen", this.m_state.toString());
|
||||
}
|
||||
Log.Helper.LOGV(this, "State after created %s (%d, %d)", this.m_state.toString(), Integer.valueOf(this.m_createdActivityCount), Integer.valueOf(this.m_runningActivityCount));
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle
|
||||
public void notifyActivityRestart(Activity activity) {
|
||||
Log.Helper.LOGV(this, "Activity %s RESTART", activity.getLocalClassName());
|
||||
ApplicationEnvironment.setCurrentActivity(activity);
|
||||
if (this.m_state == State.PAUSE) {
|
||||
Log.Helper.LOGD(this, "Activity restart from PAUSE, normal activity switch", new Object[0]);
|
||||
} else if (this.m_state == State.SUSPEND) {
|
||||
this.m_core.onApplicationResume();
|
||||
this.m_state = State.RESUME;
|
||||
Log.Helper.LOGD(this, "Activity restart from SUSPEND, external activity switch; (new) app restart", new Object[0]);
|
||||
} else {
|
||||
Log.Helper.LOGE(this, "Activity restart with invalid state %s", this.m_state.toString());
|
||||
}
|
||||
Log.Helper.LOGV(this, "State after restart %s (%d, %d)", this.m_state.toString(), Integer.valueOf(this.m_createdActivityCount), Integer.valueOf(this.m_runningActivityCount));
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle
|
||||
public void notifyActivityStart(Activity activity) {
|
||||
Log.Helper.LOGV(this, "Activity %s START", activity.getLocalClassName());
|
||||
ApplicationEnvironment.setCurrentActivity(activity);
|
||||
if (this.m_state == State.LAUNCH) {
|
||||
this.m_state = State.PAUSE;
|
||||
Log.Helper.LOGD(this, "Activity start with LAUNCH state, normal app start", new Object[0]);
|
||||
} else if (this.m_state == State.RESUME) {
|
||||
Iterator<IApplicationLifecycle.ActivityLifecycleCallbacks> it = this.m_activityLifecycleCallbacks.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().onActivityStarted(activity);
|
||||
}
|
||||
notifyApplicationResume(activity.getIntent());
|
||||
this.m_state = State.PAUSE;
|
||||
Log.Helper.LOGD(this, "Activity start with RESUME state, set to PAUSE", new Object[0]);
|
||||
} else if (this.m_state == State.CONFIG_CHANGE) {
|
||||
Iterator<IApplicationLifecycle.ActivityLifecycleCallbacks> it2 = this.m_activityLifecycleCallbacks.iterator();
|
||||
while (it2.hasNext()) {
|
||||
it2.next().onActivityStarted(activity);
|
||||
}
|
||||
if (RESTART_ON_CONFIG_CHANGE) {
|
||||
notifyApplicationResume(activity.getIntent());
|
||||
}
|
||||
this.m_state = State.PAUSE;
|
||||
Log.Helper.LOGD(this, "Activity start with CONFIG_CHANGE state, set to PAUSE", new Object[0]);
|
||||
} else if (this.m_state == State.PAUSE) {
|
||||
Log.Helper.LOGD(this, "Activity start with PAUSE state, normal activity switch", new Object[0]);
|
||||
} else {
|
||||
Iterator<IApplicationLifecycle.ActivityLifecycleCallbacks> it3 = this.m_activityLifecycleCallbacks.iterator();
|
||||
while (it3.hasNext()) {
|
||||
it3.next().onActivityStarted(activity);
|
||||
}
|
||||
Log.Helper.LOGE(this, "Activity start with invalid state %s", this.m_state.toString());
|
||||
}
|
||||
this.m_runningActivityCount++;
|
||||
Log.Helper.LOGV(this, "State after start %s (%d, %d)", this.m_state.toString(), Integer.valueOf(this.m_createdActivityCount), Integer.valueOf(this.m_runningActivityCount));
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle
|
||||
public void notifyActivityRestoreInstanceState(Bundle bundle, Activity activity) {
|
||||
Log.Helper.LOGV(this, "Activity %s RESTORE_STATE", activity.getLocalClassName());
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle
|
||||
public void notifyActivityResume(Activity activity) {
|
||||
Log.Helper.LOGV(this, "Activity %s RESUME", activity.getLocalClassName());
|
||||
ApplicationEnvironment.setCurrentActivity(activity);
|
||||
Iterator<IApplicationLifecycle.ActivityLifecycleCallbacks> it = this.m_activityLifecycleCallbacks.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().onActivityResumed(activity);
|
||||
}
|
||||
if (this.m_state != State.PAUSE) {
|
||||
Log.Helper.LOGE(this, "Activity resume on invalid state %s", this.m_state.toString());
|
||||
Log.Helper.LOGE(this, "<NOTE>Please double check if the game's activity hooks ApplicationLifecycle.onActivityRestart() correctly.", new Object[0]);
|
||||
}
|
||||
this.m_state = State.RUN;
|
||||
Log.Helper.LOGV(this, "State after resume %s (%d, %d)", this.m_state.toString(), Integer.valueOf(this.m_createdActivityCount), Integer.valueOf(this.m_runningActivityCount));
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle
|
||||
public void notifyActivityPause(Activity activity) {
|
||||
Log.Helper.LOGV(this, "Activity %s PAUSE", activity.getLocalClassName());
|
||||
Iterator<IApplicationLifecycle.ActivityLifecycleCallbacks> it = this.m_activityLifecycleCallbacks.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().onActivityPaused(activity);
|
||||
}
|
||||
if (this.m_state != State.RUN) {
|
||||
Log.Helper.LOGE(this, "Activity pause on invalid state %s", activity.getLocalClassName());
|
||||
}
|
||||
this.m_state = State.PAUSE;
|
||||
Log.Helper.LOGV(this, "State after pause %s (%d, %d)", this.m_state.toString(), Integer.valueOf(this.m_createdActivityCount), Integer.valueOf(this.m_runningActivityCount));
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle
|
||||
public void notifyActivitySaveInstanceState(Bundle bundle, Activity activity) {
|
||||
Log.Helper.LOGV(this, "Activity %s SAVE_STATE", activity.getLocalClassName());
|
||||
Iterator<IApplicationLifecycle.ActivityLifecycleCallbacks> it = this.m_activityLifecycleCallbacks.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().onActivitySaveInstanceState(activity, bundle);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle
|
||||
@SuppressLint({"NewApi"})
|
||||
public void notifyActivityStop(Activity activity) {
|
||||
Log.Helper.LOGV(this, "Activity %s STOP", activity.getLocalClassName());
|
||||
Iterator<IApplicationLifecycle.ActivityLifecycleCallbacks> it = this.m_activityLifecycleCallbacks.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().onActivityStopped(activity);
|
||||
}
|
||||
this.m_runningActivityCount--;
|
||||
if (!RESTART_ON_CONFIG_CHANGE && activity.isChangingConfigurations()) {
|
||||
this.m_state = State.CONFIG_CHANGE;
|
||||
} else if (this.m_runningActivityCount == 0) {
|
||||
if (this.m_state != State.PAUSE && this.m_state != State.SUSPEND) {
|
||||
Log.Helper.LOGW(this, "Interesting case %s, HIGHLIGHT!!", this.m_state);
|
||||
}
|
||||
this.m_state = State.SUSPEND;
|
||||
if (!activity.isFinishing()) {
|
||||
notifyApplicationSuspend();
|
||||
this.m_core.onApplicationSuspend();
|
||||
}
|
||||
} else if (this.m_state == State.PAUSE) {
|
||||
this.m_state = State.SUSPEND;
|
||||
if (!activity.isFinishing()) {
|
||||
Log.Helper.LOGW(this, "running activity count may be messed", new Object[0]);
|
||||
notifyApplicationSuspend();
|
||||
this.m_core.onApplicationSuspend();
|
||||
}
|
||||
} else if (this.m_state != State.RUN) {
|
||||
Log.Helper.LOGE(this, "Activity stop on invalid state %s", this.m_state.toString());
|
||||
}
|
||||
Log.Helper.LOGV(this, "State after stop %s (%d, %d)", this.m_state.toString(), Integer.valueOf(this.m_createdActivityCount), Integer.valueOf(this.m_runningActivityCount));
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle
|
||||
public void notifyActivityDestroy(Activity activity) {
|
||||
Log.Helper.LOGV(this, "Activity %s DESTROY", activity.getLocalClassName());
|
||||
Iterator<IApplicationLifecycle.ActivityLifecycleCallbacks> it = this.m_activityLifecycleCallbacks.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().onActivityDestroyed(activity);
|
||||
}
|
||||
if (this.m_state != State.CONFIG_CHANGE) {
|
||||
if (this.m_state != State.SUSPEND && this.m_state != State.RUN) {
|
||||
Log.Helper.LOGE(this, "Activity destroy on invalid state %s", this.m_state.toString());
|
||||
}
|
||||
this.m_createdActivityCount--;
|
||||
if (this.m_createdActivityCount == 0) {
|
||||
this.m_state = State.QUIT;
|
||||
notifyApplicationQuit();
|
||||
this.m_core.onApplicationQuit();
|
||||
ApplicationEnvironment.setCurrentActivity(null);
|
||||
}
|
||||
}
|
||||
Log.Helper.LOGV(this, "State after destroy %s (%d, %d)", this.m_state.toString(), Integer.valueOf(this.m_createdActivityCount), Integer.valueOf(this.m_runningActivityCount));
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle
|
||||
public void notifyActivityResult(int i, int i2, Intent intent, Activity activity) {
|
||||
Iterator<IApplicationLifecycle.ActivityEventCallbacks> it = this.m_activityEventCallbacks.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().onActivityResult(activity, i, i2, intent);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle
|
||||
public void notifyActivityWindowFocusChanged(boolean z, Activity activity) {
|
||||
Iterator<IApplicationLifecycle.ActivityEventCallbacks> it = this.m_activityEventCallbacks.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().onWindowFocusChanged(z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle
|
||||
public void notifyActivityOnNewIntent(Intent intent, Activity activity) {
|
||||
Iterator<IApplicationLifecycle.ActivityEventCallbacks> it = this.m_activityEventCallbacks.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().onNewIntent(activity, intent);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle
|
||||
public boolean handleBackPressed() {
|
||||
Iterator<IApplicationLifecycle.ActivityEventCallbacks> it = this.m_activityEventCallbacks.iterator();
|
||||
boolean z = true;
|
||||
while (it.hasNext()) {
|
||||
if (!it.next().onBackPressed()) {
|
||||
z = false;
|
||||
}
|
||||
}
|
||||
return z;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle
|
||||
public void notifyActivityRetainNonConfigurationInstance() {
|
||||
Log.Helper.LOGFUNC(this);
|
||||
if (RESTART_ON_CONFIG_CHANGE) {
|
||||
if (this.m_state != State.SUSPEND) {
|
||||
Log.Helper.LOGW(this, "configuration change should happen between onStop() and onDestroy(), but state is %s", this.m_state.toString());
|
||||
}
|
||||
this.m_state = State.CONFIG_CHANGE;
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteConsumedDataFromIntent(Intent intent) {
|
||||
if (intent != null) {
|
||||
if (intent.getData() != null && intent.getDataString().startsWith("ea://socialsharing")) {
|
||||
intent.removeExtra("key");
|
||||
intent.setData(null);
|
||||
}
|
||||
if (intent.getStringExtra("PushNotification") != null) {
|
||||
intent.removeExtra("PushNotification");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void notifyApplicationLaunch(Intent intent) {
|
||||
Log.Helper.LOGFUNC(this);
|
||||
Iterator<IApplicationLifecycle.ApplicationLifecycleCallbacks> it = this.m_applicationLifecycleCallbacks.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().onApplicationLaunch(intent);
|
||||
}
|
||||
deleteConsumedDataFromIntent(intent);
|
||||
}
|
||||
|
||||
private void notifyApplicationSuspend() {
|
||||
Log.Helper.LOGFUNC(this);
|
||||
Iterator<IApplicationLifecycle.ApplicationLifecycleCallbacks> it = this.m_applicationLifecycleCallbacks.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().onApplicationSuspend();
|
||||
}
|
||||
}
|
||||
|
||||
private void notifyApplicationResume(Intent intent) {
|
||||
Log.Helper.LOGFUNC(this);
|
||||
Iterator<IApplicationLifecycle.ApplicationLifecycleCallbacks> it = this.m_applicationLifecycleCallbacks.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().onApplicationResume();
|
||||
}
|
||||
deleteConsumedDataFromIntent(intent);
|
||||
}
|
||||
|
||||
private void notifyApplicationQuit() {
|
||||
Log.Helper.LOGFUNC(this);
|
||||
Iterator<IApplicationLifecycle.ApplicationLifecycleCallbacks> it = this.m_applicationLifecycleCallbacks.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().onApplicationQuit();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class BackgroundNetworkConnection extends NetworkConnection {
|
||||
@Override // com.ea.nimble.NetworkConnection
|
||||
void cancelForAppSuspend() {
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.NetworkConnection, com.ea.nimble.NetworkConnectionHandle
|
||||
public /* bridge */ /* synthetic */ void cancel() {
|
||||
super.cancel();
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.NetworkConnection, com.ea.nimble.NetworkConnectionHandle
|
||||
public /* bridge */ /* synthetic */ NetworkConnectionCallback getCompletionCallback() {
|
||||
return super.getCompletionCallback();
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.NetworkConnection, com.ea.nimble.NetworkConnectionHandle
|
||||
public /* bridge */ /* synthetic */ NetworkConnectionCallback getHeaderCallback() {
|
||||
return super.getHeaderCallback();
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.NetworkConnection, com.ea.nimble.LogSource
|
||||
public /* bridge */ /* synthetic */ String getLogSourceTitle() {
|
||||
return super.getLogSourceTitle();
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.NetworkConnection, com.ea.nimble.NetworkConnectionHandle
|
||||
public /* bridge */ /* synthetic */ NetworkConnectionCallback getProgressCallback() {
|
||||
return super.getProgressCallback();
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.NetworkConnection, com.ea.nimble.NetworkConnectionHandle
|
||||
public /* bridge */ /* synthetic */ HttpRequest getRequest() {
|
||||
return super.getRequest();
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.NetworkConnection, com.ea.nimble.NetworkConnectionHandle
|
||||
public /* bridge */ /* synthetic */ HttpResponse getResponse() {
|
||||
return super.getResponse();
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.NetworkConnection, java.lang.Runnable
|
||||
public /* bridge */ /* synthetic */ void run() {
|
||||
super.run();
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.NetworkConnection, com.ea.nimble.NetworkConnectionHandle
|
||||
public /* bridge */ /* synthetic */ void setCompletionCallback(NetworkConnectionCallback networkConnectionCallback) {
|
||||
super.setCompletionCallback(networkConnectionCallback);
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.NetworkConnection, com.ea.nimble.NetworkConnectionHandle
|
||||
public /* bridge */ /* synthetic */ void setHeaderCallback(NetworkConnectionCallback networkConnectionCallback) {
|
||||
super.setHeaderCallback(networkConnectionCallback);
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.NetworkConnection, com.ea.nimble.NetworkConnectionHandle
|
||||
public /* bridge */ /* synthetic */ void setProgressCallback(NetworkConnectionCallback networkConnectionCallback) {
|
||||
super.setProgressCallback(networkConnectionCallback);
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.NetworkConnection, com.ea.nimble.NetworkConnectionHandle
|
||||
public /* bridge */ /* synthetic */ void waitOn() {
|
||||
super.waitOn();
|
||||
}
|
||||
|
||||
public BackgroundNetworkConnection(NetworkImpl networkImpl, HttpRequest httpRequest, IOperationalTelemetryDispatch iOperationalTelemetryDispatch) {
|
||||
super(networkImpl, httpRequest, iOperationalTelemetryDispatch);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
import com.ea.nimble.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class Base {
|
||||
public static void setupNimble() {
|
||||
Log.Helper.LOGPUBLICFUNCS("Base");
|
||||
BaseCore.getInstance().setup();
|
||||
}
|
||||
|
||||
public static void teardownNimble() {
|
||||
Log.Helper.LOGPUBLICFUNCS("Base");
|
||||
BaseCore.getInstance().teardown();
|
||||
}
|
||||
|
||||
public static void registerComponent(Component component, String str) {
|
||||
Log.Helper.LOGFUNCS("Base");
|
||||
BaseCore.getInstance().getComponentManager().registerComponent(component, str);
|
||||
}
|
||||
|
||||
public static Component getComponent(String str) {
|
||||
Log.Helper.LOGFUNCS("Base");
|
||||
BaseCore activeValidate = BaseCore.getInstance().activeValidate();
|
||||
if (activeValidate == null) {
|
||||
return null;
|
||||
}
|
||||
return activeValidate.getComponentManager().getComponent(str);
|
||||
}
|
||||
|
||||
public static Component[] getComponentList(String str) {
|
||||
Log.Helper.LOGFUNCS("Base");
|
||||
BaseCore activeValidate = BaseCore.getInstance().activeValidate();
|
||||
if (activeValidate == null) {
|
||||
return null;
|
||||
}
|
||||
return activeValidate.getComponentManager().getComponentList(str);
|
||||
}
|
||||
|
||||
public static NimbleConfiguration getConfiguration() {
|
||||
Log.Helper.LOGFUNCS("Base");
|
||||
return BaseCore.getInstance().getConfiguration();
|
||||
}
|
||||
|
||||
public static void restartWithConfiguration(NimbleConfiguration nimbleConfiguration) {
|
||||
Log.Helper.LOGPUBLICFUNCS("Base");
|
||||
BaseCore activeValidate = BaseCore.getInstance().activeValidate();
|
||||
if (activeValidate != null) {
|
||||
activeValidate.restartWithConfiguration(nimbleConfiguration);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,422 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import com.ea.nimble.IApplicationLifecycle;
|
||||
import com.ea.nimble.Log;
|
||||
import com.ea.nimble.bridge.NimbleCppApplicationLifeCycle;
|
||||
import com.ea.nimble.bridge.NimbleCppComponentRegistrar;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class BaseCore implements IApplicationLifecycle.ApplicationLifecycleCallbacks {
|
||||
public static final String NIMBLE_COMPONENT_LIST = "setting::components";
|
||||
public static final String NIMBLE_LOG_SETTING = "setting::log";
|
||||
public static final String NIMBLE_SERVER_CONFIG = "com.ea.nimble.configuration";
|
||||
protected ApplicationEnvironmentImpl m_applicationEnvironment;
|
||||
protected IApplicationLifecycle m_applicationLifecycle;
|
||||
protected ComponentManager m_componentManager;
|
||||
protected NimbleConfiguration m_configuration;
|
||||
protected LogImpl m_log;
|
||||
protected PersistenceServiceImpl m_persistenceService;
|
||||
protected State m_state;
|
||||
public static final String[] NIMBLE_COMPONENTS = {"com.ea.nimble.tracking.Tracking", "com.ea.nimble.tracking.NimbleTrackingSynergyComponent", "com.ea.nimble.tracking.NimbleTrackingS2SComponent", "com.ea.nimble.tracking.TrackingEventWrangler", "com.ea.nimble.identity.NimbleIdentityImpl", "com.ea.nimble.identity.AuthenticatorOrigin", "com.ea.nimble.identity.AuthenticatorFacebook", "com.ea.nimble.identity.AuthenticatorAnonymous", "com.ea.nimble.friends.NimbleFriendsImpl", "com.ea.nimble.friends.NimbleOriginFriendsServiceImpl", "com.ea.nimble.origin.Origin", "com.ea.nimble.Facebook", "com.ea.nimble.NimbleAndroidFacebook", "com.ea.nimble.NimbleAndroidGoogleServiceImpl", "com.ea.nimble.mtx.googleplay.GooglePlay", "com.ea.nimble.mtx.amazon.AmazonStore", "com.ea.nimble.pushtng.PushNotification", NimbleCppApplicationLifeCycle.COMPONENT_ID, NimbleCppComponentRegistrar.COMPONENT_ID};
|
||||
protected static BaseCore s_core = null;
|
||||
protected static boolean s_coreDestroyed = false;
|
||||
|
||||
private enum State {
|
||||
INACTIVE,
|
||||
AUTO_SETUP,
|
||||
MANUAL_SETUP,
|
||||
MANUAL_TEARDOWN,
|
||||
QUITTING,
|
||||
DESTROY,
|
||||
FAKE_DESTROY
|
||||
}
|
||||
|
||||
BaseCore() {
|
||||
}
|
||||
|
||||
private void initialize() {
|
||||
this.m_state = State.INACTIVE;
|
||||
loadConfiguration();
|
||||
this.m_componentManager = new ComponentManager();
|
||||
this.m_applicationLifecycle = new ApplicationLifecycleImpl(this);
|
||||
this.m_applicationEnvironment = new ApplicationEnvironmentImpl(this);
|
||||
this.m_log = (LogImpl) Log.getComponent();
|
||||
this.m_log.connectToCore(this);
|
||||
this.m_persistenceService = new PersistenceServiceImpl();
|
||||
NetworkImpl networkImpl = new NetworkImpl();
|
||||
SynergyEnvironmentImpl synergyEnvironmentImpl = new SynergyEnvironmentImpl(this);
|
||||
SynergyNetworkImpl synergyNetworkImpl = new SynergyNetworkImpl();
|
||||
SynergyIdManagerImpl synergyIdManagerImpl = new SynergyIdManagerImpl();
|
||||
OperationalTelemetryDispatchImpl operationalTelemetryDispatchImpl = new OperationalTelemetryDispatchImpl();
|
||||
NimbleLocalNotificationsImpl nimbleLocalNotificationsImpl = new NimbleLocalNotificationsImpl();
|
||||
this.m_componentManager.registerComponent(this.m_applicationEnvironment, ApplicationEnvironment.COMPONENT_ID);
|
||||
this.m_componentManager.registerComponent(this.m_log, Log.COMPONENT_ID);
|
||||
this.m_componentManager.registerComponent(this.m_persistenceService, PersistenceService.COMPONENT_ID);
|
||||
this.m_componentManager.registerComponent(networkImpl, "com.ea.nimble.network");
|
||||
this.m_componentManager.registerComponent(synergyIdManagerImpl, SynergyIdManager.COMPONENT_ID);
|
||||
this.m_componentManager.registerComponent(synergyEnvironmentImpl, SynergyEnvironment.COMPONENT_ID);
|
||||
this.m_componentManager.registerComponent(synergyNetworkImpl, SynergyNetwork.COMPONENT_ID);
|
||||
this.m_componentManager.registerComponent(operationalTelemetryDispatchImpl, OperationalTelemetryDispatch.COMPONENT_ID);
|
||||
this.m_componentManager.registerComponent(nimbleLocalNotificationsImpl, NimbleLocalNotifications.COMPONENT_ID);
|
||||
for (String str : NIMBLE_COMPONENTS) {
|
||||
try {
|
||||
Method declaredMethod = Class.forName(str).getDeclaredMethod("initialize", new Class[0]);
|
||||
declaredMethod.setAccessible(true);
|
||||
declaredMethod.invoke(null, new Object[0]);
|
||||
} catch (ClassNotFoundException unused) {
|
||||
Log.Helper.LOGD(this, "Component " + str + " not found", new Object[0]);
|
||||
} catch (IllegalAccessException unused2) {
|
||||
Log.Helper.LOGE(this, "Method " + str + ".initialize() is not accessible", new Object[0]);
|
||||
} catch (IllegalArgumentException unused3) {
|
||||
Log.Helper.LOGE(this, "Method " + str + ".initialize() should take no arguments", new Object[0]);
|
||||
} catch (NoSuchMethodException unused4) {
|
||||
Log.Helper.LOGE(this, "No method " + str + ".initialize()", new Object[0]);
|
||||
} catch (NullPointerException unused5) {
|
||||
Log.Helper.LOGE(this, "Method " + str + ".initialize() should be static", new Object[0]);
|
||||
} catch (InvocationTargetException e) {
|
||||
Log.Helper.LOGE(this, "Method " + str + ".initialize() threw an exception", new Object[0]);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
try {
|
||||
if (!isAppSigned(ApplicationEnvironment.getComponent().getApplicationContext())) {
|
||||
android.util.Log.e(Global.NIMBLE_ID, "This application is NOT signed with a valid certificate. MTX may not work correctly with this application");
|
||||
} else {
|
||||
android.util.Log.i(Global.NIMBLE_ID, "This application is signed with a valid certificate.");
|
||||
}
|
||||
} catch (Exception e2) {
|
||||
android.util.Log.e(Global.NIMBLE_ID, String.format("Unable to verify application signature. Message: %s", e2.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
public NimbleConfiguration getConfiguration() {
|
||||
return this.m_configuration;
|
||||
}
|
||||
|
||||
public Map<String, String> getSettings(String str) {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
if (!str.equals(NIMBLE_LOG_SETTING)) {
|
||||
return null;
|
||||
}
|
||||
int identifier = ApplicationEnvironment.getComponent().getApplicationContext().getResources().getIdentifier("nimble_log", "xml", ApplicationEnvironment.getCurrentActivity().getPackageName());
|
||||
if (identifier == 0) {
|
||||
return null;
|
||||
}
|
||||
return Utility.parseXmlFile(identifier);
|
||||
}
|
||||
|
||||
public ComponentManager getComponentManager() {
|
||||
return this.m_componentManager;
|
||||
}
|
||||
|
||||
public ILog getLog() {
|
||||
return this.m_log;
|
||||
}
|
||||
|
||||
public IApplicationEnvironment getApplicationEnvironment() {
|
||||
return this.m_applicationEnvironment;
|
||||
}
|
||||
|
||||
public IApplicationLifecycle getApplicationLifecycle() {
|
||||
return this.m_applicationLifecycle;
|
||||
}
|
||||
|
||||
public IPersistenceService getPersistenceService() {
|
||||
return this.m_persistenceService;
|
||||
}
|
||||
|
||||
public static synchronized BaseCore getInstance() {
|
||||
BaseCore baseCore;
|
||||
synchronized (BaseCore.class) {
|
||||
if (s_core == null) {
|
||||
if (s_coreDestroyed) {
|
||||
throw new AssertionError("Cannot revive destroyed BaseCore, please utilizesetupNimble() and tearDownNimble() explicitly to extend longevity to match your expectation.");
|
||||
}
|
||||
android.util.Log.d(Global.NIMBLE_ID, String.format("NIMBLE VERSION %s (Build %s)", Global.NIMBLE_RELEASE_VERSION, Global.NIMBLE_SDK_VERSION));
|
||||
s_core = new BaseCore();
|
||||
s_core.initialize();
|
||||
}
|
||||
baseCore = s_core;
|
||||
}
|
||||
return baseCore;
|
||||
}
|
||||
|
||||
public BaseCore activeValidate() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
switch (this.m_state) {
|
||||
case INACTIVE:
|
||||
Log.Helper.LOGF(this, "Access NimbleBaseCore before setup, call setupNimble() explicitly to activate it.", new Object[0]);
|
||||
return null;
|
||||
case MANUAL_TEARDOWN:
|
||||
Log.Helper.LOGF(this, "Access NimbleBaseCore after clean up, call setupNimble() explicitly again to activate it.", new Object[0]);
|
||||
return null;
|
||||
case DESTROY:
|
||||
Log.Helper.LOGF(this, "Accessing component after destroy, only static components are available right now.", new Object[0]);
|
||||
return null;
|
||||
default:
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public void setup() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
switch (this.m_state) {
|
||||
case INACTIVE:
|
||||
case MANUAL_TEARDOWN:
|
||||
this.m_componentManager.setup();
|
||||
this.m_state = State.MANUAL_SETUP;
|
||||
Utility.sendBroadcast(Global.NOTIFICATION_COMPONENT_INDEPENDENT_SETUP_FINISHED);
|
||||
this.m_componentManager.restore();
|
||||
break;
|
||||
case DESTROY:
|
||||
case MANUAL_SETUP:
|
||||
case QUITTING:
|
||||
case FAKE_DESTROY:
|
||||
Log.Helper.LOGF(this, "Multiple setupNimble() calls without teardownNimble().", new Object[0]);
|
||||
break;
|
||||
case AUTO_SETUP:
|
||||
this.m_state = State.MANUAL_SETUP;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void teardown() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
switch (this.m_state) {
|
||||
case INACTIVE:
|
||||
case AUTO_SETUP:
|
||||
Log.Helper.LOGF(this, "Cannot teardownNimble() before setupNimble().", new Object[0]);
|
||||
break;
|
||||
case MANUAL_TEARDOWN:
|
||||
case DESTROY:
|
||||
Log.Helper.LOGF(this, "Multiple teardownNimble() calls without setupNibmle().", new Object[0]);
|
||||
break;
|
||||
case MANUAL_SETUP:
|
||||
this.m_componentManager.cleanup();
|
||||
this.m_state = State.MANUAL_TEARDOWN;
|
||||
this.m_componentManager.teardown();
|
||||
break;
|
||||
case QUITTING:
|
||||
case FAKE_DESTROY:
|
||||
this.m_componentManager.cleanup();
|
||||
this.m_state = State.MANUAL_TEARDOWN;
|
||||
this.m_componentManager.teardown();
|
||||
destroy();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void restartWithConfiguration(final NimbleConfiguration nimbleConfiguration) {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
Log.Helper.LOGE(this, ">>>>>>>>>>>>>>>>>>>>>>", new Object[0]);
|
||||
Log.Helper.LOGE(this, "restartWithConfiguration should not be used in an integration. This function is for QA testing purposes.", new Object[0]);
|
||||
Log.Helper.LOGE(this, ">>>>>>>>>>>>>>>>>>>>>>", new Object[0]);
|
||||
if (nimbleConfiguration == NimbleConfiguration.UNKNOWN) {
|
||||
Log.Helper.LOGE(this, "Cannot restart nimble with unknown configuration", new Object[0]);
|
||||
} else {
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() { // from class: com.ea.nimble.BaseCore.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
switch (AnonymousClass2.$SwitchMap$com$ea$nimble$BaseCore$State[BaseCore.this.m_state.ordinal()]) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
Log.Helper.LOGF(this, "Should not happen, getInstance should ensure active instance", new Object[0]);
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
BaseCore.this.m_componentManager.cleanup();
|
||||
BaseCore.this.m_componentManager.teardown();
|
||||
BaseCore.this.m_configuration = nimbleConfiguration;
|
||||
BaseCore.this.m_componentManager.setup();
|
||||
Utility.sendBroadcast(Global.NOTIFICATION_COMPONENT_INDEPENDENT_SETUP_FINISHED);
|
||||
BaseCore.this.m_componentManager.restore();
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
Log.Helper.LOGF(this, "Cannot restart Nimble when app is quiting", new Object[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ApplicationLifecycleCallbacks
|
||||
public void onApplicationLaunch(Intent intent) {
|
||||
if (this.m_state == State.INACTIVE || this.m_state == State.DESTROY) {
|
||||
this.m_componentManager.setup();
|
||||
Utility.sendBroadcast(Global.NOTIFICATION_COMPONENT_INDEPENDENT_SETUP_FINISHED);
|
||||
this.m_state = State.AUTO_SETUP;
|
||||
try {
|
||||
this.m_componentManager.restore();
|
||||
return;
|
||||
} catch (AssertionError e) {
|
||||
this.m_state = State.INACTIVE;
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
if (this.m_state == State.FAKE_DESTROY) {
|
||||
this.m_componentManager.resume();
|
||||
this.m_state = State.AUTO_SETUP;
|
||||
} else if (this.m_state == State.QUITTING) {
|
||||
this.m_componentManager.resume();
|
||||
this.m_state = State.MANUAL_SETUP;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ApplicationLifecycleCallbacks
|
||||
public void onApplicationSuspend() {
|
||||
if (this.m_state == State.MANUAL_SETUP || this.m_state == State.AUTO_SETUP) {
|
||||
this.m_componentManager.suspend();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ApplicationLifecycleCallbacks
|
||||
public void onApplicationResume() {
|
||||
if (this.m_state == State.MANUAL_SETUP || this.m_state == State.AUTO_SETUP) {
|
||||
this.m_componentManager.resume();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ApplicationLifecycleCallbacks
|
||||
public void onApplicationQuit() {
|
||||
switch (this.m_state) {
|
||||
case INACTIVE:
|
||||
Log.Helper.LOGF(this, "No app start before app quit, something must be wrong.", new Object[0]);
|
||||
break;
|
||||
case DESTROY:
|
||||
case QUITTING:
|
||||
Log.Helper.LOGF(this, "Double app quit, something must be wrong.", new Object[0]);
|
||||
break;
|
||||
case AUTO_SETUP:
|
||||
this.m_componentManager.suspend();
|
||||
this.m_state = State.FAKE_DESTROY;
|
||||
break;
|
||||
case MANUAL_SETUP:
|
||||
this.m_componentManager.suspend();
|
||||
this.m_state = State.QUITTING;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected static void injectMock(BaseCore baseCore) {
|
||||
Log.Helper.LOGFUNCS("BaseCore");
|
||||
if (baseCore == null) {
|
||||
s_core = null;
|
||||
s_coreDestroyed = false;
|
||||
} else {
|
||||
s_core = baseCore;
|
||||
s_coreDestroyed = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void destroy() {
|
||||
Log.Helper.LOGD(this, "NIMBLE DESTROY for Android will keep Core and Static components alive", new Object[0]);
|
||||
}
|
||||
|
||||
private void loadConfiguration() {
|
||||
Log.Helper.LOGFUNCS("BaseCore");
|
||||
String configValueAsString = NimbleApplicationConfiguration.getConfigValueAsString(NIMBLE_SERVER_CONFIG);
|
||||
if (Utility.validString(configValueAsString)) {
|
||||
this.m_configuration = NimbleConfiguration.fromName(configValueAsString);
|
||||
if (this.m_configuration != NimbleConfiguration.UNKNOWN && this.m_configuration != NimbleConfiguration.CUSTOMIZED) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
android.util.Log.e(Global.NIMBLE_ID, "WARNING! Cannot find valid NimbleConfiguration from AndroidManifest.xml");
|
||||
this.m_configuration = NimbleConfiguration.LIVE;
|
||||
}
|
||||
|
||||
/* JADX WARN: Removed duplicated region for block: B:18:0x0067 A[ORIG_RETURN, RETURN] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:19:? A[RETURN, SYNTHETIC] */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
private boolean isAppSigned(android.content.Context r9) {
|
||||
/*
|
||||
r8 = this;
|
||||
javax.security.auth.x500.X500Principal r0 = new javax.security.auth.x500.X500Principal
|
||||
java.lang.String r1 = "CN=Android Debug,O=Android,C=US"
|
||||
r0.<init>(r1)
|
||||
r1 = 0
|
||||
android.content.pm.PackageManager r2 = r9.getPackageManager() // Catch: java.lang.Exception -> L54 java.security.cert.CertificateException -> L5a android.content.pm.PackageManager.NameNotFoundException -> L60
|
||||
if (r2 != 0) goto L16
|
||||
java.lang.String r9 = "Could not get Package Manager"
|
||||
java.lang.Object[] r0 = new java.lang.Object[r1] // Catch: java.lang.Exception -> L54 java.security.cert.CertificateException -> L5a android.content.pm.PackageManager.NameNotFoundException -> L60
|
||||
com.ea.nimble.Log.Helper.LOGE(r8, r9, r0) // Catch: java.lang.Exception -> L54 java.security.cert.CertificateException -> L5a android.content.pm.PackageManager.NameNotFoundException -> L60
|
||||
return r1
|
||||
L16:
|
||||
java.lang.String r9 = r9.getPackageName() // Catch: java.lang.Exception -> L54 java.security.cert.CertificateException -> L5a android.content.pm.PackageManager.NameNotFoundException -> L60
|
||||
r3 = 64
|
||||
android.content.pm.PackageInfo r9 = r2.getPackageInfo(r9, r3) // Catch: java.lang.Exception -> L54 java.security.cert.CertificateException -> L5a android.content.pm.PackageManager.NameNotFoundException -> L60
|
||||
android.content.pm.Signature[] r9 = r9.signatures // Catch: java.lang.Exception -> L54 java.security.cert.CertificateException -> L5a android.content.pm.PackageManager.NameNotFoundException -> L60
|
||||
int r2 = r9.length // Catch: java.lang.Exception -> L54 java.security.cert.CertificateException -> L5a android.content.pm.PackageManager.NameNotFoundException -> L60
|
||||
r3 = 0
|
||||
r4 = 0
|
||||
L25:
|
||||
if (r3 >= r2) goto L65
|
||||
r5 = r9[r3] // Catch: java.lang.Exception -> L4e java.security.cert.CertificateException -> L50 android.content.pm.PackageManager.NameNotFoundException -> L52
|
||||
java.lang.String r6 = "X.509"
|
||||
java.security.cert.CertificateFactory r6 = java.security.cert.CertificateFactory.getInstance(r6) // Catch: java.lang.Exception -> L4e java.security.cert.CertificateException -> L50 android.content.pm.PackageManager.NameNotFoundException -> L52
|
||||
java.io.ByteArrayInputStream r7 = new java.io.ByteArrayInputStream // Catch: java.lang.Exception -> L4e java.security.cert.CertificateException -> L50 android.content.pm.PackageManager.NameNotFoundException -> L52
|
||||
byte[] r5 = r5.toByteArray() // Catch: java.lang.Exception -> L4e java.security.cert.CertificateException -> L50 android.content.pm.PackageManager.NameNotFoundException -> L52
|
||||
r7.<init>(r5) // Catch: java.lang.Exception -> L4e java.security.cert.CertificateException -> L50 android.content.pm.PackageManager.NameNotFoundException -> L52
|
||||
java.security.cert.Certificate r5 = r6.generateCertificate(r7) // Catch: java.lang.Exception -> L4e java.security.cert.CertificateException -> L50 android.content.pm.PackageManager.NameNotFoundException -> L52
|
||||
java.security.cert.X509Certificate r5 = (java.security.cert.X509Certificate) r5 // Catch: java.lang.Exception -> L4e java.security.cert.CertificateException -> L50 android.content.pm.PackageManager.NameNotFoundException -> L52
|
||||
javax.security.auth.x500.X500Principal r5 = r5.getSubjectX500Principal() // Catch: java.lang.Exception -> L4e java.security.cert.CertificateException -> L50 android.content.pm.PackageManager.NameNotFoundException -> L52
|
||||
boolean r5 = r5.equals(r0) // Catch: java.lang.Exception -> L4e java.security.cert.CertificateException -> L50 android.content.pm.PackageManager.NameNotFoundException -> L52
|
||||
if (r5 == 0) goto L4a
|
||||
r4 = r5
|
||||
goto L65
|
||||
L4a:
|
||||
int r3 = r3 + 1
|
||||
r4 = r5
|
||||
goto L25
|
||||
L4e:
|
||||
r9 = move-exception
|
||||
goto L56
|
||||
L50:
|
||||
r9 = move-exception
|
||||
goto L5c
|
||||
L52:
|
||||
r9 = move-exception
|
||||
goto L62
|
||||
L54:
|
||||
r9 = move-exception
|
||||
r4 = 0
|
||||
L56:
|
||||
r9.printStackTrace()
|
||||
goto L65
|
||||
L5a:
|
||||
r9 = move-exception
|
||||
r4 = 0
|
||||
L5c:
|
||||
r9.printStackTrace()
|
||||
goto L65
|
||||
L60:
|
||||
r9 = move-exception
|
||||
r4 = 0
|
||||
L62:
|
||||
r9.printStackTrace()
|
||||
L65:
|
||||
if (r4 != 0) goto L68
|
||||
r1 = 1
|
||||
L68:
|
||||
return r1
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.BaseCore.isAppSigned(android.content.Context):boolean");
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
Log.Helper.LOGPUBLICFUNCS("BaseCore");
|
||||
return this.m_state == State.AUTO_SETUP || this.m_state == State.MANUAL_SETUP;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,284 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.ListIterator;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ByteBufferIOStream {
|
||||
protected static final int SEGMENT_SIZE = 4096;
|
||||
protected int m_availableSegment;
|
||||
protected LinkedList<byte[]> m_buffer;
|
||||
protected boolean m_closed;
|
||||
protected ByteBufferInputStream m_input;
|
||||
protected ByteBufferOutputStream m_output;
|
||||
protected int m_readPosition;
|
||||
protected int m_writePosition;
|
||||
|
||||
public ByteBufferIOStream() {
|
||||
this(1);
|
||||
}
|
||||
|
||||
public ByteBufferIOStream(int i) {
|
||||
this.m_closed = false;
|
||||
this.m_availableSegment = 0;
|
||||
this.m_writePosition = 0;
|
||||
this.m_readPosition = 0;
|
||||
this.m_buffer = new LinkedList<>();
|
||||
this.m_input = new ByteBufferInputStream();
|
||||
this.m_output = new ByteBufferOutputStream();
|
||||
int i2 = (((i <= 0 ? 1 : i) - 1) / 4096) + 1;
|
||||
for (int i3 = 0; i3 < i2; i3++) {
|
||||
this.m_buffer.add(new byte[4096]);
|
||||
}
|
||||
}
|
||||
|
||||
public InputStream getInputStream() {
|
||||
return this.m_input;
|
||||
}
|
||||
|
||||
public OutputStream getOutputStream() {
|
||||
return this.m_output;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
this.m_closed = false;
|
||||
this.m_availableSegment = 0;
|
||||
this.m_writePosition = 0;
|
||||
this.m_readPosition = 0;
|
||||
}
|
||||
|
||||
public int available() throws IOException {
|
||||
return this.m_input.available();
|
||||
}
|
||||
|
||||
public byte[] prepareSegment() {
|
||||
if (this.m_availableSegment + 1 >= this.m_buffer.size()) {
|
||||
return new byte[4096];
|
||||
}
|
||||
if (this.m_buffer.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
return this.m_buffer.removeLast();
|
||||
}
|
||||
|
||||
public void appendSegmentToBuffer(byte[] bArr, int i) throws IOException {
|
||||
if (this.m_writePosition == 0 && bArr.length == 4096) {
|
||||
ListIterator<byte[]> listIterator = this.m_buffer.listIterator();
|
||||
for (int i2 = 0; i2 < this.m_availableSegment; i2++) {
|
||||
listIterator.next();
|
||||
}
|
||||
listIterator.add(bArr);
|
||||
if (i != 4096) {
|
||||
this.m_writePosition = i;
|
||||
return;
|
||||
} else {
|
||||
this.m_availableSegment++;
|
||||
return;
|
||||
}
|
||||
}
|
||||
getOutputStream().write(bArr, 0, i);
|
||||
}
|
||||
|
||||
public byte[] growBufferBySegment() throws IOException {
|
||||
if (this.m_writePosition != 0) {
|
||||
throw new IOException("Bad location to grow buffer");
|
||||
}
|
||||
ListIterator<byte[]> listIterator = this.m_buffer.listIterator();
|
||||
for (int i = 0; i < this.m_availableSegment; i++) {
|
||||
listIterator.next();
|
||||
}
|
||||
byte[] bArr = new byte[4096];
|
||||
listIterator.add(bArr);
|
||||
this.m_availableSegment++;
|
||||
return bArr;
|
||||
}
|
||||
|
||||
protected class ByteBufferInputStream extends InputStream {
|
||||
@Override // java.io.InputStream
|
||||
public boolean markSupported() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected ByteBufferInputStream() {
|
||||
}
|
||||
|
||||
@Override // java.io.InputStream
|
||||
public int available() throws IOException {
|
||||
if (ByteBufferIOStream.this.m_closed) {
|
||||
throw new IOException("ByteBufferIOStream is closed");
|
||||
}
|
||||
return ((ByteBufferIOStream.this.m_availableSegment * 4096) + ByteBufferIOStream.this.m_writePosition) - ByteBufferIOStream.this.m_readPosition;
|
||||
}
|
||||
|
||||
@Override // java.io.InputStream, java.io.Closeable, java.lang.AutoCloseable
|
||||
public void close() throws IOException {
|
||||
ByteBufferIOStream.this.closeIOStream();
|
||||
}
|
||||
|
||||
@Override // java.io.InputStream
|
||||
public int read(byte[] bArr) throws IOException {
|
||||
return read(bArr, 0, bArr.length);
|
||||
}
|
||||
|
||||
@Override // java.io.InputStream
|
||||
public int read() throws IOException {
|
||||
if (available() <= 0) {
|
||||
throw new IOException("Nothing to read in ByteBufferIOStream");
|
||||
}
|
||||
byte b = ByteBufferIOStream.this.m_buffer.getFirst()[ByteBufferIOStream.this.m_readPosition];
|
||||
ByteBufferIOStream.this.m_readPosition++;
|
||||
if (ByteBufferIOStream.this.m_readPosition >= 4096) {
|
||||
ByteBufferIOStream.this.m_buffer.add(ByteBufferIOStream.this.m_buffer.poll());
|
||||
ByteBufferIOStream.this.m_readPosition = 0;
|
||||
ByteBufferIOStream byteBufferIOStream = ByteBufferIOStream.this;
|
||||
byteBufferIOStream.m_availableSegment--;
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
@Override // java.io.InputStream
|
||||
public int read(byte[] bArr, int i, int i2) throws IOException {
|
||||
if (i < 0 || i2 < 0 || i + i2 > bArr.length) {
|
||||
throw new IndexOutOfBoundsException("The reading range of out of buffer boundary.");
|
||||
}
|
||||
int available = available();
|
||||
if (available <= 0) {
|
||||
return -1;
|
||||
}
|
||||
if (i2 > available) {
|
||||
i2 = available;
|
||||
}
|
||||
int i3 = 4096 - ByteBufferIOStream.this.m_readPosition;
|
||||
if (i2 < i3) {
|
||||
System.arraycopy(ByteBufferIOStream.this.m_buffer.getFirst(), ByteBufferIOStream.this.m_readPosition, bArr, i, i2);
|
||||
ByteBufferIOStream.this.m_readPosition += i2;
|
||||
} else {
|
||||
System.arraycopy(ByteBufferIOStream.this.m_buffer.getFirst(), ByteBufferIOStream.this.m_readPosition, bArr, i, i3);
|
||||
ByteBufferIOStream.this.m_buffer.add(ByteBufferIOStream.this.m_buffer.poll());
|
||||
int i4 = i2 - i3;
|
||||
int i5 = i + i3;
|
||||
int i6 = i4 / 4096;
|
||||
int i7 = i4;
|
||||
int i8 = i5;
|
||||
for (int i9 = 0; i9 < i6; i9++) {
|
||||
System.arraycopy(ByteBufferIOStream.this.m_buffer.getFirst(), 0, bArr, i8, 4096);
|
||||
ByteBufferIOStream.this.m_buffer.add(ByteBufferIOStream.this.m_buffer.poll());
|
||||
i7 -= 4096;
|
||||
i8 += 4096;
|
||||
}
|
||||
System.arraycopy(ByteBufferIOStream.this.m_buffer.getFirst(), 0, bArr, i8, i7);
|
||||
ByteBufferIOStream.this.m_readPosition = i7;
|
||||
ByteBufferIOStream.this.m_availableSegment -= i6 + 1;
|
||||
}
|
||||
return i2;
|
||||
}
|
||||
|
||||
@Override // java.io.InputStream
|
||||
public long skip(long j) throws IOException {
|
||||
int available = available();
|
||||
if (available <= 0) {
|
||||
return 0L;
|
||||
}
|
||||
long j2 = available;
|
||||
if (j > j2) {
|
||||
j = j2;
|
||||
}
|
||||
int i = (int) j;
|
||||
int i2 = 4096 - ByteBufferIOStream.this.m_readPosition;
|
||||
if (i < i2) {
|
||||
ByteBufferIOStream.this.m_readPosition += i;
|
||||
} else {
|
||||
ByteBufferIOStream.this.m_buffer.add(ByteBufferIOStream.this.m_buffer.poll());
|
||||
int i3 = i - i2;
|
||||
int i4 = i3 / 4096;
|
||||
for (int i5 = 0; i5 < i4; i5++) {
|
||||
ByteBufferIOStream.this.m_buffer.add(ByteBufferIOStream.this.m_buffer.poll());
|
||||
i3 -= 4096;
|
||||
}
|
||||
ByteBufferIOStream.this.m_readPosition = i3;
|
||||
ByteBufferIOStream.this.m_availableSegment -= i4 + 1;
|
||||
}
|
||||
return j;
|
||||
}
|
||||
}
|
||||
|
||||
protected class ByteBufferOutputStream extends OutputStream {
|
||||
protected ByteBufferOutputStream() {
|
||||
}
|
||||
|
||||
@Override // java.io.OutputStream, java.io.Closeable, java.lang.AutoCloseable
|
||||
public void close() throws IOException {
|
||||
ByteBufferIOStream.this.closeIOStream();
|
||||
}
|
||||
|
||||
@Override // java.io.OutputStream
|
||||
public void write(byte[] bArr, int i, int i2) throws IOException {
|
||||
byte[] bArr2;
|
||||
if (i < 0 || i2 < 0 || i + i2 > bArr.length) {
|
||||
throw new IndexOutOfBoundsException("The writing range is out of buffer boundary.");
|
||||
}
|
||||
if (ByteBufferIOStream.this.m_closed) {
|
||||
throw new IOException("ByteBufferIOStream is closed");
|
||||
}
|
||||
int i3 = 4096 - ByteBufferIOStream.this.m_writePosition;
|
||||
Iterator<byte[]> it = ByteBufferIOStream.this.m_buffer.iterator();
|
||||
for (int i4 = 0; i4 < ByteBufferIOStream.this.m_availableSegment; i4++) {
|
||||
it.next();
|
||||
}
|
||||
if (i2 < i3) {
|
||||
System.arraycopy(bArr, i, it.next(), ByteBufferIOStream.this.m_writePosition, i2);
|
||||
ByteBufferIOStream.this.m_writePosition += i2;
|
||||
return;
|
||||
}
|
||||
System.arraycopy(bArr, i, it.next(), ByteBufferIOStream.this.m_writePosition, i3);
|
||||
int i5 = i2 - i3;
|
||||
int i6 = i + i3;
|
||||
ByteBufferIOStream.this.m_availableSegment++;
|
||||
ByteBufferIOStream.this.m_writePosition = 0;
|
||||
while (i5 > 0) {
|
||||
if (it.hasNext()) {
|
||||
bArr2 = it.next();
|
||||
} else {
|
||||
bArr2 = new byte[4096];
|
||||
ByteBufferIOStream.this.m_buffer.add(bArr2);
|
||||
}
|
||||
if (i5 < 4096) {
|
||||
System.arraycopy(bArr, i6, bArr2, 0, i5);
|
||||
ByteBufferIOStream.this.m_writePosition = i5;
|
||||
i5 = 0;
|
||||
} else {
|
||||
System.arraycopy(bArr, i6, bArr2, 0, 4096);
|
||||
i5 -= 4096;
|
||||
i6 += 4096;
|
||||
ByteBufferIOStream.this.m_availableSegment++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // java.io.OutputStream
|
||||
public void write(byte[] bArr) throws IOException {
|
||||
write(bArr, 0, bArr.length);
|
||||
}
|
||||
|
||||
@Override // java.io.OutputStream
|
||||
public void write(int i) throws IOException {
|
||||
if (ByteBufferIOStream.this.m_closed) {
|
||||
throw new IOException("ByteBufferIOStream is closed");
|
||||
}
|
||||
ByteBufferIOStream.this.m_buffer.getFirst()[ByteBufferIOStream.this.m_writePosition] = (byte) i;
|
||||
ByteBufferIOStream.this.m_writePosition++;
|
||||
if (ByteBufferIOStream.this.m_writePosition == 4096) {
|
||||
ByteBufferIOStream.this.m_writePosition = 0;
|
||||
ByteBufferIOStream.this.m_availableSegment++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void closeIOStream() {
|
||||
this.m_closed = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class Component {
|
||||
protected void cleanup() {
|
||||
}
|
||||
|
||||
public abstract String getComponentId();
|
||||
|
||||
protected void restore() {
|
||||
}
|
||||
|
||||
protected void resume() {
|
||||
}
|
||||
|
||||
protected void setup() {
|
||||
}
|
||||
|
||||
protected void suspend() {
|
||||
}
|
||||
|
||||
protected void teardown() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
import com.ea.nimble.Log;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.ListIterator;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class ComponentManager implements LogSource {
|
||||
private Map<String, Component> m_components = new LinkedHashMap();
|
||||
private Stage m_stage = Stage.CREATE;
|
||||
|
||||
public enum Stage {
|
||||
CREATE,
|
||||
SETUP,
|
||||
READY,
|
||||
SUSPEND
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.LogSource
|
||||
public String getLogSourceTitle() {
|
||||
return "Component";
|
||||
}
|
||||
|
||||
ComponentManager() {
|
||||
}
|
||||
|
||||
public Stage getStage() {
|
||||
return this.m_stage;
|
||||
}
|
||||
|
||||
void registerComponent(Component component, String str) {
|
||||
Log.Helper.LOGFUNC(this);
|
||||
if (!Utility.validString(str)) {
|
||||
Log.Helper.LOGF(this, "Cannot register component without valid componentId", new Object[0]);
|
||||
return;
|
||||
}
|
||||
if (component == null) {
|
||||
Log.Helper.LOGF(this, "Try to register invalid component with id: " + str, new Object[0]);
|
||||
return;
|
||||
}
|
||||
Component component2 = this.m_components.get(str);
|
||||
if (component2 == null) {
|
||||
Log.Helper.LOGI(this, "Register module: " + str, new Object[0]);
|
||||
} else {
|
||||
Log.Helper.LOGI(this, "Register module(overwrite): " + str, new Object[0]);
|
||||
}
|
||||
this.m_components.put(str, component);
|
||||
if (this.m_stage.compareTo(Stage.SETUP) < 0) {
|
||||
return;
|
||||
}
|
||||
if (component2 != null) {
|
||||
if (this.m_stage.compareTo(Stage.SETUP) >= 0) {
|
||||
if (this.m_stage.compareTo(Stage.SUSPEND) >= 0) {
|
||||
component2.resume();
|
||||
}
|
||||
component2.cleanup();
|
||||
}
|
||||
component2.teardown();
|
||||
}
|
||||
component.setup();
|
||||
if (this.m_stage.compareTo(Stage.READY) >= 0) {
|
||||
component.restore();
|
||||
if (this.m_stage.compareTo(Stage.SUSPEND) >= 0) {
|
||||
component.suspend();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component getComponent(String str) {
|
||||
return this.m_components.get(str);
|
||||
}
|
||||
|
||||
Component[] getComponentList(String str) {
|
||||
Log.Helper.LOGFUNC(this);
|
||||
ArrayList arrayList = new ArrayList(this.m_components.size());
|
||||
for (Map.Entry<String, Component> entry : this.m_components.entrySet()) {
|
||||
if (entry.getKey().startsWith(str)) {
|
||||
arrayList.add(entry.getValue());
|
||||
}
|
||||
}
|
||||
return (Component[]) arrayList.toArray(new Component[arrayList.size()]);
|
||||
}
|
||||
|
||||
void setup() {
|
||||
this.m_stage = Stage.SETUP;
|
||||
Iterator<Component> it = this.m_components.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().setup();
|
||||
}
|
||||
}
|
||||
|
||||
void restore() {
|
||||
this.m_stage = Stage.READY;
|
||||
Iterator<Component> it = this.m_components.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().restore();
|
||||
}
|
||||
}
|
||||
|
||||
void suspend() {
|
||||
ListIterator listIterator = new ArrayList(this.m_components.values()).listIterator(this.m_components.size());
|
||||
this.m_stage = Stage.SUSPEND;
|
||||
while (listIterator.hasPrevious()) {
|
||||
((Component) listIterator.previous()).suspend();
|
||||
}
|
||||
}
|
||||
|
||||
void resume() {
|
||||
this.m_stage = Stage.READY;
|
||||
Iterator<Component> it = this.m_components.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().resume();
|
||||
}
|
||||
}
|
||||
|
||||
void cleanup() {
|
||||
ListIterator listIterator = new ArrayList(this.m_components.values()).listIterator(this.m_components.size());
|
||||
this.m_stage = Stage.CREATE;
|
||||
while (listIterator.hasPrevious()) {
|
||||
((Component) listIterator.previous()).cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
void teardown() {
|
||||
ListIterator listIterator = new ArrayList(this.m_components.values()).listIterator(this.m_components.size());
|
||||
this.m_stage = Stage.CREATE;
|
||||
while (listIterator.hasPrevious()) {
|
||||
((Component) listIterator.previous()).teardown();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
import android.content.Context;
|
||||
import com.ea.nimble.Log;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import org.apache.http.protocol.HTTP;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class EASPDataLoader {
|
||||
|
||||
public static class LogEvent {
|
||||
public int m_EAUID;
|
||||
public long m_dateTimeInNanoseconds;
|
||||
public int m_indexInsideSession;
|
||||
public int m_keyType01;
|
||||
public int m_keyType02;
|
||||
public int m_keyType03;
|
||||
public String m_randomPart;
|
||||
public long m_timestamp;
|
||||
public int m_type;
|
||||
public int m_userLevel;
|
||||
public String m_value01;
|
||||
public String m_value02;
|
||||
public String m_value03;
|
||||
}
|
||||
|
||||
public static class EASPDataBuffer {
|
||||
public ByteBuffer m_decryptedByteBuffer;
|
||||
public String m_version;
|
||||
|
||||
public EASPDataBuffer(String str, ByteBuffer byteBuffer) {
|
||||
this.m_version = str;
|
||||
this.m_decryptedByteBuffer = byteBuffer;
|
||||
}
|
||||
}
|
||||
|
||||
public static String readString(ByteBuffer byteBuffer) throws IOException {
|
||||
String str;
|
||||
int i = byteBuffer.getInt();
|
||||
if (i <= 0) {
|
||||
return null;
|
||||
}
|
||||
if (i > byteBuffer.remaining()) {
|
||||
Log.Helper.LOGES("Legacy", "String length greater than buffer remaining bytes.", new Object[0]);
|
||||
throw new IOException("String length uint32 corrupt, longer than remaining bytes.");
|
||||
}
|
||||
byte[] bArr = new byte[i];
|
||||
byteBuffer.get(bArr, 0, i);
|
||||
try {
|
||||
str = new String(bArr, HTTP.UTF_8);
|
||||
try {
|
||||
Log.Helper.LOGDS("Legacy", "Read string (%s)", str);
|
||||
} catch (Exception e) {
|
||||
e = e;
|
||||
Log.Helper.LOGES("Legacy", "Read string exception: " + e, new Object[0]);
|
||||
return str;
|
||||
}
|
||||
} catch (Exception e2) {
|
||||
e = e2;
|
||||
str = null;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
public static boolean readBooleanByte(ByteBuffer byteBuffer) {
|
||||
return byteBuffer.get() != 0;
|
||||
}
|
||||
|
||||
public static LogEvent readLogEvent(ByteBuffer byteBuffer) throws IOException {
|
||||
LogEvent logEvent = new LogEvent();
|
||||
try {
|
||||
if (!readBooleanByte(byteBuffer)) {
|
||||
return null;
|
||||
}
|
||||
logEvent.m_type = byteBuffer.getInt();
|
||||
logEvent.m_indexInsideSession = byteBuffer.getInt();
|
||||
logEvent.m_dateTimeInNanoseconds = byteBuffer.getLong();
|
||||
logEvent.m_EAUID = byteBuffer.getInt();
|
||||
logEvent.m_randomPart = readString(byteBuffer);
|
||||
logEvent.m_keyType01 = byteBuffer.getInt();
|
||||
logEvent.m_value01 = readString(byteBuffer);
|
||||
logEvent.m_keyType02 = byteBuffer.getInt();
|
||||
logEvent.m_value02 = readString(byteBuffer);
|
||||
logEvent.m_timestamp = byteBuffer.getLong();
|
||||
logEvent.m_keyType03 = byteBuffer.getInt();
|
||||
logEvent.m_value03 = readString(byteBuffer);
|
||||
logEvent.m_userLevel = byteBuffer.getInt();
|
||||
return logEvent;
|
||||
} catch (IOException e) {
|
||||
Log.Helper.LOGES("Legacy", "Exception reading LogEvent: " + e, new Object[0]);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean deleteDatFile(String str) {
|
||||
File file = new File(str);
|
||||
if (file.exists()) {
|
||||
return file.delete();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/* JADX WARN: Removed duplicated region for block: B:38:0x00e8 A[EXC_TOP_SPLITTER, SYNTHETIC] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:44:? A[SYNTHETIC] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:45:0x00d7 A[EXC_TOP_SPLITTER, SYNTHETIC] */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public static com.ea.nimble.EASPDataLoader.EASPDataBuffer loadDatFile(java.lang.String r12) throws java.lang.Exception {
|
||||
/*
|
||||
Method dump skipped, instructions count: 342
|
||||
To view this dump change 'Code comments level' option to 'DEBUG'
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.EASPDataLoader.loadDatFile(java.lang.String):com.ea.nimble.EASPDataLoader$EASPDataBuffer");
|
||||
}
|
||||
|
||||
public static String getTrackingDatFilePath() {
|
||||
String path;
|
||||
Context applicationContext = ApplicationEnvironment.getComponent().getApplicationContext();
|
||||
if (applicationContext == null) {
|
||||
path = System.getProperty("user.dir") + File.separator + "doc";
|
||||
} else {
|
||||
File filesDir = applicationContext.getFilesDir();
|
||||
if (filesDir != null) {
|
||||
path = filesDir.getPath();
|
||||
} else {
|
||||
Log.Helper.LOGES("Legacy", "Could not get Android files directory", new Object[0]);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return path + File.separator + "EASP" + File.separator + "Tracking" + File.separator + "tracking.dat";
|
||||
}
|
||||
|
||||
public static String loadEADeviceId() {
|
||||
File filesDir = ApplicationEnvironment.getComponent().getApplicationContext().getFilesDir();
|
||||
try {
|
||||
if (filesDir == null) {
|
||||
throw new Exception();
|
||||
}
|
||||
EASPDataBuffer loadDatFile = loadDatFile(filesDir.getPath() + "/EASP/commoninfo.dat");
|
||||
if (!loadDatFile.m_version.equals("1.00.02")) {
|
||||
return null;
|
||||
}
|
||||
ByteBuffer byteBuffer = loadDatFile.m_decryptedByteBuffer;
|
||||
readString(byteBuffer);
|
||||
readBooleanByte(byteBuffer);
|
||||
return readString(byteBuffer);
|
||||
} catch (FileNotFoundException unused) {
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
Log.Helper.LOGES("Legacy", "Exception when trying to load EASP data: %s", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import com.ea.nimble.Log;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.security.GeneralSecurityException;
|
||||
import java.security.Provider;
|
||||
import java.security.Security;
|
||||
import java.util.Iterator;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.CipherInputStream;
|
||||
import javax.crypto.CipherOutputStream;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.PBEKeySpec;
|
||||
import javax.crypto.spec.PBEParameterSpec;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class Encryptor {
|
||||
private static int ENCRYPTION_KEY_LENGHT = 128;
|
||||
private static int ENCRYPTION_KEY_ROUND = 997;
|
||||
private Cipher m_encryptor = null;
|
||||
private Cipher m_decryptor = null;
|
||||
|
||||
@SuppressLint({"NewApi"})
|
||||
private void initialize() throws GeneralSecurityException {
|
||||
for (Provider provider : Security.getProviders()) {
|
||||
Log.Helper.LOGIS(null, "Cryptor Provider: " + provider.getName(), new Object[0]);
|
||||
Iterator<Provider.Service> it = provider.getServices().iterator();
|
||||
while (it.hasNext()) {
|
||||
Log.Helper.LOGIS(null, "Cryptor Algorithm: " + it.next().getAlgorithm(), new Object[0]);
|
||||
}
|
||||
}
|
||||
try {
|
||||
String applicationBundleId = ApplicationEnvironment.getComponent().getApplicationBundleId();
|
||||
byte[] bytes = "02:00:00:00:00:00".getBytes();
|
||||
byte[] bArr = new byte[8];
|
||||
int i = 0;
|
||||
int i2 = 0;
|
||||
while (i < bArr.length) {
|
||||
int i3 = i2 + 1;
|
||||
if (i3 % 3 == 0) {
|
||||
i2 = i3;
|
||||
}
|
||||
bArr[i] = bytes[i2];
|
||||
i++;
|
||||
i2++;
|
||||
}
|
||||
SecretKey generateSecret = SecretKeyFactory.getInstance("PBEWithMD5AndDES").generateSecret(new PBEKeySpec(applicationBundleId.toCharArray(), bArr, ENCRYPTION_KEY_ROUND, ENCRYPTION_KEY_LENGHT));
|
||||
PBEParameterSpec pBEParameterSpec = new PBEParameterSpec(bArr, ENCRYPTION_KEY_ROUND);
|
||||
this.m_encryptor = Cipher.getInstance("PBEWithMD5AndDES");
|
||||
this.m_encryptor.init(1, generateSecret, pBEParameterSpec);
|
||||
this.m_decryptor = Cipher.getInstance("PBEWithMD5AndDES");
|
||||
this.m_decryptor.init(2, generateSecret, pBEParameterSpec);
|
||||
} catch (GeneralSecurityException e) {
|
||||
Log.Helper.LOGFS(null, "Can't initialize Encryptor: " + e.toString(), new Object[0]);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
public ObjectInputStream encryptInputStream(InputStream inputStream) throws IOException, GeneralSecurityException {
|
||||
Log.Helper.LOGFUNC(this);
|
||||
if (this.m_encryptor == null || this.m_decryptor == null) {
|
||||
initialize();
|
||||
}
|
||||
return new ObjectInputStream(new CipherInputStream(inputStream, this.m_decryptor));
|
||||
}
|
||||
|
||||
public ObjectOutputStream encryptOutputStream(OutputStream outputStream) throws IOException, GeneralSecurityException {
|
||||
Log.Helper.LOGFUNC(this);
|
||||
if (this.m_encryptor == null || this.m_decryptor == null) {
|
||||
initialize();
|
||||
}
|
||||
return new ObjectOutputStream(new CipherOutputStream(outputStream, this.m_encryptor));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,294 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
import com.ea.nimble.Error;
|
||||
import com.ea.nimble.Log;
|
||||
import com.ea.nimble.mtx.catalog.synergy.SynergyCatalog;
|
||||
import java.io.Externalizable;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInput;
|
||||
import java.io.ObjectOutput;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class EnvironmentDataContainer implements ISynergyEnvironment, Externalizable, LogSource {
|
||||
private static final int SYNERGY_DIRECTOR_RESPONSE_APP_VERSION_OK = 0;
|
||||
private static final int SYNERGY_DIRECTOR_RESPONSE_APP_VERSION_UPGRADE_RECOMMENDED = 1;
|
||||
private static final int SYNERGY_DIRECTOR_RESPONSE_APP_VERSION_UPGRADE_REQUIRED = 2;
|
||||
private String m_eaDeviceId;
|
||||
private Long m_lastDirectorResponseTimestamp;
|
||||
private Map<String, String> m_serverUrls;
|
||||
private String m_synergyAnonymousId;
|
||||
private Map<String, String> m_overrideUrls = new HashMap();
|
||||
private Map<String, Object> m_getDirectionResponseDictionary = new HashMap();
|
||||
private String m_applicationLanguageCode = "en";
|
||||
|
||||
@Override // com.ea.nimble.LogSource
|
||||
public String getLogSourceTitle() {
|
||||
return "SynergyEnv";
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.ISynergyEnvironment
|
||||
public String getEADeviceId() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.m_eaDeviceId;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.ISynergyEnvironment
|
||||
public String getSynergyId() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.m_synergyAnonymousId;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.ISynergyEnvironment
|
||||
public String getSellId() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
if (this.m_getDirectionResponseDictionary == null || this.m_getDirectionResponseDictionary.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return (String) this.m_getDirectionResponseDictionary.get(SynergyCatalog.MTX_INFO_KEY_SELLID);
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.ISynergyEnvironment
|
||||
public String getProductId() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
if (this.m_getDirectionResponseDictionary == null || this.m_getDirectionResponseDictionary.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return (String) this.m_getDirectionResponseDictionary.get("productId");
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.ISynergyEnvironment
|
||||
public String getEAHardwareId() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
if (this.m_getDirectionResponseDictionary == null || this.m_getDirectionResponseDictionary.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return (String) this.m_getDirectionResponseDictionary.get("hwId");
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.ISynergyEnvironment
|
||||
public String getNexusClientId() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
if (this.m_getDirectionResponseDictionary == null || this.m_getDirectionResponseDictionary.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return (String) this.m_getDirectionResponseDictionary.get("clientId");
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.ISynergyEnvironment
|
||||
public String getNexusClientSecret() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
if (this.m_getDirectionResponseDictionary == null || this.m_getDirectionResponseDictionary.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return (String) this.m_getDirectionResponseDictionary.get("clientSecret");
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.ISynergyEnvironment
|
||||
public String getGosMdmAppKey() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
if (this.m_getDirectionResponseDictionary == null || this.m_getDirectionResponseDictionary.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return (String) this.m_getDirectionResponseDictionary.get("mdmAppKey");
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.ISynergyEnvironment
|
||||
public Error setServerUrl(String str, String str2) {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
if (!Utility.validString(str)) {
|
||||
Log.Helper.LOGE(this, "Provided override URL key is not a valid string, unable to set URL", new Object[0]);
|
||||
return new Error(Error.Code.INVALID_ARGUMENT, "Provided override URL key is not a valid string, unable to set URL");
|
||||
}
|
||||
if (!Utility.validString(str2)) {
|
||||
Log.Helper.LOGD(this, "Empty or null value provided for key \"" + str + "\", removing key from map", new Object[0]);
|
||||
if (this.m_overrideUrls.remove(str) != null) {
|
||||
return null;
|
||||
}
|
||||
Log.Helper.LOGW(this, "No matching key found in override URLs", new Object[0]);
|
||||
return null;
|
||||
}
|
||||
this.m_overrideUrls.put(str, str2);
|
||||
Log.Helper.LOGD(this, "Successfully set Override URL pair: (%s,%s)", str, this.m_overrideUrls.get(str));
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.ISynergyEnvironment
|
||||
public String getServerUrlWithKey(String str) {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
String str2 = this.m_overrideUrls.get(str);
|
||||
return str2 != null ? str2 : this.m_serverUrls.get(str);
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.ISynergyEnvironment
|
||||
public String getSynergyDirectorServerUrl(NimbleConfiguration nimbleConfiguration) {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return SynergyEnvironment.getComponent().getSynergyDirectorServerUrl(nimbleConfiguration);
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.ISynergyEnvironment
|
||||
public int getLatestAppVersionCheckResult() {
|
||||
int parseInt;
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
if (this.m_getDirectionResponseDictionary == null || this.m_getDirectionResponseDictionary.isEmpty()) {
|
||||
return -1;
|
||||
}
|
||||
Object obj = this.m_getDirectionResponseDictionary.get("appUpgrade");
|
||||
if (obj instanceof Integer) {
|
||||
parseInt = ((Integer) obj).intValue();
|
||||
} else {
|
||||
parseInt = obj instanceof String ? Integer.parseInt((String) obj) : 0;
|
||||
}
|
||||
switch (parseInt) {
|
||||
case 0:
|
||||
default:
|
||||
return 0;
|
||||
case 1:
|
||||
return 1;
|
||||
case 2:
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.ISynergyEnvironment
|
||||
public int getTrackingPostInterval() {
|
||||
Integer num;
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
if (this.m_getDirectionResponseDictionary == null || this.m_getDirectionResponseDictionary.isEmpty() || (num = (Integer) this.m_getDirectionResponseDictionary.get("telemetryFreq")) == null) {
|
||||
return -1;
|
||||
}
|
||||
return num.intValue();
|
||||
}
|
||||
|
||||
Map<String, Object> getGetDirectionResponseDictionary() {
|
||||
return this.m_getDirectionResponseDictionary;
|
||||
}
|
||||
|
||||
void setGetDirectionResponseDictionary(Map<String, Object> map) {
|
||||
Log.Helper.LOGFUNC(this);
|
||||
if (map != null) {
|
||||
map.put(SynergyCatalog.MTX_INFO_KEY_SELLID, ((Integer) map.get(SynergyCatalog.MTX_INFO_KEY_SELLID)).toString());
|
||||
map.put("productId", ((Integer) map.get("productId")).toString());
|
||||
map.put("hwId", ((Integer) map.get("hwId")).toString());
|
||||
this.m_getDirectionResponseDictionary = map;
|
||||
return;
|
||||
}
|
||||
this.m_getDirectionResponseDictionary = new HashMap();
|
||||
}
|
||||
|
||||
Map<String, String> getServerUrls() {
|
||||
return this.m_serverUrls;
|
||||
}
|
||||
|
||||
void setServerUrls(Map<String, String> map) {
|
||||
Log.Helper.LOGFUNC(this);
|
||||
this.m_serverUrls = map;
|
||||
}
|
||||
|
||||
void setEADeviceId(String str) {
|
||||
Log.Helper.LOGFUNC(this);
|
||||
this.m_eaDeviceId = str;
|
||||
}
|
||||
|
||||
String getSynergyAnonymousId() {
|
||||
Log.Helper.LOGFUNC(this);
|
||||
return this.m_synergyAnonymousId;
|
||||
}
|
||||
|
||||
void setSynergyAnonymousId(String str) {
|
||||
Log.Helper.LOGFUNC(this);
|
||||
this.m_synergyAnonymousId = str;
|
||||
}
|
||||
|
||||
Long getMostRecentDirectorResponseTimestamp() {
|
||||
Log.Helper.LOGFUNC(this);
|
||||
return this.m_lastDirectorResponseTimestamp;
|
||||
}
|
||||
|
||||
void setMostRecentDirectorResponseTimestamp(Long l) {
|
||||
Log.Helper.LOGFUNC(this);
|
||||
this.m_lastDirectorResponseTimestamp = l;
|
||||
}
|
||||
|
||||
@Override // java.io.Externalizable
|
||||
public void readExternal(ObjectInput objectInput) throws IOException, ClassNotFoundException {
|
||||
this.m_getDirectionResponseDictionary = (Map) objectInput.readObject();
|
||||
if (this.m_getDirectionResponseDictionary.isEmpty()) {
|
||||
this.m_getDirectionResponseDictionary = null;
|
||||
}
|
||||
this.m_serverUrls = (Map) objectInput.readObject();
|
||||
if (this.m_serverUrls.isEmpty()) {
|
||||
this.m_serverUrls = null;
|
||||
}
|
||||
this.m_eaDeviceId = (String) objectInput.readObject();
|
||||
if (this.m_eaDeviceId.length() == 0) {
|
||||
this.m_eaDeviceId = null;
|
||||
}
|
||||
this.m_synergyAnonymousId = (String) objectInput.readObject();
|
||||
if (this.m_synergyAnonymousId.length() == 0) {
|
||||
this.m_synergyAnonymousId = null;
|
||||
}
|
||||
this.m_lastDirectorResponseTimestamp = Long.valueOf(objectInput.readLong());
|
||||
if (this.m_lastDirectorResponseTimestamp.longValue() == 0) {
|
||||
this.m_lastDirectorResponseTimestamp = null;
|
||||
}
|
||||
this.m_applicationLanguageCode = (String) objectInput.readObject();
|
||||
if (this.m_applicationLanguageCode.length() == 0) {
|
||||
this.m_applicationLanguageCode = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // java.io.Externalizable
|
||||
public void writeExternal(ObjectOutput objectOutput) throws IOException {
|
||||
objectOutput.writeObject(this.m_getDirectionResponseDictionary == null ? new HashMap() : this.m_getDirectionResponseDictionary);
|
||||
objectOutput.writeObject(this.m_serverUrls == null ? new HashMap() : this.m_serverUrls);
|
||||
objectOutput.writeObject(this.m_eaDeviceId == null ? "" : this.m_eaDeviceId);
|
||||
objectOutput.writeObject(this.m_synergyAnonymousId == null ? "" : this.m_synergyAnonymousId);
|
||||
objectOutput.writeLong(this.m_lastDirectorResponseTimestamp == null ? 0L : this.m_lastDirectorResponseTimestamp.longValue());
|
||||
objectOutput.writeObject(this.m_applicationLanguageCode == null ? "" : this.m_applicationLanguageCode);
|
||||
}
|
||||
|
||||
/* JADX WARN: Removed duplicated region for block: B:78:0x0273 A[RETURN] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:80:0x0274 A[RETURN] */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public java.util.Set<java.lang.String> getKeysOfDifferences(com.ea.nimble.ISynergyEnvironment r4) {
|
||||
/*
|
||||
Method dump skipped, instructions count: 630
|
||||
To view this dump change 'Code comments level' option to 'DEBUG'
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.EnvironmentDataContainer.getKeysOfDifferences(com.ea.nimble.ISynergyEnvironment):java.util.Set");
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.ISynergyEnvironment
|
||||
public boolean isDataAvailable() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.ISynergyEnvironment
|
||||
public boolean isUpdateInProgress() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.ISynergyEnvironment
|
||||
public Error checkAndInitiateSynergyEnvironmentUpdate() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.ISynergyEnvironment
|
||||
public boolean isFeatureDisabled(String str) {
|
||||
List list;
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
if (this.m_getDirectionResponseDictionary == null || (list = (List) this.m_getDirectionResponseDictionary.get("disabledFeatures")) == null) {
|
||||
return false;
|
||||
}
|
||||
return list.contains(str);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* android.os.Parcel
|
||||
* android.os.Parcelable
|
||||
* android.os.Parcelable$Creator
|
||||
*/
|
||||
package com.ea.nimble;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import java.io.Externalizable;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInput;
|
||||
import java.io.ObjectOutput;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.Serializable;
|
||||
import java.io.StringWriter;
|
||||
|
||||
public class Error
|
||||
extends Exception
|
||||
implements Parcelable,
|
||||
Externalizable {
|
||||
public static final Parcelable.Creator<Error> CREATOR = new Parcelable.Creator<Error>(){
|
||||
|
||||
public Error createFromParcel(Parcel parcel) {
|
||||
return new Error(parcel);
|
||||
}
|
||||
|
||||
public Error[] newArray(int n2) {
|
||||
return new Error[n2];
|
||||
}
|
||||
};
|
||||
public static final String ERROR_DOMAIN = "NimbleError";
|
||||
private static final long serialVersionUID = 1L;
|
||||
private int m_code;
|
||||
private String m_domain;
|
||||
|
||||
public Error() {
|
||||
}
|
||||
|
||||
public Error(Parcel parcel) {
|
||||
this.readFromParcel(parcel);
|
||||
}
|
||||
|
||||
public Error(Code code, String string2) {
|
||||
this(code, string2, null);
|
||||
}
|
||||
|
||||
public Error(Code code, String string2, Throwable throwable) {
|
||||
this(ERROR_DOMAIN, code.intValue(), string2, throwable);
|
||||
}
|
||||
|
||||
public Error(String string2, int n2, String string3) {
|
||||
this(string2, n2, string3, null);
|
||||
}
|
||||
|
||||
public Error(String string2, int n2, String string3, Throwable throwable) {
|
||||
super(string3, throwable);
|
||||
this.m_domain = string2;
|
||||
this.m_code = n2;
|
||||
}
|
||||
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return this.m_code;
|
||||
}
|
||||
|
||||
public String getDomain() {
|
||||
return this.m_domain;
|
||||
}
|
||||
|
||||
public boolean isError(Code code) {
|
||||
if (this.m_code != code.intValue()) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readExternal(ObjectInput objectInput) throws IOException, ClassNotFoundException {
|
||||
this.m_domain = objectInput.readUTF();
|
||||
this.m_code = objectInput.readInt();
|
||||
this.initCause((Throwable)objectInput.readObject());
|
||||
}
|
||||
|
||||
public void readFromParcel(Parcel parcel) {
|
||||
this.m_domain = parcel.readString();
|
||||
this.m_code = parcel.readInt();
|
||||
this.initCause((Throwable)parcel.readSerializable());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
if (this.m_domain != null && this.m_domain.length() > 0) {
|
||||
stringBuilder.append(this.m_domain).append("(");
|
||||
} else {
|
||||
stringBuilder.append("Error").append("(");
|
||||
}
|
||||
stringBuilder.append(this.m_code).append(")");
|
||||
Object object = this.getLocalizedMessage();
|
||||
if (object != null && ((String)object).length() > 0) {
|
||||
stringBuilder.append(": ").append((String)object);
|
||||
}
|
||||
if ((object = this.getCause()) == null) return stringBuilder.toString();
|
||||
stringBuilder.append("\nCaused by: ");
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
((Throwable)object).printStackTrace(new PrintWriter(stringWriter));
|
||||
stringBuilder.append(stringWriter.toString());
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeExternal(ObjectOutput objectOutput) throws IOException {
|
||||
if (this.m_domain != null && this.m_domain.length() > 0) {
|
||||
objectOutput.writeUTF(this.m_domain);
|
||||
} else {
|
||||
objectOutput.writeUTF("");
|
||||
}
|
||||
objectOutput.writeInt(this.m_code);
|
||||
objectOutput.writeObject(this.getCause());
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel parcel, int n2) {
|
||||
if (this.m_domain != null && this.m_domain.length() > 0) {
|
||||
parcel.writeString(this.m_domain);
|
||||
} else {
|
||||
parcel.writeString("");
|
||||
}
|
||||
parcel.writeInt(this.m_code);
|
||||
Throwable throwable = this.getCause();
|
||||
if (throwable != null) {
|
||||
parcel.writeSerializable((Serializable)throwable);
|
||||
return;
|
||||
}
|
||||
parcel.writeSerializable((Serializable)((Object)""));
|
||||
}
|
||||
|
||||
public static enum Code {
|
||||
UNKNOWN(0),
|
||||
SYSTEM_UNEXPECTED(100),
|
||||
NOT_READY(101),
|
||||
UNSUPPORTED(102),
|
||||
NOT_AVAILABLE(103),
|
||||
NOT_IMPLEMENTED(104),
|
||||
INVALID_ARGUMENT(301),
|
||||
MISSING_CALLBACK(300),
|
||||
NETWORK_UNSUPPORTED_CONNECTION_TYPE(1001),
|
||||
NETWORK_NO_CONNECTION(1002),
|
||||
NETWORK_UNREACHABLE(1003),
|
||||
NETWORK_OVERSIZE_DATA(1004),
|
||||
NETWORK_OPERATION_CANCELLED(1005),
|
||||
NETWORK_INVALID_SERVER_RESPONSE(1006),
|
||||
NETWORK_TIMEOUT(1007),
|
||||
NETWORK_CONNECTION_ERROR(1010),
|
||||
SYNERGY_SERVER_FULL(2001),
|
||||
SYNERGY_GET_DIRECTION_TIMEOUT(2002),
|
||||
SYNERGY_GET_EA_DEVICE_ID_FAILURE(2003),
|
||||
SYNERGY_VALIDATE_EA_DEVICE_ID_FAILURE(2004),
|
||||
SYNERGY_GET_ANONYMOUS_ID_FAILURE(2005),
|
||||
SYNERGY_ENVIRONMENT_UPDATE_FAILURE(2006),
|
||||
SYNERGY_PURCHASE_VERIFICATION_FAILURE(2007),
|
||||
SYNERGY_GET_NONCE_FAILURE(2008),
|
||||
SYNERGY_GET_AGE_COMPLIANCE_FAILURE(2009);
|
||||
|
||||
private int m_value;
|
||||
|
||||
private Code(int n3) {
|
||||
this.m_value = n3;
|
||||
}
|
||||
|
||||
public int intValue() {
|
||||
return this.m_value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class Facebook {
|
||||
public static final String COMPONENT_ID = "com.ea.nimble.facebook";
|
||||
|
||||
private static void initialize() {
|
||||
Base.registerComponent(new FacebookImpl(), "com.ea.nimble.facebook");
|
||||
}
|
||||
|
||||
public static IFacebook getComponent() {
|
||||
return (IFacebook) Base.getComponent("com.ea.nimble.facebook");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface FacebookCallback {
|
||||
void callback(IFacebook iFacebook, boolean z, Exception exc);
|
||||
}
|
||||
@@ -0,0 +1,386 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import com.ea.nimble.Error;
|
||||
import com.ea.nimble.IApplicationLifecycle;
|
||||
import com.ea.nimble.IFacebook;
|
||||
import com.ea.nimble.Log;
|
||||
import com.ea.nimble.NimbleFacebookError;
|
||||
import com.facebook.AccessToken;
|
||||
import com.facebook.CallbackManager;
|
||||
import com.facebook.FacebookException;
|
||||
import com.facebook.FacebookSdk;
|
||||
import com.facebook.GraphRequest;
|
||||
import com.facebook.HttpMethod;
|
||||
import com.facebook.Profile;
|
||||
import com.facebook.login.LoginManager;
|
||||
import com.facebook.login.LoginResult;
|
||||
import com.facebook.share.internal.ShareConstants;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class FacebookImpl extends Component implements IFacebook, LogSource, IApplicationLifecycle.ActivityLifecycleCallbacks, IApplicationLifecycle.ActivityEventCallbacks {
|
||||
private CallbackManager m_callbackManager = null;
|
||||
private IFacebook.RequestCallback m_loginCallback = null;
|
||||
|
||||
@Override // com.ea.nimble.Component
|
||||
public String getComponentId() {
|
||||
return "com.ea.nimble.facebook";
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.LogSource
|
||||
public String getLogSourceTitle() {
|
||||
return "FB-Android";
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks
|
||||
public void onActivityDestroyed(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks
|
||||
public void onActivityPaused(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks
|
||||
public void onActivityResumed(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks
|
||||
public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks
|
||||
public void onActivityStarted(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks
|
||||
public void onActivityStopped(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ActivityEventCallbacks
|
||||
public boolean onBackPressed() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ActivityEventCallbacks
|
||||
public void onNewIntent(Activity activity, Intent intent) {
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ActivityEventCallbacks
|
||||
public void onWindowFocusChanged(boolean z) {
|
||||
}
|
||||
|
||||
FacebookImpl() {
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.Component
|
||||
protected void setup() {
|
||||
Log.Helper.LOGV(this, "Using Facebook SDK version " + FacebookSdk.getSdkVersion() + ".", new Object[0]);
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.Component
|
||||
public void restore() {
|
||||
ApplicationLifecycle.getComponent().registerActivityEventCallbacks(this);
|
||||
ApplicationLifecycle.getComponent().registerActivityLifecycleCallbacks(this);
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.Component
|
||||
protected void cleanup() {
|
||||
ApplicationLifecycle.getComponent().unregisterActivityLifecycleCallbacks(this);
|
||||
ApplicationLifecycle.getComponent().unregisterActivityEventCallbacks(this);
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ActivityEventCallbacks
|
||||
public void onActivityResult(Activity activity, int i, int i2, Intent intent) {
|
||||
if (this.m_callbackManager != null) {
|
||||
this.m_callbackManager.onActivityResult(i, i2, intent);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks
|
||||
public void onActivityCreated(Activity activity, Bundle bundle) {
|
||||
this.m_callbackManager = CallbackManager.Factory.create();
|
||||
LoginManager.getInstance().registerCallback(this.m_callbackManager, new com.facebook.FacebookCallback<LoginResult>() { // from class: com.ea.nimble.FacebookImpl.1
|
||||
@Override // com.facebook.FacebookCallback
|
||||
public void onSuccess(LoginResult loginResult) {
|
||||
Log.Helper.LOGV(this, "Login success", new Object[0]);
|
||||
synchronized (this) {
|
||||
HashMap hashMap = new HashMap();
|
||||
hashMap.put("status", "loggedIn");
|
||||
Utility.sendBroadcast(IFacebook.NIMBLE_NOTIFICATION_FACEBOOK_STATUS_CHANGED, hashMap);
|
||||
if (FacebookImpl.this.m_loginCallback != null) {
|
||||
FacebookImpl.this.m_loginCallback.callback(null, null);
|
||||
FacebookImpl.this.m_loginCallback = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.facebook.FacebookCallback
|
||||
public void onCancel() {
|
||||
synchronized (this) {
|
||||
Log.Helper.LOGV(this, "Login canceled", new Object[0]);
|
||||
if (FacebookImpl.this.m_loginCallback != null) {
|
||||
FacebookImpl.this.m_loginCallback.callback(null, new Error(Error.Code.NETWORK_OPERATION_CANCELLED, "User canceled", (Throwable) null));
|
||||
FacebookImpl.this.m_loginCallback = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.facebook.FacebookCallback
|
||||
public void onError(FacebookException facebookException) {
|
||||
Log.Helper.LOGE(this, "Login failed\nError: %s", facebookException.toString());
|
||||
synchronized (this) {
|
||||
if (FacebookImpl.this.m_loginCallback != null) {
|
||||
FacebookImpl.this.m_loginCallback.callback(null, new Error(Error.Code.UNKNOWN, "Login failed", facebookException));
|
||||
FacebookImpl.this.m_loginCallback = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IFacebook
|
||||
public void login(List<String> list, IFacebook.RequestCallback requestCallback) {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
this.m_loginCallback = requestCallback;
|
||||
while (!FacebookSdk.isInitialized()) {
|
||||
try {
|
||||
Thread.sleep(10L);
|
||||
} catch (InterruptedException unused) {
|
||||
}
|
||||
}
|
||||
synchronized (this) {
|
||||
LoginManager.getInstance().logInWithReadPermissions(ApplicationEnvironment.getCurrentActivity(), list);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IFacebook
|
||||
public void logout() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
synchronized (this) {
|
||||
LoginManager.getInstance().logOut();
|
||||
AccessToken.setCurrentAccessToken(null);
|
||||
Profile.setCurrentProfile(null);
|
||||
HashMap hashMap = new HashMap();
|
||||
hashMap.put("status", "loggedOut");
|
||||
Utility.sendBroadcast(IFacebook.NIMBLE_NOTIFICATION_FACEBOOK_STATUS_CHANGED, hashMap);
|
||||
}
|
||||
}
|
||||
|
||||
private void sendGraphRequest(final String str, final HashMap<String, String> hashMap, String str2, final IFacebook.RequestCallback requestCallback) {
|
||||
Log.Helper.LOGFUNC(this);
|
||||
if (!hasOpenSession()) {
|
||||
Log.Helper.LOGD(this, "Unable to send FB Graph request to " + str + " as there is no currently active session.", new Object[0]);
|
||||
if (requestCallback != null) {
|
||||
requestCallback.callback(null, new Error(Error.Code.UNKNOWN, "Request failed as there is no active session."));
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() { // from class: com.ea.nimble.FacebookImpl.2
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
Bundle bundle = new Bundle();
|
||||
if (hashMap != null) {
|
||||
for (Map.Entry entry : hashMap.entrySet()) {
|
||||
bundle.putString((String) entry.getKey(), (String) entry.getValue());
|
||||
}
|
||||
}
|
||||
new GraphRequest(AccessToken.getCurrentAccessToken(), str, bundle, HttpMethod.GET, new GraphRequest.Callback() { // from class: com.ea.nimble.FacebookImpl.2.1
|
||||
/* JADX WARN: Removed duplicated region for block: B:10:? A[RETURN, SYNTHETIC] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:7:0x0072 */
|
||||
@Override // com.facebook.GraphRequest.Callback
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public void onCompleted(com.facebook.GraphResponse r6) {
|
||||
/*
|
||||
r5 = this;
|
||||
if (r6 == 0) goto L6b
|
||||
com.facebook.FacebookRequestError r0 = r6.getError()
|
||||
r1 = 0
|
||||
if (r0 == 0) goto L43
|
||||
com.ea.nimble.Error r0 = new com.ea.nimble.Error
|
||||
com.ea.nimble.Error$Code r2 = com.ea.nimble.Error.Code.UNKNOWN
|
||||
java.lang.String r3 = "Request failed."
|
||||
com.facebook.FacebookRequestError r4 = r6.getError()
|
||||
com.facebook.FacebookException r4 = r4.getException()
|
||||
r0.<init>(r2, r3, r4)
|
||||
java.lang.String r2 = "Facebook"
|
||||
java.lang.StringBuilder r3 = new java.lang.StringBuilder
|
||||
r3.<init>()
|
||||
java.lang.String r4 = "Response of FB Graph request to "
|
||||
r3.append(r4)
|
||||
com.ea.nimble.FacebookImpl$2 r4 = com.ea.nimble.FacebookImpl.AnonymousClass2.this
|
||||
java.lang.String r4 = r3
|
||||
r3.append(r4)
|
||||
java.lang.String r4 = " failed due to error: "
|
||||
r3.append(r4)
|
||||
java.lang.String r4 = r0.getMessage()
|
||||
r3.append(r4)
|
||||
java.lang.String r3 = r3.toString()
|
||||
java.lang.Object[] r1 = new java.lang.Object[r1]
|
||||
com.ea.nimble.Log.Helper.LOGDS(r2, r3, r1)
|
||||
goto L6c
|
||||
L43:
|
||||
java.lang.String r0 = "Facebook"
|
||||
java.lang.StringBuilder r2 = new java.lang.StringBuilder
|
||||
r2.<init>()
|
||||
java.lang.String r3 = "Response of FB Graph request "
|
||||
r2.append(r3)
|
||||
com.ea.nimble.FacebookImpl$2 r3 = com.ea.nimble.FacebookImpl.AnonymousClass2.this
|
||||
java.lang.String r3 = r3
|
||||
r2.append(r3)
|
||||
java.lang.String r3 = " returned with data: "
|
||||
r2.append(r3)
|
||||
org.json.JSONObject r3 = r6.getJSONObject()
|
||||
r2.append(r3)
|
||||
java.lang.String r2 = r2.toString()
|
||||
java.lang.Object[] r1 = new java.lang.Object[r1]
|
||||
com.ea.nimble.Log.Helper.LOGDS(r0, r2, r1)
|
||||
L6b:
|
||||
r0 = 0
|
||||
L6c:
|
||||
com.ea.nimble.FacebookImpl$2 r1 = com.ea.nimble.FacebookImpl.AnonymousClass2.this
|
||||
com.ea.nimble.IFacebook$RequestCallback r1 = r4
|
||||
if (r1 == 0) goto L7d
|
||||
com.ea.nimble.FacebookImpl$2 r1 = com.ea.nimble.FacebookImpl.AnonymousClass2.this
|
||||
com.ea.nimble.IFacebook$RequestCallback r1 = r4
|
||||
java.lang.String r6 = r6.getRawResponse()
|
||||
r1.callback(r6, r0)
|
||||
L7d:
|
||||
return
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.FacebookImpl.AnonymousClass2.AnonymousClass1.onCompleted(com.facebook.GraphResponse):void");
|
||||
}
|
||||
}).executeAsync();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IFacebook
|
||||
public void requestUserInfo(HashMap<String, String> hashMap, IFacebook.RequestCallback requestCallback) {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
if (hashMap == null || !hashMap.containsKey(GraphRequest.FIELDS_PARAM)) {
|
||||
hashMap = new HashMap<>();
|
||||
hashMap.put(GraphRequest.FIELDS_PARAM, "id, email, name, first_name, last_name, gender, link, locale, timezone, updated_time, verified");
|
||||
}
|
||||
sendGraphRequest("/me", hashMap, HttpGet.METHOD_NAME, requestCallback);
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IFacebook
|
||||
public void requestFriends(HashMap<String, String> hashMap, IFacebook.RequestCallback requestCallback) {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
sendGraphRequest("/me/friends", hashMap, HttpGet.METHOD_NAME, requestCallback);
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IFacebook
|
||||
public boolean hasOpenSession() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
AccessToken currentAccessToken = AccessToken.getCurrentAccessToken();
|
||||
return (currentAccessToken == null || currentAccessToken.isExpired()) ? false : true;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IFacebook
|
||||
public String getAccessToken() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
AccessToken currentAccessToken = AccessToken.getCurrentAccessToken();
|
||||
if (currentAccessToken != null) {
|
||||
return currentAccessToken.getToken();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IFacebook
|
||||
public List<String> getPermissions() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
AccessToken currentAccessToken = AccessToken.getCurrentAccessToken();
|
||||
if (currentAccessToken != null) {
|
||||
return new ArrayList(currentAccessToken.getPermissions());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IFacebook
|
||||
public Date getTokenExpirationDate() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
AccessToken currentAccessToken = AccessToken.getCurrentAccessToken();
|
||||
if (currentAccessToken != null) {
|
||||
return currentAccessToken.getExpires();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IFacebook
|
||||
public String getApplicationId() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
AccessToken currentAccessToken = AccessToken.getCurrentAccessToken();
|
||||
if (currentAccessToken != null) {
|
||||
return currentAccessToken.getApplicationId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IFacebook
|
||||
public void refreshToken() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
AccessToken.refreshCurrentAccessTokenAsync();
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IFacebook
|
||||
public Map<String, Object> getGraphUser() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
Profile currentProfile = Profile.getCurrentProfile();
|
||||
if (currentProfile == null) {
|
||||
return null;
|
||||
}
|
||||
HashMap hashMap = new HashMap();
|
||||
hashMap.put("first_name", currentProfile.getFirstName());
|
||||
hashMap.put("last_name", currentProfile.getLastName());
|
||||
hashMap.put("link", currentProfile.getLinkUri());
|
||||
hashMap.put("avatar", "https://graph.facebook.com/" + currentProfile.getId() + "/picture");
|
||||
hashMap.put("id", currentProfile.getId());
|
||||
return hashMap;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IFacebook
|
||||
public void retrieveFriends(int i, int i2, final IFacebook.FacebookFriendsCallback facebookFriendsCallback) {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
HashMap<String, String> hashMap = new HashMap<>();
|
||||
hashMap.put("offset", "" + i);
|
||||
hashMap.put("limit", "" + i2);
|
||||
hashMap.put(GraphRequest.FIELDS_PARAM, "name, id, picture.type(normal)");
|
||||
sendGraphRequest("/me/friends", hashMap, HttpGet.METHOD_NAME, new IFacebook.RequestCallback() { // from class: com.ea.nimble.FacebookImpl.3
|
||||
@Override // com.ea.nimble.IFacebook.RequestCallback
|
||||
public void callback(String str, Error error) {
|
||||
NimbleFacebookError nimbleFacebookError;
|
||||
JSONArray jSONArray = null;
|
||||
if (error != null) {
|
||||
nimbleFacebookError = new NimbleFacebookError(NimbleFacebookError.Code.FBSERVER_ERROR, error.toString());
|
||||
} else {
|
||||
try {
|
||||
jSONArray = new JSONObject(str).getJSONArray(ShareConstants.WEB_DIALOG_PARAM_DATA);
|
||||
nimbleFacebookError = null;
|
||||
} catch (JSONException e) {
|
||||
Log.Helper.LOGE(this, "JSON Exception encountered when parsing the facebook FQL query", new Object[0]);
|
||||
nimbleFacebookError = new NimbleFacebookError(NimbleFacebookError.Code.RESPONSE_PARSE_ERROR, e.toString());
|
||||
}
|
||||
}
|
||||
facebookFriendsCallback.callback(Facebook.getComponent(), jSONArray, nimbleFacebookError);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class Global {
|
||||
public static final String NIMBLE_AUTHENTICATOR_ANONYMOUS = "anonymous";
|
||||
public static final String NIMBLE_AUTHENTICATOR_FACEBOOK = "facebook";
|
||||
public static final String NIMBLE_AUTHENTICATOR_ORIGIN = "origin";
|
||||
public static final String NIMBLE_DOMAIN = "com.ea.nimble";
|
||||
public static final String NIMBLE_ID = "Nimble";
|
||||
public static final String NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID = "authenticatorId";
|
||||
public static final String NIMBLE_IDENTITY_DICTIONARY_KEY_PIDMAP_ID = "pidMapId";
|
||||
public static final String NIMBLE_NOTIFICATION_AGE_COMPLIANCE_DOB_UPDATE = "nimble.notification.ageCompliance.dobUpdate";
|
||||
public static final String NIMBLE_NOTIFICATION_ATTRIBUTION_DATA_AVAILABLE = "nimble.notification.attributionDataAvailable";
|
||||
public static final String NIMBLE_NOTIFICATION_IDENTITY_AUTHENTICATION_UPDATE = "nimble.notification.identity.authentication.update";
|
||||
public static final String NIMBLE_NOTIFICATION_IDENTITY_MAIN_AUTHENTICATOR_CHANGE = "nimble.notification.identity.main.authenticator.change";
|
||||
public static final String NIMBLE_NOTIFICATION_IDENTITY_PERSONA_INFO_UPDATE = "nimble.notification.identity.authenticator.persona.info.update";
|
||||
public static final String NIMBLE_NOTIFICATION_IDENTITY_PID_INFO_UPDATE = "nimble.notification.identity.authenticator.pid.info.update";
|
||||
public static final String NIMBLE_NOTIFICATION_IDENTITY_USER_INFO_UPDATE = "nimble.notification.identity.authenticator.user.info.update";
|
||||
public static final String NIMBLE_NOTIFICATION_PLAYERIDMAP_CHANGE = "nimble.notification.playerIdMapChange";
|
||||
public static final String NIMBLE_RELEASE_VERSION = "1.40.0.39";
|
||||
public static final String NIMBLE_SDK_VERSION = "1.40.0.39.0921";
|
||||
public static final String NOTIFICATION_CHANNEL_DEFAULT_DESCRIPTION_KEY = "com.ea.nimble.pushtng.channel.description";
|
||||
public static final String NOTIFICATION_CHANNEL_DEFAULT_ID = "nimble_default";
|
||||
public static final String NOTIFICATION_CHANNEL_DEFAULT_NAME_KEY = "com.ea.nimble.pushtng.channel.name";
|
||||
public static final String NOTIFICATION_CHANNEL_DEFAULT_NAME_VALUE = "Default";
|
||||
public static final String NOTIFICATION_CHANNEL_LOCAL_NOTIFICATION_ID_KEY = "com.ea.nimble.NimbleLocalNotifications.channel.id";
|
||||
public static final String NOTIFICATION_CHANNEL_PUSHTNG_ID_KEY = "com.ea.nimble.pushtng.channel.id";
|
||||
public static final String NOTIFICATION_COMPONENT_INDEPENDENT_SETUP_FINISHED = "nimble.notification.componentIndependentSetupFinished";
|
||||
public static final String NOTIFICATION_DICTIONARY_KEY_DETAIL_ERROR = "detailError";
|
||||
public static final String NOTIFICATION_DICTIONARY_KEY_ERROR = "error";
|
||||
public static final String NOTIFICATION_DICTIONARY_KEY_RESULT = "result";
|
||||
public static final String NOTIFICATION_DICTIONARY_RESULT_FAIL = "0";
|
||||
public static final String NOTIFICATION_DICTIONARY_RESULT_SUCCESS = "1";
|
||||
public static final String NOTIFICATION_LANGUAGE_CHANGE = "nimble.notification.languageChange";
|
||||
public static final String NOTIFICATION_LOGIN_STATUS_CHANGE = "nimble.notification.loginStatusChange";
|
||||
public static final String NOTIFICATION_NETWORK_STATUS_CHANGE = "nimble.notification.networkStatusChange";
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class HttpError extends Error {
|
||||
public static final String ERROR_DOMAIN = "HttpError";
|
||||
private static final long serialVersionUID = 1;
|
||||
|
||||
public HttpError(int i, String str, Throwable th) {
|
||||
super(ERROR_DOMAIN, i, str, th);
|
||||
}
|
||||
|
||||
public HttpError(int i, String str) {
|
||||
super(ERROR_DOMAIN, i, str, null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
import com.ea.nimble.IHttpRequest;
|
||||
import com.ea.nimble.Log;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class HttpRequest implements IHttpRequest {
|
||||
private static int DEFAULT_NETWORK_TIMEOUT = 30;
|
||||
public ByteArrayOutputStream data;
|
||||
public HashMap<String, String> headers;
|
||||
public IHttpRequest.Method method;
|
||||
public boolean runInBackground;
|
||||
public String targetFilePath;
|
||||
public double timeout;
|
||||
public URL url;
|
||||
|
||||
public HttpRequest() {
|
||||
this.url = null;
|
||||
this.method = IHttpRequest.Method.GET;
|
||||
this.data = new ByteArrayOutputStream();
|
||||
this.headers = new HashMap<>();
|
||||
this.timeout = DEFAULT_NETWORK_TIMEOUT;
|
||||
this.targetFilePath = null;
|
||||
}
|
||||
|
||||
public HttpRequest(URL url) {
|
||||
this();
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IHttpRequest
|
||||
public URL getUrl() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.url;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IHttpRequest
|
||||
public IHttpRequest.Method getMethod() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.method;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IHttpRequest
|
||||
public byte[] getData() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.data.toByteArray();
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IHttpRequest
|
||||
public HashMap<String, String> getHeaders() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.headers;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IHttpRequest
|
||||
public double getTimeout() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.timeout;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IHttpRequest
|
||||
public String getTargetFilePath() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.targetFilePath;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IHttpRequest
|
||||
public boolean getRunInBackground() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.runInBackground;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
import com.ea.nimble.Log;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class HttpResponse implements IHttpResponse {
|
||||
public Exception error;
|
||||
public URL url = null;
|
||||
public boolean isCompleted = false;
|
||||
public int statusCode = 0;
|
||||
public HashMap<String, String> headers = new HashMap<>();
|
||||
public long expectedContentLength = 0;
|
||||
public long downloadedContentLength = 0;
|
||||
public long lastModified = -1;
|
||||
public ByteBufferIOStream data = new ByteBufferIOStream();
|
||||
|
||||
@Override // com.ea.nimble.IHttpResponse
|
||||
public boolean isCompleted() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.isCompleted;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IHttpResponse
|
||||
public URL getUrl() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.url;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IHttpResponse
|
||||
public int getStatusCode() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.statusCode;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IHttpResponse
|
||||
public Map<String, String> getHeaders() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.headers;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IHttpResponse
|
||||
public long getExpectedContentLength() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.expectedContentLength;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IHttpResponse
|
||||
public long getDownloadedContentLength() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.downloadedContentLength;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IHttpResponse
|
||||
public Date getLastModified() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
if (this.lastModified == 0) {
|
||||
return new Date();
|
||||
}
|
||||
if (this.lastModified > 0) {
|
||||
return new Date(this.lastModified);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IHttpResponse
|
||||
public InputStream getDataStream() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.data.getInputStream();
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IHttpResponse
|
||||
public Exception getError() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.error;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
import android.content.Context;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IApplicationEnvironment {
|
||||
public static final String UNAVAILABLE_ADVERTISING_ID = "";
|
||||
|
||||
public interface AdvertisingIdCalback {
|
||||
void onCallback(String str, boolean z);
|
||||
}
|
||||
|
||||
public interface SafetyNetAttestationCallback {
|
||||
void onCallback(String str, Error error);
|
||||
}
|
||||
|
||||
String getAdvertisingId();
|
||||
|
||||
int getAgeCompliance();
|
||||
|
||||
String getAndroidId();
|
||||
|
||||
String getApplicationBundleId();
|
||||
|
||||
Context getApplicationContext();
|
||||
|
||||
String getApplicationLanguageCode();
|
||||
|
||||
String getApplicationName();
|
||||
|
||||
String getApplicationVersion();
|
||||
|
||||
String getCachePath();
|
||||
|
||||
String getCarrier();
|
||||
|
||||
String getCurrencyCode();
|
||||
|
||||
String getDeviceBrand();
|
||||
|
||||
String getDeviceCodename();
|
||||
|
||||
String getDeviceFingerprint();
|
||||
|
||||
String getDeviceManufacturer();
|
||||
|
||||
String getDeviceModel();
|
||||
|
||||
String getDeviceString();
|
||||
|
||||
String getDocumentPath();
|
||||
|
||||
String getGameSpecifiedPlayerId();
|
||||
|
||||
String getGoogleAdvertisingId();
|
||||
|
||||
String getGoogleEmail();
|
||||
|
||||
boolean getIadAttribution();
|
||||
|
||||
String getOsVersion();
|
||||
|
||||
String getParameter(String str);
|
||||
|
||||
Map<String, String> getPlayerIdMap();
|
||||
|
||||
String getShortApplicationLanguageCode();
|
||||
|
||||
String getTempPath();
|
||||
|
||||
boolean isAppCracked();
|
||||
|
||||
boolean isDeviceRooted();
|
||||
|
||||
boolean isLimitAdTrackingEnabled();
|
||||
|
||||
void refreshAgeCompliance();
|
||||
|
||||
void requestSafetyNetAttestation(byte[] bArr, SafetyNetAttestationCallback safetyNetAttestationCallback);
|
||||
|
||||
void retrieveAdvertisingId(AdvertisingIdCalback advertisingIdCalback);
|
||||
|
||||
void setApplicationLanguageCode(String str);
|
||||
|
||||
void setGameSpecifiedPlayerId(String str);
|
||||
|
||||
void setPlayerId(String str, String str2);
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IApplicationLifecycle {
|
||||
|
||||
public interface ActivityEventCallbacks {
|
||||
void onActivityResult(Activity activity, int i, int i2, Intent intent);
|
||||
|
||||
boolean onBackPressed();
|
||||
|
||||
void onNewIntent(Activity activity, Intent intent);
|
||||
|
||||
void onWindowFocusChanged(boolean z);
|
||||
}
|
||||
|
||||
public static class ActivityEventHandler implements ActivityEventCallbacks {
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ActivityEventCallbacks
|
||||
public void onActivityResult(Activity activity, int i, int i2, Intent intent) {
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ActivityEventCallbacks
|
||||
public boolean onBackPressed() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ActivityEventCallbacks
|
||||
public void onNewIntent(Activity activity, Intent intent) {
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ActivityEventCallbacks
|
||||
public void onWindowFocusChanged(boolean z) {
|
||||
}
|
||||
}
|
||||
|
||||
public interface ActivityLifecycleCallbacks {
|
||||
void onActivityCreated(Activity activity, Bundle bundle);
|
||||
|
||||
void onActivityDestroyed(Activity activity);
|
||||
|
||||
void onActivityPaused(Activity activity);
|
||||
|
||||
void onActivityResumed(Activity activity);
|
||||
|
||||
void onActivitySaveInstanceState(Activity activity, Bundle bundle);
|
||||
|
||||
void onActivityStarted(Activity activity);
|
||||
|
||||
void onActivityStopped(Activity activity);
|
||||
}
|
||||
|
||||
public static class ActivityLifecycleHandler implements ActivityLifecycleCallbacks {
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks
|
||||
public void onActivityCreated(Activity activity, Bundle bundle) {
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks
|
||||
public void onActivityDestroyed(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks
|
||||
public void onActivityPaused(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks
|
||||
public void onActivityResumed(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks
|
||||
public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks
|
||||
public void onActivityStarted(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks
|
||||
public void onActivityStopped(Activity activity) {
|
||||
}
|
||||
}
|
||||
|
||||
public interface ApplicationLifecycleCallbacks {
|
||||
void onApplicationLaunch(Intent intent);
|
||||
|
||||
void onApplicationQuit();
|
||||
|
||||
void onApplicationResume();
|
||||
|
||||
void onApplicationSuspend();
|
||||
}
|
||||
|
||||
boolean handleBackPressed();
|
||||
|
||||
void notifyActivityCreate(Bundle bundle, Activity activity);
|
||||
|
||||
void notifyActivityDestroy(Activity activity);
|
||||
|
||||
void notifyActivityOnNewIntent(Intent intent, Activity activity);
|
||||
|
||||
void notifyActivityPause(Activity activity);
|
||||
|
||||
void notifyActivityRestart(Activity activity);
|
||||
|
||||
void notifyActivityRestoreInstanceState(Bundle bundle, Activity activity);
|
||||
|
||||
void notifyActivityResult(int i, int i2, Intent intent, Activity activity);
|
||||
|
||||
void notifyActivityResume(Activity activity);
|
||||
|
||||
void notifyActivityRetainNonConfigurationInstance();
|
||||
|
||||
void notifyActivitySaveInstanceState(Bundle bundle, Activity activity);
|
||||
|
||||
void notifyActivityStart(Activity activity);
|
||||
|
||||
void notifyActivityStop(Activity activity);
|
||||
|
||||
void notifyActivityWindowFocusChanged(boolean z, Activity activity);
|
||||
|
||||
void registerActivityEventCallbacks(ActivityEventCallbacks activityEventCallbacks);
|
||||
|
||||
void registerActivityLifecycleCallbacks(ActivityLifecycleCallbacks activityLifecycleCallbacks);
|
||||
|
||||
void registerApplicationLifecycleCallbacks(ApplicationLifecycleCallbacks applicationLifecycleCallbacks);
|
||||
|
||||
void unregisterActivityEventCallbacks(ActivityEventCallbacks activityEventCallbacks);
|
||||
|
||||
void unregisterActivityLifecycleCallbacks(ActivityLifecycleCallbacks activityLifecycleCallbacks);
|
||||
|
||||
void unregisterApplicationLifecycleCallbacks(ApplicationLifecycleCallbacks applicationLifecycleCallbacks);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.json.JSONArray;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IFacebook {
|
||||
public static final String NIMBLE_NOTIFICATION_FACEBOOK_STATUS_CHANGED = "nimble.notification.facebook.statuschanged";
|
||||
|
||||
public interface FacebookFriendsCallback {
|
||||
void callback(IFacebook iFacebook, JSONArray jSONArray, Error error);
|
||||
}
|
||||
|
||||
public interface RequestCallback {
|
||||
void callback(String str, Error error);
|
||||
}
|
||||
|
||||
String getAccessToken();
|
||||
|
||||
String getApplicationId();
|
||||
|
||||
Map<String, Object> getGraphUser();
|
||||
|
||||
List<String> getPermissions();
|
||||
|
||||
Date getTokenExpirationDate();
|
||||
|
||||
boolean hasOpenSession();
|
||||
|
||||
void login(List<String> list, RequestCallback requestCallback);
|
||||
|
||||
void logout();
|
||||
|
||||
void refreshToken();
|
||||
|
||||
void requestFriends(HashMap<String, String> hashMap, RequestCallback requestCallback);
|
||||
|
||||
void requestUserInfo(HashMap<String, String> hashMap, RequestCallback requestCallback);
|
||||
|
||||
void retrieveFriends(int i, int i2, FacebookFriendsCallback facebookFriendsCallback);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.ea.nimble;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IHttpRequest {
|
||||
byte[] getData();
|
||||
|
||||
Map<String, String> getHeaders();
|
||||
|
||||
Method getMethod();
|
||||
|
||||
EnumSet<OverwritePolicy> getOverwritePolicy();
|
||||
|
||||
boolean getRunInBackground();
|
||||
|
||||
String getTargetFilePath();
|
||||
|
||||
double getTimeout();
|
||||
|
||||
URL getUrl();
|
||||
|
||||
static enum Method {
|
||||
GET("GET"),
|
||||
HEAD("HEAD"),
|
||||
POST("POST"),
|
||||
PUT("PUT"),
|
||||
DELETE("DELETE"),
|
||||
UNRECOGNIZED("UNRECOGNIZED");
|
||||
|
||||
private String title;
|
||||
|
||||
Method(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return title;
|
||||
}
|
||||
}
|
||||
|
||||
enum OverwritePolicy {
|
||||
RESUME_DOWNLOAD,
|
||||
DATE_CHECK,
|
||||
LENGTH_CHECK;
|
||||
|
||||
static final EnumSet<OverwritePolicy> OVERWRITE;
|
||||
static final EnumSet<OverwritePolicy> SMART;
|
||||
|
||||
static {
|
||||
OVERWRITE = EnumSet.noneOf(OverwritePolicy.class);
|
||||
SMART = EnumSet.allOf(OverwritePolicy.class);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IHttpResponse {
|
||||
InputStream getDataStream();
|
||||
|
||||
long getDownloadedContentLength();
|
||||
|
||||
Exception getError();
|
||||
|
||||
long getExpectedContentLength();
|
||||
|
||||
Map<String, String> getHeaders();
|
||||
|
||||
Date getLastModified();
|
||||
|
||||
int getStatusCode();
|
||||
|
||||
URL getUrl();
|
||||
|
||||
boolean isCompleted();
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ILog {
|
||||
|
||||
public interface LogCallback {
|
||||
void callback(int i, String str, String str2);
|
||||
}
|
||||
|
||||
String getLogFilePath();
|
||||
|
||||
int getThresholdLevel();
|
||||
|
||||
void setLogCallback(LogCallback logCallback);
|
||||
|
||||
void setThresholdLevel(int i);
|
||||
|
||||
void writeWithSource(int i, Object obj, String str, Object... objArr);
|
||||
|
||||
void writeWithTitle(int i, String str, String str2, Object... objArr);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
import com.ea.nimble.Network;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface INetwork {
|
||||
void forceRedetectNetworkStatus();
|
||||
|
||||
Network.Status getStatus();
|
||||
|
||||
boolean isNetworkWifi();
|
||||
|
||||
NetworkConnectionHandle sendDeleteRequest(URL url, HashMap<String, String> hashMap, NetworkConnectionCallback networkConnectionCallback);
|
||||
|
||||
NetworkConnectionHandle sendGetRequest(URL url, HashMap<String, String> hashMap, NetworkConnectionCallback networkConnectionCallback);
|
||||
|
||||
NetworkConnectionHandle sendPostRequest(URL url, HashMap<String, String> hashMap, byte[] bArr, NetworkConnectionCallback networkConnectionCallback);
|
||||
|
||||
NetworkConnectionHandle sendRequest(HttpRequest httpRequest, NetworkConnectionCallback networkConnectionCallback);
|
||||
|
||||
NetworkConnectionHandle sendRequest(HttpRequest httpRequest, NetworkConnectionCallback networkConnectionCallback, IOperationalTelemetryDispatch iOperationalTelemetryDispatch);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user