try to cut devmenu
This commit is contained in:
@@ -31,29 +31,24 @@
|
|||||||
android:icon="@drawable/icon"
|
android:icon="@drawable/icon"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:screenOrientation="landscape">
|
android:screenOrientation="landscape">
|
||||||
<activity android:name="com.ea.ironmonkey.devmenu.PuppetActivity" >
|
|
||||||
</activity>
|
|
||||||
|
|
||||||
<activity android:name="com.ea.ironmonkey.devmenu.MainActivity"/>
|
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name="com.ea.ironmonkey.devmenu.SettingsActivity"
|
|
||||||
android:title="Настройки" >
|
|
||||||
</activity>
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.ea.ironmonkey.GameActivity"
|
android:name="com.ea.ironmonkey.GameActivity"
|
||||||
android:alwaysRetainTaskState="true"
|
android:alwaysRetainTaskState="true"
|
||||||
android:configChanges="keyboardHidden|locale|orientation|screenSize|smallestScreenSize"
|
android:configChanges="keyboardHidden|locale|orientation|screenSize|smallestScreenSize"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
|
android:exported="true"
|
||||||
android:screenOrientation="landscape"
|
android:screenOrientation="landscape"
|
||||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
|
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="foo"
|
android:name="foo"
|
||||||
android:value="bar" />
|
android:value="bar" />
|
||||||
|
<intent-filter>
|
||||||
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity android:name="com.ea.ironmonkey.devmenu.RecoverListActivity" />
|
|
||||||
|
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import com.ea.EAIO.EAIO
|
|||||||
import com.ea.EAMIO.StorageDirectory
|
import com.ea.EAMIO.StorageDirectory
|
||||||
import com.ea.easp.EASPHandler
|
import com.ea.easp.EASPHandler
|
||||||
import com.ea.games.nfs13_na.BuildConfig
|
import com.ea.games.nfs13_na.BuildConfig
|
||||||
import com.ea.nimble.ApplicationLifecycle
|
//import com.ea.nimble.ApplicationLifecycle
|
||||||
import java.io.BufferedReader
|
import java.io.BufferedReader
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.FileReader
|
import java.io.FileReader
|
||||||
@@ -283,7 +283,7 @@ class GameActivity : ComponentActivity(), DrawFrameListener {
|
|||||||
public override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
public override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
super.onActivityResult(requestCode, resultCode, data)
|
super.onActivityResult(requestCode, resultCode, data)
|
||||||
easpHandler!!.onActivityResult(requestCode, resultCode, data)
|
easpHandler!!.onActivityResult(requestCode, resultCode, data)
|
||||||
ApplicationLifecycle.onActivityResult(requestCode, resultCode, data, this)
|
//ApplicationLifecycle.onActivityResult(requestCode, resultCode, data, this)
|
||||||
}
|
}
|
||||||
|
|
||||||
public override fun onCreate(bundle: Bundle?) {
|
public override fun onCreate(bundle: Bundle?) {
|
||||||
@@ -352,7 +352,7 @@ class GameActivity : ComponentActivity(), DrawFrameListener {
|
|||||||
easpHandler = EASPHandler(this, frameLayout, gameGLSurfaceView)
|
easpHandler = EASPHandler(this, frameLayout, gameGLSurfaceView)
|
||||||
easpHandler.onCreate()
|
easpHandler.onCreate()
|
||||||
|
|
||||||
ApplicationLifecycle.onActivityCreate(bundle, this)
|
//ApplicationLifecycle.onActivityCreate(bundle, this)
|
||||||
Log.d(className, "nativeOnCreate")
|
Log.d(className, "nativeOnCreate")
|
||||||
nativeOnCreate()
|
nativeOnCreate()
|
||||||
|
|
||||||
@@ -366,7 +366,7 @@ class GameActivity : ComponentActivity(), DrawFrameListener {
|
|||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
easpHandler.onDestroy()
|
easpHandler.onDestroy()
|
||||||
if (state == 8) {
|
if (state == 8) {
|
||||||
ApplicationLifecycle.onActivityDestroy(this)
|
//ApplicationLifecycle.onActivityDestroy(this)
|
||||||
nativeOnDestroy()
|
nativeOnDestroy()
|
||||||
}
|
}
|
||||||
StorageDirectory.Shutdown()
|
StorageDirectory.Shutdown()
|
||||||
@@ -480,7 +480,7 @@ class GameActivity : ComponentActivity(), DrawFrameListener {
|
|||||||
mAudioManager!!.setStreamMute(3, true)
|
mAudioManager!!.setStreamMute(3, true)
|
||||||
gameGLSurfaceView.onPause()
|
gameGLSurfaceView.onPause()
|
||||||
onWindowFocusChanged(false)
|
onWindowFocusChanged(false)
|
||||||
ApplicationLifecycle.onActivityPause(this)
|
//ApplicationLifecycle.onActivityPause(this)
|
||||||
nativeOnPause()
|
nativeOnPause()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -489,7 +489,7 @@ class GameActivity : ComponentActivity(), DrawFrameListener {
|
|||||||
Log.i(this.localClassName, "onRestart")
|
Log.i(this.localClassName, "onRestart")
|
||||||
Log.i(this.localClassName, "TouchEvent, GameActivity.state = $state")
|
Log.i(this.localClassName, "TouchEvent, GameActivity.state = $state")
|
||||||
super.onRestart()
|
super.onRestart()
|
||||||
ApplicationLifecycle.onActivityRestart(this)
|
//ApplicationLifecycle.onActivityRestart(this)
|
||||||
nativeOnRestart()
|
nativeOnRestart()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -504,7 +504,7 @@ class GameActivity : ComponentActivity(), DrawFrameListener {
|
|||||||
gameRenderer.setDrawFrameListener(this)
|
gameRenderer.setDrawFrameListener(this)
|
||||||
}
|
}
|
||||||
gameGLSurfaceView.onResume()
|
gameGLSurfaceView.onResume()
|
||||||
ApplicationLifecycle.onActivityResume(this)
|
//ApplicationLifecycle.onActivityResume(this)
|
||||||
nativeOnResume()
|
nativeOnResume()
|
||||||
MogaController.doForAllControllers {
|
MogaController.doForAllControllers {
|
||||||
val event = MogaController.createConnectEvent(it)
|
val event = MogaController.createConnectEvent(it)
|
||||||
@@ -514,7 +514,7 @@ class GameActivity : ComponentActivity(), DrawFrameListener {
|
|||||||
|
|
||||||
public override fun onSaveInstanceState(bundle: Bundle) {
|
public override fun onSaveInstanceState(bundle: Bundle) {
|
||||||
super.onSaveInstanceState(bundle)
|
super.onSaveInstanceState(bundle)
|
||||||
ApplicationLifecycle.onActivitySaveInstanceState(bundle, this)
|
//ApplicationLifecycle.onActivitySaveInstanceState(bundle, this)
|
||||||
}
|
}
|
||||||
|
|
||||||
public override fun onStart() {
|
public override fun onStart() {
|
||||||
@@ -531,7 +531,7 @@ class GameActivity : ComponentActivity(), DrawFrameListener {
|
|||||||
nativeOnStart()
|
nativeOnStart()
|
||||||
Log.i(this.localClassName, "nativeOnStart - end")
|
Log.i(this.localClassName, "nativeOnStart - end")
|
||||||
Log.i(this.localClassName, "ApplicationLifecycle")
|
Log.i(this.localClassName, "ApplicationLifecycle")
|
||||||
ApplicationLifecycle.onActivityStart(this)
|
//ApplicationLifecycle.onActivityStart(this)
|
||||||
}
|
}
|
||||||
Log.w(
|
Log.w(
|
||||||
this.localClassName,
|
this.localClassName,
|
||||||
@@ -576,7 +576,7 @@ class GameActivity : ComponentActivity(), DrawFrameListener {
|
|||||||
gameRenderer.setDrawFrameListener(this)
|
gameRenderer.setDrawFrameListener(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ApplicationLifecycle.onActivityWindowFocusChanged(hasFocus, this)
|
//ApplicationLifecycle.onActivityWindowFocusChanged(hasFocus, this)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun parseCpuList(cpuInfo: String): List<Int> {
|
fun parseCpuList(cpuInfo: String): List<Int> {
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*
|
|
||||||
* Could not load the following classes:
|
|
||||||
* android.app.Activity
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import com.ea.nimble.ApplicationEnvironmentImpl;
|
|
||||||
import com.ea.nimble.BaseCore;
|
|
||||||
import com.ea.nimble.IApplicationEnvironment;
|
|
||||||
|
|
||||||
public class ApplicationEnvironment {
|
|
||||||
public static final String COMPONENT_ID = "com.ea.nimble.applicationEnvironment";
|
|
||||||
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 boolean isMainApplicationRunning() {
|
|
||||||
return ApplicationEnvironmentImpl.isMainApplicationRunning();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setCurrentActivity(Activity activity) {
|
|
||||||
ApplicationEnvironmentImpl.setCurrentActivity(activity);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,504 +0,0 @@
|
|||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import android.accounts.Account;
|
|
||||||
import android.accounts.AccountManager;
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.net.wifi.WifiInfo;
|
|
||||||
import android.net.wifi.WifiManager;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.telephony.TelephonyManager;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.util.Patterns;
|
|
||||||
|
|
||||||
import com.ea.nimble.Log.Helper;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
public class ApplicationEnvironmentImpl
|
|
||||||
extends Component
|
|
||||||
implements IApplicationEnvironment,
|
|
||||||
LogSource {
|
|
||||||
private static final int MILLIS_IN_AN_HOUR = 3600000;
|
|
||||||
private static final String NIMBLE_APPLICATIONENVIRONMENT_PERSISTENCE_GAME_SPECIFIED_ID = "nimble_applicationenvironment_game_specified_id";
|
|
||||||
private static final String PERSISTENCE_AGE_REQUIREMENTS = "ageRequirement";
|
|
||||||
private static final String PERSISTENCE_LANGUAGE = "language";
|
|
||||||
private static final String PERSISTENCE_TIME_RETRIEVED = "timeRetrieved";
|
|
||||||
private static final String SYNERGY_API_GET_AGE_REQUIREMENTS = "/rest/agerequirements/ip";
|
|
||||||
private static boolean isMainApplicationRunning = false;
|
|
||||||
private static Activity s_currentActivity = null;
|
|
||||||
private Context m_context;
|
|
||||||
private BaseCore m_core;
|
|
||||||
private String m_gameSpecifiedPlayerId;
|
|
||||||
private boolean m_googleAdvertiserInfoLoaded;
|
|
||||||
private String m_googleAdvertisingId;
|
|
||||||
private boolean m_googleLimitAdTrackingEnabled;
|
|
||||||
private String m_language;
|
|
||||||
private String m_packageId;
|
|
||||||
private String m_version;
|
|
||||||
|
|
||||||
ApplicationEnvironmentImpl(BaseCore fileArray) {
|
|
||||||
int n2 = 0;
|
|
||||||
this.m_googleAdvertisingId = "";
|
|
||||||
this.m_googleLimitAdTrackingEnabled = true;
|
|
||||||
this.m_googleAdvertiserInfoLoaded = false;
|
|
||||||
if (s_currentActivity == null) {
|
|
||||||
throw new AssertionError("Cannot create a ApplicationEnvironment without a valid current activity");
|
|
||||||
}
|
|
||||||
this.m_core = fileArray;
|
|
||||||
this.m_context = s_currentActivity.getApplicationContext();
|
|
||||||
this.m_language = null;
|
|
||||||
File documentPath = new File(this.getDocumentPath());
|
|
||||||
File tempPath = new File(this.getTempPath());
|
|
||||||
if (!documentPath.exists()) {
|
|
||||||
if (!documentPath.mkdirs()) throw new AssertionError("APP_ENV: Cannot create necessary folder");
|
|
||||||
}
|
|
||||||
Log.i("lol", tempPath.getAbsolutePath());
|
|
||||||
if (!tempPath.exists() && !tempPath.mkdirs()) {
|
|
||||||
throw new AssertionError("APP_ENV: Cannot create necessary folder");
|
|
||||||
}
|
|
||||||
File[] files = tempPath.listFiles();
|
|
||||||
int n3 = files.length;
|
|
||||||
while (n2 < n3) {
|
|
||||||
tempPath = files[n2];
|
|
||||||
tempPath.delete();
|
|
||||||
Log.d("Nimble", "APP_ENV: Delete temp file " + tempPath.getName());
|
|
||||||
++n2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static /* synthetic */ String access$002(ApplicationEnvironmentImpl applicationEnvironmentImpl, String string2) {
|
|
||||||
applicationEnvironmentImpl.m_googleAdvertisingId = string2;
|
|
||||||
return string2;
|
|
||||||
}
|
|
||||||
|
|
||||||
static /* synthetic */ boolean access$102(ApplicationEnvironmentImpl applicationEnvironmentImpl, boolean bl2) {
|
|
||||||
applicationEnvironmentImpl.m_googleLimitAdTrackingEnabled = bl2;
|
|
||||||
return bl2;
|
|
||||||
}
|
|
||||||
|
|
||||||
static /* synthetic */ boolean access$202(ApplicationEnvironmentImpl applicationEnvironmentImpl, boolean bl2) {
|
|
||||||
applicationEnvironmentImpl.m_googleAdvertiserInfoLoaded = bl2;
|
|
||||||
return bl2;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static boolean commandExists(String string2) {
|
|
||||||
String path = System.getenv("PATH");
|
|
||||||
if (path == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
String[] split = path.split(Pattern.quote(File.pathSeparator));
|
|
||||||
int n2 = split.length;
|
|
||||||
int n3 = 0;
|
|
||||||
while (n3 < n2) {
|
|
||||||
if (new File(split[n3], string2).exists()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
++n3;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Activity getCurrentActivity() {
|
|
||||||
return s_currentActivity;
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getDeviceLanguage() {
|
|
||||||
return Locale.getDefault().toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isMainApplicationRunning() {
|
|
||||||
return isMainApplicationRunning;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Enabled unnecessary exception pruning
|
|
||||||
*/
|
|
||||||
private void retrieveGoogleAdvertiserId() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setApplicationLanguageCode(String object, boolean bl2) {
|
|
||||||
if ((object = this.validatedLanguageCode((String)object, bl2)) == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (this.m_language != null && this.m_language.equals(object)) {
|
|
||||||
if (bl2) {
|
|
||||||
Helper.LOGD(this, "Setting the same language %s, skipping assignment", this.m_language);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.m_language = object;
|
|
||||||
Helper.LOGI(this, "Successfully set language to %s.", this.m_language);
|
|
||||||
Utility.sendBroadcast("nimble.notification.LanguageChanged", null);
|
|
||||||
}
|
|
||||||
if (bl2) return;
|
|
||||||
Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.applicationEnvironment", Persistence.Storage.DOCUMENT);
|
|
||||||
if (persistenceForNimbleComponent != null) {
|
|
||||||
Helper.LOGD(this, "Saving language data to persistence.");
|
|
||||||
persistenceForNimbleComponent.setValue(PERSISTENCE_LANGUAGE, (Serializable)((Object)this.m_language));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Helper.LOGE(this, "Could not get application environment persistence object to save to.");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setCurrentActivity(Activity activity) {
|
|
||||||
isMainApplicationRunning = true;
|
|
||||||
s_currentActivity = activity;
|
|
||||||
}
|
|
||||||
|
|
||||||
private String validatedLanguageCode(String string2, boolean bl2) {
|
|
||||||
if (!Utility.validString(string2)) {
|
|
||||||
Helper.LOGI(this, "AppEnv: Language parameter is null or empty; keeping language at previous value.");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
string2 = string2.replace('_', '-');
|
|
||||||
Object object = Pattern.compile("^([a-z]{2,3})?(-([A-Z][a-z]{3}))?(-([A-Z]{2}))?(-.*)*$").matcher(string2);
|
|
||||||
if (!((Matcher)object).find()) {
|
|
||||||
Helper.LOGE(this, "Malformed language code " + string2 + " cannot be validated; backend system will likely treat it as en-US.");
|
|
||||||
return string2;
|
|
||||||
}
|
|
||||||
String string3 = ((Matcher)object).group(1);
|
|
||||||
if (Utility.validString(string3) && !Arrays.asList(Locale.getISOLanguages()).contains(string3)) {
|
|
||||||
Helper.LOGE(this, "Unknown language code " + string3 + " in language code " + string2 + "; backend system will likely treat it as en-US.");
|
|
||||||
}
|
|
||||||
if (!Utility.validString((String)(object = ((Matcher)object).group(5)))) return string2;
|
|
||||||
if (Arrays.asList(Locale.getISOCountries()).contains(object)) return string2;
|
|
||||||
Helper.LOGE(this, "Unknown region code " + (String)object + " in language code " + string2 + "; backend system will likely treat it as en-US.");
|
|
||||||
return string2;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getAgeCompliance() {
|
|
||||||
Persistence persistence = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.applicationEnvironment", Persistence.Storage.CACHE);
|
|
||||||
Serializable serializable = persistence.getValue(PERSISTENCE_TIME_RETRIEVED);
|
|
||||||
if (serializable != null) {
|
|
||||||
if ((int)(new Date().getTime() - (Long)serializable) / 3600000 <= 24) return (Integer)persistence.getValue(PERSISTENCE_AGE_REQUIREMENTS);
|
|
||||||
Helper.LOGI(this, "getAgeCompliance- Stored value is older than 24 hours. Call refreshAgeCompliance to retrieve minAgeCompliance", new Object[]{null});
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
Helper.LOGI(this, "getAgeCompliance- No stored value in persistance. Call refreshAgeCompliance to retrieve minAgeCompliance.", new Object[]{null});
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getApplicationBundleId() {
|
|
||||||
if (this.m_packageId != null) return this.m_packageId;
|
|
||||||
Context context = this.getApplicationContext();
|
|
||||||
if (context == null) return this.m_packageId;
|
|
||||||
this.m_packageId = context.getPackageName();
|
|
||||||
return this.m_packageId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Context getApplicationContext() {
|
|
||||||
return this.m_context;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getApplicationLanguageCode() {
|
|
||||||
return this.m_language;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getApplicationName() {
|
|
||||||
Context context = this.getApplicationContext();
|
|
||||||
if (context != null) return context.getPackageManager().getApplicationLabel(context.getApplicationInfo()).toString();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getApplicationVersion() {
|
|
||||||
if (this.m_version != null) return this.m_version;
|
|
||||||
Context context = this.getApplicationContext();
|
|
||||||
if (context == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
this.m_version = context.getPackageManager().getPackageInfo((String)context.getPackageName(), (int)0).versionName;
|
|
||||||
return this.m_version;
|
|
||||||
}
|
|
||||||
catch (PackageManager.NameNotFoundException nameNotFoundException) {
|
|
||||||
Helper.LOGE(this, "Package name %s not found", context.getPackageName());
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getCachePath() {
|
|
||||||
return "/data/data/" + m_context.getPackageName() + File.separator + "cache" + File.separator + "Nimble" + File.separator + this.m_core.getConfiguration().toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getCarrier() {
|
|
||||||
Context context = this.getApplicationContext();
|
|
||||||
if (context != null) return ((TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE)).getNetworkOperator();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getComponentId() {
|
|
||||||
return "com.ea.nimble.applicationEnvironment";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getDeviceBrand() {
|
|
||||||
return Build.BRAND;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getDeviceCodename() {
|
|
||||||
return Build.DEVICE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getDeviceFingerprint() {
|
|
||||||
return Build.FINGERPRINT;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getDeviceManufacturer() {
|
|
||||||
return Build.MANUFACTURER;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getDeviceModel() {
|
|
||||||
return Build.MODEL;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getDeviceString() {
|
|
||||||
return Build.MANUFACTURER + Build.MODEL;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getDocumentPath() {
|
|
||||||
Context object = this.getApplicationContext();
|
|
||||||
if (object == null) {
|
|
||||||
String s = System.getProperty("user.dir") + File.separator + "doc";
|
|
||||||
return s + File.separator + "Nimble" + File.separator + this.m_core.getConfiguration().toString();
|
|
||||||
}
|
|
||||||
String path = object.getFilesDir().getPath();
|
|
||||||
return path + File.separator + "Nimble" + File.separator + this.m_core.getConfiguration().toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getGameSpecifiedPlayerId() {
|
|
||||||
return this.m_gameSpecifiedPlayerId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getGoogleAdvertisingId() {
|
|
||||||
long l2 = System.currentTimeMillis();
|
|
||||||
while (!this.m_googleAdvertiserInfoLoaded) {
|
|
||||||
if (System.currentTimeMillis() - l2 > 5000L) {
|
|
||||||
this.m_googleAdvertiserInfoLoaded = true;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
Thread.sleep(1L);
|
|
||||||
}
|
|
||||||
catch (InterruptedException interruptedException) {
|
|
||||||
Helper.LOGI(this, "Blocking call to getGoogleAdvertisingId was interrupted prematurely.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return this.m_googleAdvertisingId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getGoogleEmail() {
|
|
||||||
int n2 = 0;
|
|
||||||
AccountManager accountArray = AccountManager.get(this.getApplicationContext());
|
|
||||||
Account[] accountsByType = accountArray.getAccountsByType("com.google");
|
|
||||||
if (accountsByType.length > 0) {
|
|
||||||
return accountsByType[0].name;
|
|
||||||
}
|
|
||||||
Pattern emailAddress = Patterns.EMAIL_ADDRESS;
|
|
||||||
Account[] accounts = accountArray.getAccounts();
|
|
||||||
int n3 = accounts.length;
|
|
||||||
while (n2 < n3) {
|
|
||||||
Account account = accounts[n2];
|
|
||||||
if (emailAddress.matcher(account.name).matches()) {
|
|
||||||
return account.name;
|
|
||||||
}
|
|
||||||
++n2;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean getIadAttribution() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getLogSourceTitle() {
|
|
||||||
return "AppEnv";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getMACAddress() {
|
|
||||||
Context context = this.getApplicationContext();
|
|
||||||
if (context == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
WifiInfo wifi = ((WifiManager) context.getSystemService(Context.WIFI_SERVICE)).getConnectionInfo();
|
|
||||||
if ( null != wifi ) return wifi.getMacAddress();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getOsVersion() {
|
|
||||||
return String.valueOf(Build.VERSION.SDK_INT);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getShortApplicationLanguageCode() {
|
|
||||||
if (this.m_language == null) return this.m_language;
|
|
||||||
int n2 = this.m_language.indexOf(45);
|
|
||||||
if (n2 == -1) return this.m_language;
|
|
||||||
return this.m_language.substring(0, n2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTempPath() {
|
|
||||||
return this.getCachePath() + File.separator + "temp";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isAppCracked() {
|
|
||||||
Helper.LOGDS("FraudDetection", "Returning false for isAppCracked() since it hasn't been implemented yet");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isDeviceRooted() {
|
|
||||||
String string2 = Build.TAGS;
|
|
||||||
if (string2 != null && string2.contains("test-keys")) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (new File("/system/app/Superuser.apk").exists()) return true;
|
|
||||||
if (ApplicationEnvironmentImpl.commandExists("su")) return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isLimitAdTrackingEnabled() {
|
|
||||||
return this.m_googleLimitAdTrackingEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void refreshAgeCompliance() {
|
|
||||||
if (Network.getComponent().getStatus() != Network.Status.OK) {
|
|
||||||
Error error = new Error(Error.Code.NETWORK_NO_CONNECTION, "No network connection, Min Age cannot update.");
|
|
||||||
HashMap<String, Serializable> hashMap = new HashMap<String, Serializable>();
|
|
||||||
hashMap.put("result", (Serializable)((Object)"0"));
|
|
||||||
hashMap.put("error", error);
|
|
||||||
Utility.sendBroadcastSerializable("nimble.notification.age_compliance_refreshed", hashMap);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Object object = (SynergyRequest.SynergyRequestPreparingCallback) synergyRequest -> {
|
|
||||||
synergyRequest.baseUrl = SynergyEnvironment.getComponent().getServerUrlWithKey("geoip.url");
|
|
||||||
synergyRequest.send();
|
|
||||||
};
|
|
||||||
SynergyNetworkConnectionCallback synergyNetworkConnectionCallback = new SynergyNetworkConnectionCallback(){
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void callback(SynergyNetworkConnectionHandle object) {
|
|
||||||
HashMap<String, Serializable> hashMap = new HashMap<>();
|
|
||||||
if (object.getResponse().getError() == null) {
|
|
||||||
Integer n2 = (Integer)object.getResponse().getJsonData().get("code");
|
|
||||||
|
|
||||||
} else {
|
|
||||||
Helper.LOGD(this, "LOG_CALLBACK_ERROR : %s", object.getResponse().getError().getMessage());
|
|
||||||
hashMap.put("result", (Serializable)((Object)"0"));
|
|
||||||
hashMap.put("error", object.getResponse().getError());
|
|
||||||
}
|
|
||||||
Utility.sendBroadcastSerializable("nimble.notification.age_compliance_refreshed", hashMap);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
object = new SynergyRequest(SYNERGY_API_GET_AGE_REQUIREMENTS, IHttpRequest.Method.GET, (SynergyRequest.SynergyRequestPreparingCallback)object);
|
|
||||||
SynergyNetwork.getComponent().sendRequest((SynergyRequest)object, synergyNetworkConnectionCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void restore() {
|
|
||||||
Object object = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.applicationEnvironment", Persistence.Storage.DOCUMENT);
|
|
||||||
if (object == null) {
|
|
||||||
this.setApplicationLanguageCode(this.getDeviceLanguage(), true);
|
|
||||||
Helper.LOGWS("ApplicationEnvironment", "Persistence is null - Couldn't read Game Specified Player ID or Language from Persistence");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!Utility.validString(this.m_gameSpecifiedPlayerId)) {
|
|
||||||
Helper.LOGDS("ApplicationEnvironment", "Current game specified player ID is empty, reload from persistence");
|
|
||||||
this.m_gameSpecifiedPlayerId = ((Persistence)object).getStringValue(NIMBLE_APPLICATIONENVIRONMENT_PERSISTENCE_GAME_SPECIFIED_ID);
|
|
||||||
}
|
|
||||||
if (Utility.validString((String)(object = ((Persistence)object).getStringValue(PERSISTENCE_LANGUAGE)))) {
|
|
||||||
Helper.LOGD(this, "Restored language %s from persistence.", this.m_language);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Helper.LOGD(this, "Unable to restore language from persistence. Setting language to device language.");
|
|
||||||
this.setApplicationLanguageCode(this.getDeviceLanguage(), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void resume() {
|
|
||||||
try {
|
|
||||||
this.retrieveGoogleAdvertiserId();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
catch (VerifyError verifyError) {}
|
|
||||||
finally {
|
|
||||||
Helper.LOGW(this, "APP_ENV: Cannot get Google Advertising ID because this device is not supported");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setApplicationBundleId(String string2) {
|
|
||||||
this.m_packageId = string2;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setApplicationLanguageCode(String string2) {
|
|
||||||
this.setApplicationLanguageCode(string2, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setGameSpecifiedPlayerId(String object) {
|
|
||||||
this.m_gameSpecifiedPlayerId = object;
|
|
||||||
Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.applicationEnvironment", Persistence.Storage.DOCUMENT);
|
|
||||||
if (object == null) {
|
|
||||||
Helper.LOGWS("ApplicationEnvironment", "Persistence is null - Couldn't save Game Specified Player ID to Persistence");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
persistenceForNimbleComponent.setValue(NIMBLE_APPLICATIONENVIRONMENT_PERSISTENCE_GAME_SPECIFIED_ID, (Serializable)((Object)this.m_gameSpecifiedPlayerId));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setup() {
|
|
||||||
this.m_context = s_currentActivity.getApplicationContext();
|
|
||||||
try {
|
|
||||||
this.retrieveGoogleAdvertiserId();
|
|
||||||
}
|
|
||||||
catch (VerifyError verifyError) {}
|
|
||||||
finally {
|
|
||||||
Helper.LOGW(this, "APP_ENV: Cannot get Google Advertising ID because this device is not supported");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void teardown() {
|
|
||||||
this.m_context = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*
|
|
||||||
* Could not load the following classes:
|
|
||||||
* android.app.Activity
|
|
||||||
* android.content.Intent
|
|
||||||
* android.os.Bundle
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import com.ea.nimble.ApplicationEnvironment;
|
|
||||||
import com.ea.nimble.BaseCore;
|
|
||||||
import com.ea.nimble.IApplicationLifecycle;
|
|
||||||
|
|
||||||
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);
|
|
||||||
ApplicationLifecycle.getComponent().notifyActivityCreate(bundle, activity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onActivityDestroy(Activity activity) {
|
|
||||||
ApplicationLifecycle.getComponent().notifyActivityDestroy(activity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onActivityPause(Activity activity) {
|
|
||||||
ApplicationLifecycle.getComponent().notifyActivityPause(activity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onActivityRestart(Activity activity) {
|
|
||||||
ApplicationLifecycle.getComponent().notifyActivityRestart(activity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onActivityRestoreInstanceState(Bundle bundle, Activity activity) {
|
|
||||||
ApplicationLifecycle.getComponent().notifyActivityRestoreInstanceState(bundle, activity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onActivityResult(int n2, int n3, Intent intent, Activity activity) {
|
|
||||||
ApplicationLifecycle.getComponent().notifyActivityResult(n2, n3, intent, activity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onActivityResume(Activity activity) {
|
|
||||||
ApplicationLifecycle.getComponent().notifyActivityResume(activity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onActivityRetainNonConfigurationInstance() {
|
|
||||||
ApplicationLifecycle.getComponent().notifyActivityRetainNonConfigurationInstance();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onActivitySaveInstanceState(Bundle bundle, Activity activity) {
|
|
||||||
ApplicationLifecycle.getComponent().notifyActivitySaveInstanceState(bundle, activity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onActivityStart(Activity activity) {
|
|
||||||
ApplicationLifecycle.getComponent().notifyActivityStart(activity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onActivityStop(Activity activity) {
|
|
||||||
ApplicationLifecycle.getComponent().notifyActivityStop(activity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onActivityWindowFocusChanged(boolean bl2, Activity activity) {
|
|
||||||
ApplicationLifecycle.getComponent().notifyActivityWindowFocusChanged(bl2, activity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean onBackPressed() {
|
|
||||||
return ApplicationLifecycle.getComponent().handleBackPressed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,392 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*
|
|
||||||
* Could not load the following classes:
|
|
||||||
* android.annotation.SuppressLint
|
|
||||||
* android.app.Activity
|
|
||||||
* android.content.Intent
|
|
||||||
* android.os.Build$VERSION
|
|
||||||
* android.os.Bundle
|
|
||||||
*/
|
|
||||||
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 java.util.ArrayList;
|
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
class ApplicationLifecycleImpl
|
|
||||||
extends Component
|
|
||||||
implements IApplicationLifecycle,
|
|
||||||
LogSource {
|
|
||||||
private static final boolean RESTART_ON_CONFIG_CHANGE;
|
|
||||||
private ArrayList<IApplicationLifecycle.ActivityEventCallbacks> m_activityEventCallbacks;
|
|
||||||
private ArrayList<IApplicationLifecycle.ActivityLifecycleCallbacks> m_activityLifecycleCallbacks;
|
|
||||||
private ArrayList<IApplicationLifecycle.ApplicationLifecycleCallbacks> m_applicationLifecycleCallbacks;
|
|
||||||
private BaseCore m_core;
|
|
||||||
private int m_createdActivityCount;
|
|
||||||
private int m_runningActivityCount;
|
|
||||||
private State m_state;
|
|
||||||
|
|
||||||
static {
|
|
||||||
boolean bl2 = Build.VERSION.SDK_INT < 11;
|
|
||||||
RESTART_ON_CONFIG_CHANGE = bl2;
|
|
||||||
}
|
|
||||||
|
|
||||||
ApplicationLifecycleImpl(BaseCore baseCore) {
|
|
||||||
this.m_core = baseCore;
|
|
||||||
this.m_state = State.INIT;
|
|
||||||
this.m_createdActivityCount = 0;
|
|
||||||
this.m_runningActivityCount = 0;
|
|
||||||
this.m_activityLifecycleCallbacks = new ArrayList();
|
|
||||||
this.m_activityEventCallbacks = new ArrayList();
|
|
||||||
this.m_applicationLifecycleCallbacks = new ArrayList();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void notifyApplicationLaunch(Intent intent) {
|
|
||||||
Log.Helper.LOGD(this, "Application launch");
|
|
||||||
Iterator<IApplicationLifecycle.ApplicationLifecycleCallbacks> iterator = this.m_applicationLifecycleCallbacks.iterator();
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
iterator.next().onApplicationLaunch(intent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void notifyApplicationQuit() {
|
|
||||||
Iterator<IApplicationLifecycle.ApplicationLifecycleCallbacks> iterator = this.m_applicationLifecycleCallbacks.iterator();
|
|
||||||
while (true) {
|
|
||||||
if (!iterator.hasNext()) {
|
|
||||||
Log.Helper.LOGD(this, "Application quit");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
iterator.next().onApplicationQuit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void notifyApplicationResume() {
|
|
||||||
Log.Helper.LOGD(this, "Application resume");
|
|
||||||
Iterator<IApplicationLifecycle.ApplicationLifecycleCallbacks> iterator = this.m_applicationLifecycleCallbacks.iterator();
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
iterator.next().onApplicationResume();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void notifyApplicationSuspend() {
|
|
||||||
Iterator<IApplicationLifecycle.ApplicationLifecycleCallbacks> iterator = this.m_applicationLifecycleCallbacks.iterator();
|
|
||||||
while (true) {
|
|
||||||
if (!iterator.hasNext()) {
|
|
||||||
Log.Helper.LOGD(this, "Application suspend");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
iterator.next().onApplicationSuspend();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getComponentId() {
|
|
||||||
return "com.ea.nimble.applicationlifecycle";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getLogSourceTitle() {
|
|
||||||
return "AppLifecycle";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handleBackPressed() {
|
|
||||||
boolean bl2 = true;
|
|
||||||
for (ActivityEventCallbacks m_activityEventCallback : this.m_activityEventCallbacks) {
|
|
||||||
if (m_activityEventCallback.onBackPressed()) continue;
|
|
||||||
bl2 = false;
|
|
||||||
}
|
|
||||||
return bl2;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
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());
|
|
||||||
for (ActivityLifecycleCallbacks m_activityLifecycleCallback : this.m_activityLifecycleCallbacks) {
|
|
||||||
m_activityLifecycleCallback.onActivityCreated(activity, bundle);
|
|
||||||
}
|
|
||||||
this.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", 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");
|
|
||||||
}
|
|
||||||
if (RESTART_ON_CONFIG_CHANGE) {
|
|
||||||
this.m_core.onApplicationResume();
|
|
||||||
}
|
|
||||||
Iterator<IApplicationLifecycle.ActivityLifecycleCallbacks> iterator = this.m_activityLifecycleCallbacks.iterator();
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
iterator.next().onActivityCreated(activity, bundle);
|
|
||||||
}
|
|
||||||
if (this.m_runningActivityCount != 0) {
|
|
||||||
Log.Helper.LOGE(this, "Invalid running acitivity count %d", 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");
|
|
||||||
for (ActivityLifecycleCallbacks m_activityLifecycleCallback : this.m_activityLifecycleCallbacks) {
|
|
||||||
m_activityLifecycleCallback.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");
|
|
||||||
this.m_core.onApplicationResume();
|
|
||||||
this.m_state = State.RESUME;
|
|
||||||
Iterator<IApplicationLifecycle.ActivityLifecycleCallbacks> iterator = this.m_activityLifecycleCallbacks.iterator();
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
iterator.next().onActivityCreated(activity, bundle);
|
|
||||||
}
|
|
||||||
++this.m_createdActivityCount;
|
|
||||||
if (this.m_runningActivityCount != 0) {
|
|
||||||
Log.Helper.LOGE(this, "Invalid running acitivity count %d", 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(), this.m_createdActivityCount, this.m_runningActivityCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void notifyActivityDestroy(Activity activity) {
|
|
||||||
Log.Helper.LOGV(this, "Activity %s DESTROY", activity.getLocalClassName());
|
|
||||||
for (ActivityLifecycleCallbacks m_activityLifecycleCallback : this.m_activityLifecycleCallbacks) {
|
|
||||||
m_activityLifecycleCallback.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;
|
|
||||||
this.notifyApplicationQuit();
|
|
||||||
this.m_core.onApplicationQuit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Log.Helper.LOGV(this, "State after destroy %s (%d, %d)", this.m_state.toString(), this.m_createdActivityCount, this.m_runningActivityCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void notifyActivityPause(Activity activity) {
|
|
||||||
Log.Helper.LOGV(this, "Activity %s PAUSE", activity.getLocalClassName());
|
|
||||||
Iterator<IApplicationLifecycle.ActivityLifecycleCallbacks> iterator = this.m_activityLifecycleCallbacks.iterator();
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
iterator.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(), this.m_createdActivityCount, this.m_runningActivityCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
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");
|
|
||||||
} 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");
|
|
||||||
} 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(), this.m_createdActivityCount, this.m_runningActivityCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void notifyActivityRestoreInstanceState(Bundle bundle, Activity activity) {
|
|
||||||
Log.Helper.LOGV(this, "Activity %s RESTORE_STATE", activity.getLocalClassName());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void notifyActivityResult(int n2, int n3, Intent intent, Activity activity) {
|
|
||||||
Iterator<IApplicationLifecycle.ActivityEventCallbacks> iterator = this.m_activityEventCallbacks.iterator();
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
iterator.next().onActivityResult(activity, n2, n3, intent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void notifyActivityResume(Activity activity) {
|
|
||||||
Log.Helper.LOGV(this, "Activity %s RESUME", activity.getLocalClassName());
|
|
||||||
ApplicationEnvironment.setCurrentActivity(activity);
|
|
||||||
Iterator<IApplicationLifecycle.ActivityLifecycleCallbacks> iterator = this.m_activityLifecycleCallbacks.iterator();
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
iterator.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.");
|
|
||||||
}
|
|
||||||
this.m_state = State.RUN;
|
|
||||||
Log.Helper.LOGV(this, "State after resume %s (%d, %d)", this.m_state.toString(), this.m_createdActivityCount, this.m_runningActivityCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void notifyActivityRetainNonConfigurationInstance() {
|
|
||||||
if (!RESTART_ON_CONFIG_CHANGE) return;
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void notifyActivitySaveInstanceState(Bundle bundle, Activity activity) {
|
|
||||||
Log.Helper.LOGV(this, "Activity %s SAVE_STATE", activity.getLocalClassName());
|
|
||||||
Iterator<IApplicationLifecycle.ActivityLifecycleCallbacks> iterator = this.m_activityLifecycleCallbacks.iterator();
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
iterator.next().onActivitySaveInstanceState(activity, bundle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
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");
|
|
||||||
} else if (this.m_state == State.RESUME) {
|
|
||||||
Iterator<IApplicationLifecycle.ActivityLifecycleCallbacks> iterator = this.m_activityLifecycleCallbacks.iterator();
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
iterator.next().onActivityStarted(activity);
|
|
||||||
}
|
|
||||||
this.notifyApplicationResume();
|
|
||||||
this.m_state = State.PAUSE;
|
|
||||||
Log.Helper.LOGD(this, "Activity start with RESUME state, set to PAUSE");
|
|
||||||
} else if (this.m_state == State.CONFIG_CHANGE) {
|
|
||||||
Iterator<IApplicationLifecycle.ActivityLifecycleCallbacks> iterator = this.m_activityLifecycleCallbacks.iterator();
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
iterator.next().onActivityStarted(activity);
|
|
||||||
}
|
|
||||||
if (RESTART_ON_CONFIG_CHANGE) {
|
|
||||||
this.notifyApplicationResume();
|
|
||||||
}
|
|
||||||
this.m_state = State.PAUSE;
|
|
||||||
Log.Helper.LOGD(this, "Activity start with CONFIG_CHANGE state, set to PAUSE");
|
|
||||||
} else if (this.m_state == State.PAUSE) {
|
|
||||||
Log.Helper.LOGD(this, "Activity start with PAUSE state, normal activity switch");
|
|
||||||
} else {
|
|
||||||
Iterator<IApplicationLifecycle.ActivityLifecycleCallbacks> iterator = this.m_activityLifecycleCallbacks.iterator();
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
iterator.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(), this.m_createdActivityCount, this.m_runningActivityCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SuppressLint(value={"NewApi"})
|
|
||||||
public void notifyActivityStop(Activity activity) {
|
|
||||||
Log.Helper.LOGV(this, "Activity %s STOP", activity.getLocalClassName());
|
|
||||||
Iterator<IApplicationLifecycle.ActivityLifecycleCallbacks> iterator = this.m_activityLifecycleCallbacks.iterator();
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
iterator.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!!", new Object[]{this.m_state});
|
|
||||||
}
|
|
||||||
this.m_state = State.SUSPEND;
|
|
||||||
if (!activity.isFinishing()) {
|
|
||||||
this.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");
|
|
||||||
this.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());
|
|
||||||
}
|
|
||||||
if (ApplicationEnvironment.getCurrentActivity() == activity) {
|
|
||||||
ApplicationEnvironment.setCurrentActivity(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Log.Helper.LOGV(this, "State after stop %s (%d, %d)", this.m_state.toString(), this.m_createdActivityCount, this.m_runningActivityCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void notifyActivityWindowFocusChanged(boolean bl2, Activity object) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void registerActivityEventCallbacks(IApplicationLifecycle.ActivityEventCallbacks activityEventCallbacks) {
|
|
||||||
this.m_activityEventCallbacks.add(activityEventCallbacks);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void registerActivityLifecycleCallbacks(IApplicationLifecycle.ActivityLifecycleCallbacks activityLifecycleCallbacks) {
|
|
||||||
this.m_activityLifecycleCallbacks.add(activityLifecycleCallbacks);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void registerApplicationLifecycleCallbacks(IApplicationLifecycle.ApplicationLifecycleCallbacks applicationLifecycleCallbacks) {
|
|
||||||
this.m_applicationLifecycleCallbacks.add(applicationLifecycleCallbacks);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void teardown() {
|
|
||||||
this.m_activityLifecycleCallbacks.clear();
|
|
||||||
this.m_activityEventCallbacks.clear();
|
|
||||||
this.m_applicationLifecycleCallbacks.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void unregisterActivityEventCallbacks(IApplicationLifecycle.ActivityEventCallbacks activityEventCallbacks) {
|
|
||||||
this.m_activityEventCallbacks.remove(activityEventCallbacks);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void unregisterActivityLifecycleCallbacks(IApplicationLifecycle.ActivityLifecycleCallbacks activityLifecycleCallbacks) {
|
|
||||||
this.m_activityLifecycleCallbacks.remove(activityLifecycleCallbacks);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void unregisterApplicationLifecycleCallbacks(IApplicationLifecycle.ApplicationLifecycleCallbacks applicationLifecycleCallbacks) {
|
|
||||||
this.m_applicationLifecycleCallbacks.remove(applicationLifecycleCallbacks);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static enum State {
|
|
||||||
INIT,
|
|
||||||
LAUNCH,
|
|
||||||
RESUME,
|
|
||||||
RUN,
|
|
||||||
PAUSE,
|
|
||||||
SUSPEND,
|
|
||||||
QUIT,
|
|
||||||
CONFIG_CHANGE;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
public class BackgroundNetworkConnection
|
|
||||||
extends NetworkConnection {
|
|
||||||
public BackgroundNetworkConnection(NetworkImpl networkImpl, HttpRequest httpRequest, IOperationalTelemetryDispatch iOperationalTelemetryDispatch) {
|
|
||||||
super(networkImpl, httpRequest, iOperationalTelemetryDispatch);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void cancelForAppSuspend() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.BaseCore;
|
|
||||||
import com.ea.nimble.Component;
|
|
||||||
import com.ea.nimble.NimbleConfiguration;
|
|
||||||
|
|
||||||
public class Base {
|
|
||||||
public static Component getComponent(String string2) {
|
|
||||||
return BaseCore.getInstance().activeValidate().getComponentManager().getComponent(string2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Component[] getComponentList(String string2) {
|
|
||||||
return BaseCore.getInstance().activeValidate().getComponentManager().getComponentList(string2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static NimbleConfiguration getConfiguration() {
|
|
||||||
return BaseCore.getInstance().getConfiguration();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void registerComponent(Component component, String string2) {
|
|
||||||
BaseCore.getInstance().getComponentManager().registerComponent(component, string2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void restartWithConfiguration(NimbleConfiguration nimbleConfiguration) {
|
|
||||||
BaseCore.getInstance().activeValidate().restartWithConfiguration(nimbleConfiguration);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setupNimble() {
|
|
||||||
BaseCore.getInstance().setup();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void teardownNimble() {
|
|
||||||
BaseCore.getInstance().teardown();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,371 +0,0 @@
|
|||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.content.pm.Signature;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.os.Looper;
|
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import java.security.cert.CertificateException;
|
|
||||||
import java.security.cert.CertificateFactory;
|
|
||||||
import java.security.cert.X509Certificate;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import javax.security.auth.x500.X500Principal;
|
|
||||||
|
|
||||||
public 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 static BaseCore s_core;
|
|
||||||
protected static boolean s_coreDestroyed = false;
|
|
||||||
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 class AnonymousClass2 {
|
|
||||||
static final int[] $SwitchMap$com$ea$nimble$BaseCore$State = new int[State.values().length];
|
|
||||||
|
|
||||||
static {
|
|
||||||
try {
|
|
||||||
$SwitchMap$com$ea$nimble$BaseCore$State[State.INACTIVE.ordinal()] = 1;
|
|
||||||
} catch (NoSuchFieldError e) {
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
$SwitchMap$com$ea$nimble$BaseCore$State[State.MANUAL_TEARDOWN.ordinal()] = 2;
|
|
||||||
} catch (NoSuchFieldError e2) {
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
$SwitchMap$com$ea$nimble$BaseCore$State[State.DESTROY.ordinal()] = 3;
|
|
||||||
} catch (NoSuchFieldError e3) {
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
$SwitchMap$com$ea$nimble$BaseCore$State[State.AUTO_SETUP.ordinal()] = 4;
|
|
||||||
} catch (NoSuchFieldError e4) {
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
$SwitchMap$com$ea$nimble$BaseCore$State[State.MANUAL_SETUP.ordinal()] = 5;
|
|
||||||
} catch (NoSuchFieldError e5) {
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
$SwitchMap$com$ea$nimble$BaseCore$State[State.QUITTING.ordinal()] = 6;
|
|
||||||
} catch (NoSuchFieldError e6) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/BaseCore$State.class */
|
|
||||||
public enum State {
|
|
||||||
INACTIVE,
|
|
||||||
AUTO_SETUP,
|
|
||||||
MANUAL_SETUP,
|
|
||||||
MANUAL_TEARDOWN,
|
|
||||||
QUITTING,
|
|
||||||
DESTROY
|
|
||||||
}
|
|
||||||
|
|
||||||
BaseCore() {
|
|
||||||
}
|
|
||||||
|
|
||||||
private void destroy() {
|
|
||||||
Log.Helper.LOGD(this, "NIMBLE DESTROY for Android will keep Core and Static components alive", new Object[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static BaseCore getInstance() {
|
|
||||||
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)", "1.23.14.1217", "1.23.14.1217"));
|
|
||||||
s_core = new BaseCore();
|
|
||||||
s_core.initialize();
|
|
||||||
}
|
|
||||||
return s_core;
|
|
||||||
}
|
|
||||||
|
|
||||||
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();
|
|
||||||
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);
|
|
||||||
for (String str : getSettings(NIMBLE_COMPONENT_LIST).values()) {
|
|
||||||
try {
|
|
||||||
Method declaredMethod = Class.forName(str).getDeclaredMethod("initialize", new Class[0]);
|
|
||||||
declaredMethod.setAccessible(true);
|
|
||||||
declaredMethod.invoke(null, new Object[0]);
|
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
Log.Helper.LOGD(this, "Component " + str + " not found", new Object[0]);
|
|
||||||
} catch (IllegalAccessException e2) {
|
|
||||||
Log.Helper.LOGE(this, "Method " + str + ".initialize() is not accessible", new Object[0]);
|
|
||||||
} catch (IllegalArgumentException e3) {
|
|
||||||
Log.Helper.LOGE(this, "Method " + str + ".initialize() should take no arguments", new Object[0]);
|
|
||||||
} catch (NoSuchMethodException e4) {
|
|
||||||
Log.Helper.LOGE(this, "No method " + str + ".initialize()", new Object[0]);
|
|
||||||
} catch (NullPointerException e5) {
|
|
||||||
Log.Helper.LOGE(this, "Method " + str + ".initialize() should be static", new Object[0]);
|
|
||||||
} catch (InvocationTargetException e6) {
|
|
||||||
Log.Helper.LOGE(this, "Method " + str + ".initialize() threw an exception", new Object[0]);
|
|
||||||
e6.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 e7) {
|
|
||||||
android.util.Log.e(Global.NIMBLE_ID, String.format("Unable to verify application signature. Message: %s", e7.getMessage()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static void injectMock(BaseCore baseCore) {
|
|
||||||
if (baseCore == null) {
|
|
||||||
s_core = null;
|
|
||||||
s_coreDestroyed = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
s_core = baseCore;
|
|
||||||
s_coreDestroyed = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isAppSigned(Context context) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void loadConfiguration() {
|
|
||||||
try {
|
|
||||||
String string = ApplicationEnvironment.getCurrentActivity().getPackageManager().getApplicationInfo(ApplicationEnvironment.getCurrentActivity().getPackageName(), 128).metaData.getString(NIMBLE_SERVER_CONFIG);
|
|
||||||
if (Utility.validString(string)) {
|
|
||||||
this.m_configuration = NimbleConfiguration.fromName(string);
|
|
||||||
if (this.m_configuration != NimbleConfiguration.UNKNOWN) {
|
|
||||||
if (this.m_configuration != NimbleConfiguration.CUSTOMIZED) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
}
|
|
||||||
android.util.Log.e(Global.NIMBLE_ID, "WARNING! Cannot find valid NimbleConfiguration from AndroidManifest.xml");
|
|
||||||
this.m_configuration = NimbleConfiguration.LIVE;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BaseCore activeValidate() {
|
|
||||||
switch (AnonymousClass2.$SwitchMap$com$ea$nimble$BaseCore$State[this.m_state.ordinal()]) {
|
|
||||||
case 1:
|
|
||||||
Log.Helper.LOGF(this, "Access NimbleBaseCore before setup, call setupNimble() explicitly to activate it.", new Object[0]);
|
|
||||||
return null;
|
|
||||||
case 2:
|
|
||||||
Log.Helper.LOGF(this, "Access NimbleBaseCore after clean up, call setupNimble() explicitly again to activate it.", new Object[0]);
|
|
||||||
return null;
|
|
||||||
case 3:
|
|
||||||
Log.Helper.LOGF(this, "Accessing component after destroy, only static components are available right now.", new Object[0]);
|
|
||||||
return null;
|
|
||||||
default:
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public IApplicationEnvironment getApplicationEnvironment() {
|
|
||||||
return this.m_applicationEnvironment;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IApplicationLifecycle getApplicationLifecycle() {
|
|
||||||
return this.m_applicationLifecycle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ComponentManager getComponentManager() {
|
|
||||||
return this.m_componentManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public NimbleConfiguration getConfiguration() {
|
|
||||||
return this.m_configuration;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ILog getLog() {
|
|
||||||
return this.m_log;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IPersistenceService getPersistenceService() {
|
|
||||||
return this.m_persistenceService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, String> getSettings(String str) {
|
|
||||||
int identifier;
|
|
||||||
if (str == NIMBLE_LOG_SETTING) {
|
|
||||||
int identifier2 = ApplicationEnvironment.getComponent().getApplicationContext().getResources().getIdentifier("nimble_log", "xml", ApplicationEnvironment.getCurrentActivity().getPackageName());
|
|
||||||
if (identifier2 == 0) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return Utility.parseXmlFile(identifier2);
|
|
||||||
} else if (str != NIMBLE_COMPONENT_LIST || (identifier = ApplicationEnvironment.getComponent().getApplicationContext().getResources().getIdentifier("components", "xml", ApplicationEnvironment.getCurrentActivity().getPackageName())) == 0) {
|
|
||||||
return null;
|
|
||||||
} else {
|
|
||||||
return Utility.parseXmlFile(identifier);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isActive() {
|
|
||||||
return this.m_state == State.AUTO_SETUP || this.m_state == State.MANUAL_SETUP;
|
|
||||||
}
|
|
||||||
|
|
||||||
@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, null);
|
|
||||||
this.m_state = State.AUTO_SETUP;
|
|
||||||
try {
|
|
||||||
this.m_componentManager.restore();
|
|
||||||
} catch (AssertionError e) {
|
|
||||||
this.m_state = State.INACTIVE;
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.IApplicationLifecycle.ApplicationLifecycleCallbacks
|
|
||||||
public void onApplicationQuit() {
|
|
||||||
switch (AnonymousClass2.$SwitchMap$com$ea$nimble$BaseCore$State[this.m_state.ordinal()]) {
|
|
||||||
case 1:
|
|
||||||
Log.Helper.LOGF(this, "No app start before app quit, something must be wrong.", new Object[0]);
|
|
||||||
return;
|
|
||||||
case 2:
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
case 3:
|
|
||||||
case 6:
|
|
||||||
Log.Helper.LOGF(this, "Double app quit, something must be wrong.", new Object[0]);
|
|
||||||
return;
|
|
||||||
case 4:
|
|
||||||
this.m_componentManager.suspend();
|
|
||||||
return;
|
|
||||||
case 5:
|
|
||||||
this.m_componentManager.suspend();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@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 onApplicationSuspend() {
|
|
||||||
if (this.m_state == State.MANUAL_SETUP || this.m_state == State.AUTO_SETUP) {
|
|
||||||
this.m_componentManager.suspend();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void restartWithConfiguration(final NimbleConfiguration nimbleConfiguration) {
|
|
||||||
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
|
|
||||||
/* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
|
|
||||||
@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, null);
|
|
||||||
BaseCore.this.m_componentManager.restore();
|
|
||||||
return;
|
|
||||||
case 6:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Log.Helper.LOGF(this, "Cannot restart Nimble when app is quiting", new Object[0]);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setup() {
|
|
||||||
switch (AnonymousClass2.$SwitchMap$com$ea$nimble$BaseCore$State[this.m_state.ordinal()]) {
|
|
||||||
case 1:
|
|
||||||
case 2:
|
|
||||||
this.m_componentManager.setup();
|
|
||||||
this.m_state = State.MANUAL_SETUP;
|
|
||||||
Utility.sendBroadcast(Global.NOTIFICATION_COMPONENT_INDEPENDENT_SETUP_FINISHED, null);
|
|
||||||
this.m_componentManager.restore();
|
|
||||||
return;
|
|
||||||
case 3:
|
|
||||||
case 5:
|
|
||||||
case 6:
|
|
||||||
Log.Helper.LOGF(this, "Multiple setupNimble() calls without teardownNimble().", new Object[0]);
|
|
||||||
return;
|
|
||||||
case 4:
|
|
||||||
this.m_state = State.MANUAL_SETUP;
|
|
||||||
return;
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
|
|
||||||
public void teardown() {
|
|
||||||
switch (AnonymousClass2.$SwitchMap$com$ea$nimble$BaseCore$State[this.m_state.ordinal()]) {
|
|
||||||
case 1:
|
|
||||||
case 4:
|
|
||||||
Log.Helper.LOGF(this, "Cannot teardownNimble() before setupNimble().", new Object[0]);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
case 3:
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
this.m_componentManager.cleanup();
|
|
||||||
this.m_state = State.MANUAL_TEARDOWN;
|
|
||||||
this.m_componentManager.teardown();
|
|
||||||
return;
|
|
||||||
case 6:
|
|
||||||
this.m_state = State.DESTROY;
|
|
||||||
destroy();
|
|
||||||
return;
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Log.Helper.LOGF(this, "Multiple teardownNimble() calls without setupNibmle().", new Object[0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,305 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
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;
|
|
||||||
|
|
||||||
public class ByteBufferIOStream {
|
|
||||||
protected static final int SEGMENT_SIZE = 4096;
|
|
||||||
protected int m_availableSegment = 0;
|
|
||||||
protected LinkedList<byte[]> m_buffer = new LinkedList<>();
|
|
||||||
protected boolean m_closed = false;
|
|
||||||
protected ByteBufferInputStream m_input = new ByteBufferInputStream();
|
|
||||||
protected ByteBufferOutputStream m_output = new ByteBufferOutputStream();
|
|
||||||
protected int m_readPosition = 0;
|
|
||||||
protected int m_writePosition = 0;
|
|
||||||
|
|
||||||
public ByteBufferIOStream() {
|
|
||||||
this(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ByteBufferIOStream(int n2) {
|
|
||||||
int n3 = n2;
|
|
||||||
if (n2 <= 0) {
|
|
||||||
n3 = 1;
|
|
||||||
}
|
|
||||||
n3 = (n3 - 1) / 4096;
|
|
||||||
n2 = 0;
|
|
||||||
while (n2 < n3 + 1) {
|
|
||||||
this.m_buffer.add(new byte[4096]);
|
|
||||||
++n2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void appendSegmentToBuffer(byte[] byArray, int n2) throws IOException {
|
|
||||||
if (this.m_writePosition == 0 && byArray.length == 4096) {
|
|
||||||
ListIterator<byte[]> listIterator = this.m_buffer.listIterator();
|
|
||||||
for (int i2 = 0; i2 < this.m_availableSegment; ++i2) {
|
|
||||||
listIterator.next();
|
|
||||||
}
|
|
||||||
listIterator.add(byArray);
|
|
||||||
if (n2 != 4096) {
|
|
||||||
this.m_writePosition = n2;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
++this.m_availableSegment;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.getOutputStream().write(byArray, 0, n2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int available() throws IOException {
|
|
||||||
return this.m_input.available();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void clear() {
|
|
||||||
this.m_closed = false;
|
|
||||||
this.m_availableSegment = 0;
|
|
||||||
this.m_writePosition = 0;
|
|
||||||
this.m_readPosition = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void closeIOStream() {
|
|
||||||
this.m_closed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public InputStream getInputStream() {
|
|
||||||
return this.m_input;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OutputStream getOutputStream() {
|
|
||||||
return this.m_output;
|
|
||||||
}
|
|
||||||
|
|
||||||
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();
|
|
||||||
int n2 = 0;
|
|
||||||
while (true) {
|
|
||||||
if (n2 >= this.m_availableSegment) {
|
|
||||||
byte[] byArray = new byte[4096];
|
|
||||||
listIterator.add(byArray);
|
|
||||||
++this.m_availableSegment;
|
|
||||||
return byArray;
|
|
||||||
}
|
|
||||||
listIterator.next();
|
|
||||||
++n2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public byte[] prepareSegment() {
|
|
||||||
if (this.m_availableSegment + 1 >= this.m_buffer.size()) {
|
|
||||||
return new byte[4096];
|
|
||||||
}
|
|
||||||
if (this.m_buffer.size() != 0) return this.m_buffer.removeLast();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected class ByteBufferInputStream
|
|
||||||
extends InputStream {
|
|
||||||
protected ByteBufferInputStream() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int available() throws IOException {
|
|
||||||
if (!ByteBufferIOStream.this.m_closed) return ByteBufferIOStream.this.m_availableSegment * 4096 + ByteBufferIOStream.this.m_writePosition - ByteBufferIOStream.this.m_readPosition;
|
|
||||||
throw new IOException("ByteBufferIOStream is closed");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void close() throws IOException {
|
|
||||||
ByteBufferIOStream.this.closeIOStream();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean markSupported() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int read() throws IOException {
|
|
||||||
if (this.available() <= 0) {
|
|
||||||
throw new IOException("Nothing to read in ByteBufferIOStream");
|
|
||||||
}
|
|
||||||
byte by2 = ByteBufferIOStream.this.m_buffer.getFirst()[ByteBufferIOStream.this.m_readPosition];
|
|
||||||
ByteBufferIOStream byteBufferIOStream = ByteBufferIOStream.this;
|
|
||||||
++byteBufferIOStream.m_readPosition;
|
|
||||||
if (ByteBufferIOStream.this.m_readPosition < 4096) return by2;
|
|
||||||
ByteBufferIOStream.this.m_buffer.add(ByteBufferIOStream.this.m_buffer.poll());
|
|
||||||
ByteBufferIOStream.this.m_readPosition = 0;
|
|
||||||
byteBufferIOStream = ByteBufferIOStream.this;
|
|
||||||
--byteBufferIOStream.m_availableSegment;
|
|
||||||
return by2;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int read(byte[] byArray) throws IOException {
|
|
||||||
return this.read(byArray, 0, byArray.length);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int read(byte[] object, int n2, int n3) throws IOException {
|
|
||||||
if (n2 < 0) throw new IndexOutOfBoundsException("The reading range of out of buffer boundary.");
|
|
||||||
if (n3 < 0) throw new IndexOutOfBoundsException("The reading range of out of buffer boundary.");
|
|
||||||
if (n2 + n3 > ((byte[])object).length) {
|
|
||||||
throw new IndexOutOfBoundsException("The reading range of out of buffer boundary.");
|
|
||||||
}
|
|
||||||
int n4 = this.available();
|
|
||||||
if (n4 <= 0) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
int n5 = n3;
|
|
||||||
if (n3 > n4) {
|
|
||||||
n5 = n4;
|
|
||||||
}
|
|
||||||
if (n5 < (n3 = 4096 - ByteBufferIOStream.this.m_readPosition)) {
|
|
||||||
System.arraycopy(ByteBufferIOStream.this.m_buffer.getFirst(), ByteBufferIOStream.this.m_readPosition, object, n2, n5);
|
|
||||||
ByteBufferIOStream byteBufferIOStream = ByteBufferIOStream.this;
|
|
||||||
byteBufferIOStream.m_readPosition += n5;
|
|
||||||
return n5;
|
|
||||||
}
|
|
||||||
System.arraycopy(ByteBufferIOStream.this.m_buffer.getFirst(), ByteBufferIOStream.this.m_readPosition, object, n2, n3);
|
|
||||||
ByteBufferIOStream.this.m_buffer.add(ByteBufferIOStream.this.m_buffer.poll());
|
|
||||||
n4 = n5 - n3;
|
|
||||||
n2 += n3;
|
|
||||||
int n6 = n4 / 4096;
|
|
||||||
n3 = 0;
|
|
||||||
while (true) {
|
|
||||||
if (n3 >= n6) {
|
|
||||||
System.arraycopy(ByteBufferIOStream.this.m_buffer.getFirst(), 0, object, n2, n4);
|
|
||||||
ByteBufferIOStream.this.m_readPosition = n4;
|
|
||||||
ByteBufferIOStream byteBufferIOStream = ByteBufferIOStream.this;
|
|
||||||
byteBufferIOStream.m_availableSegment -= n6 + 1;
|
|
||||||
return n5;
|
|
||||||
}
|
|
||||||
System.arraycopy(ByteBufferIOStream.this.m_buffer.getFirst(), 0, object, n2, 4096);
|
|
||||||
ByteBufferIOStream.this.m_buffer.add(ByteBufferIOStream.this.m_buffer.poll());
|
|
||||||
n4 -= 4096;
|
|
||||||
n2 += 4096;
|
|
||||||
++n3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public long skip(long l2) throws IOException {
|
|
||||||
int n2;
|
|
||||||
int n3 = this.available();
|
|
||||||
if (n3 <= 0) {
|
|
||||||
return 0L;
|
|
||||||
}
|
|
||||||
long l3 = l2;
|
|
||||||
if (l2 > (long)n3) {
|
|
||||||
l3 = n3;
|
|
||||||
}
|
|
||||||
if ((n3 = (int)l3) < (n2 = 4096 - ByteBufferIOStream.this.m_readPosition)) {
|
|
||||||
ByteBufferIOStream byteBufferIOStream = ByteBufferIOStream.this;
|
|
||||||
byteBufferIOStream.m_readPosition += n3;
|
|
||||||
return l3;
|
|
||||||
}
|
|
||||||
ByteBufferIOStream.this.m_buffer.add(ByteBufferIOStream.this.m_buffer.poll());
|
|
||||||
n2 = n3 - n2;
|
|
||||||
int n4 = n2 / 4096;
|
|
||||||
n3 = 0;
|
|
||||||
while (true) {
|
|
||||||
if (n3 >= n4) {
|
|
||||||
ByteBufferIOStream.this.m_readPosition = n2;
|
|
||||||
ByteBufferIOStream byteBufferIOStream = ByteBufferIOStream.this;
|
|
||||||
byteBufferIOStream.m_availableSegment -= n4 + 1;
|
|
||||||
return l3;
|
|
||||||
}
|
|
||||||
ByteBufferIOStream.this.m_buffer.add(ByteBufferIOStream.this.m_buffer.poll());
|
|
||||||
n2 -= 4096;
|
|
||||||
++n3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected class ByteBufferOutputStream
|
|
||||||
extends OutputStream {
|
|
||||||
protected ByteBufferOutputStream() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void close() throws IOException {
|
|
||||||
ByteBufferIOStream.this.closeIOStream();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void write(int n2) throws IOException {
|
|
||||||
if (ByteBufferIOStream.this.m_closed) {
|
|
||||||
throw new IOException("ByteBufferIOStream is closed");
|
|
||||||
}
|
|
||||||
ByteBufferIOStream.this.m_buffer.getFirst()[ByteBufferIOStream.this.m_writePosition] = (byte)n2;
|
|
||||||
ByteBufferIOStream byteBufferIOStream = ByteBufferIOStream.this;
|
|
||||||
++byteBufferIOStream.m_writePosition;
|
|
||||||
if (ByteBufferIOStream.this.m_writePosition != 4096) return;
|
|
||||||
ByteBufferIOStream.this.m_writePosition = 0;
|
|
||||||
byteBufferIOStream = ByteBufferIOStream.this;
|
|
||||||
++byteBufferIOStream.m_availableSegment;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void write(byte[] byArray) throws IOException {
|
|
||||||
this.write(byArray, 0, byArray.length);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void write(byte[] object, int n2, int n3) throws IOException {
|
|
||||||
int n4;
|
|
||||||
if (n2 < 0) throw new IndexOutOfBoundsException("The writing range is out of buffer boundary.");
|
|
||||||
if (n3 < 0) throw new IndexOutOfBoundsException("The writing range is out of buffer boundary.");
|
|
||||||
if (n2 + n3 > ((byte[])object).length) {
|
|
||||||
throw new IndexOutOfBoundsException("The writing range is out of buffer boundary.");
|
|
||||||
}
|
|
||||||
if (ByteBufferIOStream.this.m_closed) {
|
|
||||||
throw new IOException("ByteBufferIOStream is closed");
|
|
||||||
}
|
|
||||||
int n5 = 4096 - ByteBufferIOStream.this.m_writePosition;
|
|
||||||
Iterator iterator = ByteBufferIOStream.this.m_buffer.iterator();
|
|
||||||
for (n4 = 0; n4 < ByteBufferIOStream.this.m_availableSegment; ++n4) {
|
|
||||||
iterator.next();
|
|
||||||
}
|
|
||||||
if (n3 < n5) {
|
|
||||||
System.arraycopy(object, n2, iterator.next(), ByteBufferIOStream.this.m_writePosition, n3);
|
|
||||||
ByteBufferIOStream byteBufferIOStream = ByteBufferIOStream.this;
|
|
||||||
byteBufferIOStream.m_writePosition += n3;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
System.arraycopy(object, n2, iterator.next(), ByteBufferIOStream.this.m_writePosition, n5);
|
|
||||||
n4 = n2 + n5;
|
|
||||||
Object object2 = ByteBufferIOStream.this;
|
|
||||||
++((ByteBufferIOStream)object2).m_availableSegment;
|
|
||||||
ByteBufferIOStream.this.m_writePosition = 0;
|
|
||||||
n2 = n3 -= n5;
|
|
||||||
n3 = n4;
|
|
||||||
while (n2 > 0) {
|
|
||||||
if (iterator.hasNext()) {
|
|
||||||
object2 = (byte[])iterator.next();
|
|
||||||
} else {
|
|
||||||
object2 = new byte[4096];
|
|
||||||
ByteBufferIOStream.this.m_buffer.add((byte[])object2);
|
|
||||||
}
|
|
||||||
if (n2 < 4096) {
|
|
||||||
System.arraycopy(object, n3, object2, 0, n2);
|
|
||||||
ByteBufferIOStream.this.m_writePosition = n2;
|
|
||||||
n2 = 0;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
System.arraycopy(object, n3, object2, 0, 4096);
|
|
||||||
n2 -= 4096;
|
|
||||||
n3 += 4096;
|
|
||||||
object2 = ByteBufferIOStream.this;
|
|
||||||
++((ByteBufferIOStream)object2).m_availableSegment;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
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() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,151 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.Component;
|
|
||||||
import com.ea.nimble.Log;
|
|
||||||
import com.ea.nimble.LogSource;
|
|
||||||
import com.ea.nimble.Utility;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.ListIterator;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
class ComponentManager
|
|
||||||
implements LogSource {
|
|
||||||
private Map<String, Component> m_components = new LinkedHashMap<String, Component>();
|
|
||||||
private Stage m_stage = Stage.CREATE;
|
|
||||||
|
|
||||||
ComponentManager() {
|
|
||||||
}
|
|
||||||
|
|
||||||
void cleanup() {
|
|
||||||
ListIterator<Component> listIterator = new ArrayList<Component>(this.m_components.values()).listIterator(this.m_components.size());
|
|
||||||
while (true) {
|
|
||||||
if (!listIterator.hasPrevious()) {
|
|
||||||
this.m_stage = Stage.CREATE;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
listIterator.previous().cleanup();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component getComponent(String string2) {
|
|
||||||
return this.m_components.get(string2);
|
|
||||||
}
|
|
||||||
|
|
||||||
Component[] getComponentList(String string2) {
|
|
||||||
ArrayList<Component> arrayList = new ArrayList<Component>(this.m_components.size());
|
|
||||||
Iterator<Map.Entry<String, Component>> iterator = this.m_components.entrySet().iterator();
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
Map.Entry<String, Component> entry = iterator.next();
|
|
||||||
if (!entry.getKey().startsWith(string2)) continue;
|
|
||||||
arrayList.add(entry.getValue());
|
|
||||||
}
|
|
||||||
return arrayList.toArray(new Component[arrayList.size()]);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getLogSourceTitle() {
|
|
||||||
return "Component";
|
|
||||||
}
|
|
||||||
|
|
||||||
void registerComponent(Component component, String string2) {
|
|
||||||
if (!Utility.validString(string2)) {
|
|
||||||
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: " + string2, new Object[0]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Component component2 = this.m_components.get(string2);
|
|
||||||
if (component2 == null) {
|
|
||||||
Log.Helper.LOGI(this, "Register module: " + string2, new Object[0]);
|
|
||||||
} else {
|
|
||||||
Log.Helper.LOGI(this, "Register module(overwrite): " + string2, new Object[0]);
|
|
||||||
}
|
|
||||||
this.m_components.put(string2, 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) return;
|
|
||||||
component.restore();
|
|
||||||
if (this.m_stage.compareTo(Stage.SUSPEND) < 0) return;
|
|
||||||
component.suspend();
|
|
||||||
}
|
|
||||||
|
|
||||||
void restore() {
|
|
||||||
Iterator<Component> iterator = this.m_components.values().iterator();
|
|
||||||
while (true) {
|
|
||||||
if (!iterator.hasNext()) {
|
|
||||||
this.m_stage = Stage.READY;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
iterator.next().restore();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void resume() {
|
|
||||||
Iterator<Component> iterator = this.m_components.values().iterator();
|
|
||||||
while (true) {
|
|
||||||
if (!iterator.hasNext()) {
|
|
||||||
this.m_stage = Stage.READY;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
iterator.next().resume();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void setup() {
|
|
||||||
Iterator<Component> iterator = this.m_components.values().iterator();
|
|
||||||
while (true) {
|
|
||||||
if (!iterator.hasNext()) {
|
|
||||||
this.m_stage = Stage.SETUP;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
iterator.next().setup();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void suspend() {
|
|
||||||
ListIterator<Component> listIterator = new ArrayList<Component>(this.m_components.values()).listIterator(this.m_components.size());
|
|
||||||
while (true) {
|
|
||||||
if (!listIterator.hasPrevious()) {
|
|
||||||
this.m_stage = Stage.SUSPEND;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
listIterator.previous().suspend();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void teardown() {
|
|
||||||
ListIterator<Component> listIterator = new ArrayList<Component>(this.m_components.values()).listIterator(this.m_components.size());
|
|
||||||
while (true) {
|
|
||||||
if (!listIterator.hasPrevious()) {
|
|
||||||
this.m_stage = Stage.CREATE;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
listIterator.previous().teardown();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static enum Stage {
|
|
||||||
CREATE,
|
|
||||||
SETUP,
|
|
||||||
READY,
|
|
||||||
SUSPEND;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,178 +0,0 @@
|
|||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
import java.io.BufferedInputStream;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.nio.ByteOrder;
|
|
||||||
|
|
||||||
import javax.crypto.Cipher;
|
|
||||||
import javax.crypto.spec.IvParameterSpec;
|
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/EASPDataLoader.class */
|
|
||||||
public class EASPDataLoader {
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/EASPDataLoader$EASPDataBuffer.class */
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/EASPDataLoader$LogEvent.class */
|
|
||||||
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 boolean deleteDatFile(String str) {
|
|
||||||
File file = new File(str);
|
|
||||||
if (!file.exists()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return file.delete();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getTrackingDatFilePath() {
|
|
||||||
Context applicationContext = ApplicationEnvironment.getComponent().getApplicationContext();
|
|
||||||
return (applicationContext == null ? System.getProperty("user.dir") + File.separator + "doc" : applicationContext.getFilesDir().getPath()) + File.separator + "EASP" + File.separator + "Tracking" + File.separator + "tracking.dat";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static EASPDataBuffer loadDatFile(String str) throws Exception {
|
|
||||||
Throwable th;
|
|
||||||
Exception e;
|
|
||||||
if (str == null || str.length() == 0) {
|
|
||||||
Log.Helper.LOGDS("Legacy", "Empty path passed to loadLegacyEASPDatFile");
|
|
||||||
throw new NullPointerException();
|
|
||||||
}
|
|
||||||
File file = new File(str);
|
|
||||||
if (!file.exists()) {
|
|
||||||
Log.Helper.LOGDS("Legacy", "Couldn't find EASP data file, " + str);
|
|
||||||
throw new FileNotFoundException("Non-existent or empty file, " + str + ".");
|
|
||||||
}
|
|
||||||
Log.Helper.LOGDS("Legacy", "Attempt to read EASP data file, %s, size %d.", str, file.length());
|
|
||||||
FileInputStream fileInputStream = null;
|
|
||||||
BufferedInputStream bufferedInputStream = null;
|
|
||||||
try {
|
|
||||||
fileInputStream = new FileInputStream(file);
|
|
||||||
bufferedInputStream = new BufferedInputStream(fileInputStream);
|
|
||||||
byte[] bArr = new byte[(int) file.length()];
|
|
||||||
int read = bufferedInputStream.read(bArr);
|
|
||||||
Cipher instance = Cipher.getInstance("AES/CBC/NoPadding");
|
|
||||||
instance.init(2, new SecretKeySpec(new byte[]{-25, -17, -122, 91, 109, -87, 10, 61, 57, 50, 14, -5, -108, 24, -28, -25, -58, 20, 24, Byte.MAX_VALUE, 59, -107, -123, -38, 101, 43, -82, 117, 27, -62, -102, 55}, "AES"), new IvParameterSpec(bArr, 8, 16));
|
|
||||||
ByteBuffer wrap = ByteBuffer.wrap(instance.doFinal(bArr, 24, read - 24));
|
|
||||||
wrap.order(ByteOrder.LITTLE_ENDIAN);
|
|
||||||
EASPDataBuffer eASPDataBuffer = new EASPDataBuffer(readString(wrap), wrap.slice().order(ByteOrder.LITTLE_ENDIAN));
|
|
||||||
try {
|
|
||||||
fileInputStream.close();
|
|
||||||
bufferedInputStream.close();
|
|
||||||
} catch (IOException e2) {
|
|
||||||
Log.Helper.LOGES("Legacy", "Exception closing file stream, for file, %s.", str);
|
|
||||||
}
|
|
||||||
return eASPDataBuffer;
|
|
||||||
|
|
||||||
} catch (Exception e4) {
|
|
||||||
Log.Helper.LOGES("Legacy", "Exception reading EASP data file, %s: %s", str, e4.toString());
|
|
||||||
e4.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String loadEADeviceId() {
|
|
||||||
try {
|
|
||||||
EASPDataBuffer loadDatFile = loadDatFile(ApplicationEnvironment.getComponent().getApplicationContext().getFilesDir().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 (Exception e) {
|
|
||||||
Log.Helper.LOGES("Legacy", "Exception when trying to load EASP data: %s", e);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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 String readString(ByteBuffer byteBuffer) throws IOException {
|
|
||||||
Exception e;
|
|
||||||
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);
|
|
||||||
String str = null;
|
|
||||||
try {
|
|
||||||
String str2 = new String(bArr, "UTF-8");
|
|
||||||
try {
|
|
||||||
Log.Helper.LOGDS("Legacy", "Read string (%s)", str2);
|
|
||||||
return str2;
|
|
||||||
} catch (Exception e2) {
|
|
||||||
e = e2;
|
|
||||||
str = str2;
|
|
||||||
Log.Helper.LOGES("Legacy", "Read string exception: " + e);
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
} catch (Exception e3) {
|
|
||||||
e = e3;
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*
|
|
||||||
* Could not load the following classes:
|
|
||||||
* android.annotation.SuppressLint
|
|
||||||
* android.os.Build$VERSION
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
|
|
||||||
import com.ea.ironmonkey.devmenu.util.Observer;
|
|
||||||
|
|
||||||
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 javax.crypto.Cipher;
|
|
||||||
import javax.crypto.CipherInputStream;
|
|
||||||
import javax.crypto.CipherOutputStream;
|
|
||||||
|
|
||||||
class Encryptor {
|
|
||||||
private static int ENCRYPTION_KEY_LENGHT = 128;
|
|
||||||
private static int ENCRYPTION_KEY_ROUND = 997;
|
|
||||||
private Cipher m_decryptor;
|
|
||||||
private Cipher m_encryptor;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* WARNING - Removed back jump from a try to a catch block - possible behaviour change.
|
|
||||||
* Could not resolve type clashes
|
|
||||||
* Unable to fully structure code
|
|
||||||
*/
|
|
||||||
@SuppressLint(value={"NewApi"})
|
|
||||||
private void initialize() throws GeneralSecurityException {
|
|
||||||
Observer.onCallingMethod();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ObjectInputStream encryptInputStream(InputStream inputStream) throws IOException, GeneralSecurityException {
|
|
||||||
if (this.m_encryptor != null) {
|
|
||||||
if (this.m_encryptor != null) return new ObjectInputStream(new CipherInputStream(inputStream, this.m_decryptor));
|
|
||||||
}
|
|
||||||
this.initialize();
|
|
||||||
return new ObjectInputStream(new CipherInputStream(inputStream, this.m_decryptor));
|
|
||||||
}
|
|
||||||
|
|
||||||
public ObjectOutputStream encryptOutputStream(OutputStream outputStream) throws IOException, GeneralSecurityException {
|
|
||||||
if (this.m_encryptor != null) {
|
|
||||||
if (this.m_encryptor != null) return new ObjectOutputStream(new CipherOutputStream(outputStream, this.m_encryptor));
|
|
||||||
}
|
|
||||||
this.initialize();
|
|
||||||
return new ObjectOutputStream(new CipherOutputStream(outputStream, this.m_encryptor));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,325 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import java.io.Externalizable;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.ObjectInput;
|
|
||||||
import java.io.ObjectOutput;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
class EnvironmentDataContainer
|
|
||||||
implements ISynergyEnvironment,
|
|
||||||
LogSource,
|
|
||||||
Externalizable {
|
|
||||||
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_applicationLanguageCode = "en";
|
|
||||||
private String m_eaDeviceId;
|
|
||||||
private Map<String, Object> m_getDirectionResponseDictionary = new HashMap<String, Object>();
|
|
||||||
private Long m_lastDirectorResponseTimestamp;
|
|
||||||
private Map<String, String> m_serverUrls;
|
|
||||||
private String m_synergyAnonymousId;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Error checkAndInitiateSynergyEnvironmentUpdate() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getEADeviceId() {
|
|
||||||
return this.m_eaDeviceId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getEAHardwareId() {
|
|
||||||
if (this.m_getDirectionResponseDictionary == null) return null;
|
|
||||||
if (!this.m_getDirectionResponseDictionary.isEmpty()) return (String)this.m_getDirectionResponseDictionary.get("hwId");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, Object> getGetDirectionResponseDictionary() {
|
|
||||||
return this.m_getDirectionResponseDictionary;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getGosMdmAppKey() {
|
|
||||||
if (this.m_getDirectionResponseDictionary == null) return null;
|
|
||||||
if (!this.m_getDirectionResponseDictionary.isEmpty()) return (String)this.m_getDirectionResponseDictionary.get("mdmAppKey");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Unable to fully structure code
|
|
||||||
*/
|
|
||||||
public Set<String> getKeysOfDifferences(ISynergyEnvironment var1_1) {
|
|
||||||
HashSet<String> var2_3 = new HashSet<String>();
|
|
||||||
if (var1_1 == null) {
|
|
||||||
|
|
||||||
if (Utility.stringsAreEquivalent(this.getEADeviceId(), var1_1.getEADeviceId())){
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_EADEVICEID");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getEAHardwareId(), var1_1.getEAHardwareId())) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_EAHARDWAREID");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getSynergyId(), var1_1.getSynergyId())) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_SYNERGYID");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getSellId(), var1_1.getSellId())) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_SELLID");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getProductId(), var1_1.getProductId())) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_PRODUCTID");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("synergy.drm"), var1_1.getServerUrlWithKey("synergy.drm"))) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_SERVER_URL_SYNERGY_DRM");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("synergy.director"), var1_1.getServerUrlWithKey("synergy.director"))) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_SERVER_URL_SYNERGY_DIRECTOR");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("synergy.m2u"), var1_1.getServerUrlWithKey("synergy.m2u"))) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_SERVER_URL_SYNERGY_MESSAGE_TO_USER");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("synergy.product"), var1_1.getServerUrlWithKey("synergy.product"))) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_SERVER_URL_SYNERGY_PRODUCT");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("synergy.tracking"), var1_1.getServerUrlWithKey("synergy.tracking"))) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_SERVER_URL_SYNERGY_TRACKING");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("synergy.user"), var1_1.getServerUrlWithKey("synergy.user"))) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_SERVER_URL_SYNERGY_USER");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("geoip.url"), var1_1.getServerUrlWithKey("geoip.url"))) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_SERVER_URL_SYNERGY_CENTRAL_IP_GEOLOCATION");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("synergy.s2s"), var1_1.getServerUrlWithKey("synergy.s2s"))) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_SERVER_URL_SYNERGY_S2S");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("friends.url"), var1_1.getServerUrlWithKey("friends.url"))) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_SERVER_URL_ORIGIN_FRIENDS");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("eadp.friends.host"), var1_1.getServerUrlWithKey("eadp.friends.host"))) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_SERVER_URL_EADP_FRIENDS_HOST");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("avatars.url"), var1_1.getServerUrlWithKey("avatars.url"))) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_SERVER_URL_ORIGIN_AVATAR");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("origincasualapp.url"), var1_1.getServerUrlWithKey("origincasualapp.url"))) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_SERVER_URL_ORIGIN_CASUAL_APP");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("origincasualserver.url"), var1_1.getServerUrlWithKey("origincasualserver.url"))) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_SERVER_URL_ORIGIN_CASUAL_SERVER");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("akamai.url"), var1_1.getServerUrlWithKey("akamai.url"))) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_SERVER_URL_AKAMAI");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("dmg.url"), var1_1.getServerUrlWithKey("dmg.url"))) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_SERVER_URL_DYNAMIC_MORE_GAMES");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("mayhem.url"), var1_1.getServerUrlWithKey("mayhem.url"))) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_SERVER_URL_MAYHEM");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("nexus.connect"), var1_1.getServerUrlWithKey("nexus.connect"))) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_SERVER_URL_KEY_IDENTITY_CONNECT");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("nexus.proxy"), var1_1.getServerUrlWithKey("nexus.proxy"))) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_SERVER_URL_KEY_IDENTITY_PROXY");
|
|
||||||
}
|
|
||||||
if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("nexus.portal"), var1_1.getServerUrlWithKey("nexus.portal"))) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_SERVER_URL_KEY_IDENTITY_PORTAL");
|
|
||||||
}
|
|
||||||
if (this.getLatestAppVersionCheckResult() != var1_1.getLatestAppVersionCheckResult()) {
|
|
||||||
var2_3.add("ENVIRONMENT_KEY_APP_VERSION_CHECK_RESULT");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var2_3.size() <= 0) return null;
|
|
||||||
return var2_3;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getLatestAppVersionCheckResult() {
|
|
||||||
int n2 = 0;
|
|
||||||
if (this.m_getDirectionResponseDictionary == null) return -1;
|
|
||||||
if (this.m_getDirectionResponseDictionary.isEmpty()) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
Object object = this.m_getDirectionResponseDictionary.get("appUpgrade");
|
|
||||||
if (object instanceof Integer) {
|
|
||||||
n2 = (Integer)object;
|
|
||||||
} else if (object instanceof String) {
|
|
||||||
n2 = Integer.parseInt((String)object);
|
|
||||||
}
|
|
||||||
switch (n2) {
|
|
||||||
default: {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
case 0: {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
case 1: {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
}
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getLogSourceTitle() {
|
|
||||||
return "SynergyEnv";
|
|
||||||
}
|
|
||||||
|
|
||||||
Long getMostRecentDirectorResponseTimestamp() {
|
|
||||||
return this.m_lastDirectorResponseTimestamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getNexusClientId() {
|
|
||||||
if (this.m_getDirectionResponseDictionary == null) return null;
|
|
||||||
if (!this.m_getDirectionResponseDictionary.isEmpty()) return (String)this.m_getDirectionResponseDictionary.get("clientId");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getNexusClientSecret() {
|
|
||||||
if (this.m_getDirectionResponseDictionary == null) return null;
|
|
||||||
if (!this.m_getDirectionResponseDictionary.isEmpty()) return (String)this.m_getDirectionResponseDictionary.get("clientSecret");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getProductId() {
|
|
||||||
if (this.m_getDirectionResponseDictionary == null) return null;
|
|
||||||
if (!this.m_getDirectionResponseDictionary.isEmpty()) return (String)this.m_getDirectionResponseDictionary.get("productId");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getSellId() {
|
|
||||||
if (this.m_getDirectionResponseDictionary == null) return null;
|
|
||||||
if (!this.m_getDirectionResponseDictionary.isEmpty()) return (String)this.m_getDirectionResponseDictionary.get("sellId");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getServerUrlWithKey(String string2) {
|
|
||||||
if (this.m_serverUrls != null) return this.m_serverUrls.get(string2);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, String> getServerUrls() {
|
|
||||||
return this.m_serverUrls;
|
|
||||||
}
|
|
||||||
|
|
||||||
String getSynergyAnonymousId() {
|
|
||||||
return this.m_synergyAnonymousId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getSynergyDirectorServerUrl(NimbleConfiguration nimbleConfiguration) {
|
|
||||||
return SynergyEnvironment.getComponent().getSynergyDirectorServerUrl(nimbleConfiguration);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getSynergyId() {
|
|
||||||
return this.m_synergyAnonymousId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getTrackingPostInterval() {
|
|
||||||
if (this.m_getDirectionResponseDictionary == null) return -1;
|
|
||||||
if (this.m_getDirectionResponseDictionary.isEmpty()) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
Integer n2 = (Integer)this.m_getDirectionResponseDictionary.get("telemetryFreq");
|
|
||||||
if (n2 == null) return -1;
|
|
||||||
return n2;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isDataAvailable() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isUpdateInProgress() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
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 = objectInput.readLong();
|
|
||||||
if (this.m_lastDirectorResponseTimestamp == 0L) {
|
|
||||||
this.m_lastDirectorResponseTimestamp = null;
|
|
||||||
}
|
|
||||||
this.m_applicationLanguageCode = (String)objectInput.readObject();
|
|
||||||
if (this.m_applicationLanguageCode.length() != 0) return;
|
|
||||||
this.m_applicationLanguageCode = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setEADeviceId(String string2) {
|
|
||||||
this.m_eaDeviceId = string2;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setGetDirectionResponseDictionary(Map<String, Object> map) {
|
|
||||||
if (map != null) {
|
|
||||||
map.put("sellId", ((Integer)map.get("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<String, Object>();
|
|
||||||
}
|
|
||||||
|
|
||||||
void setMostRecentDirectorResponseTimestamp(Long l2) {
|
|
||||||
this.m_lastDirectorResponseTimestamp = l2;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setServerUrls(Map<String, String> map) {
|
|
||||||
this.m_serverUrls = map;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setSynergyAnonymousId(String string2) {
|
|
||||||
this.m_synergyAnonymousId = string2;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeExternal(ObjectOutput objectOutput) throws IOException {
|
|
||||||
Object object = this.m_getDirectionResponseDictionary == null ? new HashMap<String, Object>() : this.m_getDirectionResponseDictionary;
|
|
||||||
objectOutput.writeObject(object);
|
|
||||||
object = this.m_serverUrls == null ? new HashMap<String, Object>() : this.m_serverUrls;
|
|
||||||
objectOutput.writeObject(object);
|
|
||||||
object = this.m_eaDeviceId == null ? "" : this.m_eaDeviceId;
|
|
||||||
objectOutput.writeObject(object);
|
|
||||||
object = this.m_synergyAnonymousId == null ? "" : this.m_synergyAnonymousId;
|
|
||||||
objectOutput.writeObject(object);
|
|
||||||
long l2 = this.m_lastDirectorResponseTimestamp == null ? 0L : this.m_lastDirectorResponseTimestamp;
|
|
||||||
objectOutput.writeLong(l2);
|
|
||||||
object = this.m_applicationLanguageCode == null ? "" : this.m_applicationLanguageCode;
|
|
||||||
objectOutput.writeObject(object);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,180 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.Base;
|
|
||||||
import com.ea.nimble.FacebookImpl;
|
|
||||||
import com.ea.nimble.IFacebook;
|
|
||||||
|
|
||||||
public class Facebook {
|
|
||||||
public static final String COMPONENT_ID = "com.ea.nimble.facebook";
|
|
||||||
|
|
||||||
public static IFacebook getComponent() {
|
|
||||||
return (IFacebook)((Object)Base.getComponent(COMPONENT_ID));
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void initialize() {
|
|
||||||
Base.registerComponent(new FacebookImpl(), COMPONENT_ID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.IFacebook;
|
|
||||||
|
|
||||||
public interface FacebookCallback {
|
|
||||||
public void callback(IFacebook var1, boolean var2, Exception var3);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,173 +0,0 @@
|
|||||||
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 org.json.JSONException;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
|
||||||
|
|
||||||
class FacebookImpl extends Component implements IApplicationLifecycle.ActivityEventCallbacks, IApplicationLifecycle.ActivityLifecycleCallbacks, IFacebook, LogSource {
|
|
||||||
static boolean bHasSeenOpening;
|
|
||||||
private static String TAG = "Facebook";
|
|
||||||
private static List<IFacebook.FacebookCallback> m_callbackQueue = new ArrayList();
|
|
||||||
private Map<String, Object> userInfo = null;
|
|
||||||
private AtomicBoolean isUserGraphReady = new AtomicBoolean(true);
|
|
||||||
|
|
||||||
private String getFacebookSDKVersion() {
|
|
||||||
try {
|
|
||||||
return String.valueOf(getClass().getClassLoader().loadClass("com.facebook.FacebookSdkVersion").getField("BUILD").get(null));
|
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
Log.Helper.LOGW(TAG, "Unable to get FB SDK version.");
|
|
||||||
return null;
|
|
||||||
} catch (IllegalAccessException e2) {
|
|
||||||
Log.Helper.LOGW(TAG, "Unable to get FB SDK version.");
|
|
||||||
return null;
|
|
||||||
} catch (IllegalArgumentException e3) {
|
|
||||||
Log.Helper.LOGW(TAG, "Unable to get FB SDK version.");
|
|
||||||
return null;
|
|
||||||
} catch (NoSuchFieldException e4) {
|
|
||||||
Log.Helper.LOGW(TAG, "Unable to get FB SDK version.");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: protected */
|
|
||||||
@Override // com.ea.nimble.Component
|
|
||||||
public void cleanup() {
|
|
||||||
ApplicationLifecycle.getComponent().unregisterActivityLifecycleCallbacks(this);
|
|
||||||
ApplicationLifecycle.getComponent().unregisterActivityEventCallbacks(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.IFacebook
|
|
||||||
public String getAccessToken() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.IFacebook
|
|
||||||
public String getApplicationId() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.Component
|
|
||||||
public String getComponentId() {
|
|
||||||
return Facebook.COMPONENT_ID;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.IFacebook
|
|
||||||
public Date getExpirationDate() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.IFacebook
|
|
||||||
public Map<String, Object> getGraphUser() {
|
|
||||||
if (this.isUserGraphReady.get()) {
|
|
||||||
return this.userInfo;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.LogSource
|
|
||||||
public String getLogSourceTitle() {
|
|
||||||
return "Facebook";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.IFacebook
|
|
||||||
public boolean hasOpenSession() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.IFacebook
|
|
||||||
public void login(List<String> list, IFacebook.FacebookCallback facebookCallback) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.IFacebook
|
|
||||||
public void logout() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@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.ActivityEventCallbacks
|
|
||||||
public void onActivityResult(Activity activity, int i, int i2, Intent intent) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@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 onWindowFocusChanged(boolean z) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.IFacebook
|
|
||||||
public void refreshSession(final String str, Date date) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void restore() {
|
|
||||||
ApplicationLifecycle.getComponent().registerActivityEventCallbacks(this);
|
|
||||||
ApplicationLifecycle.getComponent().registerActivityLifecycleCallbacks(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void retrieveCurrentUserProfile(IFacebook.FacebookFriendsCallback facebookFriendsCallback) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.IFacebook
|
|
||||||
public void retrieveFriends(final int i, final int i2, final IFacebook.FacebookFriendsCallback facebookFriendsCallback) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.IFacebook
|
|
||||||
public void sendAppRequest(final String str, final String str2, final String str3, final IFacebook.FacebookCallback facebookCallback) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.Component
|
|
||||||
public void setup() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
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_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_RELEASE_VERSION = "1.23.14.1217";
|
|
||||||
public static final String NIMBLE_SDK_VERSION = "1.23.14.1217";
|
|
||||||
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.LanguageChanged";
|
|
||||||
public static final String NOTIFICATION_LOGIN_STATUS_CHANGE = "nimble.notification.LoginStatusChanged";
|
|
||||||
public static final String NOTIFICATION_NETWORK_STATUS_CHANGE = "nimble.notification.networkStatusChanged";
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.Error;
|
|
||||||
|
|
||||||
class HttpError
|
|
||||||
extends Error {
|
|
||||||
public static final String ERROR_DOMAIN = "HttpError";
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
public HttpError(int n2, String string2) {
|
|
||||||
super(ERROR_DOMAIN, n2, string2, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public HttpError(int n2, String string2, Throwable throwable) {
|
|
||||||
super(ERROR_DOMAIN, n2, string2, throwable);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.IHttpRequest;
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.util.EnumSet;
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
public class HttpRequest
|
|
||||||
implements IHttpRequest {
|
|
||||||
private static int DEFAULT_NETWORK_TIMEOUT = 30;
|
|
||||||
public ByteArrayOutputStream data;
|
|
||||||
public HashMap<String, String> headers;
|
|
||||||
public IHttpRequest.Method method = IHttpRequest.Method.GET;
|
|
||||||
public EnumSet<IHttpRequest.OverwritePolicy> overwritePolicy;
|
|
||||||
public boolean runInBackground;
|
|
||||||
public String targetFilePath;
|
|
||||||
public double timeout;
|
|
||||||
public URL url = null;
|
|
||||||
|
|
||||||
public HttpRequest() {
|
|
||||||
this.data = new ByteArrayOutputStream();
|
|
||||||
this.headers = new HashMap();
|
|
||||||
this.overwritePolicy = IHttpRequest.OverwritePolicy.SMART;
|
|
||||||
this.timeout = DEFAULT_NETWORK_TIMEOUT;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HttpRequest(URL uRL) {
|
|
||||||
this();
|
|
||||||
this.url = uRL;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public byte[] getData() {
|
|
||||||
return this.data.toByteArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
public HashMap<String, String> getHeaders() {
|
|
||||||
return this.headers;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IHttpRequest.Method getMethod() {
|
|
||||||
return this.method;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumSet<IHttpRequest.OverwritePolicy> getOverwritePolicy() {
|
|
||||||
return this.overwritePolicy;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean getRunInBackground() {
|
|
||||||
return this.runInBackground;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTargetFilePath() {
|
|
||||||
return this.targetFilePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getTimeout() {
|
|
||||||
return this.timeout;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public URL getUrl() {
|
|
||||||
return this.url;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.ByteBufferIOStream;
|
|
||||||
import com.ea.nimble.IHttpResponse;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class HttpResponse
|
|
||||||
implements IHttpResponse {
|
|
||||||
public ByteBufferIOStream data;
|
|
||||||
public long downloadedContentLength = 0L;
|
|
||||||
public Exception error;
|
|
||||||
public long expectedContentLength = 0L;
|
|
||||||
public HashMap<String, String> headers = new HashMap();
|
|
||||||
public boolean isCompleted = false;
|
|
||||||
public long lastModified = -1L;
|
|
||||||
public int statusCode = 0;
|
|
||||||
public URL url = null;
|
|
||||||
|
|
||||||
public HttpResponse() {
|
|
||||||
this.data = new ByteBufferIOStream();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public InputStream getDataStream() {
|
|
||||||
return this.data.getInputStream();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public long getDownloadedContentLength() {
|
|
||||||
return this.downloadedContentLength;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Exception getError() {
|
|
||||||
return this.error;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public long getExpectedContentLength() {
|
|
||||||
return this.expectedContentLength;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, String> getHeaders() {
|
|
||||||
return this.headers;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Date getLastModified() {
|
|
||||||
if (this.lastModified == 0L) {
|
|
||||||
return new Date();
|
|
||||||
}
|
|
||||||
if (this.lastModified <= 0L) return null;
|
|
||||||
return new Date(this.lastModified);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getStatusCode() {
|
|
||||||
return this.statusCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public URL getUrl() {
|
|
||||||
return this.url;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isCompleted() {
|
|
||||||
return this.isCompleted;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*
|
|
||||||
* Could not load the following classes:
|
|
||||||
* android.content.Context
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
public interface IApplicationEnvironment {
|
|
||||||
public int getAgeCompliance();
|
|
||||||
|
|
||||||
public String getApplicationBundleId();
|
|
||||||
|
|
||||||
public Context getApplicationContext();
|
|
||||||
|
|
||||||
public String getApplicationLanguageCode();
|
|
||||||
|
|
||||||
public String getApplicationName();
|
|
||||||
|
|
||||||
public String getApplicationVersion();
|
|
||||||
|
|
||||||
public String getCachePath();
|
|
||||||
|
|
||||||
public String getCarrier();
|
|
||||||
|
|
||||||
public String getDeviceBrand();
|
|
||||||
|
|
||||||
public String getDeviceCodename();
|
|
||||||
|
|
||||||
public String getDeviceFingerprint();
|
|
||||||
|
|
||||||
public String getDeviceManufacturer();
|
|
||||||
|
|
||||||
public String getDeviceModel();
|
|
||||||
|
|
||||||
public String getDeviceString();
|
|
||||||
|
|
||||||
public String getDocumentPath();
|
|
||||||
|
|
||||||
public String getGameSpecifiedPlayerId();
|
|
||||||
|
|
||||||
public String getGoogleAdvertisingId();
|
|
||||||
|
|
||||||
public String getGoogleEmail();
|
|
||||||
|
|
||||||
public boolean getIadAttribution();
|
|
||||||
|
|
||||||
public String getMACAddress();
|
|
||||||
|
|
||||||
public String getOsVersion();
|
|
||||||
|
|
||||||
public String getShortApplicationLanguageCode();
|
|
||||||
|
|
||||||
public String getTempPath();
|
|
||||||
|
|
||||||
public boolean isAppCracked();
|
|
||||||
|
|
||||||
public boolean isDeviceRooted();
|
|
||||||
|
|
||||||
public boolean isLimitAdTrackingEnabled();
|
|
||||||
|
|
||||||
public void refreshAgeCompliance();
|
|
||||||
|
|
||||||
public void setApplicationBundleId(String var1);
|
|
||||||
|
|
||||||
public void setApplicationLanguageCode(String var1);
|
|
||||||
|
|
||||||
public void setGameSpecifiedPlayerId(String var1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*
|
|
||||||
* Could not load the following classes:
|
|
||||||
* android.app.Activity
|
|
||||||
* android.content.Intent
|
|
||||||
* android.os.Bundle
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
|
||||||
|
|
||||||
public interface IApplicationLifecycle {
|
|
||||||
boolean handleBackPressed();
|
|
||||||
|
|
||||||
void notifyActivityCreate(Bundle var1, Activity var2);
|
|
||||||
|
|
||||||
void notifyActivityDestroy(Activity var1);
|
|
||||||
|
|
||||||
void notifyActivityPause(Activity var1);
|
|
||||||
|
|
||||||
void notifyActivityRestart(Activity var1);
|
|
||||||
|
|
||||||
void notifyActivityRestoreInstanceState(Bundle var1, Activity var2);
|
|
||||||
|
|
||||||
void notifyActivityResult(int var1, int var2, Intent var3, Activity var4);
|
|
||||||
|
|
||||||
void notifyActivityResume(Activity var1);
|
|
||||||
|
|
||||||
void notifyActivityRetainNonConfigurationInstance();
|
|
||||||
|
|
||||||
void notifyActivitySaveInstanceState(Bundle var1, Activity var2);
|
|
||||||
|
|
||||||
void notifyActivityStart(Activity var1);
|
|
||||||
|
|
||||||
void notifyActivityStop(Activity var1);
|
|
||||||
|
|
||||||
void notifyActivityWindowFocusChanged(boolean var1, Activity var2);
|
|
||||||
|
|
||||||
void registerActivityEventCallbacks(ActivityEventCallbacks var1);
|
|
||||||
|
|
||||||
void registerActivityLifecycleCallbacks(ActivityLifecycleCallbacks var1);
|
|
||||||
|
|
||||||
void registerApplicationLifecycleCallbacks(ApplicationLifecycleCallbacks var1);
|
|
||||||
|
|
||||||
void unregisterActivityEventCallbacks(ActivityEventCallbacks var1);
|
|
||||||
|
|
||||||
void unregisterActivityLifecycleCallbacks(ActivityLifecycleCallbacks var1);
|
|
||||||
|
|
||||||
void unregisterApplicationLifecycleCallbacks(ApplicationLifecycleCallbacks var1);
|
|
||||||
|
|
||||||
interface ActivityEventCallbacks {
|
|
||||||
void onActivityResult(Activity var1, int var2, int var3, Intent var4);
|
|
||||||
|
|
||||||
boolean onBackPressed();
|
|
||||||
|
|
||||||
void onWindowFocusChanged(boolean var1);
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ActivityLifecycleCallbacks {
|
|
||||||
void onActivityCreated(Activity var1, Bundle var2);
|
|
||||||
|
|
||||||
void onActivityDestroyed(Activity var1);
|
|
||||||
|
|
||||||
void onActivityPaused(Activity var1);
|
|
||||||
|
|
||||||
void onActivityResumed(Activity var1);
|
|
||||||
|
|
||||||
void onActivitySaveInstanceState(Activity var1, Bundle var2);
|
|
||||||
|
|
||||||
void onActivityStarted(Activity var1);
|
|
||||||
|
|
||||||
void onActivityStopped(Activity var1);
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ApplicationLifecycleCallbacks {
|
|
||||||
void onApplicationLaunch(Intent var1);
|
|
||||||
|
|
||||||
void onApplicationQuit();
|
|
||||||
|
|
||||||
void onApplicationResume();
|
|
||||||
|
|
||||||
void onApplicationSuspend();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*
|
|
||||||
* Could not load the following classes:
|
|
||||||
* org.json.JSONArray
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.Error;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import org.json.JSONArray;
|
|
||||||
|
|
||||||
public interface IFacebook {
|
|
||||||
public static final String NIMBLE_NOTIFICATION_FACEBOOK_STATUS_CHANGED = "nimble.notification.facebook.statuschanged";
|
|
||||||
|
|
||||||
public String getAccessToken();
|
|
||||||
|
|
||||||
public String getApplicationId();
|
|
||||||
|
|
||||||
public Date getExpirationDate();
|
|
||||||
|
|
||||||
public Map<String, Object> getGraphUser();
|
|
||||||
|
|
||||||
public boolean hasOpenSession();
|
|
||||||
|
|
||||||
public void login(List<String> var1, FacebookCallback var2);
|
|
||||||
|
|
||||||
public void logout();
|
|
||||||
|
|
||||||
public void refreshSession(String var1, Date var2);
|
|
||||||
|
|
||||||
public void retrieveFriends(int var1, int var2, FacebookFriendsCallback var3);
|
|
||||||
|
|
||||||
public void sendAppRequest(String var1, String var2, String var3, FacebookCallback var4);
|
|
||||||
|
|
||||||
public static interface FacebookCallback {
|
|
||||||
public void callback(IFacebook var1, boolean var2, Exception var3);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static interface FacebookFriendsCallback {
|
|
||||||
public void callback(IFacebook var1, JSONArray var2, Error var3);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static interface FqlRequestCallBack {
|
|
||||||
public void requestComplete(JSONArray var1, Error var2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public interface IHttpResponse {
|
|
||||||
public InputStream getDataStream();
|
|
||||||
|
|
||||||
public long getDownloadedContentLength();
|
|
||||||
|
|
||||||
public Exception getError();
|
|
||||||
|
|
||||||
public long getExpectedContentLength();
|
|
||||||
|
|
||||||
public Map<String, String> getHeaders();
|
|
||||||
|
|
||||||
public Date getLastModified();
|
|
||||||
|
|
||||||
public int getStatusCode();
|
|
||||||
|
|
||||||
public URL getUrl();
|
|
||||||
|
|
||||||
public boolean isCompleted();
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
public interface ILog {
|
|
||||||
String getLogFilePath();
|
|
||||||
|
|
||||||
int getThresholdLevel();
|
|
||||||
|
|
||||||
void setThresholdLevel(int var1);
|
|
||||||
|
|
||||||
void writeWithSource(int var1, Object var2, String var3, Object ... var4);
|
|
||||||
|
|
||||||
void writeWithTitle(int var1, String var2, String var3, Object ... var4);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.HttpRequest;
|
|
||||||
import com.ea.nimble.IOperationalTelemetryDispatch;
|
|
||||||
import com.ea.nimble.Network;
|
|
||||||
import com.ea.nimble.NetworkConnectionCallback;
|
|
||||||
import com.ea.nimble.NetworkConnectionHandle;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
public interface INetwork {
|
|
||||||
public void forceRedetectNetworkStatus();
|
|
||||||
|
|
||||||
public Network.Status getStatus();
|
|
||||||
|
|
||||||
public boolean isNetworkWifi();
|
|
||||||
|
|
||||||
public NetworkConnectionHandle sendDeleteRequest(URL var1, HashMap<String, String> var2, NetworkConnectionCallback var3);
|
|
||||||
|
|
||||||
public NetworkConnectionHandle sendGetRequest(URL var1, HashMap<String, String> var2, NetworkConnectionCallback var3);
|
|
||||||
|
|
||||||
public NetworkConnectionHandle sendPostRequest(URL var1, HashMap<String, String> var2, byte[] var3, NetworkConnectionCallback var4);
|
|
||||||
|
|
||||||
public NetworkConnectionHandle sendRequest(HttpRequest var1, NetworkConnectionCallback var2);
|
|
||||||
|
|
||||||
public NetworkConnectionHandle sendRequest(HttpRequest var1, NetworkConnectionCallback var2, IOperationalTelemetryDispatch var3);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.OperationalTelemetryEvent;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public interface IOperationalTelemetryDispatch {
|
|
||||||
public static final String EVENTTYPE_NETWORK_METRICS = "com.ea.nimble.network";
|
|
||||||
public static final String EVENTTYPE_TRACKING_SYNERGY_PAYLOADS = "com.ea.nimble.trackingimpl.synergy";
|
|
||||||
public static final int NIMBLE_DEFAULT_MAX_OT_EVENT_COUNT = 100;
|
|
||||||
public static final String NOTIFICATION_OT_EVENT_THRESHOLD_WARNING = "nimble.notification.ot.eventthresholdwarning";
|
|
||||||
|
|
||||||
public List<OperationalTelemetryEvent> getEvents(String var1);
|
|
||||||
|
|
||||||
public int getMaxEventCount(String var1);
|
|
||||||
|
|
||||||
public void logEvent(String var1, Map<String, String> var2);
|
|
||||||
|
|
||||||
public void setMaxEventCount(String var1, int var2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.Persistence;
|
|
||||||
import com.ea.nimble.PersistenceService;
|
|
||||||
|
|
||||||
public interface IPersistenceService {
|
|
||||||
public void cleanPersistenceReference(String var1, Persistence.Storage var2);
|
|
||||||
|
|
||||||
public Persistence getPersistence(String var1, Persistence.Storage var2);
|
|
||||||
|
|
||||||
public void migratePersistence(String var1, Persistence.Storage var2, String var3, PersistenceService.PersistenceMergePolicy var4);
|
|
||||||
|
|
||||||
public void removePersistence(String var1, Persistence.Storage var2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.Error;
|
|
||||||
import com.ea.nimble.NimbleConfiguration;
|
|
||||||
|
|
||||||
public interface ISynergyEnvironment {
|
|
||||||
public static final int NETWORK_CONNECTION_NONE = 1;
|
|
||||||
public static final int NETWORK_CONNECTION_UNKNOWN = 0;
|
|
||||||
public static final int NETWORK_CONNECTION_WIFI = 2;
|
|
||||||
public static final int NETWORK_CONNECTION_WIRELESS = 3;
|
|
||||||
public static final int SYNERGY_APP_VERSION_OK = 0;
|
|
||||||
public static final int SYNERGY_APP_VERSION_UPDATE_RECOMMENDED = 1;
|
|
||||||
public static final int SYNERGY_APP_VERSION_UPDATE_REQUIRED = 2;
|
|
||||||
|
|
||||||
public Error checkAndInitiateSynergyEnvironmentUpdate();
|
|
||||||
|
|
||||||
public String getEADeviceId();
|
|
||||||
|
|
||||||
public String getEAHardwareId();
|
|
||||||
|
|
||||||
public String getGosMdmAppKey();
|
|
||||||
|
|
||||||
public int getLatestAppVersionCheckResult();
|
|
||||||
|
|
||||||
public String getNexusClientId();
|
|
||||||
|
|
||||||
public String getNexusClientSecret();
|
|
||||||
|
|
||||||
public String getProductId();
|
|
||||||
|
|
||||||
public String getSellId();
|
|
||||||
|
|
||||||
public String getServerUrlWithKey(String var1);
|
|
||||||
|
|
||||||
public String getSynergyDirectorServerUrl(NimbleConfiguration var1);
|
|
||||||
|
|
||||||
public String getSynergyId();
|
|
||||||
|
|
||||||
public int getTrackingPostInterval();
|
|
||||||
|
|
||||||
public boolean isDataAvailable();
|
|
||||||
|
|
||||||
public boolean isUpdateInProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.SynergyIdManagerError;
|
|
||||||
|
|
||||||
public interface ISynergyIdManager {
|
|
||||||
public String getAnonymousSynergyId();
|
|
||||||
|
|
||||||
public String getSynergyId();
|
|
||||||
|
|
||||||
public SynergyIdManagerError login(String var1, String var2);
|
|
||||||
|
|
||||||
public SynergyIdManagerError logout(String var1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.SynergyNetworkConnectionCallback;
|
|
||||||
import com.ea.nimble.SynergyNetworkConnectionHandle;
|
|
||||||
import com.ea.nimble.SynergyRequest;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public interface ISynergyNetwork {
|
|
||||||
public SynergyNetworkConnectionHandle sendGetRequest(String var1, String var2, Map<String, String> var3, SynergyNetworkConnectionCallback var4);
|
|
||||||
|
|
||||||
public SynergyNetworkConnectionHandle sendPostRequest(String var1, String var2, Map<String, String> var3, Map<String, Object> var4, SynergyNetworkConnectionCallback var5);
|
|
||||||
|
|
||||||
public SynergyNetworkConnectionHandle sendPostRequest(String var1, String var2, Map<String, String> var3, Map<String, Object> var4, SynergyNetworkConnectionCallback var5, Map<String, String> var6);
|
|
||||||
|
|
||||||
public void sendRequest(SynergyRequest var1, SynergyNetworkConnectionCallback var2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.IHttpRequest;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public interface ISynergyRequest {
|
|
||||||
public String getApi();
|
|
||||||
|
|
||||||
public String getBaseUrl();
|
|
||||||
|
|
||||||
public IHttpRequest getHttpRequest();
|
|
||||||
|
|
||||||
public Map<String, Object> getJsonData();
|
|
||||||
|
|
||||||
public Map<String, String> getUrlParameters();
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.IHttpResponse;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public interface ISynergyResponse {
|
|
||||||
public Exception getError();
|
|
||||||
|
|
||||||
public IHttpResponse getHttpResponse();
|
|
||||||
|
|
||||||
public Map<String, Object> getJsonData();
|
|
||||||
|
|
||||||
public boolean isCompleted();
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.ILog;
|
|
||||||
import com.ea.nimble.LogImpl;
|
|
||||||
|
|
||||||
public class Log {
|
|
||||||
public static final String COMPONENT_ID = "com.ea.nimble.NimbleLog";
|
|
||||||
public static final int LEVEL_DEBUG = 200;
|
|
||||||
public static final int LEVEL_ERROR = 500;
|
|
||||||
public static final int LEVEL_FATAL = 600;
|
|
||||||
public static final int LEVEL_INFO = 300;
|
|
||||||
public static final int LEVEL_SILENT = 700;
|
|
||||||
public static final int LEVEL_VERBOSE = 100;
|
|
||||||
public static final int LEVEL_WARN = 400;
|
|
||||||
private static ILog s_instance;
|
|
||||||
|
|
||||||
public static ILog getComponent() {
|
|
||||||
synchronized (Log.class) {
|
|
||||||
if (s_instance == null) {
|
|
||||||
s_instance = new LogImpl();
|
|
||||||
}
|
|
||||||
ILog iLog = s_instance;
|
|
||||||
return iLog;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Helper {
|
|
||||||
public static void LOG(int n2, String string2, Object ... objectArray) {
|
|
||||||
Log.getComponent().writeWithTitle(n2, null, string2, objectArray);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void LOGD(Object object, String string2, Object ... objectArray) {
|
|
||||||
Log.getComponent().writeWithSource(200, object, string2, objectArray);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void LOGDS(String string2, String string3, Object ... objectArray) {
|
|
||||||
Log.getComponent().writeWithTitle(200, string2, string3, objectArray);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void LOGE(Object object, String string2, Object ... objectArray) {
|
|
||||||
Log.getComponent().writeWithSource(500, object, string2, objectArray);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void LOGES(String string2, String string3, Object ... objectArray) {
|
|
||||||
Log.getComponent().writeWithTitle(500, string2, string3, objectArray);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void LOGF(Object object, String string2, Object ... objectArray) {
|
|
||||||
Log.getComponent().writeWithSource(600, object, string2, objectArray);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void LOGFS(String string2, String string3, Object ... objectArray) {
|
|
||||||
Log.getComponent().writeWithTitle(600, string2, string3, objectArray);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void LOGI(Object object, String string2, Object ... objectArray) {
|
|
||||||
Log.getComponent().writeWithSource(300, object, string2, objectArray);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void LOGIS(String string2, String string3, Object ... objectArray) {
|
|
||||||
Log.getComponent().writeWithTitle(300, string2, string3, objectArray);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void LOGV(Object object, String string2, Object ... objectArray) {
|
|
||||||
Log.getComponent().writeWithSource(100, object, string2, objectArray);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void LOGVS(String string2, String string3, Object ... objectArray) {
|
|
||||||
Log.getComponent().writeWithTitle(100, string2, string3, objectArray);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void LOGW(Object object, String string2, Object ... objectArray) {
|
|
||||||
Log.getComponent().writeWithSource(400, object, string2, objectArray);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void LOGWS(String string2, String string3, Object ... objectArray) {
|
|
||||||
Log.getComponent().writeWithTitle(400, string2, string3, objectArray);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,473 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*
|
|
||||||
* Could not load the following classes:
|
|
||||||
* android.os.Environment
|
|
||||||
* android.util.Log
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import android.os.Environment;
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.text.DateFormat;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class LogImpl
|
|
||||||
extends Component
|
|
||||||
implements ILog {
|
|
||||||
private static final int DEFAULT_CHECK_INTERVAL = 3600;
|
|
||||||
private static final int DEFAULT_CONSOLE_OUTPUT_LIMIT = 4000;
|
|
||||||
private static final int DEFAULT_MESSAGE_LENGTH_LIMIT = 1000;
|
|
||||||
private static final int DEFAULT_SIZE_LIMIT = 1024;
|
|
||||||
private ArrayList<LogRecord> m_cache = new ArrayList();
|
|
||||||
private BaseCore m_core;
|
|
||||||
private File m_filePath = null;
|
|
||||||
private DateFormat m_format = null;
|
|
||||||
private Timer m_guardTimer = null;
|
|
||||||
private int m_interval = 0;
|
|
||||||
private int m_level = 0;
|
|
||||||
private FileOutputStream m_logFileStream = null;
|
|
||||||
private int m_messageLengthLimit;
|
|
||||||
private int m_sizeLimit;
|
|
||||||
|
|
||||||
LogImpl() {
|
|
||||||
}
|
|
||||||
|
|
||||||
private void clearLog() {
|
|
||||||
try {
|
|
||||||
this.m_logFileStream.close();
|
|
||||||
this.m_logFileStream = new FileOutputStream(this.m_filePath, false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
catch (IOException iOException) {
|
|
||||||
Log.e((String)"Nimble", (String)"LOG: Can't clear log file");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void configure() {
|
|
||||||
boolean z = this.m_level == 0;
|
|
||||||
Map<String, String> settings = this.m_core.getSettings(BaseCore.NIMBLE_LOG_SETTING);
|
|
||||||
if (settings == null) {
|
|
||||||
int parseLevel = parseLevel(null);
|
|
||||||
if (parseLevel != this.m_level) {
|
|
||||||
this.m_level = parseLevel;
|
|
||||||
Log.i(Global.NIMBLE_ID, String.format("LOG: Default Log level(%d) without log configuration file", Integer.valueOf(this.m_level)));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int parseLevel2 = parseLevel(settings.get("Level"));
|
|
||||||
if (parseLevel2 != this.m_level) {
|
|
||||||
this.m_level = parseLevel2;
|
|
||||||
Log.i(Global.NIMBLE_ID, String.format("LOG: Log level(%d)", Integer.valueOf(this.m_level)));
|
|
||||||
}
|
|
||||||
if (this.m_level <= 100) {
|
|
||||||
this.m_messageLengthLimit = 0;
|
|
||||||
} else {
|
|
||||||
String str = settings.get("MessageLengthLimit");
|
|
||||||
if (str == null) {
|
|
||||||
this.m_messageLengthLimit = 1000;
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
this.m_messageLengthLimit = Integer.parseInt(str);
|
|
||||||
if (this.m_messageLengthLimit < 0) {
|
|
||||||
this.m_messageLengthLimit = 1000;
|
|
||||||
}
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
this.m_messageLengthLimit = 1000;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
String str2 = settings.get("File");
|
|
||||||
if (Utility.validString(str2)) {
|
|
||||||
String str3 = settings.get("Location");
|
|
||||||
String str4 = ApplicationEnvironment.getComponent().getCachePath() + File.separator + str2;
|
|
||||||
String str5 = str4;
|
|
||||||
if (Utility.validString(str3)) {
|
|
||||||
str5 = str4;
|
|
||||||
if (str3.equalsIgnoreCase("external")) {
|
|
||||||
str5 = str4;
|
|
||||||
if (Environment.getExternalStorageState().equals("mounted")) {
|
|
||||||
String name = ApplicationEnvironment.getCurrentActivity().getClass().getPackage().getName();
|
|
||||||
try {
|
|
||||||
name = ApplicationEnvironment.getCurrentActivity().getPackageManager().getPackageInfo(ApplicationEnvironment.getCurrentActivity().getPackageName(), 0).packageName;
|
|
||||||
} catch (Exception e2) {
|
|
||||||
}
|
|
||||||
File file = new File(Environment.getExternalStorageDirectory(), name);
|
|
||||||
boolean exists = file.exists();
|
|
||||||
boolean z2 = exists;
|
|
||||||
if (!exists) {
|
|
||||||
z2 = file.mkdir();
|
|
||||||
}
|
|
||||||
str5 = str4;
|
|
||||||
if (z2) {
|
|
||||||
str5 = file + File.separator + str2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File file2 = new File(str5);
|
|
||||||
if (file2 != this.m_filePath) {
|
|
||||||
this.m_filePath = file2;
|
|
||||||
try {
|
|
||||||
this.m_logFileStream = new FileOutputStream(this.m_filePath, true);
|
|
||||||
Log.d(Global.NIMBLE_ID, "LOG: File path: " + this.m_filePath.toString());
|
|
||||||
} catch (FileNotFoundException e3) {
|
|
||||||
Log.e(Global.NIMBLE_ID, "LOG: Can't create log file at " + str5);
|
|
||||||
this.m_filePath = null;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
String str6 = settings.get("DateFormat");
|
|
||||||
if (str6 == null || str6.length() <= 0) {
|
|
||||||
this.m_format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.getDefault());
|
|
||||||
} else {
|
|
||||||
this.m_format = new SimpleDateFormat(str6, Locale.getDefault());
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
this.m_interval = Integer.parseInt(settings.get("FileCheckInterval"));
|
|
||||||
if (this.m_interval <= 0) {
|
|
||||||
this.m_interval = DEFAULT_CHECK_INTERVAL;
|
|
||||||
}
|
|
||||||
} catch (NumberFormatException e4) {
|
|
||||||
this.m_interval = DEFAULT_CHECK_INTERVAL;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
this.m_sizeLimit = Integer.parseInt(settings.get("MaxFileSize"));
|
|
||||||
if (this.m_sizeLimit <= 0) {
|
|
||||||
this.m_sizeLimit = DEFAULT_SIZE_LIMIT;
|
|
||||||
}
|
|
||||||
} catch (NumberFormatException e5) {
|
|
||||||
this.m_sizeLimit = DEFAULT_SIZE_LIMIT;
|
|
||||||
}
|
|
||||||
GuardTask guardTask = new GuardTask();
|
|
||||||
guardTask.run();
|
|
||||||
this.m_guardTimer = new Timer(guardTask);
|
|
||||||
this.m_guardTimer.schedule((double) this.m_interval, true);
|
|
||||||
} else if (z || this.m_filePath != null) {
|
|
||||||
this.m_filePath = null;
|
|
||||||
this.m_logFileStream = null;
|
|
||||||
this.m_interval = 0;
|
|
||||||
Log.i(Global.NIMBLE_ID, "LOG: Disable log to file since no filename provided");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void flushCache() {
|
|
||||||
Iterator<LogRecord> iterator = this.m_cache.iterator();
|
|
||||||
while (true) {
|
|
||||||
if (!iterator.hasNext()) {
|
|
||||||
this.m_cache = null;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
LogRecord logRecord = iterator.next();
|
|
||||||
this.writeLine(logRecord.level, logRecord.message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private String[] formatLine(String string2, String stringArray) {
|
|
||||||
int n2;
|
|
||||||
stringArray = string2 + ">" + (String)stringArray;
|
|
||||||
int n3 = n2 = stringArray.length();
|
|
||||||
string2 = stringArray;
|
|
||||||
if (n2 > this.m_messageLengthLimit) {
|
|
||||||
n3 = n2;
|
|
||||||
string2 = stringArray;
|
|
||||||
if (this.m_messageLengthLimit != 0) {
|
|
||||||
n3 = n2 - this.m_messageLengthLimit;
|
|
||||||
string2 = stringArray.substring(0, this.m_messageLengthLimit) + String.format("... and %d chars more", n3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
String[] strings = new String[(int) Math.ceil((double) n3 / 4000.0)];
|
|
||||||
n2 = 0;
|
|
||||||
while (n2 < n3) {
|
|
||||||
strings[n2 / 4000] = n2 + 4000 < n3 ? string2.substring(n2, n2 + 4000) : string2.substring(n2);
|
|
||||||
n2 += 4000;
|
|
||||||
}
|
|
||||||
return strings;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void outputMessageToFile(String string2) {
|
|
||||||
String string3 = System.getProperty("line.separator");
|
|
||||||
if (this.m_logFileStream == null) return;
|
|
||||||
try {
|
|
||||||
string2 = this.m_format.format(new Date()) + " " + string2 + string3;
|
|
||||||
this.m_logFileStream.write(string2.getBytes());
|
|
||||||
this.m_logFileStream.flush();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
catch (IOException iOException) {
|
|
||||||
Log.e((String)"Nimble", (String)("Error writing to log file: " + iOException.toString()));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private int parseLevel(String string2) {
|
|
||||||
block9: {
|
|
||||||
try {
|
|
||||||
int n2;
|
|
||||||
if (Utility.validString(string2) && (n2 = Integer.parseInt(string2)) != 0) {
|
|
||||||
return n2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (NumberFormatException numberFormatException) {
|
|
||||||
if (string2.equalsIgnoreCase("verbose")) {
|
|
||||||
return 100;
|
|
||||||
}
|
|
||||||
if (string2.equalsIgnoreCase("debug")) {
|
|
||||||
return 200;
|
|
||||||
}
|
|
||||||
if (string2.equalsIgnoreCase("info")) {
|
|
||||||
return 300;
|
|
||||||
}
|
|
||||||
if (string2.equalsIgnoreCase("warn")) {
|
|
||||||
return 400;
|
|
||||||
}
|
|
||||||
if (string2.equalsIgnoreCase("error")) {
|
|
||||||
return 500;
|
|
||||||
}
|
|
||||||
if (string2.equalsIgnoreCase("fatal")) {
|
|
||||||
return 600;
|
|
||||||
}
|
|
||||||
if (!string2.equalsIgnoreCase("silent")) break block9;
|
|
||||||
return 700;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.m_core.getConfiguration() == NimbleConfiguration.INTEGRATION) return 100;
|
|
||||||
if (this.m_core.getConfiguration() != NimbleConfiguration.STAGE) return 500;
|
|
||||||
return 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void write(int n2, String string2, String object) {
|
|
||||||
string2 = Utility.validString(string2) ? string2 + "> " + object : " " + object;
|
|
||||||
if (this.m_cache != null) {
|
|
||||||
LogRecord logRecord = new LogRecord();//object
|
|
||||||
logRecord.level = n2;
|
|
||||||
logRecord.message = string2;
|
|
||||||
this.m_cache.add(logRecord);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.writeLine(n2, string2);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void writeLine(int n2, String string2) {
|
|
||||||
block15: {
|
|
||||||
String string3;
|
|
||||||
int n3 = 0;
|
|
||||||
int n4 = 0;
|
|
||||||
int n5 = 0;
|
|
||||||
int n6 = 0;
|
|
||||||
switch (n2) {
|
|
||||||
default: {
|
|
||||||
int n7;
|
|
||||||
String[] stringArray = this.formatLine(String.format("NIM(%d)", n2), string2);
|
|
||||||
string3 = stringArray[0];
|
|
||||||
for (n7 = 0; n7 < stringArray.length - 1; ++n7) {
|
|
||||||
Log.e((String)"Nimble", (String)string3);
|
|
||||||
this.outputMessageToFile(string3);
|
|
||||||
string3 = stringArray[n7 + 1];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 100: {
|
|
||||||
for (String string4 : this.formatLine("NIM_VERBOSE", string2)) {
|
|
||||||
Log.v((String)"Nimble", (String)string4);
|
|
||||||
this.outputMessageToFile(string4);
|
|
||||||
}
|
|
||||||
break block15;
|
|
||||||
}
|
|
||||||
case 200: {
|
|
||||||
int n7;
|
|
||||||
String[] stringArray = this.formatLine("NIM_DEBUG", string2);
|
|
||||||
n4 = stringArray.length;
|
|
||||||
for (n7 = n3; n7 < n4; ++n7) {
|
|
||||||
String string5 = stringArray[n7];
|
|
||||||
Log.d((String)"Nimble", (String)string5);
|
|
||||||
this.outputMessageToFile(string5);
|
|
||||||
}
|
|
||||||
break block15;
|
|
||||||
}
|
|
||||||
case 300: {
|
|
||||||
int n7;
|
|
||||||
String[] stringArray = this.formatLine("NIM_INFO", string2);
|
|
||||||
n3 = stringArray.length;
|
|
||||||
for (n7 = n4; n7 < n3; ++n7) {
|
|
||||||
String string6 = stringArray[n7];
|
|
||||||
Log.i((String)"Nimble", (String)string6);
|
|
||||||
this.outputMessageToFile(string6);
|
|
||||||
}
|
|
||||||
break block15;
|
|
||||||
}
|
|
||||||
case 400: {
|
|
||||||
int n7;
|
|
||||||
String[] stringArray = this.formatLine("NIM_WARN", string2);
|
|
||||||
n3 = stringArray.length;
|
|
||||||
for (n7 = n5; n7 < n3; ++n7) {
|
|
||||||
String string7 = stringArray[n7];
|
|
||||||
Log.w((String)"Nimble", (String)string7);
|
|
||||||
this.outputMessageToFile(string7);
|
|
||||||
}
|
|
||||||
break block15;
|
|
||||||
}
|
|
||||||
case 500: {
|
|
||||||
int n7;
|
|
||||||
String[] stringArray = this.formatLine("NIM_ERROR", string2);
|
|
||||||
n3 = stringArray.length;
|
|
||||||
for (n7 = n6; n7 < n3; ++n7) {
|
|
||||||
String string8 = stringArray[n7];
|
|
||||||
Log.e((String)"Nimble", (String)string8);
|
|
||||||
this.outputMessageToFile(string8);
|
|
||||||
}
|
|
||||||
break block15;
|
|
||||||
}
|
|
||||||
case 600: {
|
|
||||||
int n7;
|
|
||||||
String[] stringArray = this.formatLine("NIM_FATAL", string2);
|
|
||||||
String string9 = stringArray[0];
|
|
||||||
for (n7 = 0; n7 < stringArray.length - 1; ++n7) {
|
|
||||||
Log.e((String)"Nimble", (String)string9);
|
|
||||||
this.outputMessageToFile(string9);
|
|
||||||
string9 = stringArray[n7 + 1];
|
|
||||||
}
|
|
||||||
Log.wtf((String)"Nimble", (String)string9);
|
|
||||||
this.outputMessageToFile(string9);
|
|
||||||
break block15;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Log.wtf((String)"Nimble", (String)string3);
|
|
||||||
this.outputMessageToFile(string3);
|
|
||||||
}
|
|
||||||
if (n2 < 600) return;
|
|
||||||
if (this.m_core.getConfiguration() == NimbleConfiguration.INTEGRATION) throw new AssertionError((Object)string2);
|
|
||||||
if (this.m_core.getConfiguration() != NimbleConfiguration.STAGE) return;
|
|
||||||
throw new AssertionError((Object)string2);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void connectToCore(BaseCore baseCore) {
|
|
||||||
this.m_core = baseCore;
|
|
||||||
this.configure();
|
|
||||||
this.flushCache();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void disconnectFromCore() {
|
|
||||||
this.m_core = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getComponentId() {
|
|
||||||
return "com.ea.nimble.NimbleLog";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getLogFilePath() {
|
|
||||||
return this.m_filePath.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getThresholdLevel() {
|
|
||||||
return this.m_level;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void resume() {
|
|
||||||
if (this.m_guardTimer == null) return;
|
|
||||||
this.m_guardTimer.fire();
|
|
||||||
this.m_guardTimer.resume();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setThresholdLevel(int n2) {
|
|
||||||
this.m_level = n2;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setup() {
|
|
||||||
this.configure();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void suspend() {
|
|
||||||
if (this.m_guardTimer == null) return;
|
|
||||||
this.m_guardTimer.pause();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.Component
|
|
||||||
public void teardown() {
|
|
||||||
if (this.m_guardTimer != null) {
|
|
||||||
this.m_guardTimer.cancel();
|
|
||||||
this.m_guardTimer = null;
|
|
||||||
}
|
|
||||||
if (this.m_logFileStream != null) {
|
|
||||||
try {
|
|
||||||
this.m_logFileStream.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
Log.e(Global.NIMBLE_ID, "LOG: Can't close log file");
|
|
||||||
}
|
|
||||||
this.m_logFileStream = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeWithSource(int n2, Object object, String string2, Object ... objectArray) {
|
|
||||||
if (n2 < this.m_level) return;
|
|
||||||
if (!Utility.validString(string2)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (objectArray.length > 0) {
|
|
||||||
string2 = String.format(string2, objectArray);
|
|
||||||
}
|
|
||||||
if (object instanceof LogSource) {
|
|
||||||
this.write(n2, ((LogSource)object).getLogSourceTitle(), string2);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (this.m_level <= 100 && object != null) {
|
|
||||||
this.write(n2, object.getClass().getName(), string2);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.write(n2, null, string2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeWithTitle(int n2, String string2, String string3, Object ... objectArray) {
|
|
||||||
if (n2 < this.m_level) return;
|
|
||||||
if (!Utility.validString(string3)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (objectArray.length > 0) {
|
|
||||||
string3 = String.format(string3, objectArray);
|
|
||||||
}
|
|
||||||
this.write(n2, string2, string3);
|
|
||||||
}
|
|
||||||
|
|
||||||
private class GuardTask
|
|
||||||
implements Runnable {
|
|
||||||
private GuardTask() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (LogImpl.this.m_filePath == null) return;
|
|
||||||
if (LogImpl.this.m_filePath.length() <= (long)(LogImpl.this.m_sizeLimit * 1024)) return;
|
|
||||||
LogImpl.this.clearLog();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class LogRecord {
|
|
||||||
public int level;
|
|
||||||
public String message;
|
|
||||||
|
|
||||||
private LogRecord() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
public interface LogSource {
|
|
||||||
public String getLogSourceTitle();
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import java.net.MalformedURLException;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class Network {
|
|
||||||
public static final String COMPONENT_ID = "com.ea.nimble.network";
|
|
||||||
|
|
||||||
public static String generateParameterString(Map<String, String> object) {
|
|
||||||
if (object == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (object.size() == 0) return null;
|
|
||||||
String string2 = "";
|
|
||||||
Iterator<Map.Entry<String, String>> iterator = object.entrySet().iterator();
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static URL generateURL(String string2, Map<String, String> object) {
|
|
||||||
if ("".equals(string2)) {
|
|
||||||
Log.Helper.LOGWS("Network", "Base url is blank, return null");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (Network.generateParameterString(object) == null) {
|
|
||||||
Log.Helper.LOGWS("Network", "Generated URL with only base url = %s", string2);
|
|
||||||
} else {
|
|
||||||
string2 = string2 + "?" + object;
|
|
||||||
Log.Helper.LOGVS("Network", "Generated URL = %s", string2);
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
return new URL(string2);
|
|
||||||
}
|
|
||||||
catch (MalformedURLException malformedURLException) {
|
|
||||||
Log.Helper.LOGFS("Network", "Malformed URL from %s", string2);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static INetwork getComponent() {
|
|
||||||
return (INetwork)((Object)Base.getComponent(COMPONENT_ID));
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum Status {
|
|
||||||
UNKNOWN,
|
|
||||||
NONE,
|
|
||||||
DEAD,
|
|
||||||
OK;
|
|
||||||
|
|
||||||
|
|
||||||
public String toString() {
|
|
||||||
switch (this.ordinal()) {
|
|
||||||
default: {
|
|
||||||
return "NET UNKNOWN";
|
|
||||||
}
|
|
||||||
case 1: {
|
|
||||||
return "NET NONE";
|
|
||||||
}
|
|
||||||
case 2: {
|
|
||||||
return "NET DEAD";
|
|
||||||
}
|
|
||||||
case 3:
|
|
||||||
}
|
|
||||||
return "NET OK";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,830 +0,0 @@
|
|||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import android.text.TextUtils;
|
|
||||||
|
|
||||||
import com.ea.ironmonkey.devmenu.util.Observer;
|
|
||||||
|
|
||||||
import org.json.JSONException;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
import org.json.JSONTokener;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.InterruptedIOException;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
import java.io.StringWriter;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.HttpURLConnection;
|
|
||||||
import java.net.SocketTimeoutException;
|
|
||||||
import java.net.UnknownHostException;
|
|
||||||
import java.nio.channels.FileChannel;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Stack;
|
|
||||||
|
|
||||||
public class NetworkConnection implements LogSource, NetworkConnectionHandle, Runnable {
|
|
||||||
private static int MAXIMUM_RAW_DATA_LENGTH = 1048576;
|
|
||||||
static int s_loggingIdCount = 100;
|
|
||||||
private NetworkConnectionCallback m_completionCallback;
|
|
||||||
private Date m_connectionStartTimestamp;
|
|
||||||
private NetworkConnectionCallback m_headerCallback;
|
|
||||||
private String m_loggingId;
|
|
||||||
private NetworkImpl m_manager;
|
|
||||||
private IOperationalTelemetryDispatch m_otDispatch;
|
|
||||||
private NetworkConnectionCallback m_progressCallback;
|
|
||||||
private HttpRequest m_request;
|
|
||||||
private String m_requestDataForLog;
|
|
||||||
private HttpResponse m_response;
|
|
||||||
private StringBuilder m_responseDataForLog;
|
|
||||||
private Thread m_thread;
|
|
||||||
|
|
||||||
public NetworkConnection(NetworkImpl networkImpl, HttpRequest httpRequest) {
|
|
||||||
this(networkImpl, httpRequest, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public NetworkConnection(NetworkImpl networkImpl, HttpRequest httpRequest, IOperationalTelemetryDispatch iOperationalTelemetryDispatch) {
|
|
||||||
this.m_manager = networkImpl;
|
|
||||||
this.m_thread = null;
|
|
||||||
this.m_request = httpRequest;
|
|
||||||
this.m_response = new HttpResponse();
|
|
||||||
this.m_headerCallback = null;
|
|
||||||
this.m_progressCallback = null;
|
|
||||||
this.m_completionCallback = null;
|
|
||||||
this.m_connectionStartTimestamp = null;
|
|
||||||
this.m_otDispatch = iOperationalTelemetryDispatch;
|
|
||||||
this.m_loggingId = String.valueOf(s_loggingIdCount);
|
|
||||||
int i = s_loggingIdCount;
|
|
||||||
s_loggingIdCount = i + 1;
|
|
||||||
if (i >= 1000) {
|
|
||||||
s_loggingIdCount = 100;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private String beautifyJSONString(String jsonString) {
|
|
||||||
try {
|
|
||||||
JSONTokener tokener = new JSONTokener(jsonString);
|
|
||||||
JSONObject jsonObject = new JSONObject(tokener);
|
|
||||||
return jsonObject.toString(4);
|
|
||||||
} catch (JSONException e) {
|
|
||||||
return jsonString;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void downloadToBuffer(java.net.HttpURLConnection r7) throws java.io.IOException {
|
|
||||||
Observer.onCallingMethod();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void downloadToBufferWithError(java.net.HttpURLConnection r7) {
|
|
||||||
Observer.onCallingMethod();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX WARN: Finally extract failed */
|
|
||||||
private void downloadToFile(HttpURLConnection httpURLConnection) throws IOException {
|
|
||||||
if (!skipDownloadForOverwritePolicy(httpURLConnection)) {
|
|
||||||
File file = new File(this.m_request.targetFilePath);
|
|
||||||
File file2 = new File(ApplicationEnvironment.getComponent().getCachePath() + File.separator + file.getName());
|
|
||||||
boolean z = file2.exists() && this.m_request.overwritePolicy.contains(IHttpRequest.OverwritePolicy.RESUME_DOWNLOAD);
|
|
||||||
InputStream inputStream = httpURLConnection.getInputStream();
|
|
||||||
FileOutputStream fileOutputStream = new FileOutputStream(file2, z);
|
|
||||||
byte[] bArr = new byte[65536];
|
|
||||||
Log.Helper.LOGI(this, "Started File Download for " + file.toString());
|
|
||||||
while (true) {
|
|
||||||
try {
|
|
||||||
int read = inputStream.read(bArr);
|
|
||||||
if (read < 0) {
|
|
||||||
break;
|
|
||||||
} else if (read == 0) {
|
|
||||||
Thread.yield();
|
|
||||||
} else {
|
|
||||||
fileOutputStream.write(bArr, 0, read);
|
|
||||||
this.m_response.downloadedContentLength += (long) read;
|
|
||||||
if (this.m_progressCallback != null) {
|
|
||||||
this.m_progressCallback.callback(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Throwable th) {
|
|
||||||
inputStream.close();
|
|
||||||
fileOutputStream.close();
|
|
||||||
throw th;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
inputStream.close();
|
|
||||||
fileOutputStream.close();
|
|
||||||
if (file.exists() && !file.delete()) {
|
|
||||||
Log.Helper.LOGE(this, "Failed to delete existed target file " + file);
|
|
||||||
}
|
|
||||||
if (!file2.renameTo(file)) {
|
|
||||||
Log.Helper.LOGI(this, "Failed to move temp file " + file2 + " to target file " + file);
|
|
||||||
Log.Helper.LOGI(this, "Using fallback, and copying file instead " + file2 + "to target file " + file);
|
|
||||||
if (!file.exists()) {
|
|
||||||
file.createNewFile();
|
|
||||||
}
|
|
||||||
FileChannel fileChannel = null;
|
|
||||||
FileChannel fileChannel2 = null;
|
|
||||||
FileChannel fileChannel3 = null;
|
|
||||||
FileChannel fileChannel4 = null;
|
|
||||||
try {
|
|
||||||
try {
|
|
||||||
FileChannel channel = new FileInputStream(file2).getChannel();
|
|
||||||
FileChannel channel2 = new FileOutputStream(file).getChannel();
|
|
||||||
fileChannel4 = channel2;
|
|
||||||
fileChannel2 = channel;
|
|
||||||
fileChannel3 = channel2;
|
|
||||||
fileChannel = channel;
|
|
||||||
channel2.transferFrom(channel, 0, channel.size());
|
|
||||||
if (channel != null) {
|
|
||||||
channel.close();
|
|
||||||
}
|
|
||||||
if (channel2 != null) {
|
|
||||||
channel2.close();
|
|
||||||
}
|
|
||||||
if (file2.exists()) {
|
|
||||||
file2.delete();
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
fileChannel3 = fileChannel4;
|
|
||||||
fileChannel = fileChannel2;
|
|
||||||
Log.Helper.LOGE(this, "ERROR while copying file, " + e);
|
|
||||||
if (fileChannel2 != null) {
|
|
||||||
fileChannel2.close();
|
|
||||||
}
|
|
||||||
if (fileChannel4 != null) {
|
|
||||||
fileChannel4.close();
|
|
||||||
}
|
|
||||||
if (file2.exists()) {
|
|
||||||
file2.delete();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Throwable th2) {
|
|
||||||
if (fileChannel != null) {
|
|
||||||
fileChannel.close();
|
|
||||||
}
|
|
||||||
if (fileChannel3 != null) {
|
|
||||||
fileChannel3.close();
|
|
||||||
}
|
|
||||||
if (file2.exists()) {
|
|
||||||
file2.delete();
|
|
||||||
}
|
|
||||||
throw th2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void finish() {
|
|
||||||
this.m_response.isCompleted = true;
|
|
||||||
logOperationalTelemetryResponse();
|
|
||||||
if (this.m_completionCallback != null) {
|
|
||||||
this.m_completionCallback.callback(this);
|
|
||||||
}
|
|
||||||
synchronized (this) {
|
|
||||||
notifyAll();
|
|
||||||
}
|
|
||||||
this.m_manager.removeConnection(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void httpRecv(HttpURLConnection httpURLConnection) throws IOException, Error {
|
|
||||||
InputStream errorStream;
|
|
||||||
try {
|
|
||||||
errorStream = httpURLConnection.getInputStream();
|
|
||||||
} catch (Exception e) {
|
|
||||||
try {
|
|
||||||
errorStream = httpURLConnection.getErrorStream();
|
|
||||||
} catch (Exception e2) {
|
|
||||||
throw new Error(Error.Code.NETWORK_CONNECTION_ERROR, "Exception when getting error stream from HTTP connection.", e2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.m_response.url = httpURLConnection.getURL();
|
|
||||||
try {
|
|
||||||
this.m_response.statusCode = httpURLConnection.getResponseCode();
|
|
||||||
this.m_response.expectedContentLength = (long) httpURLConnection.getContentLength();
|
|
||||||
this.m_response.lastModified = httpURLConnection.getLastModified();
|
|
||||||
for (Map.Entry<String, List<String>> entry : httpURLConnection.getHeaderFields().entrySet()) {
|
|
||||||
this.m_response.headers.put(entry.getKey(), TextUtils.join(", ", entry.getValue()));
|
|
||||||
}
|
|
||||||
boolean z = this.m_response.expectedContentLength > ((long) MAXIMUM_RAW_DATA_LENGTH);
|
|
||||||
boolean validString = Utility.validString(this.m_request.targetFilePath);
|
|
||||||
if (!z || validString) {
|
|
||||||
this.m_response.downloadedContentLength = 0;
|
|
||||||
if (this.m_headerCallback != null) {
|
|
||||||
this.m_headerCallback.callback(this);
|
|
||||||
}
|
|
||||||
if (validString && errorStream != null) {
|
|
||||||
downloadToFile(httpURLConnection);
|
|
||||||
} else if (this.m_response.expectedContentLength != 0) {
|
|
||||||
if (this.m_response.data == null) {
|
|
||||||
this.m_response.data = new ByteBufferIOStream((int) this.m_response.expectedContentLength);
|
|
||||||
} else {
|
|
||||||
this.m_response.data.clear();
|
|
||||||
}
|
|
||||||
if (this.m_response.statusCode == 200) {
|
|
||||||
downloadToBuffer(httpURLConnection);
|
|
||||||
} else {
|
|
||||||
downloadToBufferWithError(httpURLConnection);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!(this.m_response.statusCode == 200 || (validString && this.m_response.statusCode == 206))) {
|
|
||||||
throw new HttpError(this.m_response.statusCode, "Request " + this + " failed for HTTP error");
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
throw new Error(Error.Code.NETWORK_OVERSIZE_DATA, "Request " + this + " is oversize, please provide a local file path to download it as file.");
|
|
||||||
} finally {
|
|
||||||
if (errorStream != null) {
|
|
||||||
errorStream.close();
|
|
||||||
}
|
|
||||||
logCommunication();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX WARN: Multi-variable type inference failed */
|
|
||||||
/* JADX WARN: Type inference failed for: r6v0, types: [java.net.HttpURLConnection] */
|
|
||||||
/* JADX WARN: Type inference failed for: r8v1, types: [java.io.OutputStream] */
|
|
||||||
/* JADX WARN: Type inference failed for: r8v10, types: [java.lang.Object, java.lang.String] */
|
|
||||||
/* JADX WARN: Type inference failed for: r8v11 */
|
|
||||||
/* JADX WARN: Type inference failed for: r8v2 */
|
|
||||||
/* JADX WARN: Type inference failed for: r8v3 */
|
|
||||||
/* JADX WARN: Type inference failed for: r8v7 */
|
|
||||||
/* JADX WARN: Type inference failed for: r8v8 */
|
|
||||||
private void httpSend(HttpURLConnection httpURLConnection) throws IOException {
|
|
||||||
String str;
|
|
||||||
this.m_connectionStartTimestamp = new Date();
|
|
||||||
if (this.m_request.headers != null) {
|
|
||||||
Iterator<String> it = this.m_request.headers.keySet().iterator();
|
|
||||||
while (it.hasNext()) {
|
|
||||||
str = it.next();
|
|
||||||
httpURLConnection.setRequestProperty(str, this.m_request.headers.get(str));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.m_request.getMethod() == IHttpRequest.Method.POST || this.m_request.getMethod() == IHttpRequest.Method.PUT) {
|
|
||||||
byte[] byteArray = this.m_request.data.toByteArray();
|
|
||||||
if (byteArray == null || byteArray.length <= 0) {
|
|
||||||
logRequest();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
prepareRequestLog(byteArray);
|
|
||||||
logRequest();
|
|
||||||
httpURLConnection.setDoOutput(true);
|
|
||||||
httpURLConnection.setFixedLengthStreamingMode(byteArray.length);
|
|
||||||
OutputStream outputStream = null;
|
|
||||||
try {
|
|
||||||
OutputStream outputStream2 = httpURLConnection.getOutputStream();
|
|
||||||
outputStream = outputStream2;
|
|
||||||
outputStream2.write(byteArray);
|
|
||||||
if (outputStream2 != null) {
|
|
||||||
outputStream2.close();
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
StringWriter stringWriter = new StringWriter();
|
|
||||||
e.printStackTrace(new PrintWriter(stringWriter));
|
|
||||||
Log.Helper.LOGE(this, "Exception in network connection:" + stringWriter.toString());
|
|
||||||
if (outputStream != null) {
|
|
||||||
outputStream.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Throwable th) {
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
logRequest();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void logCommunication() {
|
|
||||||
if (Log.getComponent().getThresholdLevel() <= 100) {
|
|
||||||
int i = 4096;
|
|
||||||
if (this.m_requestDataForLog != null) {
|
|
||||||
i = 4096 + this.m_requestDataForLog.length();
|
|
||||||
}
|
|
||||||
int i2 = i;
|
|
||||||
if (this.m_responseDataForLog != null) {
|
|
||||||
i2 = i + this.m_responseDataForLog.length();
|
|
||||||
}
|
|
||||||
StringBuilder sb = new StringBuilder(i2);
|
|
||||||
sb.append(String.format("\n>>>> CONNECTION ID %s FINISHED >>>>>>>>>>>>>>\n", this.m_loggingId));
|
|
||||||
sb.append("\n>>>> REQUEST >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
|
|
||||||
sb.append("REQUEST: ").append(this.m_request.method.toString());
|
|
||||||
sb.append(' ').append(this.m_request.url.toString()).append('\n');
|
|
||||||
boolean z = false;
|
|
||||||
boolean z2 = false;
|
|
||||||
if (this.m_request.headers != null) {
|
|
||||||
z2 = false;
|
|
||||||
if (this.m_request.headers.size() > 0) {
|
|
||||||
Iterator<String> it = this.m_request.headers.keySet().iterator();
|
|
||||||
while (true) {
|
|
||||||
z2 = z;
|
|
||||||
if (!it.hasNext()) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
String next = it.next();
|
|
||||||
if (next != null) {
|
|
||||||
sb.append("REQ HEADER: ").append(next);
|
|
||||||
String safeString = Utility.safeString(this.m_request.headers.get(next));
|
|
||||||
sb.append(" VALUE: ").append(safeString).append('\n');
|
|
||||||
if (next.equals("Content-Type") && (safeString.contains("application/json") || safeString.contains("text/json"))) {
|
|
||||||
z = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.m_requestDataForLog != null && this.m_requestDataForLog.length() > 0) {
|
|
||||||
sb.append("REQ BODY:\n");
|
|
||||||
String str = this.m_requestDataForLog.toString();
|
|
||||||
String str2 = str;
|
|
||||||
if (z2) {
|
|
||||||
str2 = beautifyJSONString(str);
|
|
||||||
}
|
|
||||||
sb.append(str2).append('\n');
|
|
||||||
}
|
|
||||||
sb.append("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
|
|
||||||
sb.append(">>>> RESPONSE >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
|
|
||||||
sb.append("RESP URL: ").append(this.m_response.url.toString()).append('\n');
|
|
||||||
sb.append("RESP STATUS: ").append(this.m_response.statusCode).append('\n');
|
|
||||||
boolean z3 = false;
|
|
||||||
boolean z4 = false;
|
|
||||||
if (this.m_response.headers != null) {
|
|
||||||
z4 = false;
|
|
||||||
if (this.m_response.headers.size() > 0) {
|
|
||||||
Iterator<String> it2 = this.m_response.headers.keySet().iterator();
|
|
||||||
while (true) {
|
|
||||||
z4 = z3;
|
|
||||||
if (!it2.hasNext()) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
String next2 = it2.next();
|
|
||||||
if (next2 != null) {
|
|
||||||
sb.append("RESP HEADER: ").append(next2);
|
|
||||||
String safeString2 = Utility.safeString(this.m_response.headers.get(next2));
|
|
||||||
sb.append(" VALUE: ").append(safeString2).append('\n');
|
|
||||||
if (next2.equals("Content-Type") && (safeString2.contains("application/json") || safeString2.contains("text/json"))) {
|
|
||||||
z3 = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sb.append("RESP BODY:\n");
|
|
||||||
String str3 = "<Empty>: there is no response body for this call";
|
|
||||||
try {
|
|
||||||
if (this.m_responseDataForLog != null) {
|
|
||||||
str3 = this.m_responseDataForLog.toString();
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.Helper.LOGE(this, "Attempting to process the response body failed.");
|
|
||||||
str3 = "<Empty>: there is no response body for this call";
|
|
||||||
if (this.m_response != null) {
|
|
||||||
str3 = "<Empty>: there is no response body for this call";
|
|
||||||
if (this.m_response.getError() != null) {
|
|
||||||
str3 = "<Empty>: there is no response body for this call";
|
|
||||||
if (this.m_response.getError().getMessage() != null) {
|
|
||||||
str3 = this.m_response.getError().getMessage();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
String str4 = str3;
|
|
||||||
if (z4) {
|
|
||||||
str4 = beautifyJSONString(str3);
|
|
||||||
}
|
|
||||||
sb.append(str4).append('\n');
|
|
||||||
sb.append("<<<< CONNECTION FINISHED <<<<<<<<<<<<<<<<<<<<<");
|
|
||||||
Log.Helper.LOGV(this, sb.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void logRequest() {
|
|
||||||
if (Log.getComponent().getThresholdLevel() <= 100) {
|
|
||||||
int i = 2048;
|
|
||||||
if (this.m_requestDataForLog != null) {
|
|
||||||
i = 2048 + this.m_requestDataForLog.length();
|
|
||||||
}
|
|
||||||
StringBuilder sb = new StringBuilder(i);
|
|
||||||
sb.append(String.format("\n>>>> CONNECTION ID %s BEGIN >>>>>>>>>>>>>>>>>\n", this.m_loggingId));
|
|
||||||
sb.append("REQUEST: ").append(this.m_request.method.toString());
|
|
||||||
sb.append(' ').append(this.m_request.url.toString()).append('\n');
|
|
||||||
boolean z = false;
|
|
||||||
boolean z2 = false;
|
|
||||||
if (this.m_request.headers != null) {
|
|
||||||
z2 = false;
|
|
||||||
if (this.m_request.headers.size() > 0) {
|
|
||||||
Iterator<String> it = this.m_request.headers.keySet().iterator();
|
|
||||||
while (true) {
|
|
||||||
z2 = z;
|
|
||||||
if (!it.hasNext()) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
String next = it.next();
|
|
||||||
sb.append("REQ HEADER: ").append(next);
|
|
||||||
String str = this.m_request.headers.get(next);
|
|
||||||
sb.append(" VALUE: ").append(str).append('\n');
|
|
||||||
if (next.equals("Content-Type") && (str.contains("application/json") || str.contains("text/json"))) {
|
|
||||||
z = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.m_requestDataForLog != null && this.m_requestDataForLog.length() > 0) {
|
|
||||||
sb.append("REQ BODY:\n");
|
|
||||||
String str2 = this.m_requestDataForLog.toString();
|
|
||||||
String str3 = str2;
|
|
||||||
if (z2) {
|
|
||||||
str3 = beautifyJSONString(str2);
|
|
||||||
}
|
|
||||||
sb.append(str3).append('\n');
|
|
||||||
}
|
|
||||||
sb.append("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
|
|
||||||
Log.Helper.LOGV(this, sb.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private String multiplyStringNTimes(String str, int i) {
|
|
||||||
StringBuilder sb = new StringBuilder(str.length() * i);
|
|
||||||
for (int i2 = 0; i2 < i; i2++) {
|
|
||||||
sb.append(str);
|
|
||||||
}
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void prepareRequestLog(byte[] bArr) {
|
|
||||||
if (Log.getComponent().getThresholdLevel() <= 100) {
|
|
||||||
try {
|
|
||||||
this.m_requestDataForLog = new String(bArr, "UTF-8");
|
|
||||||
} catch (UnsupportedEncodingException e) {
|
|
||||||
this.m_requestDataForLog = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void prepareResponseLog() {
|
|
||||||
if (Log.getComponent().getThresholdLevel() <= 100) {
|
|
||||||
this.m_responseDataForLog = new StringBuilder(this.m_response.expectedContentLength > 0 ? (int) this.m_response.expectedContentLength : 4096);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void prepareResponseLog(byte[] bArr, int i, int i2) {
|
|
||||||
if (Log.getComponent().getThresholdLevel() <= 100 && this.m_responseDataForLog != null) {
|
|
||||||
try {
|
|
||||||
this.m_responseDataForLog.append(new String(bArr, i, i2, "UTF-8"));
|
|
||||||
} catch (UnsupportedEncodingException e) {
|
|
||||||
this.m_responseDataForLog = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX WARN: Code restructure failed: missing block: B:10:0x003a, code lost:
|
|
||||||
if (r5.m_request.overwritePolicy.contains(com.ea.nimble.IHttpRequest.OverwritePolicy.LENGTH_CHECK) == false) goto L_0x003d;
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
Code decompiled incorrectly, please refer to instructions dump.
|
|
||||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
|
||||||
*/
|
|
||||||
private boolean skipDownloadForOverwritePolicy(java.net.HttpURLConnection r6) {
|
|
||||||
/*
|
|
||||||
r5 = this;
|
|
||||||
r0 = 1
|
|
||||||
r8 = r0
|
|
||||||
java.io.File r0 = new java.io.File
|
|
||||||
r1 = r0
|
|
||||||
r2 = r5
|
|
||||||
com.ea.nimble.HttpRequest r2 = r2.m_request
|
|
||||||
java.lang.String r2 = r2.targetFilePath
|
|
||||||
r1.<init>(r2)
|
|
||||||
r6 = r0
|
|
||||||
r0 = r6
|
|
||||||
boolean r0 = r0.exists()
|
|
||||||
if (r0 != 0) goto L_0x001c
|
|
||||||
r0 = 0
|
|
||||||
r7 = r0
|
|
||||||
L_0x001a:
|
|
||||||
r0 = r7
|
|
||||||
return r0
|
|
||||||
L_0x001c:
|
|
||||||
r0 = r6
|
|
||||||
long r0 = r0.length()
|
|
||||||
r1 = r5
|
|
||||||
com.ea.nimble.HttpResponse r1 = r1.m_response
|
|
||||||
long r1 = r1.expectedContentLength
|
|
||||||
int r0 = (r0 > r1 ? 1 : (r0 == r1 ? 0 : -1))
|
|
||||||
if (r0 == 0) goto L_0x003d
|
|
||||||
r0 = r8
|
|
||||||
r7 = r0
|
|
||||||
r0 = r5
|
|
||||||
com.ea.nimble.HttpRequest r0 = r0.m_request
|
|
||||||
java.util.EnumSet<com.ea.nimble.IHttpRequest$OverwritePolicy> r0 = r0.overwritePolicy
|
|
||||||
com.ea.nimble.IHttpRequest$OverwritePolicy r1 = com.ea.nimble.IHttpRequest.OverwritePolicy.LENGTH_CHECK
|
|
||||||
boolean r0 = r0.contains(r1)
|
|
||||||
if (r0 != 0) goto L_0x001a
|
|
||||||
L_0x003d:
|
|
||||||
r0 = r8
|
|
||||||
r7 = r0
|
|
||||||
r0 = r6
|
|
||||||
long r0 = r0.lastModified()
|
|
||||||
r1 = r5
|
|
||||||
com.ea.nimble.HttpResponse r1 = r1.m_response
|
|
||||||
long r1 = r1.lastModified
|
|
||||||
int r0 = (r0 > r1 ? 1 : (r0 == r1 ? 0 : -1))
|
|
||||||
if (r0 < 0) goto L_0x001a
|
|
||||||
r0 = r8
|
|
||||||
r7 = r0
|
|
||||||
r0 = r5
|
|
||||||
com.ea.nimble.HttpRequest r0 = r0.m_request
|
|
||||||
java.util.EnumSet<com.ea.nimble.IHttpRequest$OverwritePolicy> r0 = r0.overwritePolicy
|
|
||||||
com.ea.nimble.IHttpRequest$OverwritePolicy r1 = com.ea.nimble.IHttpRequest.OverwritePolicy.DATE_CHECK
|
|
||||||
boolean r0 = r0.contains(r1)
|
|
||||||
if (r0 == 0) goto L_0x001a
|
|
||||||
r0 = 1
|
|
||||||
return r0
|
|
||||||
*/
|
|
||||||
throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.NetworkConnection.skipDownloadForOverwritePolicy(java.net.HttpURLConnection):boolean");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.NetworkConnectionHandle
|
|
||||||
public void cancel() {
|
|
||||||
synchronized (this) {
|
|
||||||
if (this.m_thread != null) {
|
|
||||||
this.m_thread.interrupt();
|
|
||||||
} else {
|
|
||||||
finishWithError(new Error(Error.Code.NETWORK_OPERATION_CANCELLED, "Network connection " + toString() + " is cancelled"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: package-private */
|
|
||||||
public void cancelForAppSuspend() {
|
|
||||||
cancel();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: package-private */
|
|
||||||
public void finishWithError(Exception exc) {
|
|
||||||
if (this.m_response.isCompleted) {
|
|
||||||
Log.Helper.LOGI(this, "Finished connection %s skipped an error %s", toString(), exc.toString());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Log.Helper.LOGW(this, "Running connection number %s with name %s failed for error %s", this.m_loggingId, toString(), exc.toString());
|
|
||||||
this.m_response.error = exc;
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.NetworkConnectionHandle
|
|
||||||
public NetworkConnectionCallback getCompletionCallback() {
|
|
||||||
return this.m_completionCallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.NetworkConnectionHandle
|
|
||||||
public NetworkConnectionCallback getHeaderCallback() {
|
|
||||||
return this.m_headerCallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.LogSource
|
|
||||||
public String getLogSourceTitle() {
|
|
||||||
return "Network";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.NetworkConnectionHandle
|
|
||||||
public NetworkConnectionCallback getProgressCallback() {
|
|
||||||
return this.m_progressCallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.NetworkConnectionHandle
|
|
||||||
public HttpRequest getRequest() {
|
|
||||||
return this.m_request;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.NetworkConnectionHandle
|
|
||||||
public HttpResponse getResponse() {
|
|
||||||
return this.m_response;
|
|
||||||
}
|
|
||||||
|
|
||||||
void logOperationalTelemetryResponse() {
|
|
||||||
if (this.m_request == null || this.m_request.url == null) {
|
|
||||||
Log.Helper.LOGE(this, "Empty request object and/or request URL for OT logging.");
|
|
||||||
} else if (this.m_response == null) {
|
|
||||||
Log.Helper.LOGE(this, "Empty response object for OT logging.");
|
|
||||||
} else if (!BaseCore.getInstance().isActive()) {
|
|
||||||
Log.Helper.LOGV(this, "BaseCore not active for operational telemetry logging.");
|
|
||||||
} else {
|
|
||||||
if (this.m_otDispatch == null) {
|
|
||||||
this.m_otDispatch = OperationalTelemetryDispatch.getComponent();
|
|
||||||
if (this.m_otDispatch == null) {
|
|
||||||
Log.Helper.LOGV(this, "OperationalTelemetry Component not active for operational telemetry logging.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
HashMap hashMap = new HashMap();
|
|
||||||
String protocol = this.m_request.url.getProtocol();
|
|
||||||
String path = this.m_request.url.getPath();
|
|
||||||
String query = this.m_request.url.getQuery();
|
|
||||||
String host = this.m_request.url.getHost();
|
|
||||||
int i = this.m_response.statusCode;
|
|
||||||
String url = this.m_request.url.toString();
|
|
||||||
String str = Global.NOTIFICATION_DICTIONARY_RESULT_FAIL;
|
|
||||||
if (this.m_connectionStartTimestamp != null) {
|
|
||||||
try {
|
|
||||||
Date date = new Date();
|
|
||||||
str = Global.NOTIFICATION_DICTIONARY_RESULT_FAIL;
|
|
||||||
if (date != null) {
|
|
||||||
str = String.valueOf(date.getTime() - this.m_connectionStartTimestamp.getTime());
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.Helper.LOGE(this, "Unable to allocate new Date object to calculate response time.");
|
|
||||||
str = Global.NOTIFICATION_DICTIONARY_RESULT_FAIL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Exception error = this.m_response.getError();
|
|
||||||
boolean z = false;
|
|
||||||
if (error != null) {
|
|
||||||
if (error instanceof Error) {
|
|
||||||
Error error2 = (Error) error;
|
|
||||||
int code = error2.getCode();
|
|
||||||
hashMap.put("NIMBLE_ERROR_DOMAIN", error2.getDomain());
|
|
||||||
hashMap.put("NIMBLE_ERROR_CODE", String.valueOf(code));
|
|
||||||
z = error2.getDomain().equals(Error.ERROR_DOMAIN) && code == Error.Code.NETWORK_TIMEOUT.intValue();
|
|
||||||
} else {
|
|
||||||
hashMap.put("NIMBLE_ERROR_DOMAIN", error.getClass().getName());
|
|
||||||
z = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
hashMap.put("CONNECTIONID", this.m_loggingId);
|
|
||||||
hashMap.put("URL_ABSOLUTE", url);
|
|
||||||
hashMap.put("URL_PROTOCOL", protocol);
|
|
||||||
hashMap.put("URL_PATH", path);
|
|
||||||
hashMap.put("URL_QUERY", query);
|
|
||||||
hashMap.put("URL_HOST", host);
|
|
||||||
hashMap.put("RESPONSE_TIME_MS", str);
|
|
||||||
hashMap.put("HTTP_STATUS_CODE", String.valueOf(i));
|
|
||||||
hashMap.put("REQUEST_TIMED_OUT", String.valueOf(z));
|
|
||||||
this.m_otDispatch.logEvent("com.ea.nimble.network", hashMap);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // java.lang.Runnable
|
|
||||||
public void run() {
|
|
||||||
try {
|
|
||||||
try {
|
|
||||||
try {
|
|
||||||
try {
|
|
||||||
try {
|
|
||||||
try {
|
|
||||||
try {
|
|
||||||
if (this.m_response.isCompleted) {
|
|
||||||
synchronized (this) {
|
|
||||||
try {
|
|
||||||
this.m_thread = null;
|
|
||||||
} catch (Throwable th) {
|
|
||||||
throw th;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (Thread.interrupted()) {
|
|
||||||
throw new InterruptedIOException();
|
|
||||||
} else {
|
|
||||||
synchronized (this) {
|
|
||||||
try {
|
|
||||||
this.m_thread = Thread.currentThread();
|
|
||||||
} catch (Throwable th2) {
|
|
||||||
throw th2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
HttpURLConnection httpURLConnection = (HttpURLConnection) this.m_request.getUrl().openConnection();
|
|
||||||
httpURLConnection.setRequestMethod(this.m_request.method.toString());
|
|
||||||
httpURLConnection.setConnectTimeout((int) (this.m_request.timeout * 1000.0d));
|
|
||||||
httpURLConnection.setReadTimeout((int) (this.m_request.timeout * 1000.0d));
|
|
||||||
httpURLConnection.setRequestProperty("Connection", "close");
|
|
||||||
if (Thread.interrupted()) {
|
|
||||||
throw new InterruptedIOException();
|
|
||||||
}
|
|
||||||
httpSend(httpURLConnection);
|
|
||||||
if (Thread.interrupted()) {
|
|
||||||
throw new InterruptedIOException();
|
|
||||||
}
|
|
||||||
httpRecv(httpURLConnection);
|
|
||||||
finish();
|
|
||||||
synchronized (this) {
|
|
||||||
try {
|
|
||||||
this.m_thread = null;
|
|
||||||
} catch (Throwable th3) {
|
|
||||||
throw th3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Throwable th4) {
|
|
||||||
synchronized (this) {
|
|
||||||
try {
|
|
||||||
this.m_thread = null;
|
|
||||||
throw th4;
|
|
||||||
} catch (Throwable th5) {
|
|
||||||
throw th5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (InterruptedIOException e) {
|
|
||||||
finishWithError(new Error(Error.Code.NETWORK_OPERATION_CANCELLED, "Connection " + toString() + " is cancelled", e));
|
|
||||||
synchronized (this) {
|
|
||||||
try {
|
|
||||||
this.m_thread = null;
|
|
||||||
} catch (Throwable th6) {
|
|
||||||
throw th6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Error e2) {
|
|
||||||
finishWithError(e2);
|
|
||||||
synchronized (this) {
|
|
||||||
try {
|
|
||||||
this.m_thread = null;
|
|
||||||
} catch (Throwable th7) {
|
|
||||||
throw th7;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (SocketTimeoutException e3) {
|
|
||||||
finishWithError(new Error(Error.Code.NETWORK_TIMEOUT, "Connection " + toString() + " timed out", e3));
|
|
||||||
synchronized (this) {
|
|
||||||
try {
|
|
||||||
this.m_thread = null;
|
|
||||||
} catch (Throwable th8) {
|
|
||||||
throw th8;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (ClassCastException e4) {
|
|
||||||
finishWithError(new Error(Error.Code.NETWORK_UNSUPPORTED_CONNECTION_TYPE, "Request " + toString() + " failed for unsupported connection type" + this.m_request.getUrl().getProtocol(), e4));
|
|
||||||
synchronized (this) {
|
|
||||||
try {
|
|
||||||
this.m_thread = null;
|
|
||||||
} catch (Throwable th9) {
|
|
||||||
throw th9;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (UnknownHostException e5) {
|
|
||||||
Network.Status status = this.m_manager.getStatus();
|
|
||||||
if (status != Network.Status.OK) {
|
|
||||||
finishWithError(new Error(Error.Code.NETWORK_NO_CONNECTION, "No network connection, network status " + status.toString(), e5));
|
|
||||||
} else {
|
|
||||||
finishWithError(new Error(Error.Code.NETWORK_UNREACHABLE, "Request " + toString() + " failed for unreachable host", e5));
|
|
||||||
}
|
|
||||||
synchronized (this) {
|
|
||||||
try {
|
|
||||||
this.m_thread = null;
|
|
||||||
} catch (Throwable th10) {
|
|
||||||
throw th10;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (IOException e6) {
|
|
||||||
finishWithError(new Error(Error.Code.NETWORK_CONNECTION_ERROR, "Connection " + toString() + " failed with I/O exception", e6));
|
|
||||||
synchronized (this) {
|
|
||||||
try {
|
|
||||||
this.m_thread = null;
|
|
||||||
} catch (Throwable th11) {
|
|
||||||
throw th11;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception e7) {
|
|
||||||
finishWithError(new Error(Error.Code.SYSTEM_UNEXPECTED, "Unexpected error.", e7));
|
|
||||||
synchronized (this) {
|
|
||||||
try {
|
|
||||||
this.m_thread = null;
|
|
||||||
} catch (Throwable th12) {
|
|
||||||
throw th12;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.NetworkConnectionHandle
|
|
||||||
public void setCompletionCallback(NetworkConnectionCallback networkConnectionCallback) {
|
|
||||||
this.m_completionCallback = networkConnectionCallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.NetworkConnectionHandle
|
|
||||||
public void setHeaderCallback(NetworkConnectionCallback networkConnectionCallback) {
|
|
||||||
this.m_headerCallback = networkConnectionCallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.NetworkConnectionHandle
|
|
||||||
public void setProgressCallback(NetworkConnectionCallback networkConnectionCallback) {
|
|
||||||
this.m_progressCallback = networkConnectionCallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.NetworkConnectionHandle
|
|
||||||
public void waitOn() {
|
|
||||||
synchronized (this) {
|
|
||||||
while (!this.m_response.isCompleted) {
|
|
||||||
try {
|
|
||||||
wait();
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.NetworkConnectionHandle;
|
|
||||||
|
|
||||||
public interface NetworkConnectionCallback {
|
|
||||||
public void callback(NetworkConnectionHandle var1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.IHttpRequest;
|
|
||||||
import com.ea.nimble.IHttpResponse;
|
|
||||||
import com.ea.nimble.NetworkConnectionCallback;
|
|
||||||
|
|
||||||
public interface NetworkConnectionHandle {
|
|
||||||
public void cancel();
|
|
||||||
|
|
||||||
public NetworkConnectionCallback getCompletionCallback();
|
|
||||||
|
|
||||||
public NetworkConnectionCallback getHeaderCallback();
|
|
||||||
|
|
||||||
public NetworkConnectionCallback getProgressCallback();
|
|
||||||
|
|
||||||
public IHttpRequest getRequest();
|
|
||||||
|
|
||||||
public IHttpResponse getResponse();
|
|
||||||
|
|
||||||
public void setCompletionCallback(NetworkConnectionCallback var1);
|
|
||||||
|
|
||||||
public void setHeaderCallback(NetworkConnectionCallback var1);
|
|
||||||
|
|
||||||
public void setProgressCallback(NetworkConnectionCallback var1);
|
|
||||||
|
|
||||||
public void waitOn();
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,486 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*
|
|
||||||
* Could not load the following classes:
|
|
||||||
* android.content.BroadcastReceiver
|
|
||||||
* android.content.Context
|
|
||||||
* android.content.Intent
|
|
||||||
* android.content.IntentFilter
|
|
||||||
* android.net.ConnectivityManager
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import android.content.BroadcastReceiver;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.IntentFilter;
|
|
||||||
|
|
||||||
import java.net.MalformedURLException;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.ExecutorService;
|
|
||||||
import java.util.concurrent.Executors;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
public class NetworkImpl
|
|
||||||
extends Component
|
|
||||||
implements INetwork,
|
|
||||||
LogSource {
|
|
||||||
private static final String BACKUP_NETWORK_REACHABILITY_CHECK_URL = "http://www.ea.com";
|
|
||||||
private static final int DETECTION_TIMEOUT = 30;
|
|
||||||
private static final String MAIN_NETWORK_REACHABILITY_CHECK_URL = "http://cdn.skum.eamobile.com";
|
|
||||||
private static final int[] PING_INTERVAL = new int[]{5, 10, 30, 60};
|
|
||||||
private static final int QUICK_DETECTION_TIMEOUT = 5;
|
|
||||||
private final int MAX_CONCURRENT_THREADS;
|
|
||||||
private ExecutorService m_asyncTaskManager;
|
|
||||||
private ConnectivityReceiver m_connectivityReceiver;
|
|
||||||
private NetworkConnection m_detectionConnection;
|
|
||||||
private boolean m_isWifi;
|
|
||||||
private DetectionState m_networkDetectionState;
|
|
||||||
private int m_pingIndex;
|
|
||||||
private List<NetworkConnection> m_queue;
|
|
||||||
private Network.Status m_status;
|
|
||||||
private Timer m_timer;
|
|
||||||
private LinkedList<NetworkConnection> m_waitingToExecuteQueue;
|
|
||||||
|
|
||||||
public NetworkImpl() {
|
|
||||||
this.MAX_CONCURRENT_THREADS = 4;
|
|
||||||
Log.Helper.LOGV(this, "constructor, start task manager and monitor the connectivity");
|
|
||||||
this.m_connectivityReceiver = null;
|
|
||||||
this.m_status = Network.Status.UNKNOWN;
|
|
||||||
this.m_detectionConnection = null;
|
|
||||||
this.m_networkDetectionState = DetectionState.NONE;
|
|
||||||
this.m_pingIndex = 0;
|
|
||||||
this.m_queue = new ArrayList<NetworkConnection>();
|
|
||||||
this.startWork();
|
|
||||||
}
|
|
||||||
|
|
||||||
static /* synthetic */ Timer access$302(NetworkImpl networkImpl, Timer timer) {
|
|
||||||
networkImpl.m_timer = timer;
|
|
||||||
return timer;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void detect(boolean bl2) {
|
|
||||||
if (this.m_detectionConnection != null) {
|
|
||||||
if (!bl2) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
NetworkConnection networkConnection = this.m_detectionConnection;
|
|
||||||
this.m_detectionConnection = null;
|
|
||||||
networkConnection.cancel();
|
|
||||||
}
|
|
||||||
this.stopPing();
|
|
||||||
if (this.reachabilityCheck()) {
|
|
||||||
if (this.m_status != Network.Status.DEAD) {
|
|
||||||
this.setStatus(Network.Status.OK);
|
|
||||||
}
|
|
||||||
this.m_networkDetectionState = DetectionState.VERIFY_REACHABLE_MAIN;
|
|
||||||
} else {
|
|
||||||
if (this.m_status == Network.Status.UNKNOWN) {
|
|
||||||
this.setStatus(Network.Status.NONE);
|
|
||||||
}
|
|
||||||
this.m_networkDetectionState = DetectionState.VERIFY_UNREACHABLE_MAIN;
|
|
||||||
}
|
|
||||||
this.verifyReachability(MAIN_NETWORK_REACHABILITY_CHECK_URL, 5.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Enabled unnecessary exception pruning
|
|
||||||
*/
|
|
||||||
private void onReachabilityVerification(NetworkConnectionHandle object) {
|
|
||||||
synchronized (this) {
|
|
||||||
Exception exception = object.getResponse().getError();
|
|
||||||
if (exception == null) {
|
|
||||||
Log.Helper.LOGD(this, "network verified reachable.");
|
|
||||||
this.setStatus(Network.Status.OK);
|
|
||||||
this.m_detectionConnection = null;
|
|
||||||
} else {
|
|
||||||
if (object != this.m_detectionConnection) return;
|
|
||||||
this.m_detectionConnection = null;
|
|
||||||
Log.Helper.LOGD(this, "network verified unreachable, ERROR %s for detection state %s", object.getResponse().getError(), this.m_networkDetectionState);
|
|
||||||
if (
|
|
||||||
//TODO В этом месте ложится при targetSdk 30
|
|
||||||
exception instanceof Error/* &&
|
|
||||||
((Error)((Error)exception)).getDomain().equals("NimbleError") &&
|
|
||||||
((Error)object).isError(Error.Code.NETWORK_OPERATION_CANCELLED)*/) {
|
|
||||||
Log.Helper.LOGW(this, "Network detection verification connection get cancelled for unknown reason (maybe reasonable for Android)");
|
|
||||||
}
|
|
||||||
switch (this.m_networkDetectionState.ordinal()) {
|
|
||||||
case 1: {
|
|
||||||
this.m_networkDetectionState = DetectionState.VERIFY_REACHABLE_BACKUP;
|
|
||||||
this.verifyReachability(BACKUP_NETWORK_REACHABILITY_CHECK_URL, 30.0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 2: {
|
|
||||||
this.setStatus(Network.Status.NONE);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 3: {
|
|
||||||
this.m_networkDetectionState = DetectionState.PING;
|
|
||||||
if (this.m_status == Network.Status.DEAD) {
|
|
||||||
this.startPing();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
this.setStatus(Network.Status.DEAD);
|
|
||||||
this.m_pingIndex = 0;
|
|
||||||
this.startPing();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 4: {
|
|
||||||
++this.m_pingIndex;
|
|
||||||
this.startPing();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean reachabilityCheck() {
|
|
||||||
this.m_isWifi = false;
|
|
||||||
Context context = ApplicationEnvironment.getComponent().getApplicationContext();
|
|
||||||
if (context == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if ((context.getSystemService(Context.CONNECTIVITY_SERVICE)) == null) return false;
|
|
||||||
if (!BaseCore.getInstance().isActive()) {
|
|
||||||
Log.Helper.LOGD(this, "BaseCore not active yet. Postpone reachability check.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
this.m_isWifi = true;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void registerNetworkListener() {
|
|
||||||
if (this.m_connectivityReceiver != null) return;
|
|
||||||
Log.Helper.LOGD(this, "Register network reachability listener.");
|
|
||||||
this.m_connectivityReceiver = new ConnectivityReceiver();
|
|
||||||
IntentFilter intentFilter = new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE");
|
|
||||||
ApplicationEnvironment.getComponent().getApplicationContext().registerReceiver((BroadcastReceiver)this.m_connectivityReceiver, intentFilter);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setStatus(Network.Status status) {
|
|
||||||
Log.Helper.LOGI(this, "Status change %s -> %s", this.m_status, status);
|
|
||||||
if (status == this.m_status) return;
|
|
||||||
this.m_status = status;
|
|
||||||
Utility.sendBroadcast("nimble.notification.networkStatusChanged", null);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void startPing() {
|
|
||||||
if (this.m_pingIndex >= PING_INTERVAL.length) {
|
|
||||||
this.m_pingIndex = PING_INTERVAL.length - 1;
|
|
||||||
}
|
|
||||||
this.m_timer = new Timer(new TimerTask());
|
|
||||||
this.m_timer.schedule(PING_INTERVAL[this.m_pingIndex], false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Enabled unnecessary exception pruning
|
|
||||||
*/
|
|
||||||
private void startWork() {
|
|
||||||
synchronized (this) {
|
|
||||||
Object object = this.m_asyncTaskManager;
|
|
||||||
if (object != null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.detect(true);
|
|
||||||
this.registerNetworkListener();
|
|
||||||
this.m_asyncTaskManager = Executors.newFixedThreadPool(4);
|
|
||||||
if (this.m_waitingToExecuteQueue == null) return;
|
|
||||||
if (this.m_waitingToExecuteQueue.isEmpty()) return;
|
|
||||||
Log.Helper.LOGW(this, "NetworkConnections waiting to execute on new AsyncTaskManager. Executing.");
|
|
||||||
while (!this.m_waitingToExecuteQueue.isEmpty()) {
|
|
||||||
object = this.m_waitingToExecuteQueue.poll();
|
|
||||||
Log.Helper.LOGW(this, "Executing request URL: " + ((NetworkConnection)object).getRequest().url.toString());
|
|
||||||
this.m_asyncTaskManager.execute((Runnable)object);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void stopPing() {
|
|
||||||
if (this.m_timer == null) return;
|
|
||||||
this.m_timer.cancel();
|
|
||||||
this.m_timer = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Enabled unnecessary exception pruning
|
|
||||||
* Converted monitor instructions to comments
|
|
||||||
*/
|
|
||||||
private void stopWork() {
|
|
||||||
// MONITORENTER : this
|
|
||||||
this.m_detectionConnection = null;
|
|
||||||
this.stopPing();
|
|
||||||
this.unregisterNetworkListener();
|
|
||||||
// MONITOREXIT : this
|
|
||||||
if (this.m_asyncTaskManager == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
Iterator<Runnable> iterator = this.m_asyncTaskManager.shutdownNow().iterator();
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
((NetworkConnection)iterator.next()).cancelForAppSuspend();
|
|
||||||
}
|
|
||||||
this.m_asyncTaskManager.awaitTermination(60L, TimeUnit.SECONDS);
|
|
||||||
}
|
|
||||||
catch (InterruptedException interruptedException) {
|
|
||||||
this.m_asyncTaskManager.shutdownNow();
|
|
||||||
Thread.currentThread().interrupt();
|
|
||||||
}
|
|
||||||
this.m_asyncTaskManager = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Unable to fully structure code
|
|
||||||
*/
|
|
||||||
private void unregisterNetworkListener() {
|
|
||||||
if (this.m_connectivityReceiver == null) return;
|
|
||||||
try {
|
|
||||||
ApplicationEnvironment.getComponent().getApplicationContext().unregisterReceiver((BroadcastReceiver)this.m_connectivityReceiver);
|
|
||||||
lbl4:
|
|
||||||
// 2 sources
|
|
||||||
|
|
||||||
while (true) {
|
|
||||||
this.m_connectivityReceiver = null;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (IllegalArgumentException var1_1) {
|
|
||||||
Log.Helper.LOGE(this, "Unable to unregister network reachability listener even it does exists");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void verifyReachability(String string2, double d2) {
|
|
||||||
block3: {
|
|
||||||
try {
|
|
||||||
HttpRequest httpRequest = new HttpRequest(new URL(string2));
|
|
||||||
httpRequest.timeout = d2;
|
|
||||||
httpRequest.method = IHttpRequest.Method.GET;
|
|
||||||
this.m_detectionConnection = new NetworkConnection(this, httpRequest);
|
|
||||||
this.m_detectionConnection.setCompletionCallback(new NetworkConnectionCallback(){
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void callback(NetworkConnectionHandle networkConnectionHandle) {
|
|
||||||
NetworkImpl.this.onReachabilityVerification(networkConnectionHandle);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (this.m_asyncTaskManager != null && !this.m_asyncTaskManager.isShutdown()) break block3;
|
|
||||||
}
|
|
||||||
catch (MalformedURLException malformedURLException) {
|
|
||||||
Log.Helper.LOGE(this, "Invalid url: " + string2);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Log.Helper.LOGW(this, "AsyncTaskManager is not ready. Queueing networkconnection until AsyncTaskManager is started.");
|
|
||||||
if (this.m_waitingToExecuteQueue == null) {
|
|
||||||
this.m_waitingToExecuteQueue = new LinkedList();
|
|
||||||
}
|
|
||||||
this.m_waitingToExecuteQueue.addFirst(this.m_detectionConnection);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.m_asyncTaskManager.execute(this.m_detectionConnection);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void cleanup() {
|
|
||||||
this.stopWork();
|
|
||||||
Log.Helper.LOGV(this, "cleanup");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void forceRedetectNetworkStatus() {
|
|
||||||
synchronized (this) {
|
|
||||||
this.detect(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getComponentId() {
|
|
||||||
return "com.ea.nimble.network";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getLogSourceTitle() {
|
|
||||||
return "Network";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Network.Status getStatus() {
|
|
||||||
return this.m_status;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isNetworkWifi() {
|
|
||||||
return this.m_isWifi;
|
|
||||||
}
|
|
||||||
|
|
||||||
void removeConnection(NetworkConnection networkConnection) {
|
|
||||||
synchronized (this) {
|
|
||||||
this.m_queue.remove(networkConnection);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void resume() {
|
|
||||||
Log.Helper.LOGV(this, "resume");
|
|
||||||
synchronized (this) {
|
|
||||||
this.detect(true);
|
|
||||||
this.registerNetworkListener();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NetworkConnectionHandle sendDeleteRequest(URL object, HashMap<String, String> hashMap, NetworkConnectionCallback networkConnectionCallback) {
|
|
||||||
HttpRequest httpRequest = new HttpRequest(object);
|
|
||||||
httpRequest.method = IHttpRequest.Method.DELETE;
|
|
||||||
httpRequest.headers = hashMap;
|
|
||||||
return this.sendRequest(httpRequest, networkConnectionCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NetworkConnectionHandle sendGetRequest(URL object, HashMap<String, String> hashMap, NetworkConnectionCallback networkConnectionCallback) {
|
|
||||||
HttpRequest httpRequest = new HttpRequest(object);
|
|
||||||
httpRequest.method = IHttpRequest.Method.GET;
|
|
||||||
httpRequest.headers = hashMap;
|
|
||||||
return this.sendRequest(httpRequest, networkConnectionCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NetworkConnectionHandle sendPostRequest(URL object, HashMap<String, String> hashMap, byte[] byArray, NetworkConnectionCallback networkConnectionCallback) {
|
|
||||||
HttpRequest httpRequest = new HttpRequest(object);
|
|
||||||
httpRequest.method = IHttpRequest.Method.POST;
|
|
||||||
httpRequest.headers = hashMap;
|
|
||||||
try {
|
|
||||||
httpRequest.data.write(byArray);
|
|
||||||
return this.sendRequest(httpRequest, networkConnectionCallback);
|
|
||||||
}
|
|
||||||
catch (Exception exception) {
|
|
||||||
exception.printStackTrace();
|
|
||||||
return this.sendRequest(httpRequest, networkConnectionCallback);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NetworkConnectionHandle sendRequest(HttpRequest httpRequest, NetworkConnectionCallback networkConnectionCallback) {
|
|
||||||
return this.sendRequest(httpRequest, networkConnectionCallback, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Enabled unnecessary exception pruning
|
|
||||||
* Converted monitor instructions to comments
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public NetworkConnectionHandle sendRequest(
|
|
||||||
HttpRequest httpRequest,
|
|
||||||
NetworkConnectionCallback networkConnectionCallback,
|
|
||||||
IOperationalTelemetryDispatch object) {
|
|
||||||
|
|
||||||
NetworkConnection networkConnection =
|
|
||||||
httpRequest.runInBackground ?
|
|
||||||
new BackgroundNetworkConnection(this, httpRequest, (IOperationalTelemetryDispatch) object) :
|
|
||||||
new NetworkConnection(this, httpRequest, (IOperationalTelemetryDispatch) object);
|
|
||||||
|
|
||||||
networkConnection.setCompletionCallback(networkConnectionCallback);
|
|
||||||
if (httpRequest.url == null || !Utility.validString(httpRequest.url.toString())) {
|
|
||||||
networkConnection.finishWithError(new Error(Error.Code.INVALID_ARGUMENT, "Sending request without valid url"));
|
|
||||||
return networkConnection;
|
|
||||||
}
|
|
||||||
if (this.m_status != Network.Status.OK) {
|
|
||||||
networkConnection.finishWithError(new Error(Error.Code.NETWORK_NO_CONNECTION, "No network connection, network status " + this.m_status.toString()));
|
|
||||||
return networkConnection;
|
|
||||||
}
|
|
||||||
// MONITORENTER : this
|
|
||||||
this.m_queue.add(networkConnection);
|
|
||||||
// MONITOREXIT : this
|
|
||||||
if (this.m_asyncTaskManager != null && !this.m_asyncTaskManager.isShutdown()) {
|
|
||||||
this.m_asyncTaskManager.execute(networkConnection);
|
|
||||||
return networkConnection;
|
|
||||||
}
|
|
||||||
if (this.m_asyncTaskManager != null) {
|
|
||||||
Log.Helper.LOGW(this, "AsyncTaskManager shutdown. Queueing networkconnection until AsyncTaskManager is started.");
|
|
||||||
} else {
|
|
||||||
Log.Helper.LOGW(this, "AsyncTaskManager is not ready. Queueing networkconnection until AsyncTaskManager is started.");
|
|
||||||
}
|
|
||||||
if (this.m_waitingToExecuteQueue == null) {
|
|
||||||
this.m_waitingToExecuteQueue = new LinkedList();
|
|
||||||
}
|
|
||||||
this.m_waitingToExecuteQueue.add(networkConnection);
|
|
||||||
return networkConnection;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setup() {
|
|
||||||
Log.Helper.LOGV(this, "setup");
|
|
||||||
this.startWork();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Enabled unnecessary exception pruning
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void suspend() {
|
|
||||||
synchronized (this) {
|
|
||||||
this.stopPing();
|
|
||||||
this.unregisterNetworkListener();
|
|
||||||
synchronized (this) {
|
|
||||||
Iterator iterator = new ArrayList<NetworkConnection>(this.m_queue).iterator();
|
|
||||||
while (true) {
|
|
||||||
if (!iterator.hasNext()) {
|
|
||||||
// MONITOREXIT @DISABLED, blocks:[4, 6, 7] lbl8 : MonitorExitStatement: MONITOREXIT : this
|
|
||||||
// MONITOREXIT @DISABLED, blocks:[4, 5, 6, 7] lbl9 : MonitorExitStatement: MONITOREXIT : this
|
|
||||||
Log.Helper.LOGV(this, "suspend");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
((NetworkConnection)iterator.next()).cancelForAppSuspend();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class ConnectivityReceiver
|
|
||||||
extends BroadcastReceiver {
|
|
||||||
private ConnectivityReceiver() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onReceive(Context object, Intent intent) {
|
|
||||||
Log.Helper.LOGD((Object)this, "Network reachability changed!");
|
|
||||||
|
|
||||||
synchronized (new Object()) {
|
|
||||||
NetworkImpl.this.detect(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static enum DetectionState {
|
|
||||||
NONE,
|
|
||||||
VERIFY_REACHABLE_MAIN,
|
|
||||||
VERIFY_UNREACHABLE_MAIN,
|
|
||||||
VERIFY_REACHABLE_BACKUP,
|
|
||||||
PING;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private class TimerTask
|
|
||||||
implements Runnable {
|
|
||||||
private TimerTask() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
NetworkImpl networkImpl = NetworkImpl.this;
|
|
||||||
synchronized (networkImpl) {
|
|
||||||
NetworkImpl.access$302(NetworkImpl.this, null);
|
|
||||||
NetworkImpl.this.verifyReachability(NetworkImpl.MAIN_NETWORK_REACHABILITY_CHECK_URL, 30.0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
public enum NimbleConfiguration {
|
|
||||||
UNKNOWN,
|
|
||||||
INTEGRATION,
|
|
||||||
STAGE,
|
|
||||||
LIVE,
|
|
||||||
CUSTOMIZED;
|
|
||||||
|
|
||||||
|
|
||||||
public static NimbleConfiguration fromName(String string2) {
|
|
||||||
if (string2.equals("int")) {
|
|
||||||
return INTEGRATION;
|
|
||||||
}
|
|
||||||
if (string2.equals("stage")) {
|
|
||||||
return STAGE;
|
|
||||||
}
|
|
||||||
if (string2.equals("live")) {
|
|
||||||
return LIVE;
|
|
||||||
}
|
|
||||||
if (!string2.equals("custom")) return UNKNOWN;
|
|
||||||
return CUSTOMIZED;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
|
||||||
switch (this.ordinal()) {
|
|
||||||
default: {
|
|
||||||
return "unknown";
|
|
||||||
}
|
|
||||||
case 1: {
|
|
||||||
return "int";
|
|
||||||
}
|
|
||||||
case 2: {
|
|
||||||
return "stage";
|
|
||||||
}
|
|
||||||
case 3: {
|
|
||||||
return "live";
|
|
||||||
}
|
|
||||||
case 4:
|
|
||||||
}
|
|
||||||
return "custom";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.Error;
|
|
||||||
|
|
||||||
public class NimbleFacebookError
|
|
||||||
extends Error {
|
|
||||||
public static final String NIMBLE_FACEBOOK_ERROR_DOMAIN = "NimbleFacebookError";
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
public NimbleFacebookError(int n2, String string2) {
|
|
||||||
super(NIMBLE_FACEBOOK_ERROR_DOMAIN, n2, string2, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public NimbleFacebookError(int n2, String string2, Throwable throwable) {
|
|
||||||
super(NIMBLE_FACEBOOK_ERROR_DOMAIN, n2, string2, throwable);
|
|
||||||
}
|
|
||||||
|
|
||||||
public NimbleFacebookError(Code code, String string2) {
|
|
||||||
super(NIMBLE_FACEBOOK_ERROR_DOMAIN, code.intValue(), string2, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isError(int n2) {
|
|
||||||
if (this.getCode() != n2) return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static enum Code {
|
|
||||||
FBSERVER_ERROR(90000),
|
|
||||||
RESPONSE_PARSE_ERROR(90001);
|
|
||||||
|
|
||||||
private int m_value;
|
|
||||||
|
|
||||||
private Code(int n3) {
|
|
||||||
this.m_value = n3;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int intValue() {
|
|
||||||
return this.m_value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.Base;
|
|
||||||
import com.ea.nimble.IOperationalTelemetryDispatch;
|
|
||||||
|
|
||||||
public class OperationalTelemetryDispatch {
|
|
||||||
public static final String COMPONENT_ID = "com.ea.nimble.operationaltelemetrydispatch";
|
|
||||||
public static final String LOG_TAG = "OTDispatch";
|
|
||||||
|
|
||||||
public static IOperationalTelemetryDispatch getComponent() {
|
|
||||||
return (IOperationalTelemetryDispatch)((Object)Base.getComponent(COMPONENT_ID));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,154 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
class OperationalTelemetryDispatchImpl
|
|
||||||
extends Component
|
|
||||||
implements IOperationalTelemetryDispatch,
|
|
||||||
LogSource {
|
|
||||||
private Map<String, Integer> m_maxEventQueueSizeDict;
|
|
||||||
private List<OperationalTelemetryEvent> m_networkMetricsArray = new ArrayList<OperationalTelemetryEvent>();
|
|
||||||
private List<OperationalTelemetryEvent> m_networkPayloadsArray = new ArrayList<OperationalTelemetryEvent>();
|
|
||||||
|
|
||||||
public OperationalTelemetryDispatchImpl() {
|
|
||||||
this.m_maxEventQueueSizeDict = new HashMap<String, Integer>();
|
|
||||||
this.m_maxEventQueueSizeDict.put("com.ea.nimble.network", 100);
|
|
||||||
this.m_maxEventQueueSizeDict.put("com.ea.nimble.trackingimpl.synergy", 100);
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean canLogEvent(String list) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Enabled unnecessary exception pruning
|
|
||||||
*/
|
|
||||||
private void purgeOldestEvent(List<OperationalTelemetryEvent> list) {
|
|
||||||
synchronized (this) {
|
|
||||||
if (list.size() == 0) {
|
|
||||||
Log.Helper.LOGD(this, "purgeOldestEvent called with empty event array.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
OperationalTelemetryEvent operationalTelemetryEvent = null;
|
|
||||||
Iterator<OperationalTelemetryEvent> iterator = list.iterator();
|
|
||||||
while (true) {
|
|
||||||
if (!iterator.hasNext()) {
|
|
||||||
if (operationalTelemetryEvent == null) return;
|
|
||||||
list.remove(operationalTelemetryEvent);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
OperationalTelemetryEvent operationalTelemetryEvent2 = iterator.next();
|
|
||||||
if (operationalTelemetryEvent != null && !operationalTelemetryEvent2.getLoggedTime().before(operationalTelemetryEvent.getLoggedTime())) continue;
|
|
||||||
operationalTelemetryEvent = operationalTelemetryEvent2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Enabled unnecessary exception pruning
|
|
||||||
*/
|
|
||||||
private void trimEventQueue(String list) {
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateEventThresholdListeners() {
|
|
||||||
HashMap<String, String> hashMap;
|
|
||||||
int n2 = this.getMaxEventCount("com.ea.nimble.network");
|
|
||||||
if (n2 > 0) {
|
|
||||||
n2 = (int)((double)n2 * 0.75);
|
|
||||||
if (this.m_networkMetricsArray.size() >= n2) {
|
|
||||||
hashMap = new HashMap<String, String>();
|
|
||||||
hashMap.put("eventType", "com.ea.nimble.network");
|
|
||||||
Utility.sendBroadcast("nimble.notification.ot.eventthresholdwarning", hashMap);
|
|
||||||
Log.Helper.LOGV(this, "updateEventThresholdListeners, notifying listeners event queue is approaching threshold.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((n2 = this.getMaxEventCount("com.ea.nimble.trackingimpl.synergy")) <= 0) return;
|
|
||||||
n2 = (int)((double)n2 * 0.75);
|
|
||||||
if (this.m_networkPayloadsArray.size() < n2) return;
|
|
||||||
hashMap = new HashMap();
|
|
||||||
hashMap.put("eventType", "com.ea.nimble.trackingimpl.synergy");
|
|
||||||
Utility.sendBroadcast("nimble.notification.ot.eventthresholdwarning", hashMap);
|
|
||||||
Log.Helper.LOGV(this, "updateEventThresholdListeners, notifying listeners event queue is approaching threshold.");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void cleanup() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getComponentId() {
|
|
||||||
return "com.ea.nimble.operationaltelemetrydispatch";
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Enabled unnecessary exception pruning
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<OperationalTelemetryEvent> getEvents(String string2) {
|
|
||||||
if (!Utility.validString(string2)) {
|
|
||||||
Log.Helper.LOGE(this, "getEvents called with null or empty eventType.");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
List<OperationalTelemetryEvent> list = null;
|
|
||||||
synchronized (this) {
|
|
||||||
if (string2.equals("com.ea.nimble.network")) {
|
|
||||||
list = this.m_networkMetricsArray;
|
|
||||||
this.m_networkMetricsArray = new ArrayList<OperationalTelemetryEvent>();
|
|
||||||
} else if (string2.equals("com.ea.nimble.trackingimpl.synergy")) {
|
|
||||||
list = this.m_networkPayloadsArray;
|
|
||||||
this.m_networkPayloadsArray = new ArrayList<OperationalTelemetryEvent>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (list != null) return Collections.unmodifiableList(list);
|
|
||||||
Log.Helper.LOGE(this, "getEvents, unsupported OT eventType, " + string2 + ".");
|
|
||||||
return Collections.unmodifiableList(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getLogSourceTitle() {
|
|
||||||
return "OTDispatch";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMaxEventCount(String object) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Enabled unnecessary exception pruning
|
|
||||||
* Converted monitor instructions to comments
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void logEvent(String string2, Map<String, String> object) {}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void restore() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void resume() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setMaxEventCount(String string2, int n2) {
|
|
||||||
if (!Utility.validString(string2)) {
|
|
||||||
Log.Helper.LOGE(this, "setMaxEventCount called with null or empty eventType.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.m_maxEventQueueSizeDict.put(string2, n2);
|
|
||||||
this.trimEventQueue(string2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void suspend() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public interface OperationalTelemetryEvent {
|
|
||||||
public Map<String, String> getEventDictionary();
|
|
||||||
|
|
||||||
public String getEventType();
|
|
||||||
|
|
||||||
public Date getLoggedTime();
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.OperationalTelemetryEvent;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
class OperationalTelemetryEventImpl
|
|
||||||
implements OperationalTelemetryEvent {
|
|
||||||
private Map<String, String> m_eventDictionary;
|
|
||||||
private String m_eventType;
|
|
||||||
private Date m_loggedTime;
|
|
||||||
|
|
||||||
public OperationalTelemetryEventImpl(String string2, Map<String, String> map, Date date) {
|
|
||||||
this.m_eventType = string2;
|
|
||||||
this.m_eventDictionary = map;
|
|
||||||
this.m_loggedTime = date;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, String> getEventDictionary() {
|
|
||||||
return this.m_eventDictionary;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getEventType() {
|
|
||||||
return this.m_eventType;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Date getLoggedTime() {
|
|
||||||
return this.m_loggedTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
|
||||||
return String.format("OperationalTelemetryEvent(%s)-(%s) > %s", this.getEventType(), this.getLoggedTime(), this.getEventDictionary());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,405 +0,0 @@
|
|||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import android.app.backup.BackupManager;
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
import java.io.BufferedInputStream;
|
|
||||||
import java.io.BufferedOutputStream;
|
|
||||||
import java.io.ByteArrayInputStream;
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InvalidClassException;
|
|
||||||
import java.io.ObjectInputStream;
|
|
||||||
import java.io.ObjectOutputStream;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/Persistence.class */
|
|
||||||
public class Persistence implements LogSource {
|
|
||||||
private static int PERSISTENCE_VERSION = -1;
|
|
||||||
static final Object s_dataLock = new Object();
|
|
||||||
private boolean m_backUp;
|
|
||||||
private boolean m_changed;
|
|
||||||
private Map<String, byte[]> m_content;
|
|
||||||
private boolean m_encryption;
|
|
||||||
private Encryptor m_encryptor;
|
|
||||||
private String m_identifier;
|
|
||||||
private Storage m_storage;
|
|
||||||
private Timer m_synchronizeTimer;
|
|
||||||
|
|
||||||
public static class AnonymousClass2 {
|
|
||||||
static final int[] $SwitchMap$com$ea$nimble$Persistence$Storage = new int[Storage.values().length];
|
|
||||||
static final int[] $SwitchMap$com$ea$nimble$PersistenceService$PersistenceMergePolicy = new int[10];
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/Persistence$Storage.class */
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum Storage {
|
|
||||||
DOCUMENT,
|
|
||||||
CACHE,
|
|
||||||
TEMP
|
|
||||||
}
|
|
||||||
|
|
||||||
public Persistence(Persistence persistence, String str) {
|
|
||||||
this.m_synchronizeTimer = new Timer(new Runnable() { // from class: com.ea.nimble.Persistence.1
|
|
||||||
@Override // java.lang.Runnable
|
|
||||||
public void run() {
|
|
||||||
Persistence.this.synchronize();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.m_content = new HashMap(persistence.m_content);
|
|
||||||
this.m_identifier = str;
|
|
||||||
this.m_storage = persistence.m_storage;
|
|
||||||
this.m_encryptor = persistence.m_encryptor;
|
|
||||||
this.m_encryption = persistence.m_encryption;
|
|
||||||
this.m_backUp = persistence.m_backUp;
|
|
||||||
flagChange();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Persistence(String str, Storage storage, Encryptor encryptor) {
|
|
||||||
this.m_synchronizeTimer = new Timer(new Runnable() { // from class: com.ea.nimble.Persistence.1
|
|
||||||
@Override // java.lang.Runnable
|
|
||||||
public void run() {
|
|
||||||
Persistence.this.synchronize();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.m_content = new HashMap();
|
|
||||||
this.m_identifier = str;
|
|
||||||
this.m_storage = storage;
|
|
||||||
this.m_encryptor = encryptor;
|
|
||||||
this.m_encryption = false;
|
|
||||||
this.m_backUp = false;
|
|
||||||
this.m_changed = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void clearSynchronizeTimer() {
|
|
||||||
synchronized (s_dataLock) {
|
|
||||||
this.m_synchronizeTimer.cancel();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void flagChange() {
|
|
||||||
this.m_changed = true;
|
|
||||||
synchronized (s_dataLock) {
|
|
||||||
clearSynchronizeTimer();
|
|
||||||
this.m_synchronizeTimer.schedule(0.5d, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX WARN: Removed duplicated region for block: B:10:0x0068 */
|
|
||||||
/*
|
|
||||||
Code decompiled incorrectly, please refer to instructions dump.
|
|
||||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
|
||||||
*/
|
|
||||||
static java.io.File getPersistenceDirectory(com.ea.nimble.Persistence.Storage r7) {
|
|
||||||
return new File("");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX WARN: Removed duplicated region for block: B:13:0x008f */
|
|
||||||
/* JADX WARN: Removed duplicated region for block: B:16:0x00bb */
|
|
||||||
/*
|
|
||||||
Code decompiled incorrectly, please refer to instructions dump.
|
|
||||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
|
||||||
*/
|
|
||||||
public static java.io.File getPersistenceDirectory(com.ea.nimble.Persistence.Storage r7, android.content.Context r8) {
|
|
||||||
/*
|
|
||||||
Method dump skipped, instructions count: 241
|
|
||||||
To view this dump change 'Code comments level' option to 'DEBUG'
|
|
||||||
*/
|
|
||||||
throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.Persistence.getPersistenceDirectory(com.ea.nimble.Persistence$Storage, android.content.Context):java.io.File");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getPersistencePath(String str, Storage storage) {
|
|
||||||
File persistenceDirectory = getPersistenceDirectory(storage);
|
|
||||||
if (persistenceDirectory == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return persistenceDirectory + File.separator + str + ".dat";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getPersistencePath(String str, Storage storage, Context context) {
|
|
||||||
File persistenceDirectory = getPersistenceDirectory(storage, context);
|
|
||||||
if (persistenceDirectory == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return persistenceDirectory + File.separator + str + ".dat";
|
|
||||||
}
|
|
||||||
|
|
||||||
private void loadPersistenceData(boolean z, Context context) {
|
|
||||||
Throwable th;
|
|
||||||
FileInputStream fileInputStream = null;
|
|
||||||
String persistencePath = context == null ? getPersistencePath(this.m_identifier, this.m_storage) : getPersistencePath(this.m_identifier, this.m_storage, context);
|
|
||||||
if (persistencePath != null) {
|
|
||||||
File file = new File(persistencePath);
|
|
||||||
if (!file.exists() || file.length() == 0) {
|
|
||||||
Log.Helper.LOGD(this, "No persistence file for id[%s] to restore from storage %s", this.m_identifier, this.m_storage.toString());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
Log.Helper.LOGD(this, "Loading persistence file size %d", file.length());
|
|
||||||
fileInputStream = null;
|
|
||||||
try {
|
|
||||||
fileInputStream = new FileInputStream(file);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e = e;
|
|
||||||
}
|
|
||||||
} catch (Throwable th2) {
|
|
||||||
th = th2;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream);
|
|
||||||
if (objectInputStream.readInt() != PERSISTENCE_VERSION) {
|
|
||||||
throw new InvalidClassException("com.ea.nimble.Persistence", "Persistence version doesn't match");
|
|
||||||
}
|
|
||||||
this.m_encryption = objectInputStream.readBoolean();
|
|
||||||
this.m_backUp = objectInputStream.readBoolean();
|
|
||||||
if (!z) {
|
|
||||||
BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);
|
|
||||||
ObjectInputStream encryptInputStream = this.m_encryption ? this.m_encryptor.encryptInputStream(bufferedInputStream) : new ObjectInputStream(bufferedInputStream);
|
|
||||||
this.m_content = (Map) encryptInputStream.readObject();
|
|
||||||
Log.Helper.LOGD(this, "Persistence file for id[%s] restored from storage %s", this.m_identifier, this.m_storage.toString());
|
|
||||||
encryptInputStream.close();
|
|
||||||
}
|
|
||||||
objectInputStream.close();
|
|
||||||
if (fileInputStream != null) {
|
|
||||||
try {
|
|
||||||
fileInputStream.close();
|
|
||||||
} catch (IOException e2) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception e3) {
|
|
||||||
Log.Helper.LOGE(this, "Can't read persistence (%s) file, %s: %s", this.m_identifier, persistencePath, e3.toString());
|
|
||||||
e3.printStackTrace();
|
|
||||||
if (fileInputStream != null) {
|
|
||||||
try {
|
|
||||||
fileInputStream.close();
|
|
||||||
} catch (IOException e4) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Throwable th3) {
|
|
||||||
if (fileInputStream != null) {
|
|
||||||
try {
|
|
||||||
fileInputStream.close();
|
|
||||||
} catch (IOException e5) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void putValue(String str, Serializable serializable) throws IOException {
|
|
||||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
|
||||||
ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream);
|
|
||||||
objectOutputStream.writeObject(serializable);
|
|
||||||
objectOutputStream.close();
|
|
||||||
byte[] byteArray = byteArrayOutputStream.toByteArray();
|
|
||||||
if (!byteArray.equals(this.m_content.get(str))) {
|
|
||||||
this.m_content.put(str, byteArray);
|
|
||||||
flagChange();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void savePersistenceData() {
|
|
||||||
String persistencePath = getPersistencePath(this.m_identifier, this.m_storage);
|
|
||||||
if (persistencePath != null) {
|
|
||||||
File file = new File(persistencePath);
|
|
||||||
|
|
||||||
try (FileOutputStream fileOutputStream = new FileOutputStream(file);
|
|
||||||
ObjectOutputStream objectOutputStream = new ObjectOutputStream(
|
|
||||||
this.m_encryption ? this.m_encryptor.encryptOutputStream(
|
|
||||||
new BufferedOutputStream(fileOutputStream)) :
|
|
||||||
new BufferedOutputStream(fileOutputStream))) {
|
|
||||||
|
|
||||||
objectOutputStream.writeInt(PERSISTENCE_VERSION);
|
|
||||||
objectOutputStream.writeBoolean(this.m_encryption);
|
|
||||||
objectOutputStream.writeBoolean(this.m_backUp);
|
|
||||||
objectOutputStream.writeObject(this.m_content);
|
|
||||||
|
|
||||||
Log.Helper.LOGD(this, "Synchronize persistence for id[%s] in storage %s", this.m_identifier, this.m_storage.toString());
|
|
||||||
Log.Helper.LOGD(this, "Saving persistence file size %d", file.length());
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.Helper.LOGE(this, "Fail to save persistence file for id[%s] in storage %s: %s", this.m_identifier, this.m_storage.toString(), e.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addEntries(Object... objArr) {
|
|
||||||
synchronized (s_dataLock) {
|
|
||||||
String str = null;
|
|
||||||
for (int i = 0; i < objArr.length; i++) {
|
|
||||||
if (i % 2 == 0) {
|
|
||||||
try {
|
|
||||||
str = (String) objArr[i];
|
|
||||||
if (!Utility.validString(str)) {
|
|
||||||
throw new RuntimeException("Invalid key");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.Helper.LOGF(this, "Invalid key in NimblePersistence.addEntries at index %d, not a string", Integer.valueOf(i));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
putValue(str, (Serializable) objArr[i]);
|
|
||||||
} catch (Exception e2) {
|
|
||||||
Log.Helper.LOGF(this, "Invalid value in NimblePersistence.addEntries for key %s at index %d", str, Integer.valueOf(i));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addEntriesFromMap(Map<String, Serializable> map) {
|
|
||||||
synchronized (s_dataLock) {
|
|
||||||
for (String str : map.keySet()) {
|
|
||||||
if (!Utility.validString(str)) {
|
|
||||||
Log.Helper.LOGE(this, "Invalid key %s in NimblePersistence.addEntriesInDictionary, not a string, skip it", str);
|
|
||||||
} else {
|
|
||||||
Serializable serializable = map.get(str);
|
|
||||||
if (serializable != null) {
|
|
||||||
try {
|
|
||||||
putValue(str, serializable);
|
|
||||||
} catch (IOException e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Log.Helper.LOGE(this, "Invalid value in NimblePersistence.addEntries for key %s", str);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void clean() {
|
|
||||||
synchronized (s_dataLock) {
|
|
||||||
File file = new File(getPersistencePath(this.m_identifier, this.m_storage));
|
|
||||||
if (file.exists() && !file.delete()) {
|
|
||||||
Log.Helper.LOGE(this, "Fail to clean persistence file for id[%s] in storage %s", this.m_identifier, this.m_storage.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getBackUp() {
|
|
||||||
return this.m_backUp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getEncryption() {
|
|
||||||
return this.m_encryption;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIdentifier() {
|
|
||||||
return this.m_identifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.LogSource
|
|
||||||
public String getLogSourceTitle() {
|
|
||||||
return "Persistence";
|
|
||||||
}
|
|
||||||
|
|
||||||
public Storage getStorage() {
|
|
||||||
return this.m_storage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStringValue(String str) {
|
|
||||||
Serializable value = getValue(str);
|
|
||||||
try {
|
|
||||||
return (String) value;
|
|
||||||
} catch (ClassCastException e) {
|
|
||||||
Log.Helper.LOGF(this, "Invalid value type for getStringValueCall, value is " + value.getClass().getName());
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Serializable getValue(String str) {
|
|
||||||
synchronized (s_dataLock) {
|
|
||||||
byte[] bArr = this.m_content.get(str);
|
|
||||||
if (bArr == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
return (Serializable) new ObjectInputStream(new ByteArrayInputStream(bArr)).readObject();
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.Helper.LOGD(this, "PERSIST: Exception getting value, " + str + ":" + e);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void merge(Persistence persistence, PersistenceService.PersistenceMergePolicy persistenceMergePolicy) {
|
|
||||||
switch (AnonymousClass2.$SwitchMap$com$ea$nimble$PersistenceService$PersistenceMergePolicy[persistenceMergePolicy.ordinal()]) {
|
|
||||||
case 1:
|
|
||||||
this.m_content = new HashMap(persistence.m_content);
|
|
||||||
return;
|
|
||||||
case 2:
|
|
||||||
this.m_content.putAll(persistence.m_content);
|
|
||||||
return;
|
|
||||||
case 3:
|
|
||||||
for (String str : persistence.m_content.keySet()) {
|
|
||||||
if (this.m_content.get(str) == null) {
|
|
||||||
this.m_content.put(str, persistence.m_content.get(str));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void restore(boolean z, Context context) {
|
|
||||||
synchronized (s_dataLock) {
|
|
||||||
loadPersistenceData(z, context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBackUp(boolean z) {
|
|
||||||
if (this.m_storage != Storage.DOCUMENT) {
|
|
||||||
Log.Helper.LOGF(this, "Error: Backup flag not supported for storage: " + this.m_storage);
|
|
||||||
} else {
|
|
||||||
this.m_backUp = z;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEncryption(boolean z) {
|
|
||||||
if (z != this.m_encryption) {
|
|
||||||
this.m_encryption = z;
|
|
||||||
flagChange();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValue(String str, Serializable serializable) {
|
|
||||||
synchronized (s_dataLock) {
|
|
||||||
if (!Utility.validString(str)) {
|
|
||||||
Log.Helper.LOGF(this, "NimblePersistence cannot accept an invalid string " + str + " as key");
|
|
||||||
} else if (serializable == null) {
|
|
||||||
if (this.m_content.get(str) != null) {
|
|
||||||
this.m_content.remove(str);
|
|
||||||
flagChange();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
putValue(str, serializable);
|
|
||||||
} catch (IOException e) {
|
|
||||||
Log.Helper.LOGF(this, "NimblePersistence cannot archive value " + serializable.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void synchronize() {
|
|
||||||
synchronized (s_dataLock) {
|
|
||||||
if (!this.m_changed) {
|
|
||||||
Log.Helper.LOGD(this, "Not synchronizing to persistence for id[%s] since there is no change", this.m_identifier);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
clearSynchronizeTimer();
|
|
||||||
savePersistenceData();
|
|
||||||
if (this.m_backUp) {
|
|
||||||
new BackupManager(ApplicationEnvironment.getComponent().getApplicationContext()).dataChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import android.app.backup.BackupAgent;
|
|
||||||
import android.app.backup.BackupDataInput;
|
|
||||||
import android.app.backup.BackupDataOutput;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.os.ParcelFileDescriptor;
|
|
||||||
|
|
||||||
import com.ea.ironmonkey.devmenu.util.Observer;
|
|
||||||
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/PersistenceService.class */
|
|
||||||
public class PersistenceService {
|
|
||||||
private static final String APPLICATION_PERSISTENCE_ID = "[APPLICATION]";
|
|
||||||
public static final String COMPONENT_ID = "com.ea.nimble.persistence";
|
|
||||||
private static final String NIMBLE_COMPONENT_PERSISTENCE_ID_TEMPLATE = "[COMPONENT]%s";
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/PersistenceService$PersistenceBackupAgent.class */
|
|
||||||
public static class PersistenceBackupAgent extends BackupAgent {
|
|
||||||
@Override // android.app.backup.BackupAgent
|
|
||||||
public void onBackup(ParcelFileDescriptor parcelFileDescriptor, BackupDataOutput backupDataOutput, ParcelFileDescriptor parcelFileDescriptor2) throws IOException {
|
|
||||||
synchronized (Persistence.s_dataLock) {
|
|
||||||
PersistenceService.writeBackup(parcelFileDescriptor, backupDataOutput, parcelFileDescriptor2, this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // android.app.backup.BackupAgent
|
|
||||||
public void onRestore(BackupDataInput backupDataInput, int i, ParcelFileDescriptor parcelFileDescriptor) throws IOException {
|
|
||||||
synchronized (Persistence.s_dataLock) {
|
|
||||||
PersistenceService.readBackup(backupDataInput, i, parcelFileDescriptor, this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/PersistenceService$PersistenceMergePolicy.class */
|
|
||||||
public enum PersistenceMergePolicy {
|
|
||||||
OVERWRITE,
|
|
||||||
SOURCE_FIRST,
|
|
||||||
TARGET_FIRST
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void cleanReferenceToPersistence(String str, Persistence.Storage storage) {
|
|
||||||
if (!Utility.validString(str)) {
|
|
||||||
Log.Helper.LOGF("Persistence", "Invalid componentId " + str + " for component persistence", new Object[0]);
|
|
||||||
} else {
|
|
||||||
getComponent().cleanPersistenceReference(String.format(NIMBLE_COMPONENT_PERSISTENCE_ID_TEMPLATE, str), storage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Persistence getAppPersistence(Persistence.Storage storage) {
|
|
||||||
return getComponent().getPersistence(APPLICATION_PERSISTENCE_ID, storage);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IPersistenceService getComponent() {
|
|
||||||
return BaseCore.getInstance().getPersistenceService();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Persistence getPersistenceForNimbleComponent(String str, Persistence.Storage storage) {
|
|
||||||
if (Utility.validString(str)) {
|
|
||||||
return getComponent().getPersistence(String.format(NIMBLE_COMPONENT_PERSISTENCE_ID_TEMPLATE, str), storage);
|
|
||||||
}
|
|
||||||
Log.Helper.LOGF("Persistence", "Invalid componentId " + str + " for component persistence", new Object[0]);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void readBackup(BackupDataInput backupDataInput, int i, ParcelFileDescriptor parcelFileDescriptor, Context context) throws IOException {
|
|
||||||
Throwable th;
|
|
||||||
while (backupDataInput.readNextHeader()) {
|
|
||||||
String key = backupDataInput.getKey();
|
|
||||||
int dataSize = backupDataInput.getDataSize();
|
|
||||||
byte[] bArr = new byte[dataSize];
|
|
||||||
backupDataInput.readEntityData(bArr, 0, dataSize);
|
|
||||||
FileOutputStream fileOutputStream = null;
|
|
||||||
try {
|
|
||||||
FileOutputStream fileOutputStream2 = new FileOutputStream(Persistence.getPersistencePath(key, Persistence.Storage.DOCUMENT, context));
|
|
||||||
try {
|
|
||||||
fileOutputStream2.write(bArr);
|
|
||||||
if (fileOutputStream2 != null) {
|
|
||||||
fileOutputStream2.close();
|
|
||||||
}
|
|
||||||
} catch (Throwable th2) {
|
|
||||||
th = th2;
|
|
||||||
fileOutputStream = fileOutputStream2;
|
|
||||||
if (fileOutputStream != null) {
|
|
||||||
fileOutputStream.close();
|
|
||||||
}
|
|
||||||
throw th;
|
|
||||||
}
|
|
||||||
} catch (Throwable th3) {
|
|
||||||
th = th3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ApplicationEnvironment.isMainApplicationRunning()) {
|
|
||||||
for (Persistence persistence : ((PersistenceServiceImpl) getComponent()).m_persistences.values()) {
|
|
||||||
if (persistence.getBackUp()) {
|
|
||||||
persistence.restore(false, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void removePersistenceForNimbleComponent(String str, Persistence.Storage storage) {
|
|
||||||
if (!Utility.validString(str)) {
|
|
||||||
Log.Helper.LOGF("Persistence", "Invalid componentId " + str + " for component persistence", new Object[0]);
|
|
||||||
} else {
|
|
||||||
getComponent().removePersistence(String.format(NIMBLE_COMPONENT_PERSISTENCE_ID_TEMPLATE, str), storage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void writeBackup(android.os.ParcelFileDescriptor r6, android.app.backup.BackupDataOutput r7, android.os.ParcelFileDescriptor r8, android.content.Context r9) throws java.io.IOException {
|
|
||||||
Observer.onCallingMethod();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,149 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
import java.util.concurrent.ConcurrentMap;
|
|
||||||
|
|
||||||
public class PersistenceServiceImpl
|
|
||||||
extends Component
|
|
||||||
implements IPersistenceService,
|
|
||||||
LogSource {
|
|
||||||
private Encryptor m_encryptor;
|
|
||||||
protected ConcurrentMap<String, Persistence> m_persistences;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Enabled unnecessary exception pruning
|
|
||||||
*/
|
|
||||||
private Persistence loadPersistenceById(String object, Persistence.Storage storage) {
|
|
||||||
Object object2 = Persistence.s_dataLock;
|
|
||||||
synchronized (object2) {
|
|
||||||
String string2 = (String)object + "-" + storage.toString();
|
|
||||||
Persistence persistence = (Persistence)this.m_persistences.get(string2);
|
|
||||||
if (persistence != null) {
|
|
||||||
return persistence;
|
|
||||||
}
|
|
||||||
if (!new File(Persistence.getPersistencePath(object, storage)).exists()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
Persistence persistence1 = new Persistence(object, storage, this.m_encryptor);
|
|
||||||
persistence1.restore(false, null);
|
|
||||||
this.m_persistences.put(string2, persistence1);
|
|
||||||
return persistence1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void synchronize() {
|
|
||||||
for (Persistence persistence : this.m_persistences.values()) {
|
|
||||||
persistence.synchronize();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void cleanPersistenceReference(String string2, Persistence.Storage storage) {
|
|
||||||
if (!Utility.validString(string2)) {
|
|
||||||
Log.Helper.LOGF(this, "Invalid identifier " + string2 + " for persistence");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Object object = Persistence.s_dataLock;
|
|
||||||
synchronized (object) {
|
|
||||||
this.m_persistences.remove(string2 + "-" + storage.toString());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getComponentId() {
|
|
||||||
return "com.ea.nimble.persistence";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getLogSourceTitle() {
|
|
||||||
return "Persistence";
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Enabled unnecessary exception pruning
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Persistence getPersistence(String string2, Persistence.Storage storage) {
|
|
||||||
if (!Utility.validString(string2)) {
|
|
||||||
Log.Helper.LOGF(this, "Invalid identifier " + string2 + " for persistence");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
Object object = Persistence.s_dataLock;
|
|
||||||
synchronized (object) {
|
|
||||||
Persistence persistence = this.loadPersistenceById(string2, storage);
|
|
||||||
if (persistence != null) {
|
|
||||||
return persistence;
|
|
||||||
}
|
|
||||||
persistence = new Persistence(string2, storage, this.m_encryptor);
|
|
||||||
this.m_persistences.put(string2 + "-" + storage.toString(), persistence);
|
|
||||||
return persistence;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Enabled unnecessary exception pruning
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void migratePersistence(String object, Persistence.Storage object2, String string2, PersistenceService.PersistenceMergePolicy persistenceMergePolicy) {
|
|
||||||
if (!Utility.validString((String)object) || !Utility.validString(string2)) {
|
|
||||||
Log.Helper.LOGF(this, "Invalid identifiers " + (String)object + " or " + string2 + " for component persistence");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Persistence.Storage object3 = (Persistence.Storage) Persistence.s_dataLock;
|
|
||||||
synchronized (object3) {
|
|
||||||
String string3 = string2 + "-" + ((Enum)object2).toString();
|
|
||||||
Persistence persistence = this.loadPersistenceById(object, object2);
|
|
||||||
if (persistence == null) {
|
|
||||||
if (persistenceMergePolicy != PersistenceService.PersistenceMergePolicy.OVERWRITE) return;
|
|
||||||
this.m_persistences.remove(string3);
|
|
||||||
new File(Persistence.getPersistencePath(string2, object2)).delete();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Persistence persistence2 = this.loadPersistenceById(string2, object2);
|
|
||||||
if (persistence2 == null) {
|
|
||||||
Persistence persistence1 = new Persistence(persistence, string2);
|
|
||||||
this.m_persistences.put(string3, persistence);
|
|
||||||
persistence1.synchronize();
|
|
||||||
} else {
|
|
||||||
persistence2.merge(persistence, persistenceMergePolicy);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void removePersistence(String string2, Persistence.Storage storage) {
|
|
||||||
if (!Utility.validString(string2)) {
|
|
||||||
Log.Helper.LOGF(this, "Invalid identifier " + string2 + " for persistence");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.cleanPersistenceReference(string2, storage);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setup() {
|
|
||||||
this.m_persistences = new ConcurrentHashMap<>();
|
|
||||||
this.m_encryptor = new Encryptor();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void suspend() {
|
|
||||||
this.synchronize();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void teardown() {
|
|
||||||
this.synchronize();
|
|
||||||
Object object = Persistence.s_dataLock;
|
|
||||||
synchronized (object) {
|
|
||||||
this.m_persistences = null;
|
|
||||||
this.m_encryptor = null;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.Persistence;
|
|
||||||
|
|
||||||
public class QA {
|
|
||||||
static String getPersistencePath(String string2, Persistence.Storage storage) {
|
|
||||||
return Persistence.getPersistencePath(string2, storage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.Base;
|
|
||||||
import com.ea.nimble.ISynergyEnvironment;
|
|
||||||
|
|
||||||
public class SynergyEnvironment {
|
|
||||||
public static final String COMPONENT_ID = "com.ea.nimble.synergyEnvironment";
|
|
||||||
public static final int INVALID_INT_VALUE = -1;
|
|
||||||
public static final String NOTIFICATION_APP_VERSION_CHECK_FINISHED = "nimble.environment.notification.app_version_check_finished";
|
|
||||||
public static final String NOTIFICATION_RESTORED_FROM_PERSISTENT = "nimble.environment.notification.restored_from_persistent";
|
|
||||||
public static final String NOTIFICATION_STARTUP_ENVIRONMENT_DATA_CHANGED = "nimble.environment.notification.startup_environment_data_changed";
|
|
||||||
public static final String NOTIFICATION_STARTUP_REQUESTS_FINISHED = "nimble.environment.notification.startup_requests_finished";
|
|
||||||
public static final String NOTIFICATION_STARTUP_REQUESTS_STARTED = "nimble.environment.notification.startup_requests_started";
|
|
||||||
public static final String SERVER_URL_KEY_AKAMAI = "akamai.url";
|
|
||||||
public static final String SERVER_URL_KEY_DYNAMIC_MORE_GAMES = "dmg.url";
|
|
||||||
public static final String SERVER_URL_KEY_EADP_FRIENDS_HOST = "eadp.friends.host";
|
|
||||||
public static final String SERVER_URL_KEY_ENS = "ens.url";
|
|
||||||
public static final String SERVER_URL_KEY_IDENTITY_CONNECT = "nexus.connect";
|
|
||||||
public static final String SERVER_URL_KEY_IDENTITY_PORTAL = "nexus.portal";
|
|
||||||
public static final String SERVER_URL_KEY_IDENTITY_PROXY = "nexus.proxy";
|
|
||||||
public static final String SERVER_URL_KEY_MAYHEM = "mayhem.url";
|
|
||||||
public static final String SERVER_URL_KEY_ORIGIN_AVATAR = "avatars.url";
|
|
||||||
public static final String SERVER_URL_KEY_ORIGIN_CASUAL_APP = "origincasualapp.url";
|
|
||||||
public static final String SERVER_URL_KEY_ORIGIN_CASUAL_SERVER = "origincasualserver.url";
|
|
||||||
public static final String SERVER_URL_KEY_ORIGIN_FRIENDS = "friends.url";
|
|
||||||
public static final String SERVER_URL_KEY_SYNERGY_CENTRAL_IP_GEOLOCATION = "geoip.url";
|
|
||||||
public static final String SERVER_URL_KEY_SYNERGY_DIRECTOR = "synergy.director";
|
|
||||||
public static final String SERVER_URL_KEY_SYNERGY_DRM = "synergy.drm";
|
|
||||||
public static final String SERVER_URL_KEY_SYNERGY_MESSAGE_TO_USER = "synergy.m2u";
|
|
||||||
public static final String SERVER_URL_KEY_SYNERGY_PRODUCT = "synergy.product";
|
|
||||||
public static final String SERVER_URL_KEY_SYNERGY_S2S = "synergy.s2s";
|
|
||||||
public static final String SERVER_URL_KEY_SYNERGY_TRACKING = "synergy.tracking";
|
|
||||||
public static final String SERVER_URL_KEY_SYNERGY_USER = "synergy.user";
|
|
||||||
|
|
||||||
public static ISynergyEnvironment getComponent() {
|
|
||||||
return (ISynergyEnvironment)((Object)Base.getComponent(COMPONENT_ID));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,400 +0,0 @@
|
|||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import android.content.BroadcastReceiver;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/SynergyEnvironmentImpl.class */
|
|
||||||
public class SynergyEnvironmentImpl extends Component implements ISynergyEnvironment, LogSource {
|
|
||||||
private static final String PERSISTENCE_DATA_ID = "environmentData";
|
|
||||||
public static final int SYNERGY_APP_VERSION_OK = 0;
|
|
||||||
public static final int SYNERGY_APP_VERSION_UPDATE_RECOMMENDED = 1;
|
|
||||||
public static final int SYNERGY_APP_VERSION_UPDATE_REQUIRED = 2;
|
|
||||||
private static final String SYNERGY_INT_SERVER_URL = "https://director-int.sn.eamobile.com";
|
|
||||||
private static final String SYNERGY_LIVE_SERVER_URL = "https://syn-dir.sn.eamobile.com";
|
|
||||||
private static final String SYNERGY_STAGE_SERVER_URL = "https://director-stage.sn.eamobile.com";
|
|
||||||
public static final double SYNERGY_UPDATE_RATE_LIMIT_PERIOD_IN_SECONDS = 60.0d;
|
|
||||||
public static final double SYNERGY_UPDATE_REFRESH_PERIOD_IN_SECONDS = 300.0d;
|
|
||||||
private BaseCore m_core;
|
|
||||||
private EnvironmentDataContainer m_environmentDataContainer;
|
|
||||||
private EnvironmentDataContainer m_previousValidEnvironmentDataContainer;
|
|
||||||
private Long m_synergyEnvironmentUpdateRateLimitTriggerTimestamp;
|
|
||||||
private SynergyEnvironmentUpdater m_synergyStartupObject;
|
|
||||||
private BroadcastReceiver m_networkStatusChangeReceiver = null;
|
|
||||||
private boolean m_dataLoadedOnComponentSetup = false;
|
|
||||||
|
|
||||||
/* renamed from: com.ea.nimble.SynergyEnvironmentImpl$3 reason: invalid class name */
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/SynergyEnvironmentImpl$3.class */
|
|
||||||
static /* synthetic */ class AnonymousClass3 {
|
|
||||||
static final /* synthetic */ int[] $SwitchMap$com$ea$nimble$NimbleConfiguration = new int[NimbleConfiguration.values().length];
|
|
||||||
|
|
||||||
static {
|
|
||||||
try {
|
|
||||||
$SwitchMap$com$ea$nimble$NimbleConfiguration[NimbleConfiguration.INTEGRATION.ordinal()] = 1;
|
|
||||||
} catch (NoSuchFieldError e) {
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
$SwitchMap$com$ea$nimble$NimbleConfiguration[NimbleConfiguration.STAGE.ordinal()] = 2;
|
|
||||||
} catch (NoSuchFieldError e2) {
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
$SwitchMap$com$ea$nimble$NimbleConfiguration[NimbleConfiguration.LIVE.ordinal()] = 3;
|
|
||||||
} catch (NoSuchFieldError e3) {
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
$SwitchMap$com$ea$nimble$NimbleConfiguration[NimbleConfiguration.CUSTOMIZED.ordinal()] = 4;
|
|
||||||
} catch (NoSuchFieldError e4) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: package-private */
|
|
||||||
public SynergyEnvironmentImpl(BaseCore baseCore) {
|
|
||||||
this.m_core = baseCore;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void clearSynergyEnvironmentUpdateRateLimiting() {
|
|
||||||
this.m_synergyEnvironmentUpdateRateLimitTriggerTimestamp = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isInSynergyEnvironmentUpdateRateLimitingPeriod() {
|
|
||||||
return this.m_synergyEnvironmentUpdateRateLimitTriggerTimestamp != null && ((double) (System.currentTimeMillis() - this.m_synergyEnvironmentUpdateRateLimitTriggerTimestamp.longValue())) <= 60000.0d;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean restoreEnvironmentDataFromPersistent(boolean z) {
|
|
||||||
boolean z2 = true;
|
|
||||||
Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(SynergyEnvironment.COMPONENT_ID, Persistence.Storage.CACHE);
|
|
||||||
if (persistenceForNimbleComponent != null) {
|
|
||||||
Serializable value = persistenceForNimbleComponent.getValue(PERSISTENCE_DATA_ID);
|
|
||||||
if (value == null) {
|
|
||||||
Log.Helper.LOGD(this, "Environment persistence data value not found in persistence object. Probably first install.", new Object[0]);
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
this.m_environmentDataContainer = (EnvironmentDataContainer) value;
|
|
||||||
Log.Helper.LOGD(this, "Restored environment data from persistent. Restored data timestamp, %s", this.m_environmentDataContainer.getMostRecentDirectorResponseTimestamp());
|
|
||||||
if (this.m_environmentDataContainer.getEADeviceId() == null) {
|
|
||||||
this.m_environmentDataContainer.setEADeviceId(EASPDataLoader.loadEADeviceId());
|
|
||||||
}
|
|
||||||
if (!z) {
|
|
||||||
Utility.sendBroadcast(SynergyEnvironment.NOTIFICATION_RESTORED_FROM_PERSISTENT, null);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} catch (ClassCastException e) {
|
|
||||||
Log.Helper.LOGE(this, "Environment persistence data value is not the expected type.", new Object[0]);
|
|
||||||
}
|
|
||||||
return z2;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.Helper.LOGE(this, "Could not get environment persistence object to restore from", new Object[0]);
|
|
||||||
}
|
|
||||||
this.m_environmentDataContainer = null;
|
|
||||||
z2 = false;
|
|
||||||
return z2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: private */
|
|
||||||
public void saveEnvironmentDataToPersistent() {
|
|
||||||
Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(SynergyEnvironment.COMPONENT_ID, Persistence.Storage.CACHE);
|
|
||||||
if (persistenceForNimbleComponent != null) {
|
|
||||||
Log.Helper.LOGD(this, "Saving environment data to persistent.", new Object[0]);
|
|
||||||
persistenceForNimbleComponent.setValue(PERSISTENCE_DATA_ID, this.m_environmentDataContainer);
|
|
||||||
persistenceForNimbleComponent.synchronize();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Log.Helper.LOGE(this, "Could not get environment persistence object to save to.", new Object[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: private */
|
|
||||||
public void startSynergyEnvironmentUpdate() {
|
|
||||||
if (isUpdateInProgress()) {
|
|
||||||
Log.Helper.LOGD(this, "Attempt made to start Synergy environment update while a previous one is active. Exiting.", new Object[0]);
|
|
||||||
} else if (Network.getComponent().getStatus() == Network.Status.OK) {
|
|
||||||
this.m_synergyStartupObject = new SynergyEnvironmentUpdater(this.m_core);
|
|
||||||
this.m_previousValidEnvironmentDataContainer = this.m_environmentDataContainer;
|
|
||||||
HashMap hashMap = new HashMap();
|
|
||||||
hashMap.put(Global.NOTIFICATION_DICTIONARY_KEY_RESULT, Global.NOTIFICATION_DICTIONARY_RESULT_SUCCESS);
|
|
||||||
Utility.sendBroadcast(SynergyEnvironment.NOTIFICATION_STARTUP_REQUESTS_STARTED, hashMap);
|
|
||||||
this.m_synergyStartupObject.startSynergyStartupSequence(this.m_previousValidEnvironmentDataContainer, new SynergyEnvironmentUpdater.CompletionCallback() { // from class: com.ea.nimble.SynergyEnvironmentImpl.2
|
|
||||||
@Override // com.ea.nimble.SynergyEnvironmentUpdater.CompletionCallback
|
|
||||||
public void callback(Exception exc) {
|
|
||||||
if (exc != null) {
|
|
||||||
Log.Helper.LOGE(this, "StartupError(%s)", exc);
|
|
||||||
if (exc instanceof Error) {
|
|
||||||
Error error = (Error) exc;
|
|
||||||
if (error.isError(Error.Code.SYNERGY_GET_DIRECTION_TIMEOUT) || error.isError(Error.Code.SYNERGY_SERVER_FULL)) {
|
|
||||||
Log.Helper.LOGD(this, "GetDirection request timed out or ServerUnavailable signal received. Start rate limiting of /getDirection call.", new Object[0]);
|
|
||||||
SynergyEnvironmentImpl.this.startSynergyEnvironmentUpdateRateLimiting();
|
|
||||||
}
|
|
||||||
} else if (SynergyEnvironmentImpl.this.m_synergyStartupObject == null || SynergyEnvironmentImpl.this.m_synergyStartupObject.getEnvironmentDataContainer() == null) {
|
|
||||||
Log.Helper.LOGD(this, "Synergy Environment Update object or dataContainer null at callback. More than one update was being peroformed", new Object[0]);
|
|
||||||
}
|
|
||||||
HashMap hashMap2 = new HashMap();
|
|
||||||
hashMap2.put(Global.NOTIFICATION_DICTIONARY_KEY_RESULT, Global.NOTIFICATION_DICTIONARY_RESULT_FAIL);
|
|
||||||
hashMap2.put("error", exc.toString());
|
|
||||||
if (!ApplicationEnvironment.isMainApplicationRunning() || ApplicationEnvironment.getCurrentActivity() == null) {
|
|
||||||
Log.Helper.LOGI(this, "App is not running in forground, discard the NOTIFICATION_STARTUP_REQUESTS_FINISHED notification", new Object[0]);
|
|
||||||
} else {
|
|
||||||
Log.Helper.LOGD(this, "App is running in forground, send the NOTIFICATION_STARTUP_REQUESTS_FINISHED notification", new Object[0]);
|
|
||||||
Utility.sendBroadcast(SynergyEnvironment.NOTIFICATION_STARTUP_REQUESTS_FINISHED, hashMap2);
|
|
||||||
}
|
|
||||||
} else if (SynergyEnvironmentImpl.this.m_synergyStartupObject == null || SynergyEnvironmentImpl.this.m_synergyStartupObject.getEnvironmentDataContainer() == null) {
|
|
||||||
Log.Helper.LOGD(this, "Synergy Environment Update object or dataContainer null at callback. More than one update was being peroformed", new Object[0]);
|
|
||||||
} else {
|
|
||||||
SynergyEnvironmentImpl.this.m_environmentDataContainer = SynergyEnvironmentImpl.this.m_synergyStartupObject.getEnvironmentDataContainer();
|
|
||||||
SynergyEnvironmentImpl.this.saveEnvironmentDataToPersistent();
|
|
||||||
if (SynergyEnvironmentImpl.this.m_environmentDataContainer.getKeysOfDifferences(SynergyEnvironmentImpl.this.m_previousValidEnvironmentDataContainer) != null) {
|
|
||||||
Utility.sendBroadcast(SynergyEnvironment.NOTIFICATION_STARTUP_ENVIRONMENT_DATA_CHANGED, null);
|
|
||||||
}
|
|
||||||
HashMap hashMap3 = new HashMap();
|
|
||||||
hashMap3.put(Global.NOTIFICATION_DICTIONARY_KEY_RESULT, Global.NOTIFICATION_DICTIONARY_RESULT_SUCCESS);
|
|
||||||
if (!ApplicationEnvironment.isMainApplicationRunning() || ApplicationEnvironment.getCurrentActivity() == null) {
|
|
||||||
Log.Helper.LOGI(this, "App is not running in forground, discard the NOTIFICATION_STARTUP_REQUESTS_FINISHED notification", new Object[0]);
|
|
||||||
} else {
|
|
||||||
Log.Helper.LOGD(this, "App is running in forground, send the NOTIFICATION_STARTUP_REQUESTS_FINISHED notification", new Object[0]);
|
|
||||||
Utility.sendBroadcast(SynergyEnvironment.NOTIFICATION_STARTUP_REQUESTS_FINISHED, hashMap3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SynergyEnvironmentImpl.this.m_synergyStartupObject = null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (this.m_networkStatusChangeReceiver == null) {
|
|
||||||
this.m_networkStatusChangeReceiver = new BroadcastReceiver() { // from class: com.ea.nimble.SynergyEnvironmentImpl.1
|
|
||||||
@Override // android.content.BroadcastReceiver
|
|
||||||
public void onReceive(Context context, Intent intent) {
|
|
||||||
if (intent.getAction().equals(Global.NOTIFICATION_NETWORK_STATUS_CHANGE) && Network.getComponent().getStatus() == Network.Status.OK) {
|
|
||||||
Log.Helper.LOGD(this, "Network restored. Starting Synergy environment update.", new Object[0]);
|
|
||||||
Utility.unregisterReceiver(SynergyEnvironmentImpl.this.m_networkStatusChangeReceiver);
|
|
||||||
SynergyEnvironmentImpl.this.m_networkStatusChangeReceiver = null;
|
|
||||||
SynergyEnvironmentImpl.this.startSynergyEnvironmentUpdate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Log.Helper.LOGD(this, "Network not available to perform environment update. Setting receiver to listen for network status change.", new Object[0]);
|
|
||||||
Utility.registerReceiver(Global.NOTIFICATION_NETWORK_STATUS_CHANGE, this.m_networkStatusChangeReceiver);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: private */
|
|
||||||
public void startSynergyEnvironmentUpdateRateLimiting() {
|
|
||||||
this.m_synergyEnvironmentUpdateRateLimitTriggerTimestamp = Long.valueOf(System.currentTimeMillis());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.ISynergyEnvironment
|
|
||||||
public Error checkAndInitiateSynergyEnvironmentUpdate() {
|
|
||||||
if (isUpdateInProgress()) {
|
|
||||||
return new Error(Error.Code.SYNERGY_ENVIRONMENT_UPDATE_FAILURE, "Update in progress.");
|
|
||||||
}
|
|
||||||
if (this.m_environmentDataContainer != null && this.m_environmentDataContainer.getMostRecentDirectorResponseTimestamp() != null) {
|
|
||||||
return new Error(Error.Code.SYNERGY_ENVIRONMENT_UPDATE_FAILURE, "Environment data already cached.");
|
|
||||||
}
|
|
||||||
if (isInSynergyEnvironmentUpdateRateLimitingPeriod()) {
|
|
||||||
Log.Helper.LOGD(this, "Attempt to re-initiate Synergy environment update blocked by rate limiting. %.2f seconds of rate limiting left", Double.valueOf(60.0d - (((double) (System.currentTimeMillis() - this.m_synergyEnvironmentUpdateRateLimitTriggerTimestamp.longValue())) / 1000.0d)));
|
|
||||||
return new Error(Error.Code.SYNERGY_ENVIRONMENT_UPDATE_FAILURE, "Synergy environment update rate limit in effect.");
|
|
||||||
}
|
|
||||||
startSynergyEnvironmentUpdate();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.Component
|
|
||||||
public void cleanup() {
|
|
||||||
Log.Helper.LOGD(this, "cleanup", new Object[0]);
|
|
||||||
if (this.m_synergyStartupObject != null) {
|
|
||||||
this.m_synergyStartupObject.cancel();
|
|
||||||
this.m_synergyStartupObject = null;
|
|
||||||
}
|
|
||||||
if (this.m_networkStatusChangeReceiver != null) {
|
|
||||||
Utility.unregisterReceiver(this.m_networkStatusChangeReceiver);
|
|
||||||
this.m_networkStatusChangeReceiver = null;
|
|
||||||
}
|
|
||||||
saveEnvironmentDataToPersistent();
|
|
||||||
this.m_environmentDataContainer = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.Component
|
|
||||||
public String getComponentId() {
|
|
||||||
return SynergyEnvironment.COMPONENT_ID;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.ISynergyEnvironment
|
|
||||||
public String getEADeviceId() {
|
|
||||||
checkAndInitiateSynergyEnvironmentUpdate();
|
|
||||||
if (this.m_environmentDataContainer == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return this.m_environmentDataContainer.getEADeviceId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.ISynergyEnvironment
|
|
||||||
public String getEAHardwareId() {
|
|
||||||
checkAndInitiateSynergyEnvironmentUpdate();
|
|
||||||
if (this.m_environmentDataContainer == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return this.m_environmentDataContainer.getEAHardwareId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.ISynergyEnvironment
|
|
||||||
public String getGosMdmAppKey() {
|
|
||||||
checkAndInitiateSynergyEnvironmentUpdate();
|
|
||||||
if (this.m_environmentDataContainer == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return this.m_environmentDataContainer.getGosMdmAppKey();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.ISynergyEnvironment
|
|
||||||
public int getLatestAppVersionCheckResult() {
|
|
||||||
if (this.m_environmentDataContainer == null) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return this.m_environmentDataContainer.getLatestAppVersionCheckResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.LogSource
|
|
||||||
public String getLogSourceTitle() {
|
|
||||||
return "SynergyEnv";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.ISynergyEnvironment
|
|
||||||
public String getNexusClientId() {
|
|
||||||
checkAndInitiateSynergyEnvironmentUpdate();
|
|
||||||
if (this.m_environmentDataContainer == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return this.m_environmentDataContainer.getNexusClientId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.ISynergyEnvironment
|
|
||||||
public String getNexusClientSecret() {
|
|
||||||
checkAndInitiateSynergyEnvironmentUpdate();
|
|
||||||
if (this.m_environmentDataContainer == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return this.m_environmentDataContainer.getNexusClientSecret();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.ISynergyEnvironment
|
|
||||||
public String getProductId() {
|
|
||||||
checkAndInitiateSynergyEnvironmentUpdate();
|
|
||||||
if (this.m_environmentDataContainer == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return this.m_environmentDataContainer.getProductId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.ISynergyEnvironment
|
|
||||||
public String getSellId() {
|
|
||||||
checkAndInitiateSynergyEnvironmentUpdate();
|
|
||||||
if (this.m_environmentDataContainer == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return this.m_environmentDataContainer.getSellId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.ISynergyEnvironment
|
|
||||||
public String getServerUrlWithKey(String str) {
|
|
||||||
checkAndInitiateSynergyEnvironmentUpdate();
|
|
||||||
if (this.m_environmentDataContainer == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return this.m_environmentDataContainer.getServerUrlWithKey(str);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.ISynergyEnvironment
|
|
||||||
public String getSynergyDirectorServerUrl(NimbleConfiguration nimbleConfiguration) {
|
|
||||||
switch (AnonymousClass3.$SwitchMap$com$ea$nimble$NimbleConfiguration[nimbleConfiguration.ordinal()]) {
|
|
||||||
case 1:
|
|
||||||
return SYNERGY_INT_SERVER_URL;
|
|
||||||
case 2:
|
|
||||||
return SYNERGY_STAGE_SERVER_URL;
|
|
||||||
case 3:
|
|
||||||
return SYNERGY_LIVE_SERVER_URL;
|
|
||||||
case 4:
|
|
||||||
return PreferenceManager.getDefaultSharedPreferences(ApplicationEnvironment.getComponent().getApplicationContext()).getString("NimbleCustomizedSynergyServerEndpointUrl", SYNERGY_LIVE_SERVER_URL);
|
|
||||||
default:
|
|
||||||
Log.Helper.LOGF(this, "Request for Synergy Director server URL with unknown NimbleConfiguration, %d.", nimbleConfiguration);
|
|
||||||
return SYNERGY_LIVE_SERVER_URL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.ISynergyEnvironment
|
|
||||||
public String getSynergyId() {
|
|
||||||
checkAndInitiateSynergyEnvironmentUpdate();
|
|
||||||
if (this.m_environmentDataContainer == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return this.m_environmentDataContainer.getSynergyId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.ISynergyEnvironment
|
|
||||||
public int getTrackingPostInterval() {
|
|
||||||
if (this.m_environmentDataContainer == null) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return this.m_environmentDataContainer.getTrackingPostInterval();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.ISynergyEnvironment
|
|
||||||
public boolean isDataAvailable() {
|
|
||||||
return this.m_environmentDataContainer != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.ISynergyEnvironment
|
|
||||||
public boolean isUpdateInProgress() {
|
|
||||||
return this.m_synergyStartupObject != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.Component
|
|
||||||
public void restore() {
|
|
||||||
Log.Helper.LOGD(this, "restore", new Object[0]);
|
|
||||||
if (this.m_dataLoadedOnComponentSetup) {
|
|
||||||
this.m_dataLoadedOnComponentSetup = false;
|
|
||||||
Utility.sendBroadcast(SynergyEnvironment.NOTIFICATION_RESTORED_FROM_PERSISTENT, null);
|
|
||||||
} else {
|
|
||||||
restoreEnvironmentDataFromPersistent(false);
|
|
||||||
}
|
|
||||||
if (this.m_environmentDataContainer == null || this.m_environmentDataContainer.getMostRecentDirectorResponseTimestamp() == null || ((double) (System.currentTimeMillis() - this.m_environmentDataContainer.getMostRecentDirectorResponseTimestamp().longValue())) / 1000.0d > 300.0d) {
|
|
||||||
startSynergyEnvironmentUpdate();
|
|
||||||
} else {
|
|
||||||
checkAndInitiateSynergyEnvironmentUpdate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.Component
|
|
||||||
public void resume() {
|
|
||||||
Log.Helper.LOGD(this, "resume", new Object[0]);
|
|
||||||
clearSynergyEnvironmentUpdateRateLimiting();
|
|
||||||
if (this.m_environmentDataContainer == null || this.m_environmentDataContainer.getMostRecentDirectorResponseTimestamp() == null || ((double) (System.currentTimeMillis() - this.m_environmentDataContainer.getMostRecentDirectorResponseTimestamp().longValue())) / 1000.0d > 300.0d) {
|
|
||||||
startSynergyEnvironmentUpdate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.Component
|
|
||||||
public void setup() {
|
|
||||||
Log.Helper.LOGD(this, "setup", new Object[0]);
|
|
||||||
this.m_dataLoadedOnComponentSetup = restoreEnvironmentDataFromPersistent(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.Component
|
|
||||||
public void suspend() {
|
|
||||||
Log.Helper.LOGD(this, "suspend", new Object[0]);
|
|
||||||
if (this.m_synergyStartupObject != null) {
|
|
||||||
this.m_synergyStartupObject.cancel();
|
|
||||||
this.m_synergyStartupObject = null;
|
|
||||||
}
|
|
||||||
if (this.m_networkStatusChangeReceiver != null) {
|
|
||||||
Utility.unregisterReceiver(this.m_networkStatusChangeReceiver);
|
|
||||||
this.m_networkStatusChangeReceiver = null;
|
|
||||||
}
|
|
||||||
saveEnvironmentDataToPersistent();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.Component
|
|
||||||
public void teardown() {
|
|
||||||
this.m_environmentDataContainer = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,403 +0,0 @@
|
|||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.provider.Settings;
|
|
||||||
import android.telephony.TelephonyManager;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: package-private */
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/SynergyEnvironmentUpdater.class */
|
|
||||||
public class SynergyEnvironmentUpdater implements LogSource {
|
|
||||||
private static final int GET_ANONUID_MAX_RETRY_ATTEMPTS = 3;
|
|
||||||
private static final int GET_DIRECTION_MAX_RETRY_ATTEMPTS = 3;
|
|
||||||
private static final int GET_EADEVICEID_MAX_RETRY_ATTEMPTS = 3;
|
|
||||||
private static final int SYNERGY_DIRECTOR_RESPONSE_ERROR_CODE_SERVERS_FULL = -70002;
|
|
||||||
private static final int SYNERGY_USER_VALIDATE_EADEVICEID_RESPONSE_ERROR_CODE_CLEAR_CLIENT_CACHED_EADEVICEID = -20094;
|
|
||||||
private static final int SYNERGY_USER_VALIDATE_EADEVICEID_RESPONSE_ERROR_CODE_VALIDATION_FAILED = -20093;
|
|
||||||
private static final int VALIDATE_EADEVICEID_MAX_RETRY_ATTEMPTS = 3;
|
|
||||||
private BaseCore m_core;
|
|
||||||
private long m_getAnonUIDRetryCount;
|
|
||||||
private long m_getDirectionRetryCount;
|
|
||||||
private EnvironmentDataContainer m_environmentForSynergyStartUp = new EnvironmentDataContainer();
|
|
||||||
private CompletionCallback m_completionCallback = null;
|
|
||||||
private EnvironmentDataContainer m_previousValidEnvironmentData = null;
|
|
||||||
private SynergyNetworkConnectionHandle m_synergyNetworkConnectionHandle = null;
|
|
||||||
private long m_validateEADeviceIDRetryCount = 0;
|
|
||||||
private long m_getEADeviceIDRetryCount = 0;
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: package-private */
|
|
||||||
/* renamed from: com.ea.nimble.SynergyEnvironmentUpdater$5 reason: invalid class name */
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/SynergyEnvironmentUpdater$5.class */
|
|
||||||
public static /* synthetic */ class AnonymousClass5 {
|
|
||||||
static final /* synthetic */ int[] $SwitchMap$com$ea$nimble$NimbleConfiguration = new int[NimbleConfiguration.values().length];
|
|
||||||
|
|
||||||
static {
|
|
||||||
try {
|
|
||||||
$SwitchMap$com$ea$nimble$NimbleConfiguration[NimbleConfiguration.INTEGRATION.ordinal()] = 1;
|
|
||||||
} catch (NoSuchFieldError e) {
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
$SwitchMap$com$ea$nimble$NimbleConfiguration[NimbleConfiguration.STAGE.ordinal()] = 2;
|
|
||||||
} catch (NoSuchFieldError e2) {
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
$SwitchMap$com$ea$nimble$NimbleConfiguration[NimbleConfiguration.LIVE.ordinal()] = 3;
|
|
||||||
} catch (NoSuchFieldError e3) {
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
$SwitchMap$com$ea$nimble$NimbleConfiguration[NimbleConfiguration.CUSTOMIZED.ordinal()] = 4;
|
|
||||||
} catch (NoSuchFieldError e4) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: package-private */
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/SynergyEnvironmentUpdater$CompletionCallback.class */
|
|
||||||
public interface CompletionCallback {
|
|
||||||
void callback(Exception exc);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: package-private */
|
|
||||||
public SynergyEnvironmentUpdater(BaseCore baseCore) {
|
|
||||||
this.m_core = baseCore;
|
|
||||||
}
|
|
||||||
|
|
||||||
static /* synthetic */ long access$1008(SynergyEnvironmentUpdater synergyEnvironmentUpdater) {
|
|
||||||
long j = synergyEnvironmentUpdater.m_getEADeviceIDRetryCount;
|
|
||||||
synergyEnvironmentUpdater.m_getEADeviceIDRetryCount = 1 + j;
|
|
||||||
return j;
|
|
||||||
}
|
|
||||||
|
|
||||||
static /* synthetic */ long access$1108(SynergyEnvironmentUpdater synergyEnvironmentUpdater) {
|
|
||||||
long j = synergyEnvironmentUpdater.m_validateEADeviceIDRetryCount;
|
|
||||||
synergyEnvironmentUpdater.m_validateEADeviceIDRetryCount = 1 + j;
|
|
||||||
return j;
|
|
||||||
}
|
|
||||||
|
|
||||||
static /* synthetic */ long access$1208(SynergyEnvironmentUpdater synergyEnvironmentUpdater) {
|
|
||||||
long j = synergyEnvironmentUpdater.m_getAnonUIDRetryCount;
|
|
||||||
synergyEnvironmentUpdater.m_getAnonUIDRetryCount = 1 + j;
|
|
||||||
return j;
|
|
||||||
}
|
|
||||||
|
|
||||||
static /* synthetic */ long access$708(SynergyEnvironmentUpdater synergyEnvironmentUpdater) {
|
|
||||||
long j = synergyEnvironmentUpdater.m_getDirectionRetryCount;
|
|
||||||
synergyEnvironmentUpdater.m_getDirectionRetryCount = 1 + j;
|
|
||||||
return j;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: private */
|
|
||||||
public void callSynergyGetAnonUid() {
|
|
||||||
String anonymousSynergyId = SynergyIdManager.getComponent().getAnonymousSynergyId();
|
|
||||||
if (anonymousSynergyId != null) {
|
|
||||||
Log.Helper.LOGD(this, "Not getting anonymous ID from Synergy since it was loaded from persistence");
|
|
||||||
this.m_environmentForSynergyStartUp.setSynergyAnonymousId(anonymousSynergyId);
|
|
||||||
onStartUpSequenceFinished(null);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
HashMap hashMap = new HashMap();
|
|
||||||
hashMap.put("apiVer", "1.0.0");
|
|
||||||
hashMap.put("updatePriority", "false");
|
|
||||||
hashMap.put("hwId", this.m_environmentForSynergyStartUp.getEAHardwareId());
|
|
||||||
if (Utility.validString(this.m_environmentForSynergyStartUp.getEADeviceId())) {
|
|
||||||
hashMap.put("eadeviceid", this.m_environmentForSynergyStartUp.getEADeviceId());
|
|
||||||
this.m_synergyNetworkConnectionHandle = SynergyNetwork.getComponent().sendGetRequest(this.m_environmentForSynergyStartUp.getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_SYNERGY_USER), "/user/api/android/getAnonUid", hashMap, new SynergyNetworkConnectionCallback() { // from class: com.ea.nimble.SynergyEnvironmentUpdater.4
|
|
||||||
@Override // com.ea.nimble.SynergyNetworkConnectionCallback
|
|
||||||
public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) {
|
|
||||||
SynergyEnvironmentUpdater.this.m_synergyNetworkConnectionHandle = null;
|
|
||||||
Exception error = synergyNetworkConnectionHandle.getResponse().getError();
|
|
||||||
if (error == null) {
|
|
||||||
Log.Helper.LOGD(this, "GETANON Success");
|
|
||||||
SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.setSynergyAnonymousId(synergyNetworkConnectionHandle.getResponse().getJsonData().get("uid").toString());
|
|
||||||
SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(null);
|
|
||||||
} else if (SynergyEnvironmentUpdater.this.isTimeoutError(error) || SynergyEnvironmentUpdater.this.m_getAnonUIDRetryCount >= 3) {
|
|
||||||
SynergyEnvironmentUpdater.this.m_getAnonUIDRetryCount = 0;
|
|
||||||
Log.Helper.LOGD(this, "GETANON Error, (%s)", synergyNetworkConnectionHandle.getResponse().getError().toString());
|
|
||||||
SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(new Error(Error.Code.SYNERGY_GET_ANONYMOUS_ID_FAILURE, "Synergy \"get anonymous id\" call failed.", error));
|
|
||||||
} else {
|
|
||||||
SynergyEnvironmentUpdater.access$1208(SynergyEnvironmentUpdater.this);
|
|
||||||
Log.Helper.LOGD(this, "GetAnonUid, call failed. Making retry attempt number %d.", Long.valueOf(SynergyEnvironmentUpdater.this.m_getAnonUIDRetryCount));
|
|
||||||
SynergyEnvironmentUpdater.this.callSynergyGetAnonUid();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Log.Helper.LOGE(this, "getAnonUid got an invalid EA Device ID.");
|
|
||||||
onStartUpSequenceFinished(new Error(Error.Code.INVALID_ARGUMENT, "EA Device ID is invalid"));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: private */
|
|
||||||
public void callSynergyGetDirection() {
|
|
||||||
String applicationBundleId = ApplicationEnvironment.getComponent().getApplicationBundleId();
|
|
||||||
String deviceString = ApplicationEnvironment.getComponent().getDeviceString();
|
|
||||||
String deviceCodename = ApplicationEnvironment.getComponent().getDeviceCodename();
|
|
||||||
String deviceManufacturer = ApplicationEnvironment.getComponent().getDeviceManufacturer();
|
|
||||||
String deviceModel = ApplicationEnvironment.getComponent().getDeviceModel();
|
|
||||||
String deviceBrand = ApplicationEnvironment.getComponent().getDeviceBrand();
|
|
||||||
String deviceFingerprint = ApplicationEnvironment.getComponent().getDeviceFingerprint();
|
|
||||||
if (!Utility.validString(applicationBundleId)) {
|
|
||||||
Log.Helper.LOGE(this, "GETDIRECTION bundleId is invalid");
|
|
||||||
onStartUpSequenceFinished(new Error(Error.Code.INVALID_ARGUMENT, "bundleId is invalid"));
|
|
||||||
} else if (!Utility.validString(deviceString)) {
|
|
||||||
Log.Helper.LOGE(this, "GETDIRECTION deviceString is invalid");
|
|
||||||
onStartUpSequenceFinished(new Error(Error.Code.INVALID_ARGUMENT, "deviceString is invalid"));
|
|
||||||
} else {
|
|
||||||
HashMap<String, String> hashMap = new HashMap<>();
|
|
||||||
hashMap.put("packageId", applicationBundleId);
|
|
||||||
hashMap.put("deviceString", deviceString);
|
|
||||||
hashMap.put("deviceCodename", deviceCodename);
|
|
||||||
hashMap.put("manufacturer", deviceManufacturer);
|
|
||||||
hashMap.put("model", deviceModel);
|
|
||||||
hashMap.put("brand", deviceBrand);
|
|
||||||
hashMap.put("fingerprint", deviceFingerprint);
|
|
||||||
hashMap.put("serverEnvironment", getSynergyServerEnvironmentName());
|
|
||||||
hashMap.put("sdkVersion", "1.23.14.1217");
|
|
||||||
hashMap.put("apiVer", "1.0.0");
|
|
||||||
this.m_synergyNetworkConnectionHandle = SynergyNetwork.getComponent().sendGetRequest(this.m_environmentForSynergyStartUp.getSynergyDirectorServerUrl(Base.getConfiguration()), "/director/api/android/getDirectionByPackage", hashMap, new SynergyNetworkConnectionCallback() { // from class: com.ea.nimble.SynergyEnvironmentUpdater.1
|
|
||||||
/* JADX WARN: Type inference failed for: r1v24, types: [java.lang.Object] */
|
|
||||||
/* JADX WARN: Type inference failed for: r2v10, types: [java.lang.Object] */
|
|
||||||
@Override // com.ea.nimble.SynergyNetworkConnectionCallback
|
|
||||||
public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) {
|
|
||||||
Log.Helper.LOGD(this, "GETDIRECTION FINISHED");
|
|
||||||
SynergyEnvironmentUpdater.this.m_synergyNetworkConnectionHandle = null;
|
|
||||||
Exception error = synergyNetworkConnectionHandle.getResponse().getError();
|
|
||||||
if (error == null) {
|
|
||||||
SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.setMostRecentDirectorResponseTimestamp(System.currentTimeMillis());
|
|
||||||
SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.setGetDirectionResponseDictionary(synergyNetworkConnectionHandle.getResponse().getJsonData());
|
|
||||||
List<Map> list = (List) SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.getGetDirectionResponseDictionary().get("serverData");
|
|
||||||
SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.setServerUrls(new HashMap());
|
|
||||||
if (list != null) {
|
|
||||||
for (Map map : list) {
|
|
||||||
SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.getServerUrls().put((String) map.get("key"), (String)map.get("value"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.getServerUrls().size() == 0) {
|
|
||||||
SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(new Error(Error.Code.NOT_AVAILABLE, "No Synergy server URLs available."));
|
|
||||||
} else if (SynergyEnvironmentUpdater.this.m_previousValidEnvironmentData == null || !Utility.validString(SynergyEnvironmentUpdater.this.m_previousValidEnvironmentData.getEADeviceId())) {
|
|
||||||
String loadEADeviceId = EASPDataLoader.loadEADeviceId();
|
|
||||||
if (loadEADeviceId != null) {
|
|
||||||
SynergyEnvironmentUpdater.this.callSynergyValidateEADeviceId(loadEADeviceId);
|
|
||||||
} else {
|
|
||||||
SynergyEnvironmentUpdater.this.callSynergyGetEADeviceId();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
SynergyEnvironmentUpdater.this.callSynergyValidateEADeviceId(SynergyEnvironmentUpdater.this.m_previousValidEnvironmentData.getEADeviceId());
|
|
||||||
}
|
|
||||||
} else if (!(error instanceof SynergyServerError)) {
|
|
||||||
boolean isTimeoutError = SynergyEnvironmentUpdater.this.isTimeoutError(error);
|
|
||||||
if (isTimeoutError || SynergyEnvironmentUpdater.this.m_getDirectionRetryCount >= 3) {
|
|
||||||
SynergyEnvironmentUpdater.this.m_getDirectionRetryCount = 0;
|
|
||||||
if (isTimeoutError) {
|
|
||||||
SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(new Error(Error.Code.SYNERGY_GET_DIRECTION_TIMEOUT, "Synergy /getDirectionByPackage request timed out.", error));
|
|
||||||
} else {
|
|
||||||
SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(error);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
SynergyEnvironmentUpdater.access$708(SynergyEnvironmentUpdater.this);
|
|
||||||
Log.Helper.LOGD(this, "GetDirection, call failed. Making retry attempt number %d.", Long.valueOf(SynergyEnvironmentUpdater.this.m_getDirectionRetryCount));
|
|
||||||
SynergyEnvironmentUpdater.this.callSynergyGetDirection();
|
|
||||||
}
|
|
||||||
} else if (((SynergyServerError) error).isError(SynergyEnvironmentUpdater.SYNERGY_DIRECTOR_RESPONSE_ERROR_CODE_SERVERS_FULL)) {
|
|
||||||
SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(new Error(Error.Code.SYNERGY_SERVER_FULL, "Synergy ServerUnavailable signal received.", error));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: private */
|
|
||||||
public void callSynergyGetEADeviceId() {
|
|
||||||
int phoneType;
|
|
||||||
String string;
|
|
||||||
String SHA256HashString;
|
|
||||||
EnvironmentDataContainer environmentDataContainer = this.m_environmentForSynergyStartUp;
|
|
||||||
HashMap hashMap = new HashMap();
|
|
||||||
hashMap.put("apiVer", "1.0.0");
|
|
||||||
hashMap.put("hwId", environmentDataContainer.getEAHardwareId());
|
|
||||||
String mACAddress = ApplicationEnvironment.getComponent().getMACAddress();
|
|
||||||
if (Utility.validString(mACAddress) && (SHA256HashString = Utility.SHA256HashString(mACAddress)) != null) {
|
|
||||||
hashMap.put("macHash", SHA256HashString);
|
|
||||||
}
|
|
||||||
IApplicationEnvironment component = ApplicationEnvironment.getComponent();
|
|
||||||
Context context = null;
|
|
||||||
if (component != null) {
|
|
||||||
context = component.getApplicationContext();
|
|
||||||
}
|
|
||||||
if (!(context == null || (string = Settings.Secure.getString(component.getApplicationContext().getContentResolver(), "android_id")) == null)) {
|
|
||||||
hashMap.put("androidId", string);
|
|
||||||
}
|
|
||||||
if (context != null) {
|
|
||||||
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
|
||||||
PackageManager packageManager = context.getPackageManager();
|
|
||||||
if (!(telephonyManager == null || packageManager.checkPermission("android.permission.READ_PHONE_STATE", context.getPackageName()) != 0 || (phoneType = telephonyManager.getPhoneType()) == 0)) {
|
|
||||||
String deviceId = telephonyManager.getDeviceId();
|
|
||||||
if (Utility.validString(deviceId)) {
|
|
||||||
String str = "imei";
|
|
||||||
if (phoneType == 2) {
|
|
||||||
str = "meid";
|
|
||||||
}
|
|
||||||
hashMap.put(str, deviceId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.m_synergyNetworkConnectionHandle = SynergyNetwork.getComponent().sendGetRequest(this.m_environmentForSynergyStartUp.getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_SYNERGY_USER), "/user/api/android/getDeviceID", hashMap, new SynergyNetworkConnectionCallback() { // from class: com.ea.nimble.SynergyEnvironmentUpdater.2
|
|
||||||
@Override // com.ea.nimble.SynergyNetworkConnectionCallback
|
|
||||||
public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) {
|
|
||||||
SynergyEnvironmentUpdater.this.m_synergyNetworkConnectionHandle = null;
|
|
||||||
Exception error = synergyNetworkConnectionHandle.getResponse().getError();
|
|
||||||
if (error == null) {
|
|
||||||
Log.Helper.LOGD(this, "GetEADeviceID Success");
|
|
||||||
SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.setEADeviceId((String) synergyNetworkConnectionHandle.getResponse().getJsonData().get("deviceId"));
|
|
||||||
SynergyEnvironmentUpdater.this.callSynergyGetAnonUid();
|
|
||||||
} else if (SynergyEnvironmentUpdater.this.isTimeoutError(error) || SynergyEnvironmentUpdater.this.m_getEADeviceIDRetryCount >= 3) {
|
|
||||||
SynergyEnvironmentUpdater.this.m_getEADeviceIDRetryCount = 0;
|
|
||||||
Log.Helper.LOGD(this, "GetEADeviceID Error (%s)", synergyNetworkConnectionHandle.getResponse().getError());
|
|
||||||
SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(new Error(Error.Code.SYNERGY_GET_EA_DEVICE_ID_FAILURE, "GetEADevideId call failed", synergyNetworkConnectionHandle.getResponse().getError()));
|
|
||||||
} else {
|
|
||||||
SynergyEnvironmentUpdater.access$1008(SynergyEnvironmentUpdater.this);
|
|
||||||
Log.Helper.LOGD(this, "GetEADeviceID, call failed. Making retry attempt number %d.", Long.valueOf(SynergyEnvironmentUpdater.this.m_getEADeviceIDRetryCount));
|
|
||||||
SynergyEnvironmentUpdater.this.callSynergyGetEADeviceId();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: private */
|
|
||||||
public void callSynergyValidateEADeviceId(final String str) {
|
|
||||||
int phoneType;
|
|
||||||
String string;
|
|
||||||
String SHA256HashString;
|
|
||||||
EnvironmentDataContainer environmentDataContainer = this.m_environmentForSynergyStartUp;
|
|
||||||
HashMap hashMap = new HashMap();
|
|
||||||
hashMap.put("apiVer", "1.0.0");
|
|
||||||
hashMap.put("hwId", environmentDataContainer.getEAHardwareId());
|
|
||||||
hashMap.put("eadeviceid", str);
|
|
||||||
String mACAddress = ApplicationEnvironment.getComponent().getMACAddress();
|
|
||||||
if (Utility.validString(mACAddress) && (SHA256HashString = Utility.SHA256HashString(mACAddress)) != null) {
|
|
||||||
hashMap.put("macHash", SHA256HashString);
|
|
||||||
}
|
|
||||||
IApplicationEnvironment component = ApplicationEnvironment.getComponent();
|
|
||||||
Context context = null;
|
|
||||||
if (component != null) {
|
|
||||||
context = component.getApplicationContext();
|
|
||||||
}
|
|
||||||
if (!(context == null || (string = Settings.Secure.getString(component.getApplicationContext().getContentResolver(), "android_id")) == null)) {
|
|
||||||
hashMap.put("androidId", string);
|
|
||||||
}
|
|
||||||
if (context != null) {
|
|
||||||
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService("phone");
|
|
||||||
PackageManager packageManager = context.getPackageManager();
|
|
||||||
if (!(telephonyManager == null || packageManager.checkPermission("android.permission.READ_PHONE_STATE", context.getPackageName()) != 0 || (phoneType = telephonyManager.getPhoneType()) == 0)) {
|
|
||||||
String deviceId = telephonyManager.getDeviceId();
|
|
||||||
if (Utility.validString(deviceId)) {
|
|
||||||
String str2 = "imei";
|
|
||||||
if (phoneType == 2) {
|
|
||||||
str2 = "meid";
|
|
||||||
}
|
|
||||||
hashMap.put(str2, deviceId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.m_synergyNetworkConnectionHandle = SynergyNetwork.getComponent().sendGetRequest(this.m_environmentForSynergyStartUp.getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_SYNERGY_USER), "/user/api/android/validateDeviceID", hashMap, new SynergyNetworkConnectionCallback() { // from class: com.ea.nimble.SynergyEnvironmentUpdater.3
|
|
||||||
@Override // com.ea.nimble.SynergyNetworkConnectionCallback
|
|
||||||
public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) {
|
|
||||||
SynergyEnvironmentUpdater.this.m_synergyNetworkConnectionHandle = null;
|
|
||||||
Exception error = synergyNetworkConnectionHandle.getResponse().getError();
|
|
||||||
if (error == null) {
|
|
||||||
Log.Helper.LOGD(this, "ValidateEADeviceID Success");
|
|
||||||
SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.setEADeviceId((String) synergyNetworkConnectionHandle.getResponse().getJsonData().get("deviceId"));
|
|
||||||
SynergyEnvironmentUpdater.this.callSynergyGetAnonUid();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Log.Helper.LOGD(this, "ValidateEADeviceID Error (%s)", error);
|
|
||||||
if (error instanceof SynergyServerError) {
|
|
||||||
SynergyServerError synergyServerError = (SynergyServerError) error;
|
|
||||||
if (synergyServerError.isError(SynergyEnvironmentUpdater.SYNERGY_USER_VALIDATE_EADEVICEID_RESPONSE_ERROR_CODE_CLEAR_CLIENT_CACHED_EADEVICEID)) {
|
|
||||||
if (SynergyEnvironmentUpdater.this.m_previousValidEnvironmentData != null) {
|
|
||||||
SynergyEnvironmentUpdater.this.m_previousValidEnvironmentData.setEADeviceId(null);
|
|
||||||
}
|
|
||||||
Log.Helper.LOGD(this, "ValidateEADeviceID, Server signal received to delete cached EA Device ID. Making request to get a new EA Device ID.");
|
|
||||||
SynergyEnvironmentUpdater.this.callSynergyGetEADeviceId();
|
|
||||||
return;
|
|
||||||
} else if (synergyServerError.isError(SynergyEnvironmentUpdater.SYNERGY_USER_VALIDATE_EADEVICEID_RESPONSE_ERROR_CODE_VALIDATION_FAILED)) {
|
|
||||||
Log.Helper.LOGD(this, "ValidateEADeviceID, EADeviceID validation failed. Making request to get a new EA Device ID.");
|
|
||||||
SynergyEnvironmentUpdater.this.callSynergyGetEADeviceId();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (SynergyEnvironmentUpdater.this.isTimeoutError(error) || SynergyEnvironmentUpdater.this.m_validateEADeviceIDRetryCount >= 3) {
|
|
||||||
SynergyEnvironmentUpdater.this.m_validateEADeviceIDRetryCount = 0;
|
|
||||||
SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(new Error(Error.Code.SYNERGY_GET_EA_DEVICE_ID_FAILURE, "ValidateEADeviceId call failed", error));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
SynergyEnvironmentUpdater.access$1108(SynergyEnvironmentUpdater.this);
|
|
||||||
Log.Helper.LOGD(this, "ValidateEADeviceID, call failed. Making retry attempt number %d.", Long.valueOf(SynergyEnvironmentUpdater.this.m_validateEADeviceIDRetryCount));
|
|
||||||
SynergyEnvironmentUpdater.this.callSynergyValidateEADeviceId(str);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getSynergyServerEnvironmentName() {
|
|
||||||
switch (AnonymousClass5.$SwitchMap$com$ea$nimble$NimbleConfiguration[this.m_core.getConfiguration().ordinal()]) {
|
|
||||||
case 1:
|
|
||||||
case 2:
|
|
||||||
case 3:
|
|
||||||
return this.m_core.getConfiguration().toString();
|
|
||||||
case 4:
|
|
||||||
return PreferenceManager.getDefaultSharedPreferences(ApplicationEnvironment.getComponent().getApplicationContext()).getString("NimbleCustomizedSynergyServerEnvironmentName", "live");
|
|
||||||
default:
|
|
||||||
Log.Helper.LOGF(this, "Request for Synergy server environment name with unknown NimbleConfiguration %s", this.m_core.getConfiguration().toString());
|
|
||||||
return "live";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: private */
|
|
||||||
public boolean isTimeoutError(Exception exc) {
|
|
||||||
return (exc instanceof Error) && ((Error) exc).isError(Error.Code.NETWORK_TIMEOUT);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: private */
|
|
||||||
public void onStartUpSequenceFinished(Exception exc) {
|
|
||||||
if (this.m_completionCallback != null) {
|
|
||||||
this.m_completionCallback.callback(exc);
|
|
||||||
} else {
|
|
||||||
Log.Helper.LOGW(this, "Startup sequence finished, but no completion callback set.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void cancel() {
|
|
||||||
SynergyNetworkConnectionHandle synergyNetworkConnectionHandle = this.m_synergyNetworkConnectionHandle;
|
|
||||||
if (synergyNetworkConnectionHandle != null) {
|
|
||||||
Log.Helper.LOGD(this, "Canceling network connection.");
|
|
||||||
synergyNetworkConnectionHandle.cancel();
|
|
||||||
this.m_synergyNetworkConnectionHandle = null;
|
|
||||||
}
|
|
||||||
onStartUpSequenceFinished(new Error(Error.Code.NETWORK_OPERATION_CANCELLED, "Synergy startup sequence canceled."));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: package-private */
|
|
||||||
public EnvironmentDataContainer getEnvironmentDataContainer() {
|
|
||||||
return this.m_environmentForSynergyStartUp;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.LogSource
|
|
||||||
public String getLogSourceTitle() {
|
|
||||||
return "SynergyEnv";
|
|
||||||
}
|
|
||||||
|
|
||||||
public void startSynergyStartupSequence(EnvironmentDataContainer environmentDataContainer, CompletionCallback completionCallback) {
|
|
||||||
this.m_completionCallback = completionCallback;
|
|
||||||
this.m_previousValidEnvironmentData = environmentDataContainer;
|
|
||||||
if (Network.getComponent().getStatus() != Network.Status.OK) {
|
|
||||||
onStartUpSequenceFinished(new Error(Error.Code.NETWORK_NO_CONNECTION, "Device is not connected to Wifi or wireless."));
|
|
||||||
} else {
|
|
||||||
callSynergyGetDirection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.ISynergyIdManager;
|
|
||||||
import com.ea.nimble.SynergyIdManagerImpl;
|
|
||||||
|
|
||||||
public class SynergyIdManager {
|
|
||||||
public static final String COMPONENT_ID = "com.ea.nimble.synergyidmanager";
|
|
||||||
public static final String LOG_TAG = "SynergyID";
|
|
||||||
public static final String NOTIFICATION_ANONYMOUS_SYNERGY_ID_CHANGED = "nimble.synergyidmanager.notification.anonymous_synergy_id_changed";
|
|
||||||
public static final String NOTIFICATION_SYNERGY_ID_CHANGED = "nimble.synergyidmanager.notification.synergy_id_changed";
|
|
||||||
|
|
||||||
public static ISynergyIdManager getComponent() {
|
|
||||||
return SynergyIdManagerImpl.getComponent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.Error;
|
|
||||||
|
|
||||||
public class SynergyIdManagerError
|
|
||||||
extends Error {
|
|
||||||
public static final String ERROR_DOMAIN = "NimbleSynergyIdManager";
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
public SynergyIdManagerError(int n2, String string2) {
|
|
||||||
super(ERROR_DOMAIN, n2, string2, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SynergyIdManagerError(int n2, String string2, Throwable throwable) {
|
|
||||||
super(ERROR_DOMAIN, n2, string2, throwable);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static enum Code {
|
|
||||||
AUTHENTICATOR_CONFLICT(5000),
|
|
||||||
UNEXPECTED_LOGIN_STATE(5001),
|
|
||||||
INVALID_ID(5002),
|
|
||||||
MISSING_AUTHENTICATOR(5003);
|
|
||||||
|
|
||||||
private int m_value;
|
|
||||||
|
|
||||||
private Code(int n3) {
|
|
||||||
this.m_value = n3;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int intValue() {
|
|
||||||
return this.m_value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,231 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*
|
|
||||||
* Could not load the following classes:
|
|
||||||
* android.content.BroadcastReceiver
|
|
||||||
* android.content.Context
|
|
||||||
* android.content.Intent
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import android.content.BroadcastReceiver;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
class SynergyIdManagerImpl
|
|
||||||
extends Component
|
|
||||||
implements ISynergyIdManager,
|
|
||||||
LogSource {
|
|
||||||
private static final String ANONYMOUS_ID_PERSISTENCE_DATA_ID = "anonymousId";
|
|
||||||
private static final String AUTHENTICATOR_PERSISTENCE_DATA_ID = "authenticator";
|
|
||||||
private static final String CURRENT_ID_PERSISTENCE_DATA_ID = "currentId";
|
|
||||||
private static final String SYNERGY_ID_MANAGER_ANONYMOUS_ID_PERSISTENCE_ID = "com.ea.nimble.synergyidmanager.anonymousId";
|
|
||||||
private static final String VERSION_PERSISTENCE_DATA_ID = "dataVersion";
|
|
||||||
private String m_anonymousSynergyId;
|
|
||||||
private String m_authenticatorIdentifier;
|
|
||||||
private String m_currentSynergyId;
|
|
||||||
private BroadcastReceiver m_receiver = new SynergyIdManagerReceiver();
|
|
||||||
|
|
||||||
SynergyIdManagerImpl() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ISynergyIdManager getComponent() {
|
|
||||||
return (ISynergyIdManager)((Object)Base.getComponent("com.ea.nimble.synergyidmanager"));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onSynergyEnvironmentStartupRequestsFinished() {
|
|
||||||
if (SynergyEnvironment.getComponent() != null) {
|
|
||||||
Log.Helper.LOGD(this, "onSynergyEnvironmentStartupRequestsFinished - Process the notification, everything looks okay");
|
|
||||||
this.setAnonymousSynergyId(SynergyEnvironment.getComponent().getSynergyId());
|
|
||||||
if (Utility.validString(this.m_currentSynergyId)) return;
|
|
||||||
this.setCurrentSynergyId(this.m_anonymousSynergyId);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Log.Helper.LOGI(this, "onSynergyEnvironmentStartupRequestsFinished - Aborted because we were unable to get SynergyEnvironment");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void restoreFromPersistent() {
|
|
||||||
Persistence persistence = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.synergyidmanager", Persistence.Storage.CACHE);
|
|
||||||
if (persistence != null) {
|
|
||||||
Log.Helper.LOGD("Loaded persistence data version, %s.", persistence.getStringValue(VERSION_PERSISTENCE_DATA_ID));
|
|
||||||
this.m_currentSynergyId = persistence.getStringValue(CURRENT_ID_PERSISTENCE_DATA_ID);
|
|
||||||
this.m_authenticatorIdentifier = persistence.getStringValue(AUTHENTICATOR_PERSISTENCE_DATA_ID);
|
|
||||||
Log.Helper.LOGD(this, "Loaded Synergy ID, %s, with authenticator, %s.", this.m_currentSynergyId, this.m_authenticatorIdentifier);
|
|
||||||
} else {
|
|
||||||
Log.Helper.LOGE(this, "Could not get persistence object to load from.");
|
|
||||||
}
|
|
||||||
if ((persistence = PersistenceService.getPersistenceForNimbleComponent(SYNERGY_ID_MANAGER_ANONYMOUS_ID_PERSISTENCE_ID, Persistence.Storage.DOCUMENT)) != null) {
|
|
||||||
Log.Helper.LOGD(this, "Loaded persistence data version, %s.", Utility.safeString(persistence.getStringValue(VERSION_PERSISTENCE_DATA_ID)));
|
|
||||||
this.m_anonymousSynergyId = persistence.getStringValue(ANONYMOUS_ID_PERSISTENCE_DATA_ID);
|
|
||||||
Log.Helper.LOGD(this, "Loaded anonymous Synergy ID, %s.", Utility.safeString(this.m_anonymousSynergyId));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Log.Helper.LOGE(this, "Could not get anonymous Synergy ID persistence object to load from.");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void saveDataToPersistent() {
|
|
||||||
Persistence persistence = PersistenceService.getPersistenceForNimbleComponent(SYNERGY_ID_MANAGER_ANONYMOUS_ID_PERSISTENCE_ID, Persistence.Storage.DOCUMENT);
|
|
||||||
if (persistence != null) {
|
|
||||||
Log.Helper.LOGD("Saving anonymous Synergy ID, %s, to persistent.", this.m_anonymousSynergyId);
|
|
||||||
persistence.setValue(VERSION_PERSISTENCE_DATA_ID, (Serializable)((Object)"1.0.0"));
|
|
||||||
persistence.setValue(ANONYMOUS_ID_PERSISTENCE_DATA_ID, (Serializable)((Object)this.m_anonymousSynergyId));
|
|
||||||
persistence.setBackUp(true);
|
|
||||||
persistence.synchronize();
|
|
||||||
} else {
|
|
||||||
Log.Helper.LOGE(this, "Could not get anonymous Synergy ID persistence object to save to.");
|
|
||||||
}
|
|
||||||
if ((persistence = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.synergyidmanager", Persistence.Storage.CACHE)) != null) {
|
|
||||||
Log.Helper.LOGD(this, "Saving current Synergy ID, %s, and authenticator, %s, to persistent.", this.m_currentSynergyId, this.m_authenticatorIdentifier);
|
|
||||||
persistence.setValue(VERSION_PERSISTENCE_DATA_ID, (Serializable)((Object)"1.0.0"));
|
|
||||||
persistence.setValue(CURRENT_ID_PERSISTENCE_DATA_ID, (Serializable)((Object)this.m_currentSynergyId));
|
|
||||||
persistence.setValue(AUTHENTICATOR_PERSISTENCE_DATA_ID, (Serializable)((Object)this.m_authenticatorIdentifier));
|
|
||||||
persistence.synchronize();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Log.Helper.LOGE(this, "Could not get persistence object to save to.");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setAnonymousSynergyId(String object) {
|
|
||||||
if (Utility.validString(this.m_anonymousSynergyId) && !Utility.validString((String)object)) {
|
|
||||||
Log.Helper.LOGE(this, "Attempt to set invalid anonymous Synergy ID over existing ID, %s. Ignoring attempt.", this.m_anonymousSynergyId);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String string2 = this.m_anonymousSynergyId;
|
|
||||||
this.m_anonymousSynergyId = object;
|
|
||||||
this.saveDataToPersistent();
|
|
||||||
if (Utility.validString(string2) && (Utility.validString(string2) && !string2.equals(this.m_anonymousSynergyId) || Utility.validString(this.m_anonymousSynergyId) && !this.m_anonymousSynergyId.equals(string2))) {
|
|
||||||
HashMap<String, String> hashMap = new HashMap<>();
|
|
||||||
hashMap.put("previousSynergyId", Utility.safeString(string2));
|
|
||||||
hashMap.put("currentSynergyId", Utility.safeString(this.m_anonymousSynergyId));
|
|
||||||
Utility.sendBroadcast("nimble.synergyidmanager.notification.anonymous_synergy_id_changed", hashMap);
|
|
||||||
}
|
|
||||||
if (this.m_authenticatorIdentifier != null) return;
|
|
||||||
this.setCurrentSynergyId(this.m_anonymousSynergyId);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setCurrentSynergyId(String object) {
|
|
||||||
if (Utility.validString(this.m_currentSynergyId) && !Utility.validString((String)object)) {
|
|
||||||
Log.Helper.LOGE(this, "Attempt to set invalid current Synergy ID over existing ID, %s. Ignoring attempt.", this.m_currentSynergyId);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String string2 = this.m_currentSynergyId;
|
|
||||||
this.m_currentSynergyId = object;
|
|
||||||
this.saveDataToPersistent();
|
|
||||||
if (!Utility.validString(string2)) return;
|
|
||||||
if (!Utility.validString(string2) || string2.equals(this.m_currentSynergyId)) {
|
|
||||||
if (!Utility.validString(this.m_currentSynergyId)) return;
|
|
||||||
if (this.m_currentSynergyId.equals(string2)) return;
|
|
||||||
}
|
|
||||||
HashMap<String, String> hashMap = new HashMap<>();
|
|
||||||
hashMap.put("previousSynergyId", Utility.safeString(string2));
|
|
||||||
hashMap.put("currentSynergyId", Utility.safeString(this.m_currentSynergyId));
|
|
||||||
Utility.sendBroadcast("nimble.synergyidmanager.notification.synergy_id_changed", hashMap);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void sleep() {
|
|
||||||
Utility.unregisterReceiver(this.m_receiver);
|
|
||||||
this.saveDataToPersistent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void wakeup() {
|
|
||||||
this.restoreFromPersistent();
|
|
||||||
if (!Utility.validString(this.m_anonymousSynergyId)) {
|
|
||||||
this.setAnonymousSynergyId(SynergyEnvironment.getComponent().getSynergyId());
|
|
||||||
}
|
|
||||||
if (!Utility.validString(this.m_currentSynergyId)) {
|
|
||||||
this.setCurrentSynergyId(this.m_anonymousSynergyId);
|
|
||||||
}
|
|
||||||
Utility.registerReceiver("nimble.environment.notification.startup_requests_finished", this.m_receiver);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void cleanup() {
|
|
||||||
this.sleep();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getAnonymousSynergyId() {
|
|
||||||
if (!Utility.validString(this.m_anonymousSynergyId)) return SynergyEnvironment.getComponent().getSynergyId();
|
|
||||||
return this.m_anonymousSynergyId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getComponentId() {
|
|
||||||
return "com.ea.nimble.synergyidmanager";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getLogSourceTitle() {
|
|
||||||
return "SynergyId";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getSynergyId() {
|
|
||||||
if (!Utility.validString(this.m_currentSynergyId)) return this.getAnonymousSynergyId();
|
|
||||||
return this.m_currentSynergyId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SynergyIdManagerError login(String string2, String string3) {
|
|
||||||
if (this.m_authenticatorIdentifier != null) {
|
|
||||||
return new SynergyIdManagerError(SynergyIdManagerError.Code.UNEXPECTED_LOGIN_STATE.intValue(), "Already logged in with authenticator, " + this.m_authenticatorIdentifier);
|
|
||||||
}
|
|
||||||
if (!Utility.validString(string2)) return new SynergyIdManagerError(SynergyIdManagerError.Code.INVALID_ID.intValue(), "Synergy ID must be numeric digits.");
|
|
||||||
if (!Utility.isOnlyDecimalCharacters(string2)) {
|
|
||||||
return new SynergyIdManagerError(SynergyIdManagerError.Code.INVALID_ID.intValue(), "Synergy ID must be numeric digits.");
|
|
||||||
}
|
|
||||||
if (!Utility.validString(string3)) {
|
|
||||||
return new SynergyIdManagerError(SynergyIdManagerError.Code.MISSING_AUTHENTICATOR.intValue(), "Authenticator string required for login API.");
|
|
||||||
}
|
|
||||||
this.m_authenticatorIdentifier = string3;
|
|
||||||
this.setCurrentSynergyId(string2);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SynergyIdManagerError logout(String string2) {
|
|
||||||
if (this.m_authenticatorIdentifier == null) {
|
|
||||||
return new SynergyIdManagerError(SynergyIdManagerError.Code.UNEXPECTED_LOGIN_STATE.intValue(), "Already logged out.");
|
|
||||||
}
|
|
||||||
if (!Utility.validString(string2)) {
|
|
||||||
return new SynergyIdManagerError(SynergyIdManagerError.Code.MISSING_AUTHENTICATOR.intValue(), "Authenticator string required for logout API.");
|
|
||||||
}
|
|
||||||
if (!this.m_authenticatorIdentifier.equals(string2)) {
|
|
||||||
return new SynergyIdManagerError(SynergyIdManagerError.Code.AUTHENTICATOR_CONFLICT.intValue(), "Logout must be performed by the same authenticator that logged in, " + this.m_authenticatorIdentifier);
|
|
||||||
}
|
|
||||||
this.setCurrentSynergyId(this.m_anonymousSynergyId);
|
|
||||||
this.m_authenticatorIdentifier = null;
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void restore() {
|
|
||||||
this.wakeup();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void resume() {
|
|
||||||
this.wakeup();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void suspend() {
|
|
||||||
this.sleep();
|
|
||||||
}
|
|
||||||
|
|
||||||
private class SynergyIdManagerReceiver
|
|
||||||
extends BroadcastReceiver {
|
|
||||||
private SynergyIdManagerReceiver() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onReceive(Context context, Intent intent) {
|
|
||||||
if (!ApplicationEnvironment.isMainApplicationRunning()) return;
|
|
||||||
if (ApplicationEnvironment.getCurrentActivity() == null) return;
|
|
||||||
SynergyIdManagerImpl.this.onSynergyEnvironmentStartupRequestsFinished();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.ISynergyNetwork;
|
|
||||||
import com.ea.nimble.SynergyNetworkImpl;
|
|
||||||
|
|
||||||
public class SynergyNetwork {
|
|
||||||
public static final String COMPONENT_ID = "com.ea.nimble.synergynetwork";
|
|
||||||
|
|
||||||
public static ISynergyNetwork getComponent() {
|
|
||||||
return SynergyNetworkImpl.getComponent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,243 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.BaseCore;
|
|
||||||
import com.ea.nimble.HttpResponse;
|
|
||||||
import com.ea.nimble.IOperationalTelemetryDispatch;
|
|
||||||
import com.ea.nimble.ISynergyRequest;
|
|
||||||
import com.ea.nimble.ISynergyResponse;
|
|
||||||
import com.ea.nimble.Log;
|
|
||||||
import com.ea.nimble.Network;
|
|
||||||
import com.ea.nimble.NetworkConnectionCallback;
|
|
||||||
import com.ea.nimble.NetworkConnectionHandle;
|
|
||||||
import com.ea.nimble.OperationalTelemetryDispatch;
|
|
||||||
import com.ea.nimble.OperationalTelemetryEvent;
|
|
||||||
import com.ea.nimble.SynergyNetworkConnectionCallback;
|
|
||||||
import com.ea.nimble.SynergyNetworkConnectionHandle;
|
|
||||||
import com.ea.nimble.SynergyRequest;
|
|
||||||
import com.ea.nimble.SynergyResponse;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
class SynergyNetworkConnection
|
|
||||||
implements SynergyNetworkConnectionHandle {
|
|
||||||
private SynergyNetworkConnectionCallback m_completionCallback;
|
|
||||||
private SynergyNetworkConnectionCallback m_headerCallback;
|
|
||||||
private NetworkConnectionHandle m_networkHandle = null;
|
|
||||||
private SynergyOperationalTelemetryDispatch m_otDispatch;
|
|
||||||
private SynergyNetworkConnectionCallback m_progressCallback;
|
|
||||||
private SynergyRequest m_request;
|
|
||||||
private SynergyResponse m_response;
|
|
||||||
|
|
||||||
public SynergyNetworkConnection(SynergyRequest synergyRequest, SynergyNetworkConnectionCallback synergyNetworkConnectionCallback) {
|
|
||||||
this.m_request = synergyRequest;
|
|
||||||
this.m_response = new SynergyResponse();
|
|
||||||
this.m_otDispatch = new SynergyOperationalTelemetryDispatch();
|
|
||||||
this.m_headerCallback = null;
|
|
||||||
this.m_progressCallback = null;
|
|
||||||
this.m_completionCallback = synergyNetworkConnectionCallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
static /* synthetic */ NetworkConnectionHandle access$102(SynergyNetworkConnection synergyNetworkConnection, NetworkConnectionHandle networkConnectionHandle) {
|
|
||||||
synergyNetworkConnection.m_networkHandle = networkConnectionHandle;
|
|
||||||
return networkConnectionHandle;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void parseDataFromNetworkHandle() {
|
|
||||||
if (this.m_networkHandle == null) return;
|
|
||||||
this.m_response.httpResponse = this.m_networkHandle.getResponse();
|
|
||||||
this.m_response.parseData();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateNetworkHeaderHandler() {
|
|
||||||
if (this.m_headerCallback == null) {
|
|
||||||
this.m_networkHandle.setHeaderCallback(null);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.m_networkHandle.setHeaderCallback(new NetworkConnectionCallback(){
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void callback(NetworkConnectionHandle networkConnectionHandle) {
|
|
||||||
SynergyNetworkConnection.this.m_headerCallback.callback(SynergyNetworkConnection.this);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateNetworkProgressHandler() {
|
|
||||||
if (this.m_progressCallback == null) {
|
|
||||||
this.m_networkHandle.setProgressCallback(null);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.m_networkHandle.setProgressCallback(new NetworkConnectionCallback(){
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void callback(NetworkConnectionHandle networkConnectionHandle) {
|
|
||||||
SynergyNetworkConnection.this.m_progressCallback.callback(SynergyNetworkConnection.this);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void cancel() {
|
|
||||||
if (this.m_networkHandle == null) return;
|
|
||||||
this.m_networkHandle.cancel();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void errorPriorToSend(Exception exception) {
|
|
||||||
HttpResponse httpResponse = new HttpResponse();
|
|
||||||
httpResponse.error = exception;
|
|
||||||
httpResponse.isCompleted = true;
|
|
||||||
this.m_response.httpResponse = httpResponse;
|
|
||||||
if (this.m_completionCallback == null) return;
|
|
||||||
this.m_completionCallback.callback(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SynergyNetworkConnectionCallback getCompletionCallback() {
|
|
||||||
return this.m_completionCallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SynergyNetworkConnectionCallback getHeaderCallback() {
|
|
||||||
return this.m_headerCallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
public NetworkConnectionHandle getNetworkConnectionHandle() {
|
|
||||||
return this.m_networkHandle;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SynergyNetworkConnectionCallback getProgressCallback() {
|
|
||||||
return this.m_progressCallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ISynergyRequest getRequest() {
|
|
||||||
return this.m_request;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ISynergyResponse getResponse() {
|
|
||||||
return this.m_response;
|
|
||||||
}
|
|
||||||
|
|
||||||
void send() {
|
|
||||||
try {
|
|
||||||
this.m_request.build();
|
|
||||||
this.m_networkHandle = Network.getComponent().sendRequest(this.m_request.httpRequest, new NetworkConnectionCallback(){
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void callback(NetworkConnectionHandle networkConnectionHandle) {
|
|
||||||
if (SynergyNetworkConnection.this.m_networkHandle == null) {
|
|
||||||
SynergyNetworkConnection.access$102(SynergyNetworkConnection.this, networkConnectionHandle);
|
|
||||||
}
|
|
||||||
SynergyNetworkConnection.this.parseDataFromNetworkHandle();
|
|
||||||
networkConnectionHandle.setHeaderCallback(null);
|
|
||||||
networkConnectionHandle.setProgressCallback(null);
|
|
||||||
networkConnectionHandle.setCompletionCallback(null);
|
|
||||||
if (SynergyNetworkConnection.this.m_completionCallback == null) return;
|
|
||||||
SynergyNetworkConnection.this.m_completionCallback.callback(SynergyNetworkConnection.this);
|
|
||||||
}
|
|
||||||
}, this.m_otDispatch);
|
|
||||||
this.m_response.httpResponse = this.m_networkHandle.getResponse();
|
|
||||||
this.updateNetworkHeaderHandler();
|
|
||||||
this.updateNetworkProgressHandler();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
catch (Exception exception) {
|
|
||||||
this.errorPriorToSend(exception);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setCompletionCallback(SynergyNetworkConnectionCallback synergyNetworkConnectionCallback) {
|
|
||||||
this.m_completionCallback = synergyNetworkConnectionCallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setHeaderCallback(SynergyNetworkConnectionCallback synergyNetworkConnectionCallback) {
|
|
||||||
this.m_headerCallback = synergyNetworkConnectionCallback;
|
|
||||||
if (this.m_networkHandle == null) return;
|
|
||||||
this.updateNetworkHeaderHandler();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNetworkConnectionHandle(NetworkConnectionHandle networkConnectionHandle) {
|
|
||||||
this.m_networkHandle = networkConnectionHandle;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setProgressCallback(SynergyNetworkConnectionCallback synergyNetworkConnectionCallback) {
|
|
||||||
this.m_progressCallback = synergyNetworkConnectionCallback;
|
|
||||||
if (this.m_networkHandle == null) return;
|
|
||||||
this.updateNetworkProgressHandler();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void start() {
|
|
||||||
this.m_request.prepare(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void waitOn() {
|
|
||||||
if (this.m_networkHandle == null) return;
|
|
||||||
this.m_networkHandle.waitOn();
|
|
||||||
}
|
|
||||||
|
|
||||||
private class SynergyOperationalTelemetryDispatch
|
|
||||||
implements IOperationalTelemetryDispatch {
|
|
||||||
private SynergyOperationalTelemetryDispatch() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<OperationalTelemetryEvent> getEvents(String string2) {
|
|
||||||
if (!BaseCore.getInstance().isActive()) {
|
|
||||||
Log.Helper.LOGV(this, "BaseCore not active for operational telemetry logging.", new Object[0]);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
IOperationalTelemetryDispatch iOperationalTelemetryDispatch = OperationalTelemetryDispatch.getComponent();
|
|
||||||
if (iOperationalTelemetryDispatch == null) return null;
|
|
||||||
return iOperationalTelemetryDispatch.getEvents(string2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMaxEventCount(String string2) {
|
|
||||||
if (!BaseCore.getInstance().isActive()) {
|
|
||||||
Log.Helper.LOGV(this, "BaseCore not active for operational telemetry logging.", new Object[0]);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
IOperationalTelemetryDispatch iOperationalTelemetryDispatch = OperationalTelemetryDispatch.getComponent();
|
|
||||||
if (iOperationalTelemetryDispatch == null) return -1;
|
|
||||||
return iOperationalTelemetryDispatch.getMaxEventCount(string2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void logEvent(String string2, Map<String, String> map) {
|
|
||||||
if (!BaseCore.getInstance().isActive()) {
|
|
||||||
Log.Helper.LOGV(this, "BaseCore not active for operational telemetry logging.", new Object[0]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
IOperationalTelemetryDispatch iOperationalTelemetryDispatch = OperationalTelemetryDispatch.getComponent();
|
|
||||||
if (iOperationalTelemetryDispatch == null) return;
|
|
||||||
SynergyNetworkConnection.this.parseDataFromNetworkHandle();
|
|
||||||
Map<String, Object> map2 = SynergyNetworkConnection.this.m_response.getJsonData();
|
|
||||||
if (map2 != null && map2.containsKey("resultCode")) {
|
|
||||||
map.put("SYNERGY_RESULT_CODE", ((Integer)map2.get("resultCode")).toString());
|
|
||||||
}
|
|
||||||
iOperationalTelemetryDispatch.logEvent(string2, map);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setMaxEventCount(String string2, int n2) {
|
|
||||||
if (!BaseCore.getInstance().isActive()) {
|
|
||||||
Log.Helper.LOGV(this, "BaseCore not active for operational telemetry logging.", new Object[0]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
IOperationalTelemetryDispatch iOperationalTelemetryDispatch = OperationalTelemetryDispatch.getComponent();
|
|
||||||
if (iOperationalTelemetryDispatch == null) return;
|
|
||||||
iOperationalTelemetryDispatch.setMaxEventCount(string2, n2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.SynergyNetworkConnectionHandle;
|
|
||||||
|
|
||||||
public interface SynergyNetworkConnectionCallback {
|
|
||||||
public void callback(SynergyNetworkConnectionHandle var1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.ISynergyRequest;
|
|
||||||
import com.ea.nimble.ISynergyResponse;
|
|
||||||
import com.ea.nimble.SynergyNetworkConnectionCallback;
|
|
||||||
|
|
||||||
public interface SynergyNetworkConnectionHandle {
|
|
||||||
public void cancel();
|
|
||||||
|
|
||||||
public SynergyNetworkConnectionCallback getCompletionCallback();
|
|
||||||
|
|
||||||
public SynergyNetworkConnectionCallback getHeaderCallback();
|
|
||||||
|
|
||||||
public SynergyNetworkConnectionCallback getProgressCallback();
|
|
||||||
|
|
||||||
public ISynergyRequest getRequest();
|
|
||||||
|
|
||||||
public ISynergyResponse getResponse();
|
|
||||||
|
|
||||||
public void setCompletionCallback(SynergyNetworkConnectionCallback var1);
|
|
||||||
|
|
||||||
public void setHeaderCallback(SynergyNetworkConnectionCallback var1);
|
|
||||||
|
|
||||||
public void setProgressCallback(SynergyNetworkConnectionCallback var1);
|
|
||||||
|
|
||||||
public void waitOn();
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,140 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*
|
|
||||||
* Could not load the following classes:
|
|
||||||
* android.content.BroadcastReceiver
|
|
||||||
* android.content.Context
|
|
||||||
* android.content.Intent
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import android.content.BroadcastReceiver;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
public class SynergyNetworkImpl
|
|
||||||
extends Component
|
|
||||||
implements ISynergyNetwork {
|
|
||||||
private ArrayList<SynergyNetworkConnection> m_pendingRequests = null;
|
|
||||||
private String m_sessionId;
|
|
||||||
private BroadcastReceiver m_synergyEnvironmentNotifyReceiver = null;
|
|
||||||
|
|
||||||
SynergyNetworkImpl() {
|
|
||||||
}
|
|
||||||
|
|
||||||
private String generateSessionId() {
|
|
||||||
return UUID.randomUUID().toString().replace("-", "").toLowerCase(Locale.US);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ISynergyNetwork getComponent() {
|
|
||||||
return (ISynergyNetwork)(Base.getComponent("com.ea.nimble.synergynetwork"));
|
|
||||||
}
|
|
||||||
|
|
||||||
private SynergyNetworkConnectionHandle sendSynergyRequest(SynergyRequest object, SynergyNetworkConnectionCallback synergyNetworkConnectionCallback) {
|
|
||||||
SynergyNetworkConnection synergyNetworkConnection = new SynergyNetworkConnection(object, synergyNetworkConnectionCallback);
|
|
||||||
synergyNetworkConnection.start();
|
|
||||||
return synergyNetworkConnection;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void cleanup() {
|
|
||||||
if (this.m_synergyEnvironmentNotifyReceiver != null) {
|
|
||||||
Utility.unregisterReceiver(this.m_synergyEnvironmentNotifyReceiver);
|
|
||||||
this.m_synergyEnvironmentNotifyReceiver = null;
|
|
||||||
}
|
|
||||||
this.m_pendingRequests.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getComponentId() {
|
|
||||||
return "com.ea.nimble.synergynetwork";
|
|
||||||
}
|
|
||||||
|
|
||||||
String getSessionId() {
|
|
||||||
return this.m_sessionId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void restore() {
|
|
||||||
if (SynergyEnvironment.getComponent().isDataAvailable()) return;
|
|
||||||
this.m_synergyEnvironmentNotifyReceiver = new BroadcastReceiver(){
|
|
||||||
|
|
||||||
public void onReceive(Context object, Intent intent) {
|
|
||||||
|
|
||||||
for (SynergyNetworkConnection m_pendingRequest : SynergyNetworkImpl.this.m_pendingRequests)
|
|
||||||
if (intent.getStringExtra("result").equals("0"))
|
|
||||||
m_pendingRequest.errorPriorToSend(new Error(Error.Code.SYNERGY_ENVIRONMENT_UPDATE_FAILURE, "Failed to retrieve Environment data from Synergy"));
|
|
||||||
else
|
|
||||||
m_pendingRequest.start();
|
|
||||||
|
|
||||||
SynergyNetworkImpl.this.m_pendingRequests.clear();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Utility.registerReceiver("nimble.environment.notification.startup_requests_finished", this.m_synergyEnvironmentNotifyReceiver);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void resume() {
|
|
||||||
this.m_sessionId = this.generateSessionId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SynergyNetworkConnectionHandle sendGetRequest(String string2, String object, Map<String, String> map, SynergyNetworkConnectionCallback synergyNetworkConnectionCallback) {
|
|
||||||
SynergyRequest synergyRequest = new SynergyRequest(object, IHttpRequest.Method.GET, null);
|
|
||||||
synergyRequest.baseUrl = string2;
|
|
||||||
synergyRequest.urlParameters = map;
|
|
||||||
return this.sendSynergyRequest(synergyRequest, synergyNetworkConnectionCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SynergyNetworkConnectionHandle sendPostRequest(String string2, String object, Map<String, String> map, Map<String, Object> map2, SynergyNetworkConnectionCallback synergyNetworkConnectionCallback) {
|
|
||||||
SynergyRequest synergyRequest = new SynergyRequest(object, IHttpRequest.Method.POST, null);
|
|
||||||
synergyRequest.baseUrl = string2;
|
|
||||||
synergyRequest.urlParameters = map;
|
|
||||||
synergyRequest.jsonData = map2;
|
|
||||||
return this.sendSynergyRequest(synergyRequest, synergyNetworkConnectionCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SynergyNetworkConnectionHandle sendPostRequest(String string2, String object, Map<String, String> map, Map<String, Object> map2, SynergyNetworkConnectionCallback synergyNetworkConnectionCallback, Map<String, String> map3) {
|
|
||||||
SynergyRequest synergyRequest = new SynergyRequest((String) object, IHttpRequest.Method.POST, null);
|
|
||||||
synergyRequest.baseUrl = string2;
|
|
||||||
synergyRequest.urlParameters = map;
|
|
||||||
synergyRequest.jsonData = map2;
|
|
||||||
if (map3 == null) return this.sendSynergyRequest(synergyRequest, synergyNetworkConnectionCallback);
|
|
||||||
synergyRequest.httpRequest.headers.putAll(map3);
|
|
||||||
return this.sendSynergyRequest(synergyRequest, synergyNetworkConnectionCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void sendRequest(SynergyRequest object, SynergyNetworkConnectionCallback object2) {
|
|
||||||
ISynergyEnvironment iSynergyEnvironment = SynergyEnvironment.getComponent();
|
|
||||||
if (iSynergyEnvironment.isDataAvailable()) {
|
|
||||||
this.sendSynergyRequest(object, object2);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
SynergyNetworkConnection synergyNetworkConnection = new SynergyNetworkConnection(object, object2);
|
|
||||||
if (iSynergyEnvironment.isUpdateInProgress()) {
|
|
||||||
this.m_pendingRequests.add(synergyNetworkConnection);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Error error = iSynergyEnvironment.checkAndInitiateSynergyEnvironmentUpdate();
|
|
||||||
if (error == null) {
|
|
||||||
this.m_pendingRequests.add(synergyNetworkConnection);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
synergyNetworkConnection.errorPriorToSend((Exception)object2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setup() {
|
|
||||||
this.m_pendingRequests = new ArrayList();
|
|
||||||
this.m_sessionId = this.generateSessionId();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class SynergyRequest
|
|
||||||
implements ISynergyRequest {
|
|
||||||
public String api;
|
|
||||||
public String baseUrl;
|
|
||||||
public HttpRequest httpRequest;
|
|
||||||
public Map<String, Object> jsonData;
|
|
||||||
private SynergyNetworkConnection m_connection;
|
|
||||||
public SynergyRequestPreparingCallback prepareRequestCallback;
|
|
||||||
public Map<String, String> urlParameters;
|
|
||||||
|
|
||||||
public SynergyRequest(String string2, IHttpRequest.Method method, SynergyRequestPreparingCallback synergyRequestPreparingCallback) {
|
|
||||||
this.api = string2;
|
|
||||||
this.httpRequest = new HttpRequest();
|
|
||||||
this.prepareRequestCallback = synergyRequestPreparingCallback;
|
|
||||||
this.urlParameters = null;
|
|
||||||
this.jsonData = null;
|
|
||||||
this.httpRequest.method = method;
|
|
||||||
this.httpRequest.headers.put("Content-Type", "application/json");
|
|
||||||
this.httpRequest.headers.put("SDK-VERSION", "1.23.14.1217");
|
|
||||||
this.httpRequest.headers.put("SDK-TYPE", "Nimble");
|
|
||||||
this.httpRequest.headers.put("EAM-USER-ID", SynergyIdManager.getComponent().getSynergyId());
|
|
||||||
this.httpRequest.headers.put("EA-SELL-ID", SynergyEnvironment.getComponent().getSellId());
|
|
||||||
this.httpRequest.headers.put("EAM-SESSION", ((SynergyNetworkImpl)SynergyNetwork.getComponent()).getSessionId());
|
|
||||||
}
|
|
||||||
|
|
||||||
void build() throws Error {
|
|
||||||
if (!Utility.validString(this.baseUrl) || !Utility.validString(this.api)) {
|
|
||||||
throw new Error(Error.Code.INVALID_ARGUMENT, String.format("Invalid synergy request parameter (%s, %s) to build http request url", this.baseUrl, this.api));
|
|
||||||
}
|
|
||||||
IApplicationEnvironment object = ApplicationEnvironment.getComponent();
|
|
||||||
HashMap<String, String> object2 = new HashMap<String, String>();
|
|
||||||
object2.put("appVer", object.getApplicationVersion());
|
|
||||||
object2.put("appLang", object.getShortApplicationLanguageCode());
|
|
||||||
object2.put("localization", object.getApplicationLanguageCode());
|
|
||||||
object2.put("deviceLanguage", Locale.getDefault().getLanguage());
|
|
||||||
object2.put("deviceLocale", Locale.getDefault().toString());
|
|
||||||
String eaHardwareId = SynergyEnvironment.getComponent().getEAHardwareId();
|
|
||||||
if (Utility.validString(eaHardwareId)) {
|
|
||||||
object2.put("hwId", eaHardwareId);
|
|
||||||
}
|
|
||||||
if (this.urlParameters != null) {
|
|
||||||
object2.putAll(this.urlParameters);
|
|
||||||
}
|
|
||||||
this.httpRequest.url = Network.generateURL(this.baseUrl + this.api, object2);
|
|
||||||
if (this.httpRequest.method != IHttpRequest.Method.POST) {
|
|
||||||
if (this.httpRequest.method != IHttpRequest.Method.PUT) return;
|
|
||||||
}
|
|
||||||
if (this.jsonData == null) return;
|
|
||||||
if (this.jsonData.size() <= 0) return;
|
|
||||||
String s = Utility.convertObjectToJSONString(this.jsonData);
|
|
||||||
this.httpRequest.data = new ByteArrayOutputStream();
|
|
||||||
try {
|
|
||||||
this.httpRequest.data.write(s.getBytes());
|
|
||||||
}
|
|
||||||
catch (IOException iOException) {
|
|
||||||
throw new Error(Error.Code.INVALID_ARGUMENT, "Error converting jsonData in SynergyRequest to a data stream", iOException);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getApi() {
|
|
||||||
return this.api;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getBaseUrl() {
|
|
||||||
return this.baseUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public HttpRequest getHttpRequest() {
|
|
||||||
return this.httpRequest;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> getJsonData() {
|
|
||||||
return this.jsonData;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IHttpRequest.Method getMethod() {
|
|
||||||
return this.httpRequest.getMethod();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, String> getUrlParameters() {
|
|
||||||
return this.urlParameters;
|
|
||||||
}
|
|
||||||
|
|
||||||
void prepare(SynergyNetworkConnection synergyNetworkConnection) {
|
|
||||||
this.m_connection = synergyNetworkConnection;
|
|
||||||
if (this.prepareRequestCallback != null) {
|
|
||||||
this.prepareRequestCallback.prepareRequest(this);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.send();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void send() {
|
|
||||||
this.m_connection.send();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMethod(IHttpRequest.Method method) {
|
|
||||||
this.httpRequest.method = method;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static interface SynergyRequestPreparingCallback {
|
|
||||||
public void prepareRequest(SynergyRequest var1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*
|
|
||||||
* Could not load the following classes:
|
|
||||||
* org.json.JSONObject
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.Error;
|
|
||||||
import com.ea.nimble.IHttpResponse;
|
|
||||||
import com.ea.nimble.ISynergyResponse;
|
|
||||||
import com.ea.nimble.SynergyServerError;
|
|
||||||
import com.ea.nimble.Utility;
|
|
||||||
import java.util.Map;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
public class SynergyResponse
|
|
||||||
implements ISynergyResponse {
|
|
||||||
public Error error = null;
|
|
||||||
public IHttpResponse httpResponse = null;
|
|
||||||
public Map<String, Object> jsonData = null;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Exception getError() {
|
|
||||||
if (this.error != null) return this.error;
|
|
||||||
if (this.httpResponse != null) return this.httpResponse.getError();
|
|
||||||
return this.error;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IHttpResponse getHttpResponse() {
|
|
||||||
return this.httpResponse;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> getJsonData() {
|
|
||||||
return this.jsonData;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isCompleted() {
|
|
||||||
if (this.httpResponse != null) return this.httpResponse.isCompleted();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void parseData() {
|
|
||||||
if (this.jsonData != null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (this.httpResponse != null && this.httpResponse.getError() == null) {
|
|
||||||
String string2 = "<empty>";
|
|
||||||
try {
|
|
||||||
String string3;
|
|
||||||
string2 = string3 = Utility.readStringFromStream(this.httpResponse.getDataStream());
|
|
||||||
this.jsonData = Utility.convertJSONObjectToMap(new JSONObject(string3));
|
|
||||||
if (!this.jsonData.containsKey("resultCode")) return;
|
|
||||||
int n2 = (Integer)this.jsonData.get("resultCode");
|
|
||||||
if (n2 >= 0) return;
|
|
||||||
this.error = new SynergyServerError(n2, (String)this.jsonData.get("message"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
catch (Exception exception) {
|
|
||||||
this.jsonData = null;
|
|
||||||
this.error = new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Unparseable synergy json response " + string2);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.jsonData = null;
|
|
||||||
this.error = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import com.ea.nimble.Error;
|
|
||||||
|
|
||||||
public class SynergyServerError
|
|
||||||
extends Error {
|
|
||||||
public static final String ERROR_DOMAIN = "SynergyServerError";
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
public SynergyServerError() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public SynergyServerError(int n2, String string2) {
|
|
||||||
super(ERROR_DOMAIN, n2, string2, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SynergyServerError(int n2, String string2, Throwable throwable) {
|
|
||||||
super(ERROR_DOMAIN, n2, string2, throwable);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isError(int n2) {
|
|
||||||
if (this.getCode() != n2) return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static enum Code {
|
|
||||||
ERROR_NONCE_VERIFICATION(-30013),
|
|
||||||
ERROR_SIGNATURE_VERIFICATION(-30014),
|
|
||||||
ERROR_NOT_SUPPORTED_RECEIPT_TYPE(-30015),
|
|
||||||
AMAZON_SERVER_CONNECTION_ERROR(-30016),
|
|
||||||
APPLE_SERVER_CONNECTION_ERROR(10001);
|
|
||||||
|
|
||||||
private int m_value;
|
|
||||||
|
|
||||||
private Code(int n3) {
|
|
||||||
this.m_value = n3;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int intValue() {
|
|
||||||
return this.m_value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,136 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*
|
|
||||||
* Could not load the following classes:
|
|
||||||
* android.os.Handler
|
|
||||||
* android.os.Looper
|
|
||||||
* android.os.SystemClock
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.os.Looper;
|
|
||||||
import android.os.SystemClock;
|
|
||||||
import com.ea.nimble.Log;
|
|
||||||
|
|
||||||
public class Timer {
|
|
||||||
private static Handler s_handler = new Handler(Looper.getMainLooper());
|
|
||||||
private long m_fireTime;
|
|
||||||
private long m_pauseTime;
|
|
||||||
private boolean m_paused;
|
|
||||||
private boolean m_running;
|
|
||||||
private Runnable m_task;
|
|
||||||
private Runnable m_taskToRun;
|
|
||||||
private long m_timeInterval;
|
|
||||||
|
|
||||||
public Timer(Runnable runnable) {
|
|
||||||
this.m_task = runnable;
|
|
||||||
this.m_running = false;
|
|
||||||
this.m_paused = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static /* synthetic */ boolean access$102(Timer timer, boolean bl2) {
|
|
||||||
timer.m_running = bl2;
|
|
||||||
return bl2;
|
|
||||||
}
|
|
||||||
|
|
||||||
static /* synthetic */ long access$302(Timer timer, long l2) {
|
|
||||||
timer.m_fireTime = l2;
|
|
||||||
return l2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void cancel() {
|
|
||||||
if (!this.m_running) return;
|
|
||||||
if (!this.m_paused) {
|
|
||||||
s_handler.removeCallbacks(this.m_taskToRun);
|
|
||||||
}
|
|
||||||
this.m_running = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void fire() {
|
|
||||||
this.cancel();
|
|
||||||
this.m_task.run();
|
|
||||||
if (!(this.m_taskToRun instanceof RepeatingTask)) return;
|
|
||||||
if (this.m_paused) {
|
|
||||||
this.m_fireTime = this.m_pauseTime + this.m_timeInterval;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.m_fireTime = SystemClock.uptimeMillis() + this.m_timeInterval;
|
|
||||||
s_handler.postDelayed(this.m_taskToRun, this.m_timeInterval);
|
|
||||||
this.m_running = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isPaused() {
|
|
||||||
return this.m_paused;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isRunning() {
|
|
||||||
return this.m_running;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void pause() {
|
|
||||||
if (this.m_paused) return;
|
|
||||||
if (!this.m_running) return;
|
|
||||||
this.m_pauseTime = SystemClock.uptimeMillis();
|
|
||||||
s_handler.removeCallbacks(this.m_taskToRun);
|
|
||||||
this.m_paused = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void resume() {
|
|
||||||
if (!this.m_paused) return;
|
|
||||||
if (!this.m_running) return;
|
|
||||||
this.m_fireTime += SystemClock.uptimeMillis() - this.m_pauseTime;
|
|
||||||
s_handler.postAtTime(this.m_taskToRun, this.m_fireTime);
|
|
||||||
this.m_paused = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void schedule(double d2, boolean bl2) {
|
|
||||||
this.cancel();
|
|
||||||
if (d2 < 0.1) {
|
|
||||||
if (bl2) {
|
|
||||||
Log.Helper.LOGES(null, "Timer scheduled to repeat for %.2f seconds, running only once", d2);
|
|
||||||
}
|
|
||||||
if (Looper.myLooper() == Looper.getMainLooper()) {
|
|
||||||
this.m_task.run();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
s_handler.post(this.m_task);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.m_timeInterval = (long)(1000.0 * d2);
|
|
||||||
this.m_fireTime = SystemClock.uptimeMillis() + this.m_timeInterval;
|
|
||||||
this.m_taskToRun = bl2 ? new RepeatingTask() : new SingleRunTask();
|
|
||||||
s_handler.postDelayed(this.m_taskToRun, this.m_timeInterval);
|
|
||||||
this.m_running = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private class RepeatingTask
|
|
||||||
implements Runnable {
|
|
||||||
private RepeatingTask() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (Timer.this.m_paused) return;
|
|
||||||
if (!Timer.this.m_running) return;
|
|
||||||
Timer.this.m_task.run();
|
|
||||||
Timer.access$302(Timer.this, SystemClock.uptimeMillis() + Timer.this.m_fireTime);
|
|
||||||
s_handler.postDelayed((Runnable)this, Timer.this.m_timeInterval);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class SingleRunTask
|
|
||||||
implements Runnable {
|
|
||||||
private SingleRunTask() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (Timer.this.m_paused) return;
|
|
||||||
if (!Timer.this.m_running) return;
|
|
||||||
Timer.access$102(Timer.this, false);
|
|
||||||
Timer.this.m_task.run();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,274 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*
|
|
||||||
* Could not load the following classes:
|
|
||||||
* android.content.BroadcastReceiver
|
|
||||||
* android.content.Context
|
|
||||||
* android.content.Intent
|
|
||||||
* android.content.IntentFilter
|
|
||||||
* android.support.v4.content.LocalBroadcastManager
|
|
||||||
* org.json.JSONArray
|
|
||||||
* org.json.JSONException
|
|
||||||
* org.json.JSONObject
|
|
||||||
*/
|
|
||||||
package com.ea.nimble;
|
|
||||||
|
|
||||||
import android.content.BroadcastReceiver;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.IntentFilter;
|
|
||||||
import android.content.res.XmlResourceParser;
|
|
||||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
|
||||||
import org.json.JSONArray;
|
|
||||||
import org.json.JSONException;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.io.StringWriter;
|
|
||||||
import java.security.MessageDigest;
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.TimeZone;
|
|
||||||
|
|
||||||
public final class Utility {
|
|
||||||
private Utility() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String SHA256HashString(String object) {
|
|
||||||
MessageDigest object2;
|
|
||||||
if (object == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
object2 = MessageDigest.getInstance("SHA-256");
|
|
||||||
object2.reset();
|
|
||||||
}
|
|
||||||
catch (NoSuchAlgorithmException noSuchAlgorithmException) {
|
|
||||||
Log.Helper.LOGES(null, "Can't find SHA-256 algorithm");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
byte[] digest = object2.digest(object.getBytes());
|
|
||||||
StringBuffer stringBuffer = new StringBuffer();
|
|
||||||
int n2 = 0;
|
|
||||||
|
|
||||||
while (n2 < digest.length) {
|
|
||||||
stringBuffer.append(Integer.toString((digest[n2] & 0xFF) + 256, 16).substring(1));
|
|
||||||
++n2;
|
|
||||||
}
|
|
||||||
return stringBuffer.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String bytesToHexString(byte[] byArray) {
|
|
||||||
char[] cArray = "0123456789ABCDEF".toCharArray();
|
|
||||||
char[] cArray2 = new char[byArray.length * 2];
|
|
||||||
int n2 = 0;
|
|
||||||
while (n2 < byArray.length) {
|
|
||||||
int n3 = byArray[n2] & 0xFF;
|
|
||||||
cArray2[n2 * 2] = cArray[n3 >> 4];
|
|
||||||
cArray2[n2 * 2 + 1] = cArray[n3 & 0xF];
|
|
||||||
++n2;
|
|
||||||
}
|
|
||||||
return new String(cArray2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<Object> convertJSONArrayToList(JSONArray jSONArray) {
|
|
||||||
ArrayList<Object> arrayList = new ArrayList<>();
|
|
||||||
if (jSONArray != null)
|
|
||||||
for (int i=0;i<jSONArray.length();i++)
|
|
||||||
try {
|
|
||||||
arrayList.add(jSONArray.get(i));
|
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
return arrayList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Map<String, Object> convertJSONObjectStringToMap(String object) {
|
|
||||||
try {
|
|
||||||
return Utility.convertJSONObjectToMap(new JSONObject(object));
|
|
||||||
}
|
|
||||||
catch (JSONException jSONException) {
|
|
||||||
jSONException.printStackTrace();
|
|
||||||
return new HashMap<String, Object>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Map<String, Object> convertJSONObjectToMap(JSONObject jSONObject) {
|
|
||||||
|
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
|
||||||
Iterator<String> keys = jSONObject.keys();
|
|
||||||
while(keys.hasNext()) {
|
|
||||||
String key = keys.next();
|
|
||||||
Object value = null;
|
|
||||||
try {
|
|
||||||
value = jSONObject.get(key);
|
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (value instanceof JSONArray) {
|
|
||||||
value = convertJSONArrayToList((JSONArray) value);
|
|
||||||
} else if (value instanceof JSONObject) {
|
|
||||||
value = convertJSONObjectToMap((JSONObject) value);
|
|
||||||
}
|
|
||||||
map.put(key, value);
|
|
||||||
} return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String convertObjectToJSONString(Object object) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean getTestResult() {
|
|
||||||
if (5 + 5 != 10) return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getUTCDateStringFormat(Date date) {
|
|
||||||
if (date == null) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.US);
|
|
||||||
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
|
||||||
return simpleDateFormat.format(date);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isOnlyDecimalCharacters(String string2) {
|
|
||||||
if (string2 == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
int n2 = 0;
|
|
||||||
while (n2 < string2.length()) {
|
|
||||||
if (!Character.isDigit(string2.charAt(n2))) return false;
|
|
||||||
++n2;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* WARNING - Removed back jump from a try to a catch block - possible behaviour change.
|
|
||||||
* Enabled unnecessary exception pruning
|
|
||||||
*/
|
|
||||||
public static LinkedHashMap parseXmlFile(int i) {
|
|
||||||
XmlResourceParser xmlResourceParser = null;
|
|
||||||
LinkedHashMap linkedHashMap;
|
|
||||||
try {
|
|
||||||
xmlResourceParser = null;
|
|
||||||
XmlResourceParser xmlResourceParser2 = null;
|
|
||||||
try {
|
|
||||||
XmlResourceParser xml = ApplicationEnvironment.getComponent().getApplicationContext().getResources().getXml(i);
|
|
||||||
LinkedHashMap linkedHashMap2 = new LinkedHashMap();
|
|
||||||
String str = null;
|
|
||||||
int eventType = xml.getEventType();
|
|
||||||
while (eventType != 1) {
|
|
||||||
if (eventType == 2) {
|
|
||||||
str = xml.getName();
|
|
||||||
} else {
|
|
||||||
str = str;
|
|
||||||
if (eventType == 4) {
|
|
||||||
linkedHashMap2.put(str, xml.getText());
|
|
||||||
str = str;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
eventType = xml.next();
|
|
||||||
}
|
|
||||||
xmlResourceParser2 = xml;
|
|
||||||
xmlResourceParser = xml;
|
|
||||||
xml.close();
|
|
||||||
linkedHashMap = linkedHashMap2;
|
|
||||||
xml.close();
|
|
||||||
return linkedHashMap2;
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.Helper.LOGES(null, "Error reading xml file: " + e.toString());
|
|
||||||
if (xmlResourceParser2 != null) {
|
|
||||||
xmlResourceParser2.close();
|
|
||||||
}
|
|
||||||
linkedHashMap = null;
|
|
||||||
}
|
|
||||||
return linkedHashMap;
|
|
||||||
} catch (Throwable th) {
|
|
||||||
if (xmlResourceParser != null) {
|
|
||||||
xmlResourceParser.close();
|
|
||||||
}
|
|
||||||
throw th;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String readStringFromStream(InputStream closeable) throws IOException {
|
|
||||||
int n2;
|
|
||||||
byte[] cArray = new byte[8192];
|
|
||||||
StringWriter stringWriter = new StringWriter();
|
|
||||||
while ((n2 = closeable.read(cArray, 0, 4096)) > 0) {
|
|
||||||
stringWriter.write(Arrays.toString(cArray), 0, n2);
|
|
||||||
}
|
|
||||||
return stringWriter.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void registerReceiver(String string2, BroadcastReceiver broadcastReceiver) {
|
|
||||||
IntentFilter intentFilter = new IntentFilter(string2);
|
|
||||||
LocalBroadcastManager
|
|
||||||
.getInstance(
|
|
||||||
ApplicationEnvironment
|
|
||||||
.getComponent()
|
|
||||||
.getApplicationContext()
|
|
||||||
)
|
|
||||||
.registerReceiver(broadcastReceiver, intentFilter);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String safeString(String string2) {
|
|
||||||
String string3 = string2;
|
|
||||||
if (string2 != null) return string3;
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void sendBroadcast(String string2, Map<String, String> map) {
|
|
||||||
LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(ApplicationEnvironment.getComponent().getApplicationContext());
|
|
||||||
Intent intent = new Intent(string2);
|
|
||||||
if (map != null) {
|
|
||||||
for (String string3 : map.keySet()) {
|
|
||||||
intent.putExtra(string3, map.get(string3));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
localBroadcastManager.sendBroadcast(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void sendBroadcastSerializable(String string2, Map<String, Serializable> map) {
|
|
||||||
LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(ApplicationEnvironment.getComponent().getApplicationContext());
|
|
||||||
Intent intent = new Intent(string2);
|
|
||||||
if (map != null) {
|
|
||||||
for (String string3 : map.keySet()) {
|
|
||||||
intent.putExtra(string3, map.get(string3));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
localBroadcastManager.sendBroadcast(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean stringsAreEquivalent(String string2, String string3) {
|
|
||||||
if (string2 != null && string3 != null) {
|
|
||||||
return string2.compareTo(string3) == 0;
|
|
||||||
}
|
|
||||||
if (string2 == string3) return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void unregisterReceiver(BroadcastReceiver broadcastReceiver) {
|
|
||||||
LocalBroadcastManager.getInstance(ApplicationEnvironment.getComponent().getApplicationContext()).unregisterReceiver(broadcastReceiver);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean validString(String string2) {
|
|
||||||
if (string2 == null) return false;
|
|
||||||
if (string2.length() <= 0) return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*
|
|
||||||
* Could not load the following classes:
|
|
||||||
* android.content.BroadcastReceiver
|
|
||||||
* android.content.Context
|
|
||||||
* android.content.Intent
|
|
||||||
* android.os.Bundle
|
|
||||||
*/
|
|
||||||
package com.ea.nimble.bridge;
|
|
||||||
|
|
||||||
import android.content.BroadcastReceiver;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import com.ea.nimble.NetworkConnectionCallback;
|
|
||||||
import com.ea.nimble.NetworkConnectionHandle;
|
|
||||||
import com.ea.nimble.SynergyNetworkConnectionCallback;
|
|
||||||
import com.ea.nimble.SynergyNetworkConnectionHandle;
|
|
||||||
import com.ea.nimble.SynergyRequest;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class BaseNativeCallback
|
|
||||||
extends BroadcastReceiver
|
|
||||||
implements NetworkConnectionCallback,
|
|
||||||
SynergyNetworkConnectionCallback,
|
|
||||||
SynergyRequest.SynergyRequestPreparingCallback {
|
|
||||||
private int m_id;
|
|
||||||
|
|
||||||
public BaseNativeCallback(int n2) {
|
|
||||||
this.m_id = n2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static native void nativeCallback(int var0, Object ... var1);
|
|
||||||
|
|
||||||
public static native void nativeFinalize(int var0);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void callback(NetworkConnectionHandle networkConnectionHandle) {
|
|
||||||
BaseNativeCallback.nativeCallback(this.m_id, networkConnectionHandle);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) {
|
|
||||||
BaseNativeCallback.nativeCallback(this.m_id, synergyNetworkConnectionHandle);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void finalize() {
|
|
||||||
BaseNativeCallback.nativeFinalize(this.m_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onReceive(Context object, Intent intent) {
|
|
||||||
Map<String, Object> hashMap = new HashMap<>();
|
|
||||||
Bundle bundle = intent.getExtras();
|
|
||||||
if (bundle != null) {
|
|
||||||
for (String string2 : bundle.keySet()) {
|
|
||||||
hashMap.put(string2, bundle.get(string2));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
BaseNativeCallback.nativeCallback(this.m_id, intent.getAction(), hashMap);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void prepareRequest(SynergyRequest synergyRequest) {
|
|
||||||
BaseNativeCallback.nativeCallback(this.m_id, synergyRequest);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble.bridge;
|
|
||||||
|
|
||||||
import com.ea.nimble.IFacebook;
|
|
||||||
import com.ea.nimble.bridge.BaseNativeCallback;
|
|
||||||
|
|
||||||
public class FacebookNativeCallback
|
|
||||||
implements IFacebook.FacebookCallback {
|
|
||||||
private int m_id;
|
|
||||||
|
|
||||||
public FacebookNativeCallback(int n2) {
|
|
||||||
this.m_id = n2;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void callback(IFacebook iFacebook, boolean bl2, Exception exception) {
|
|
||||||
BaseNativeCallback.nativeCallback(this.m_id, iFacebook, bl2, exception);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void finalize() {
|
|
||||||
BaseNativeCallback.nativeFinalize(this.m_id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble.bridge;
|
|
||||||
|
|
||||||
import com.ea.nimble.Error;
|
|
||||||
import com.ea.nimble.friends.INimbleOriginFriendsService;
|
|
||||||
import com.ea.nimble.friends.NimbleFriendsList;
|
|
||||||
import com.ea.nimble.friends.NimbleFriendsRefreshCallback;
|
|
||||||
import com.ea.nimble.friends.NimbleFriendsRefreshResult;
|
|
||||||
import com.ea.nimble.friends.NimbleFriendsRefreshScope;
|
|
||||||
import com.ea.nimble.friends.NimbleUser;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class FriendsNativeCallback
|
|
||||||
implements INimbleOriginFriendsService.NimbleFriendInvitationCallback,
|
|
||||||
INimbleOriginFriendsService.NimbleUserSearchCallback,
|
|
||||||
NimbleFriendsRefreshCallback {
|
|
||||||
private int m_id;
|
|
||||||
|
|
||||||
public FriendsNativeCallback(int n2) {
|
|
||||||
this.m_id = n2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void finalize() {
|
|
||||||
BaseNativeCallback.nativeFinalize(this.m_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCallback(NimbleFriendsList nimbleFriendsList, NimbleFriendsRefreshScope nimbleFriendsRefreshScope, NimbleFriendsRefreshResult nimbleFriendsRefreshResult) {
|
|
||||||
BaseNativeCallback.nativeCallback(this.m_id, nimbleFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCallback(ArrayList<NimbleUser> arrayList, Error error) {
|
|
||||||
BaseNativeCallback.nativeCallback(this.m_id, arrayList, error);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCallback(boolean bl2, Error error) {
|
|
||||||
BaseNativeCallback.nativeCallback(this.m_id, bl2, error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble.bridge;
|
|
||||||
|
|
||||||
import com.ea.nimble.bridge.BaseNativeCallback;
|
|
||||||
import com.ea.nimble.identity.INimbleIdentityGenericAuthenticationConductor;
|
|
||||||
import com.ea.nimble.identity.INimbleIdentityGenericLoginResolver;
|
|
||||||
import com.ea.nimble.identity.INimbleIdentityGenericLogoutResolver;
|
|
||||||
|
|
||||||
public class IdentityGenericAuthenticationConductor
|
|
||||||
implements INimbleIdentityGenericAuthenticationConductor {
|
|
||||||
private int m_id;
|
|
||||||
|
|
||||||
public IdentityGenericAuthenticationConductor(int n2) {
|
|
||||||
this.m_id = n2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void finalize() {
|
|
||||||
BaseNativeCallback.nativeFinalize(this.m_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handleLogin(INimbleIdentityGenericLoginResolver iNimbleIdentityGenericLoginResolver) {
|
|
||||||
BaseNativeCallback.nativeCallback(this.m_id, iNimbleIdentityGenericLoginResolver);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handleLogout(INimbleIdentityGenericLogoutResolver iNimbleIdentityGenericLogoutResolver) {
|
|
||||||
BaseNativeCallback.nativeCallback(this.m_id, iNimbleIdentityGenericLogoutResolver, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble.bridge;
|
|
||||||
|
|
||||||
import com.ea.nimble.bridge.BaseNativeCallback;
|
|
||||||
import com.ea.nimble.identity.INimbleIdentityMigrationAuthenticationConductor;
|
|
||||||
import com.ea.nimble.identity.INimbleIdentityMigrationLoginResolver;
|
|
||||||
import com.ea.nimble.identity.INimbleIdentityPendingMigrationResolver;
|
|
||||||
|
|
||||||
public class IdentityMigrationAuthenticationConductor
|
|
||||||
implements INimbleIdentityMigrationAuthenticationConductor {
|
|
||||||
private int m_id;
|
|
||||||
|
|
||||||
public IdentityMigrationAuthenticationConductor(int n2) {
|
|
||||||
this.m_id = n2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void finalize() {
|
|
||||||
BaseNativeCallback.nativeFinalize(this.m_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handleLogin(INimbleIdentityMigrationLoginResolver iNimbleIdentityMigrationLoginResolver) {
|
|
||||||
BaseNativeCallback.nativeCallback(this.m_id, iNimbleIdentityMigrationLoginResolver);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handleLogout() {
|
|
||||||
BaseNativeCallback.nativeCallback(this.m_id, new Object[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handlePendingMigration(INimbleIdentityPendingMigrationResolver iNimbleIdentityPendingMigrationResolver) {
|
|
||||||
BaseNativeCallback.nativeCallback(this.m_id, iNimbleIdentityPendingMigrationResolver, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*
|
|
||||||
* Could not load the following classes:
|
|
||||||
* org.json.JSONObject
|
|
||||||
*/
|
|
||||||
package com.ea.nimble.bridge;
|
|
||||||
|
|
||||||
import com.ea.nimble.Error;
|
|
||||||
import com.ea.nimble.bridge.BaseNativeCallback;
|
|
||||||
import com.ea.nimble.identity.INimbleIdentityAuthenticator;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
public class IdentityNativeCallback
|
|
||||||
implements INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback,
|
|
||||||
INimbleIdentityAuthenticator.NimbleIdentityFriendsIdentityInfoCallback,
|
|
||||||
INimbleIdentityAuthenticator.NimbleIdentityServerAuthCodeCallback {
|
|
||||||
private int m_id;
|
|
||||||
|
|
||||||
public IdentityNativeCallback(int n2) {
|
|
||||||
this.m_id = n2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void finalize() {
|
|
||||||
BaseNativeCallback.nativeFinalize(this.m_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, Error error) {
|
|
||||||
BaseNativeCallback.nativeCallback(this.m_id, iNimbleIdentityAuthenticator, error);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String string2, String string3, String string4, Error error) {
|
|
||||||
BaseNativeCallback.nativeCallback(this.m_id, iNimbleIdentityAuthenticator, string2, string3, string4, error);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, JSONObject jSONObject, Error error) {
|
|
||||||
BaseNativeCallback.nativeCallback(this.m_id, iNimbleIdentityAuthenticator, jSONObject, error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble.bridge;
|
|
||||||
|
|
||||||
import com.ea.nimble.bridge.BaseNativeCallback;
|
|
||||||
import com.ea.nimble.identity.INimbleIdentityPlainAuthenticationConductor;
|
|
||||||
|
|
||||||
public class IdentityPlainAuthenticationConductor
|
|
||||||
implements INimbleIdentityPlainAuthenticationConductor {
|
|
||||||
private int m_id;
|
|
||||||
|
|
||||||
public IdentityPlainAuthenticationConductor(int n2) {
|
|
||||||
this.m_id = n2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void finalize() {
|
|
||||||
BaseNativeCallback.nativeFinalize(this.m_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handleLogin() {
|
|
||||||
BaseNativeCallback.nativeCallback(this.m_id, new Object[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handleLogout() {
|
|
||||||
BaseNativeCallback.nativeCallback(this.m_id, new Object[]{null});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*/
|
|
||||||
package com.ea.nimble.bridge;
|
|
||||||
|
|
||||||
import com.ea.nimble.bridge.BaseNativeCallback;
|
|
||||||
import com.ea.nimble.mtx.INimbleMTX;
|
|
||||||
import com.ea.nimble.mtx.NimbleMTXTransaction;
|
|
||||||
|
|
||||||
public class MTXNativeCallback
|
|
||||||
implements INimbleMTX.FinalizeTransactionCallback,
|
|
||||||
INimbleMTX.ItemGrantedCallback,
|
|
||||||
INimbleMTX.PurchaseTransactionCallback {
|
|
||||||
private int m_id;
|
|
||||||
|
|
||||||
public MTXNativeCallback(int n2) {
|
|
||||||
this.m_id = n2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void finalize() {
|
|
||||||
BaseNativeCallback.nativeFinalize(this.m_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void finalizeComplete(NimbleMTXTransaction nimbleMTXTransaction) {
|
|
||||||
BaseNativeCallback.nativeCallback(this.m_id, nimbleMTXTransaction);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void itemGrantedComplete(NimbleMTXTransaction nimbleMTXTransaction) {
|
|
||||||
BaseNativeCallback.nativeCallback(this.m_id, nimbleMTXTransaction);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void purchaseComplete(NimbleMTXTransaction nimbleMTXTransaction) {
|
|
||||||
BaseNativeCallback.nativeCallback(this.m_id, nimbleMTXTransaction, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void unverifiedReceiptReceived(NimbleMTXTransaction nimbleMTXTransaction) {
|
|
||||||
BaseNativeCallback.nativeCallback(this.m_id, nimbleMTXTransaction, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
package com.ea.nimble.friends;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/friends/INimbleFriends.class */
|
|
||||||
public interface INimbleFriends {
|
|
||||||
public static final int IDENTITY_FRIEND_INFO_REQUEST_LIMIT = 20;
|
|
||||||
public static final String NIMBLE_NOTIFICATION_FRIENDS_LIST_UPDATE = "nimble.notification.friends.update";
|
|
||||||
|
|
||||||
NimbleFriendsList getFriendsList(String str, boolean z);
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
package com.ea.nimble.friends;
|
|
||||||
|
|
||||||
import com.ea.nimble.Error;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/friends/INimbleOriginFriendsService.class */
|
|
||||||
public interface INimbleOriginFriendsService {
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/friends/INimbleOriginFriendsService$NimbleFriendInvitationCallback.class */
|
|
||||||
public interface NimbleFriendInvitationCallback {
|
|
||||||
void onCallback(boolean z, Error error);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/friends/INimbleOriginFriendsService$NimbleUserSearchCallback.class */
|
|
||||||
public interface NimbleUserSearchCallback {
|
|
||||||
void onCallback(ArrayList<NimbleUser> arrayList, Error error);
|
|
||||||
}
|
|
||||||
|
|
||||||
void acceptFriendInvitation(String str, NimbleFriendInvitationCallback nimbleFriendInvitationCallback);
|
|
||||||
|
|
||||||
void declineFriendInvitation(String str, NimbleFriendInvitationCallback nimbleFriendInvitationCallback);
|
|
||||||
|
|
||||||
void listFriendInvitationsReceived(NimbleUserSearchCallback nimbleUserSearchCallback);
|
|
||||||
|
|
||||||
void listFriendInvitationsSent(NimbleUserSearchCallback nimbleUserSearchCallback);
|
|
||||||
|
|
||||||
void searchUserByDisplayName(String str, NimbleUserSearchCallback nimbleUserSearchCallback);
|
|
||||||
|
|
||||||
void searchUserByEmail(String str, NimbleUserSearchCallback nimbleUserSearchCallback);
|
|
||||||
|
|
||||||
void sendFriendInvitation(String str, String str2, NimbleFriendInvitationCallback nimbleFriendInvitationCallback);
|
|
||||||
|
|
||||||
void sendInvitationOverEmail(ArrayList<String> arrayList, String str, String str2, NimbleFriendInvitationCallback nimbleFriendInvitationCallback);
|
|
||||||
|
|
||||||
void sendInvitationOverSMS(ArrayList<String> arrayList, String str, NimbleFriendInvitationCallback nimbleFriendInvitationCallback);
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package com.ea.nimble.friends;
|
|
||||||
|
|
||||||
import com.ea.nimble.Global;
|
|
||||||
import java.util.Date;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
class NimbleFacebookUser extends NimbleUser {
|
|
||||||
|
|
||||||
public NimbleFacebookUser(JSONObject jSONObject) {
|
|
||||||
this.authenticatorId = Global.NIMBLE_AUTHENTICATOR_FACEBOOK;
|
|
||||||
this.userId = jSONObject.optString("id");
|
|
||||||
this.displayName = jSONObject.optString("name");
|
|
||||||
this.imageUrl = jSONObject.optJSONObject("picture").optJSONObject("data").optString("");
|
|
||||||
this.refreshTimestamp = new Date();
|
|
||||||
setPlayedCurrentGame(NimbleUser.PlayedCurrentGameFlag.PLAYED);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
package com.ea.nimble.friends;
|
|
||||||
|
|
||||||
import com.ea.nimble.Base;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriends.class */
|
|
||||||
public class NimbleFriends {
|
|
||||||
public static final String NIMBLE_COMPONENT_ID_FRIENDS = "com.ea.nimble.friends";
|
|
||||||
|
|
||||||
public static INimbleFriends getComponent() {
|
|
||||||
return (INimbleFriends) Base.getComponent(NIMBLE_COMPONENT_ID_FRIENDS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
package com.ea.nimble.friends;
|
|
||||||
|
|
||||||
import com.ea.nimble.Error;
|
|
||||||
|
|
||||||
public class NimbleFriendsError extends Error {
|
|
||||||
public static final String NIMBLE_FRIENDS_ERROR_DOMAIN = "NimbleFriendsError";
|
|
||||||
private static final long serialVersionUID = 1;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsError$Code.class */
|
|
||||||
public enum Code {
|
|
||||||
NIMBLE_FRIENDS_FACEBOOK_NOT_AVAILABLE(90000),
|
|
||||||
NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE(90001),
|
|
||||||
NIMBLE_FRIENDS_FACEBOOK_USER_NOT_LOGGED_IN(90002),
|
|
||||||
NIMBLE_FRIENDS_EMAIL_NOT_AVAILABLE(90003),
|
|
||||||
NIMBLE_FRIENDS_SMS_NOT_AVAILABLE(90004),
|
|
||||||
NIMBLE_FRIENDS_EMAIL_LAST_REQUEST_NOT_FINISHED(90005),
|
|
||||||
NIMBLE_FRIENDS_SMS_LAST_REQUEST_NOT_FINISHED(90006),
|
|
||||||
NIMBLE_FRIENDS_SMS_NOT_SENT_OUT(90007),
|
|
||||||
NIMBLE_FRIENDS_NO_TARGETS_PROVIDED(90008),
|
|
||||||
NIMBLE_FRIENDS_SERVER_RETURNED_ERROR(90009),
|
|
||||||
NIMBLE_FRIENDS_REFRESH_SCOPE_INVALID(10001),
|
|
||||||
NIMBLE_FRIENDS_REFRESH_SCOPE_RANGE_EXCEED_LIMIT(10002),
|
|
||||||
NIMBLE_FRIENDS_REFRESH_SCOPE_INVALID_START_INDEX(10003),
|
|
||||||
NIMBLE_FRIENDS_REFRESH_FRIENDS_PROVIDER_NOT_AVAILABLE(10004),
|
|
||||||
NIMBLE_FRIENDS_REFRESH_NO_USER_IDS_LIST(10005),
|
|
||||||
NIMBLE_FRIENDS_REFRESH_IDENTITY_SERVER_ERROR(10006),
|
|
||||||
NIMBLE_FRIENDS_REFRESH_IDENTITY_SERVER_EMPTY_RESPONSE(10007),
|
|
||||||
NIMBLE_FRIENDS_REFRESH_FRIENDS_LIST_EMPTY(10008),
|
|
||||||
NIMBLE_FRIENDS_REFRESH_FRIENDS_LIST_NOT_UPDATED(10009),
|
|
||||||
NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_SUPPORTED(10010),
|
|
||||||
NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_LOGGED_IN(10011),
|
|
||||||
NIMBLE_FRIENDS_REFRESH_SCOPE_FAILED_TO_CREATE_GOS_REQUEST(10012),
|
|
||||||
NIMBLE_FRIENDS_FAILED_TO_CREATE_GOS_REQUEST(10012),
|
|
||||||
NIMBLE_FRIENDS_REFRESH_SCOPE_ERROR_PARSING_HTTP_RESPONSE(10013),
|
|
||||||
NIMBLE_FRIENDS_REFRESH_SCOPE_EMPTY_HTTP_RESPONSE(10014),
|
|
||||||
NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR(10015),
|
|
||||||
NIMBLE_FRIENDS_REFRESH_SCOPE_FRIENDS_LIST_TYPE_UNSUPPORTED(10016),
|
|
||||||
NIMBLE_FRIENDS_REFRESH_TYPE_UNSUPPORTED(10017),
|
|
||||||
NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR(10018),
|
|
||||||
NIMBLE_FRIENDS_UNKNOWN_ERROR(0);
|
|
||||||
|
|
||||||
private int m_value;
|
|
||||||
|
|
||||||
Code(int i) {
|
|
||||||
this.m_value = i;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int intValue() {
|
|
||||||
return this.m_value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public NimbleFriendsError(int i, String str) {
|
|
||||||
super(NIMBLE_FRIENDS_ERROR_DOMAIN, i, str, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public NimbleFriendsError(int i, String str, Throwable th) {
|
|
||||||
super(NIMBLE_FRIENDS_ERROR_DOMAIN, i, str, th);
|
|
||||||
}
|
|
||||||
|
|
||||||
public NimbleFriendsError(Code code, String str) {
|
|
||||||
super(NIMBLE_FRIENDS_ERROR_DOMAIN, code.intValue(), str, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,105 +0,0 @@
|
|||||||
package com.ea.nimble.friends;
|
|
||||||
|
|
||||||
import android.content.BroadcastReceiver;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import com.ea.nimble.Base;
|
|
||||||
import com.ea.nimble.Component;
|
|
||||||
import com.ea.nimble.Global;
|
|
||||||
import com.ea.nimble.Log;
|
|
||||||
import com.ea.nimble.LogSource;
|
|
||||||
import com.ea.nimble.Utility;
|
|
||||||
import com.ea.nimble.identity.INimbleIdentity;
|
|
||||||
import com.ea.nimble.identity.INimbleIdentityAuthenticator;
|
|
||||||
import java.util.Hashtable;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsImpl.class */
|
|
||||||
public class NimbleFriendsImpl extends Component implements LogSource, INimbleFriends {
|
|
||||||
private Hashtable<String, NimbleFriendsListImpl> m_friends = new Hashtable<>();
|
|
||||||
private BroadcastReceiver m_authenticatorLoginChangeReceiver = new BroadcastReceiver() { // from class: com.ea.nimble.friends.NimbleFriendsImpl.1
|
|
||||||
@Override // android.content.BroadcastReceiver
|
|
||||||
public void onReceive(Context context, Intent intent) {
|
|
||||||
INimbleIdentityAuthenticator authenticatorById;
|
|
||||||
if (intent != null && intent.getExtras() != null && intent.getAction() != null && intent.getAction().equalsIgnoreCase(Global.NIMBLE_NOTIFICATION_IDENTITY_AUTHENTICATION_UPDATE)) {
|
|
||||||
String string = intent.getExtras().getString(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID);
|
|
||||||
if (Utility.validString(string) && (authenticatorById = ((INimbleIdentity) Base.getComponent("com.ea.nimble.identity")).getAuthenticatorById(string)) != null) {
|
|
||||||
if (authenticatorById.getState() == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) {
|
|
||||||
if (NimbleFriendsImpl.this.m_friends.get(string) != null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (Global.NIMBLE_AUTHENTICATOR_FACEBOOK == string) {
|
|
||||||
NimbleFriendsImpl.this.m_friends.put(string, new NimbleFriendsListFacebook());
|
|
||||||
} else if (Global.NIMBLE_AUTHENTICATOR_ORIGIN == string) {
|
|
||||||
NimbleFriendsImpl.this.m_friends.put(string, new NimbleFriendsListOrigin());
|
|
||||||
}
|
|
||||||
} else if (NimbleFriendsImpl.this.m_friends.get(string) != null) {
|
|
||||||
((NimbleFriendsListImpl) NimbleFriendsImpl.this.m_friends.get(string)).clear();
|
|
||||||
NimbleFriendsImpl.this.m_friends.remove(string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private static void initialize() {
|
|
||||||
Base.registerComponent(new NimbleFriendsImpl(), NimbleFriends.NIMBLE_COMPONENT_ID_FRIENDS);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.Component
|
|
||||||
public void cleanup() {
|
|
||||||
Log.Helper.LOGV(this, "Component cleanup", new Object[0]);
|
|
||||||
try {
|
|
||||||
Utility.unregisterReceiver(this.m_authenticatorLoginChangeReceiver);
|
|
||||||
} catch (Exception e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.Component
|
|
||||||
public String getComponentId() {
|
|
||||||
return NimbleFriends.NIMBLE_COMPONENT_ID_FRIENDS;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.friends.INimbleFriends
|
|
||||||
public NimbleFriendsList getFriendsList(String str, boolean z) {
|
|
||||||
NimbleFriendsList friendsList;
|
|
||||||
synchronized (this) {
|
|
||||||
friendsList = this.m_friends.get(str) != null ? this.m_friends.get(str).getFriendsList(z) : null;
|
|
||||||
}
|
|
||||||
return friendsList;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.LogSource
|
|
||||||
public String getLogSourceTitle() {
|
|
||||||
return "NimbleFriendsService";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.Component
|
|
||||||
public void restore() {
|
|
||||||
Log.Helper.LOGV(this, "Component restore", new Object[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.Component
|
|
||||||
public void resume() {
|
|
||||||
Log.Helper.LOGV(this, "Component resume", new Object[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.Component
|
|
||||||
public void setup() {
|
|
||||||
Log.Helper.LOGD(this, "Component setup", new Object[0]);
|
|
||||||
try {
|
|
||||||
Utility.registerReceiver(Global.NIMBLE_NOTIFICATION_IDENTITY_AUTHENTICATION_UPDATE, this.m_authenticatorLoginChangeReceiver);
|
|
||||||
} catch (Exception e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.Component
|
|
||||||
public void suspend() {
|
|
||||||
Log.Helper.LOGV(this, "Component suspend", new Object[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: protected */
|
|
||||||
@Override // com.ea.nimble.Component
|
|
||||||
public void teardown() {
|
|
||||||
Log.Helper.LOGV(this, "Component teardown", new Object[0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
package com.ea.nimble.friends;
|
|
||||||
|
|
||||||
import com.ea.nimble.friends.NimbleFriendsError;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsList.class */
|
|
||||||
public class NimbleFriendsList {
|
|
||||||
private NimbleFriendsListImpl m_friendsListImpl;
|
|
||||||
private FriendsListType m_type;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsList$FriendsListType.class */
|
|
||||||
public enum FriendsListType {
|
|
||||||
ALL_FRIENDS,
|
|
||||||
CURRENT_GAME_FRIENDS
|
|
||||||
}
|
|
||||||
|
|
||||||
public NimbleFriendsList(NimbleFriendsListImpl nimbleFriendsListImpl, FriendsListType friendsListType) {
|
|
||||||
this.m_friendsListImpl = nimbleFriendsListImpl;
|
|
||||||
this.m_type = friendsListType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public NimbleUser getFriendProfile(String str) {
|
|
||||||
if (this.m_friendsListImpl != null) {
|
|
||||||
return this.m_friendsListImpl.m_friends.get(str);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArrayList<String> getFriends() {
|
|
||||||
if (this.m_friendsListImpl != null) {
|
|
||||||
return this.m_type == FriendsListType.CURRENT_GAME_FRIENDS ? this.m_friendsListImpl.m_playedFriendsList : this.m_friendsListImpl.m_friendsList;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getRefreshPageSize() {
|
|
||||||
if (this.m_friendsListImpl != null) {
|
|
||||||
return this.m_friendsListImpl.getPageSize();
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getTotalFriendCount() {
|
|
||||||
return this.m_type == FriendsListType.CURRENT_GAME_FRIENDS ? this.m_friendsListImpl.m_totalPlayedFriends : this.m_friendsListImpl.m_totalFriends;
|
|
||||||
}
|
|
||||||
|
|
||||||
FriendsListType getType() {
|
|
||||||
return this.m_type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void refreshFriendsList(NimbleFriendsRefreshScope nimbleFriendsRefreshScope, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback) {
|
|
||||||
synchronized (this) {
|
|
||||||
if (this.m_friendsListImpl != null) {
|
|
||||||
this.m_friendsListImpl.refreshFriendsList(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, this.m_type);
|
|
||||||
} else if (nimbleFriendsRefreshCallback != null) {
|
|
||||||
NimbleFriendsError nimbleFriendsError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_FRIENDS_PROVIDER_NOT_AVAILABLE, "Specified Friends provider is not available. Failed to refresh Friends list.");
|
|
||||||
NimbleFriendsRefreshResult nimbleFriendsRefreshResult = new NimbleFriendsRefreshResult();
|
|
||||||
nimbleFriendsRefreshResult.m_error = nimbleFriendsError;
|
|
||||||
nimbleFriendsRefreshResult.m_success = false;
|
|
||||||
nimbleFriendsRefreshResult.m_userList = null;
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(null, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
package com.ea.nimble.friends;
|
|
||||||
|
|
||||||
import com.ea.nimble.Base;
|
|
||||||
import com.ea.nimble.Error;
|
|
||||||
import com.ea.nimble.Global;
|
|
||||||
import com.ea.nimble.IFacebook;
|
|
||||||
import com.ea.nimble.Log;
|
|
||||||
import com.ea.nimble.friends.NimbleFriendsError;
|
|
||||||
import com.ea.nimble.friends.NimbleFriendsList;
|
|
||||||
import java.util.List;
|
|
||||||
import org.json.JSONArray;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsListFacebook.class */
|
|
||||||
public class NimbleFriendsListFacebook extends NimbleFriendsListImpl {
|
|
||||||
private static final String FACEBOOK_COMPONENT_ID = "com.ea.nimble.facebook";
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: package-private */
|
|
||||||
public NimbleFriendsListFacebook() {
|
|
||||||
this.LOG_SOURCE_TITLE = "NimbleFriendsListFacebook";
|
|
||||||
this.m_authenticatorId = Global.NIMBLE_AUTHENTICATOR_FACEBOOK;
|
|
||||||
Log.Helper.LOGV(this, "Constructed", new Object[0]);
|
|
||||||
this.m_pageSize = 1000;
|
|
||||||
this.m_nimbleFriendsList = new NimbleFriendsList(this, NimbleFriendsList.FriendsListType.ALL_FRIENDS);
|
|
||||||
this.m_nimblePlayedFriendsList = new NimbleFriendsList(this, NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.friends.NimbleFriendsListImpl
|
|
||||||
protected NimbleUser createNimbleUser(JSONObject jSONObject) {
|
|
||||||
return new NimbleFacebookUser(jSONObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.friends.NimbleFriendsListImpl, com.ea.nimble.LogSource
|
|
||||||
public /* bridge */ /* synthetic */ String getLogSourceTitle() {
|
|
||||||
return super.getLogSourceTitle();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.friends.NimbleFriendsListImpl
|
|
||||||
protected void refreshFriendsListBasicInfo(final int i, final int i2, String str, final NimbleFriendsList.FriendsListType friendsListType, final NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, final NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo) {
|
|
||||||
if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) {
|
|
||||||
Log.Helper.LOGE(this, "Facebook no longer supports getting friends with ALL_FRIENDS flag", new Object[0]);
|
|
||||||
invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_FRIENDS_LIST_TYPE_UNSUPPORTED, "Facebook no longer supports getting friends with ALL_FRIENDS flag", friendsListType);
|
|
||||||
} else if (!isNimbleComponentAvailable("com.ea.nimble.facebook") || !((IFacebook) Base.getComponent("com.ea.nimble.facebook")).hasOpenSession()) {
|
|
||||||
Log.Helper.LOGE(this, "Unable to refresh friends from Facebook because NimbleFacebook is either unavailable or the session is not open", new Object[0]);
|
|
||||||
invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_FACEBOOK_USER_NOT_LOGGED_IN, "Unable to refresh friends from Facebook because NimbleFacebook is either unavailable or the session is not open", friendsListType);
|
|
||||||
} else {
|
|
||||||
((IFacebook) Base.getComponent("com.ea.nimble.facebook")).retrieveFriends(i, i2, new IFacebook.FacebookFriendsCallback() { // from class: com.ea.nimble.friends.NimbleFriendsListFacebook.1
|
|
||||||
@Override // com.ea.nimble.IFacebook.FacebookFriendsCallback
|
|
||||||
public void callback(IFacebook iFacebook, JSONArray jSONArray, Error error) {
|
|
||||||
if (error != null) {
|
|
||||||
Log.Helper.LOGE(this, String.format("Error in retrieving friends list from Facebook. Error :%s", error.toString()), new Object[0]);
|
|
||||||
if (nimbleFriendsRefreshCallback != null) {
|
|
||||||
NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult = new NimbleFriendsRangeRefreshResult();
|
|
||||||
nimbleFriendsRangeRefreshResult.m_success = false;
|
|
||||||
nimbleFriendsRangeRefreshResult.m_error = error;
|
|
||||||
nimbleFriendsRangeRefreshResult.m_userList = null;
|
|
||||||
nimbleFriendsRangeRefreshResult.m_startIndex = i;
|
|
||||||
nimbleFriendsRangeRefreshResult.m_size = i2;
|
|
||||||
nimbleFriendsRangeRefreshResult.m_friendListEndInRefresh = false;
|
|
||||||
if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) {
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(NimbleFriendsListFacebook.this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult);
|
|
||||||
} else {
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(NimbleFriendsListFacebook.this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (jSONArray == null || jSONArray.length() <= 0) {
|
|
||||||
Log.Helper.LOGD(NimbleFriendsListFacebook.this, "No friends retrieved from Facebook even though the operation was successful", new Object[0]);
|
|
||||||
if (nimbleFriendsRefreshCallback != null) {
|
|
||||||
NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult2 = new NimbleFriendsRangeRefreshResult();
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_success = true;
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_error = null;
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_userList = null;
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_startIndex = i;
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_size = i2;
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_friendListEndInRefresh = false;
|
|
||||||
if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) {
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(NimbleFriendsListFacebook.this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult2);
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(NimbleFriendsListFacebook.this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult2);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Log.Helper.LOGD(this, "Successfully retrieved friends for specified scope from Facebook. Proceeding with NimbleFriendList update", new Object[0]);
|
|
||||||
NimbleFriendsListFacebook.this.updateFriendsListBasicInfo(jSONArray, friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshBasicInfo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.friends.NimbleFriendsListImpl
|
|
||||||
protected void refreshFriendsListImageUrl(List<String> list, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsRefreshScope nimbleFriendsRefreshScope) {
|
|
||||||
Log.Helper.LOGI(this, "Facebook Friends Service does not support ImageUri refresh because Facebook friends already have Image URI information", new Object[0]);
|
|
||||||
invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_TYPE_UNSUPPORTED, "Facebook Friends Service does not support ImageUri refresh because Facebook friends already have Image URI information", friendsListType);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,635 +0,0 @@
|
|||||||
package com.ea.nimble.friends;
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
|
|
||||||
import com.ea.nimble.Base;
|
|
||||||
import com.ea.nimble.Error;
|
|
||||||
import com.ea.nimble.Global;
|
|
||||||
import com.ea.nimble.Log;
|
|
||||||
import com.ea.nimble.LogSource;
|
|
||||||
import com.ea.nimble.Network;
|
|
||||||
import com.ea.nimble.SynergyEnvironment;
|
|
||||||
import com.ea.nimble.Utility;
|
|
||||||
import com.ea.nimble.identity.INimbleIdentity;
|
|
||||||
import com.ea.nimble.identity.INimbleIdentityAuthenticator;
|
|
||||||
|
|
||||||
import org.json.JSONArray;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Hashtable;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@SuppressLint({"DefaultLocale"})
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsListImpl.class */
|
|
||||||
public abstract class NimbleFriendsListImpl implements LogSource {
|
|
||||||
protected NimbleFriendsList m_nimbleFriendsList;
|
|
||||||
protected NimbleFriendsList m_nimblePlayedFriendsList;
|
|
||||||
protected Hashtable<String, NimbleUser> m_friends = new Hashtable<>();
|
|
||||||
protected ArrayList<String> m_friendsList = new ArrayList<>();
|
|
||||||
protected ArrayList<String> m_playedFriendsList = new ArrayList<>();
|
|
||||||
protected int m_totalFriends = -1;
|
|
||||||
protected int m_totalPlayedFriends = -1;
|
|
||||||
protected String LOG_SOURCE_TITLE = "NimbleFriendsListImpl";
|
|
||||||
protected int m_pageSize = 100;
|
|
||||||
protected String m_authenticatorId = "";
|
|
||||||
|
|
||||||
public NimbleFriendsListImpl() {
|
|
||||||
Log.Helper.LOGV(this, "No default implementation for NimbleFriendsListImpl - Must construct a typed-NimbleFriendsListImpl", new Object[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Error environmentCheck() {
|
|
||||||
Log.Helper.LOGV(this, "Environment Check -->", new Object[0]);
|
|
||||||
if (Network.getComponent().getStatus() != Network.Status.OK) {
|
|
||||||
Log.Helper.LOGD(this, "Environment Check - Network unavailable", new Object[0]);
|
|
||||||
return new Error(Error.Code.NETWORK_NO_CONNECTION, "Friends component cannot do updates without network");
|
|
||||||
} else if (SynergyEnvironment.getComponent().isDataAvailable()) {
|
|
||||||
return null;
|
|
||||||
} else {
|
|
||||||
Log.Helper.LOGD(this, "Environment Check - Synergy Environment Not Ready", new Object[0]);
|
|
||||||
return new Error(Error.Code.SYNERGY_GET_DIRECTION_TIMEOUT, "Friends component is still in initialization and not ready for operation");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void clear() {
|
|
||||||
synchronized (this) {
|
|
||||||
if (this.m_friends != null) {
|
|
||||||
this.m_friends.clear();
|
|
||||||
}
|
|
||||||
if (this.m_friendsList != null) {
|
|
||||||
this.m_friendsList.clear();
|
|
||||||
}
|
|
||||||
if (this.m_playedFriendsList != null) {
|
|
||||||
this.m_playedFriendsList.clear();
|
|
||||||
}
|
|
||||||
this.m_totalFriends = -1;
|
|
||||||
this.m_totalPlayedFriends = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract NimbleUser createNimbleUser(JSONObject jSONObject);
|
|
||||||
|
|
||||||
public NimbleFriendsList getFriendsList(boolean z) {
|
|
||||||
synchronized (this) {
|
|
||||||
if (z) {
|
|
||||||
Log.Helper.LOGV(this, "Returning NimbleFriendsList with playedCurrentGameOnly flag returned", new Object[0]);
|
|
||||||
return this.m_nimblePlayedFriendsList;
|
|
||||||
}
|
|
||||||
Log.Helper.LOGV(this, "Returning NimbleFriendsList with all friends", new Object[0]);
|
|
||||||
return this.m_nimbleFriendsList;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.LogSource
|
|
||||||
public String getLogSourceTitle() {
|
|
||||||
return this.LOG_SOURCE_TITLE;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getPageSize() {
|
|
||||||
return this.m_pageSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
void invokeCallbackWithBasicScopeError(NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, Error error, NimbleFriendsList.FriendsListType friendsListType) {
|
|
||||||
if (nimbleFriendsRefreshCallback != null) {
|
|
||||||
NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult = new NimbleFriendsRangeRefreshResult();
|
|
||||||
nimbleFriendsRangeRefreshResult.m_success = false;
|
|
||||||
nimbleFriendsRangeRefreshResult.m_error = error;
|
|
||||||
nimbleFriendsRangeRefreshResult.m_userList = null;
|
|
||||||
nimbleFriendsRangeRefreshResult.m_startIndex = nimbleFriendsRefreshBasicInfo.getStartIndex();
|
|
||||||
nimbleFriendsRangeRefreshResult.m_size = nimbleFriendsRefreshBasicInfo.getRange();
|
|
||||||
nimbleFriendsRangeRefreshResult.m_friendListEndInRefresh = false;
|
|
||||||
if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) {
|
|
||||||
nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalFriends;
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalPlayedFriends;
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void invokeCallbackWithBasicScopeError(NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsError.Code code, String str, NimbleFriendsList.FriendsListType friendsListType) {
|
|
||||||
if (nimbleFriendsRefreshCallback != null) {
|
|
||||||
NimbleFriendsError nimbleFriendsError = new NimbleFriendsError(code, str);
|
|
||||||
NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult = new NimbleFriendsRangeRefreshResult();
|
|
||||||
nimbleFriendsRangeRefreshResult.m_success = false;
|
|
||||||
nimbleFriendsRangeRefreshResult.m_error = nimbleFriendsError;
|
|
||||||
nimbleFriendsRangeRefreshResult.m_userList = null;
|
|
||||||
nimbleFriendsRangeRefreshResult.m_startIndex = nimbleFriendsRefreshBasicInfo.getStartIndex();
|
|
||||||
nimbleFriendsRangeRefreshResult.m_size = nimbleFriendsRefreshBasicInfo.getRange();
|
|
||||||
nimbleFriendsRangeRefreshResult.m_friendListEndInRefresh = false;
|
|
||||||
if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) {
|
|
||||||
nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalFriends;
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalPlayedFriends;
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void invokeCallbackWithScopeError(NimbleFriendsRefreshScope nimbleFriendsRefreshScope, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, Error error, NimbleFriendsList.FriendsListType friendsListType) {
|
|
||||||
if (nimbleFriendsRefreshCallback != null) {
|
|
||||||
NimbleFriendsRefreshResult nimbleFriendsRefreshResult = new NimbleFriendsRefreshResult();
|
|
||||||
nimbleFriendsRefreshResult.m_success = false;
|
|
||||||
nimbleFriendsRefreshResult.m_error = error;
|
|
||||||
nimbleFriendsRefreshResult.m_userList = null;
|
|
||||||
if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) {
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult);
|
|
||||||
} else {
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void invokeCallbackWithScopeError(NimbleFriendsRefreshScope nimbleFriendsRefreshScope, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsError.Code code, String str, NimbleFriendsList.FriendsListType friendsListType) {
|
|
||||||
if (nimbleFriendsRefreshCallback != null) {
|
|
||||||
NimbleFriendsError nimbleFriendsError = new NimbleFriendsError(code, str);
|
|
||||||
NimbleFriendsRefreshResult nimbleFriendsRefreshResult = new NimbleFriendsRefreshResult();
|
|
||||||
nimbleFriendsRefreshResult.m_success = false;
|
|
||||||
nimbleFriendsRefreshResult.m_error = nimbleFriendsError;
|
|
||||||
nimbleFriendsRefreshResult.m_userList = null;
|
|
||||||
if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) {
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult);
|
|
||||||
} else {
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected boolean isNimbleComponentAvailable(String str) {
|
|
||||||
boolean z = false;
|
|
||||||
if (Base.getComponent(str) != null) {
|
|
||||||
z = true;
|
|
||||||
}
|
|
||||||
return z;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressLint({"DefaultLocale"})
|
|
||||||
public void refreshFriendsList(NimbleFriendsRefreshScope nimbleFriendsRefreshScope, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsList.FriendsListType friendsListType) {
|
|
||||||
int i;
|
|
||||||
Object obj;
|
|
||||||
String str;
|
|
||||||
int i2;
|
|
||||||
String str2;
|
|
||||||
Log.Helper.LOGV(this, "refreshFriendsList API called", new Object[0]);
|
|
||||||
Error environmentCheck = environmentCheck();
|
|
||||||
if (environmentCheck == null) {
|
|
||||||
if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) {
|
|
||||||
Log.Helper.LOGV(this, "Refresh API called for All Friends List", new Object[0]);
|
|
||||||
i = 0;
|
|
||||||
obj = "ALL_FRIENDS";
|
|
||||||
if (this.m_friendsList != null) {
|
|
||||||
i = 0;
|
|
||||||
obj = "ALL_FRIENDS";
|
|
||||||
if (this.m_friendsList.size() > 0) {
|
|
||||||
i = this.m_friendsList.size() - 1;
|
|
||||||
obj = "ALL_FRIENDS";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.Helper.LOGV(this, "Refresh API called for Played Current Game Friends List", new Object[0]);
|
|
||||||
i = 0;
|
|
||||||
obj = "CURRENT_GAME_FRIENDS";
|
|
||||||
if (this.m_playedFriendsList != null) {
|
|
||||||
i = 0;
|
|
||||||
obj = "CURRENT_GAME_FRIENDS";
|
|
||||||
if (this.m_playedFriendsList.size() > 0) {
|
|
||||||
i = this.m_playedFriendsList.size() - 1;
|
|
||||||
obj = "CURRENT_GAME_FRIENDS";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (nimbleFriendsRefreshScope == null) {
|
|
||||||
Log.Helper.LOGW(this, "NimbleFriendsRefreshScope is null. Unable to process the request", new Object[0]);
|
|
||||||
invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_INVALID, "NimbleFriendsRefreshScope is null. Unable to process the request", friendsListType);
|
|
||||||
} else if (nimbleFriendsRefreshScope instanceof NimbleFriendsRefreshBasicInfo) {
|
|
||||||
NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo = (NimbleFriendsRefreshBasicInfo) nimbleFriendsRefreshScope;
|
|
||||||
int startIndex = nimbleFriendsRefreshBasicInfo.getStartIndex();
|
|
||||||
int range = nimbleFriendsRefreshBasicInfo.getRange();
|
|
||||||
if (nimbleFriendsRefreshBasicInfo.getNextPage()) {
|
|
||||||
Log.Helper.LOGV(this, "Refresh API is called to get the next page of friends", new Object[0]);
|
|
||||||
int i3 = this.m_pageSize;
|
|
||||||
if (friendsListType != NimbleFriendsList.FriendsListType.ALL_FRIENDS || this.m_friendsList == null || this.m_friendsList.size() <= 0) {
|
|
||||||
i2 = 0;
|
|
||||||
str2 = "";
|
|
||||||
if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) {
|
|
||||||
i2 = 0;
|
|
||||||
str2 = "";
|
|
||||||
if (this.m_playedFriendsList != null) {
|
|
||||||
i2 = 0;
|
|
||||||
str2 = "";
|
|
||||||
if (this.m_playedFriendsList.size() > 0) {
|
|
||||||
str2 = this.m_playedFriendsList.get(i);
|
|
||||||
i2 = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
str2 = this.m_friendsList.get(i);
|
|
||||||
i2 = i;
|
|
||||||
}
|
|
||||||
Log.Helper.LOGD(this, String.format("Refreshing next page for Type = %s, Start Index = %d, Range = %d, Last UID: %s", obj, Integer.valueOf(i2), Integer.valueOf(i3), str2), new Object[0]);
|
|
||||||
refreshFriendsListBasicInfo(i2, i3, str2, friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshBasicInfo);
|
|
||||||
} else if (startIndex <= 0) {
|
|
||||||
Log.Helper.LOGD(this, String.format("Start Index is less than or equal to 0 - get friends from 0 to page size for Type = %s", obj), new Object[0]);
|
|
||||||
refreshFriendsListBasicInfo(0, this.m_pageSize, "", friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshBasicInfo);
|
|
||||||
} else if (range > this.m_pageSize || range <= 0) {
|
|
||||||
String format = String.format("Range (%d) either exceeds Page Size (%d) or is less than 1. Unable to process this request.", Integer.valueOf(range), Integer.valueOf(this.m_pageSize));
|
|
||||||
Log.Helper.LOGW(this, format, new Object[0]);
|
|
||||||
invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_RANGE_EXCEED_LIMIT, format, friendsListType);
|
|
||||||
} else if (startIndex - i >= 1) {
|
|
||||||
String format2 = String.format("Start Index (%d) higher than currentsize (%d). Unable to process this request.", Integer.valueOf(startIndex), Integer.valueOf(i));
|
|
||||||
Log.Helper.LOGW(this, format2, new Object[0]);
|
|
||||||
invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_INVALID_START_INDEX, format2, friendsListType);
|
|
||||||
} else if (startIndex + range > i + 1) {
|
|
||||||
String format3 = String.format("Range (%d) exceeds Available Size (%d). Unable to process this request.", Integer.valueOf(range), Integer.valueOf(i));
|
|
||||||
Log.Helper.LOGW(this, format3, new Object[0]);
|
|
||||||
invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_RANGE_EXCEED_LIMIT, format3, friendsListType);
|
|
||||||
} else if (startIndex > 0) {
|
|
||||||
if (friendsListType != NimbleFriendsList.FriendsListType.ALL_FRIENDS || this.m_friendsList == null || this.m_friendsList.size() <= 0 || startIndex >= this.m_friendsList.size()) {
|
|
||||||
str = "";
|
|
||||||
if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) {
|
|
||||||
str = "";
|
|
||||||
if (this.m_playedFriendsList != null) {
|
|
||||||
str = "";
|
|
||||||
if (this.m_playedFriendsList.size() > 0) {
|
|
||||||
str = "";
|
|
||||||
if (startIndex < this.m_playedFriendsList.size()) {
|
|
||||||
str = this.m_playedFriendsList.get(startIndex - 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
str = this.m_friendsList.get(startIndex - 1);
|
|
||||||
}
|
|
||||||
if (str.length() > 0) {
|
|
||||||
Log.Helper.LOGD(this, String.format("Refreshing friends by range for Type = %s, Start Index = %d, Range = %d, Last UID = %s", obj, Integer.valueOf(startIndex), Integer.valueOf(range), str), new Object[0]);
|
|
||||||
refreshFriendsListBasicInfo(startIndex, range, str, friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshBasicInfo);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String format4 = String.format("Unable to process refresh request because we are unable to retrieve the last UID before start index %d.", Integer.valueOf(startIndex));
|
|
||||||
Log.Helper.LOGW(this, format4, new Object[0]);
|
|
||||||
invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_INVALID, format4, friendsListType);
|
|
||||||
} else {
|
|
||||||
Log.Helper.LOGD(this, String.format("Refreshing friends by range for Type = %s, Range = %d with starting index at 0 and no last UID", obj, Integer.valueOf(range)), new Object[0]);
|
|
||||||
refreshFriendsListBasicInfo(0, range, "", friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshBasicInfo);
|
|
||||||
}
|
|
||||||
} else if (nimbleFriendsRefreshScope instanceof NimbleFriendsRefreshIdentityInfo) {
|
|
||||||
ArrayList<String> targetedFriendIds = ((NimbleFriendsRefreshIdentityInfo) nimbleFriendsRefreshScope).getTargetedFriendIds();
|
|
||||||
if (targetedFriendIds == null || targetedFriendIds.size() <= 0) {
|
|
||||||
Log.Helper.LOGW(this, "No user IDs provided for NimbleFriendsRefreshIdentityInfo scope. Unable to process request", new Object[0]);
|
|
||||||
invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_NO_USER_IDS_LIST, "No user IDs provided for NimbleFriendsRefreshIdentityInfo scope. Unable to process request", friendsListType);
|
|
||||||
} else if (targetedFriendIds.size() > 20 || targetedFriendIds.size() > i + 1) {
|
|
||||||
Log.Helper.LOGW(this, "Number of user IDs provided for NimbleFriendsRefreshIdentityInfo exceeds allowed limits. Unable to process request", new Object[0]);
|
|
||||||
invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_RANGE_EXCEED_LIMIT, "Number of user IDs provided for NimbleFriendsRefreshIdentityInfo exceeds allowed limits. Unable to process request", friendsListType);
|
|
||||||
} else {
|
|
||||||
Log.Helper.LOGD(this, "Refreshing identity info of %d friends of type %s", Integer.valueOf(targetedFriendIds.size()), obj);
|
|
||||||
refreshFriendsListIdentityInfo(targetedFriendIds, friendsListType, nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback);
|
|
||||||
}
|
|
||||||
} else if (nimbleFriendsRefreshScope instanceof NimbleFriendsRefreshImageUrl) {
|
|
||||||
ArrayList<String> targetedFriendIds2 = ((NimbleFriendsRefreshImageUrl) nimbleFriendsRefreshScope).getTargetedFriendIds();
|
|
||||||
if (targetedFriendIds2 == null || targetedFriendIds2.size() <= 0) {
|
|
||||||
Log.Helper.LOGW(this, "No user IDs provided for NimbleFriendsRefreshImageUrl scope. Unable to process request", new Object[0]);
|
|
||||||
invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_NO_USER_IDS_LIST, "No user IDs provided for NimbleFriendsRefreshImageUrl scope. Unable to process request", friendsListType);
|
|
||||||
} else if (targetedFriendIds2.size() > i + 1 || targetedFriendIds2.size() > 20) {
|
|
||||||
Log.Helper.LOGW(this, "Number of user IDs provided for NimbleFriendsRefreshImageUrl is more than the page size. Unable to process request", new Object[0]);
|
|
||||||
invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_RANGE_EXCEED_LIMIT, "Number of user IDs provided for NimbleFriendsRefreshImageUrl is more than the page size. Unable to process request", friendsListType);
|
|
||||||
} else {
|
|
||||||
Log.Helper.LOGD(this, "Refreshing image url of %d friends of type %s", Integer.valueOf(targetedFriendIds2.size()), obj);
|
|
||||||
refreshFriendsListImageUrl(targetedFriendIds2, friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshScope);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (nimbleFriendsRefreshCallback != null) {
|
|
||||||
NimbleFriendsRefreshResult nimbleFriendsRefreshResult = new NimbleFriendsRefreshResult();
|
|
||||||
nimbleFriendsRefreshResult.m_error = environmentCheck;
|
|
||||||
nimbleFriendsRefreshResult.m_success = false;
|
|
||||||
nimbleFriendsRefreshResult.m_userList = null;
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(null, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract void refreshFriendsListBasicInfo(int i, int i2, String str, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo);
|
|
||||||
|
|
||||||
protected void refreshFriendsListIdentityInfo(ArrayList<String> arrayList, final NimbleFriendsList.FriendsListType friendsListType, final NimbleFriendsRefreshScope nimbleFriendsRefreshScope, final NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback) {
|
|
||||||
Log.Helper.LOGD(this, "Preparing to make the call to C&I to get the pid info", new Object[0]);
|
|
||||||
if (!isNimbleComponentAvailable("com.ea.nimble.identity")) {
|
|
||||||
Log.Helper.LOGE(this, "Unable to refresh friends Identity information because NimbleIdentity is not available", new Object[0]);
|
|
||||||
invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE, "Unable to refresh friends Identity information because NimbleIdentity is not available", friendsListType);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
INimbleIdentity iNimbleIdentity = (INimbleIdentity) Base.getComponent("com.ea.nimble.identity");
|
|
||||||
if (iNimbleIdentity.getAuthenticatorById(this.m_authenticatorId).getState() != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) {
|
|
||||||
String format = String.format("Authenticator (%s) is not logged in or is unavailable", this.m_authenticatorId);
|
|
||||||
Log.Helper.LOGE(this, format, new Object[0]);
|
|
||||||
invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_LOGGED_IN, format, friendsListType);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
iNimbleIdentity.getAuthenticatorById(this.m_authenticatorId).requestIdentityForFriends(arrayList, new INimbleIdentityAuthenticator.NimbleIdentityFriendsIdentityInfoCallback() { // from class: com.ea.nimble.friends.NimbleFriendsListImpl.1
|
|
||||||
@Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityFriendsIdentityInfoCallback
|
|
||||||
public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, JSONObject jSONObject, Error error) {
|
|
||||||
if (error != null) {
|
|
||||||
Log.Helper.LOGE(this, "Server error when retrieving Pid Info. Error: " + error.toString(), new Object[0]);
|
|
||||||
NimbleFriendsListImpl.this.invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_IDENTITY_SERVER_ERROR, error.toString(), friendsListType);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Log.Helper.LOGD(this, "No errors when retrieving Pid Info response from C&I server", new Object[0]);
|
|
||||||
ArrayList<UserInfoFromIdentity> parseJSONObjectToArrayOfUserInfo = NimbleFriendsUtility.parseJSONObjectToArrayOfUserInfo(jSONObject);
|
|
||||||
if (parseJSONObjectToArrayOfUserInfo == null || parseJSONObjectToArrayOfUserInfo.size() == 0) {
|
|
||||||
Log.Helper.LOGW(this, "Response for Pid Info request is empty. No Pids were updated for this request. It is probably because the selected friends do not have any Pids associated with them", new Object[0]);
|
|
||||||
NimbleFriendsListImpl.this.invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_IDENTITY_SERVER_EMPTY_RESPONSE, "Response for Pid Info request is empty. No Pids were updated for this request. It is probably because the selected friends do not have any Pids associated with them", friendsListType);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Log.Helper.LOGD(this, "Successfully retrieved non-empty updated pid info from Identity server.", new Object[0]);
|
|
||||||
NimbleFriendsListImpl.this.updateFriendsListIdentityInfo(parseJSONObjectToArrayOfUserInfo, friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshScope);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (Exception e) {
|
|
||||||
String format2 = String.format("Authenticator (%s) does not support Identity Refresh for Friends List", this.m_authenticatorId);
|
|
||||||
Log.Helper.LOGE(this, format2, new Object[0]);
|
|
||||||
invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_SUPPORTED, format2, friendsListType);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract void refreshFriendsListImageUrl(List<String> list, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsRefreshScope nimbleFriendsRefreshScope);
|
|
||||||
|
|
||||||
protected void sendUpdateNotification() {
|
|
||||||
HashMap hashMap = new HashMap();
|
|
||||||
if (Base.getComponent("com.ea.nimble.identity") != null) {
|
|
||||||
hashMap.put(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID, this.m_authenticatorId);
|
|
||||||
} else {
|
|
||||||
hashMap.put(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID, this.m_authenticatorId);
|
|
||||||
}
|
|
||||||
Utility.sendBroadcast(INimbleFriends.NIMBLE_NOTIFICATION_FRIENDS_LIST_UPDATE, hashMap);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void d(ArrayList<NimbleUser> arrayList, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsRefreshScope nimbleFriendsRefreshScope) {
|
|
||||||
boolean z;
|
|
||||||
synchronized (this) {
|
|
||||||
ArrayList<NimbleUser> arrayList2 = new ArrayList<>();
|
|
||||||
if (this.m_friends == null || this.m_friends.size() <= 0) {
|
|
||||||
Log.Helper.LOGE(this, "Current Friends list is empty. Unable to process the PID update", new Object[0]);
|
|
||||||
invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_FRIENDS_LIST_EMPTY, "Current Friends list is empty. Unable to process the PID update", friendsListType);
|
|
||||||
} else if (arrayList == null || arrayList.size() <= 0) {
|
|
||||||
Log.Helper.LOGE(this, "Updated users array for Avatar info is empty", new Object[0]);
|
|
||||||
invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_IDENTITY_SERVER_EMPTY_RESPONSE, "Updated users array for Avatar info is empty", friendsListType);
|
|
||||||
} else {
|
|
||||||
for (int i = 0; i < arrayList.size(); i++) {
|
|
||||||
NimbleUser nimbleUser = this.m_friends.get(arrayList.get(i).getUserId());
|
|
||||||
String imageUrl = arrayList.get(i).getImageUrl();
|
|
||||||
if (nimbleUser != null) {
|
|
||||||
String imageUrl2 = nimbleUser.getImageUrl();
|
|
||||||
if (!Utility.validString(imageUrl2) && Utility.validString(imageUrl)) {
|
|
||||||
z = true;
|
|
||||||
} else if (!Utility.validString(imageUrl2) || Utility.validString(imageUrl)) {
|
|
||||||
z = false;
|
|
||||||
if (Utility.validString(imageUrl2)) {
|
|
||||||
z = false;
|
|
||||||
if (Utility.validString(imageUrl)) {
|
|
||||||
z = false;
|
|
||||||
if (!imageUrl2.equalsIgnoreCase(imageUrl)) {
|
|
||||||
z = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
z = true;
|
|
||||||
}
|
|
||||||
if (z) {
|
|
||||||
NimbleUser nimbleUser2 = new NimbleUser(nimbleUser);
|
|
||||||
nimbleUser2.setImageUrl(imageUrl);
|
|
||||||
this.m_friends.put(nimbleUser2.getUserId(), nimbleUser2);
|
|
||||||
arrayList2.add(nimbleUser2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (arrayList2.size() == 0) {
|
|
||||||
Log.Helper.LOGD(this, "No Avatar Info updates were made to the Friends List", new Object[0]);
|
|
||||||
invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_FRIENDS_LIST_NOT_UPDATED, "No Avatar Info updates were made to the Friends List", friendsListType);
|
|
||||||
} else {
|
|
||||||
Log.Helper.LOGD(this, String.format("%d Friends were updated for Avatar Info", Integer.valueOf(arrayList2.size())), new Object[0]);
|
|
||||||
sendUpdateNotification();
|
|
||||||
if (nimbleFriendsRefreshCallback != null) {
|
|
||||||
Log.Helper.LOGD(this, "Friends list was updated. Invoking the callback", new Object[0]);
|
|
||||||
NimbleFriendsRefreshResult nimbleFriendsRefreshResult = new NimbleFriendsRefreshResult();
|
|
||||||
nimbleFriendsRefreshResult.m_success = true;
|
|
||||||
nimbleFriendsRefreshResult.m_error = null;
|
|
||||||
nimbleFriendsRefreshResult.m_userList = arrayList2;
|
|
||||||
if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) {
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult);
|
|
||||||
} else {
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void updateFriendsListBasicInfo(ArrayList<NimbleUser> arrayList, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo) {
|
|
||||||
synchronized (this) {
|
|
||||||
ArrayList<NimbleUser> arrayList2 = new ArrayList<>();
|
|
||||||
if (arrayList == null || arrayList.size() <= 0) {
|
|
||||||
Log.Helper.LOGD(this, "Even though the retrieval of Friends list was successful, the retrieved Friend list is empty", new Object[0]);
|
|
||||||
if (nimbleFriendsRefreshCallback != null) {
|
|
||||||
NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult = new NimbleFriendsRangeRefreshResult();
|
|
||||||
nimbleFriendsRangeRefreshResult.m_success = true;
|
|
||||||
nimbleFriendsRangeRefreshResult.m_error = null;
|
|
||||||
nimbleFriendsRangeRefreshResult.m_userList = null;
|
|
||||||
nimbleFriendsRangeRefreshResult.m_startIndex = nimbleFriendsRefreshBasicInfo.getStartIndex();
|
|
||||||
nimbleFriendsRangeRefreshResult.m_size = nimbleFriendsRefreshBasicInfo.getRange();
|
|
||||||
nimbleFriendsRangeRefreshResult.m_friendListEndInRefresh = false;
|
|
||||||
if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) {
|
|
||||||
nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalFriends;
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult);
|
|
||||||
} else {
|
|
||||||
nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalPlayedFriends;
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.Helper.LOGV(this, "Retrieved " + arrayList.size() + "friends.", new Object[0]);
|
|
||||||
for (int i = 0; i < arrayList.size(); i++) {
|
|
||||||
if (arrayList.get(i) != null) {
|
|
||||||
updateInternalCache(arrayList.get(i), friendsListType, arrayList2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) {
|
|
||||||
this.m_totalPlayedFriends = this.m_playedFriendsList.size();
|
|
||||||
} else {
|
|
||||||
this.m_totalFriends = this.m_friendsList.size();
|
|
||||||
}
|
|
||||||
if (nimbleFriendsRefreshCallback != null) {
|
|
||||||
Log.Helper.LOGD(this, "Friends list was updated. Invoking the callback", new Object[0]);
|
|
||||||
NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult2 = new NimbleFriendsRangeRefreshResult();
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_success = true;
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_error = null;
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_userList = arrayList2;
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_startIndex = nimbleFriendsRefreshBasicInfo.getStartIndex();
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_size = nimbleFriendsRefreshBasicInfo.getRange();
|
|
||||||
if (arrayList2.size() > 0) {
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_friendListEndInRefresh = true;
|
|
||||||
} else {
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_friendListEndInRefresh = false;
|
|
||||||
}
|
|
||||||
if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) {
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_totalFriendCount = this.m_totalFriends;
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult2);
|
|
||||||
} else {
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_totalFriendCount = this.m_totalPlayedFriends;
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Log.Helper.LOGD(this, "Friends list was upodated, send the update notification", new Object[0]);
|
|
||||||
sendUpdateNotification();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void updateFriendsListBasicInfo(JSONArray jSONArray, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo) {
|
|
||||||
synchronized (this) {
|
|
||||||
ArrayList<NimbleUser> arrayList = new ArrayList<>();
|
|
||||||
if (jSONArray == null || jSONArray.length() <= 0) {
|
|
||||||
Log.Helper.LOGD(this, "Even though the retrieval of Friends list was successful, the retrieved Friend list is empty", new Object[0]);
|
|
||||||
if (nimbleFriendsRefreshCallback != null) {
|
|
||||||
NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult = new NimbleFriendsRangeRefreshResult();
|
|
||||||
nimbleFriendsRangeRefreshResult.m_success = true;
|
|
||||||
nimbleFriendsRangeRefreshResult.m_error = null;
|
|
||||||
nimbleFriendsRangeRefreshResult.m_userList = null;
|
|
||||||
nimbleFriendsRangeRefreshResult.m_startIndex = nimbleFriendsRefreshBasicInfo.getStartIndex();
|
|
||||||
nimbleFriendsRangeRefreshResult.m_size = nimbleFriendsRefreshBasicInfo.getRange();
|
|
||||||
nimbleFriendsRangeRefreshResult.m_friendListEndInRefresh = false;
|
|
||||||
if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) {
|
|
||||||
nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalFriends;
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult);
|
|
||||||
} else {
|
|
||||||
nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalPlayedFriends;
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.Helper.LOGV(this, "Retrieved " + jSONArray.length() + "friends.", new Object[0]);
|
|
||||||
for (int i = 0; i < jSONArray.length(); i++) {
|
|
||||||
if (jSONArray.optJSONObject(i) != null) {
|
|
||||||
updateInternalCache(createNimbleUser(jSONArray.optJSONObject(i)), friendsListType, arrayList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) {
|
|
||||||
this.m_totalPlayedFriends = this.m_playedFriendsList.size();
|
|
||||||
} else {
|
|
||||||
this.m_totalFriends = this.m_friendsList.size();
|
|
||||||
}
|
|
||||||
if (nimbleFriendsRefreshCallback != null) {
|
|
||||||
Log.Helper.LOGD(this, "Friends list was updated. Invoking the callback", new Object[0]);
|
|
||||||
NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult2 = new NimbleFriendsRangeRefreshResult();
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_success = true;
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_error = null;
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_userList = arrayList;
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_startIndex = nimbleFriendsRefreshBasicInfo.getStartIndex();
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_size = nimbleFriendsRefreshBasicInfo.getRange();
|
|
||||||
if (arrayList.size() > 0) {
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_friendListEndInRefresh = true;
|
|
||||||
} else {
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_friendListEndInRefresh = false;
|
|
||||||
}
|
|
||||||
if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) {
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_totalFriendCount = this.m_totalFriends;
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult2);
|
|
||||||
} else {
|
|
||||||
nimbleFriendsRangeRefreshResult2.m_totalFriendCount = this.m_totalPlayedFriends;
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Log.Helper.LOGD(this, "Friends list was upodated, send the update notification", new Object[0]);
|
|
||||||
sendUpdateNotification();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void updateFriendsListIdentityInfo(ArrayList<UserInfoFromIdentity> arrayList, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsRefreshScope nimbleFriendsRefreshScope) {
|
|
||||||
synchronized (this) {
|
|
||||||
ArrayList<NimbleUser> arrayList2 = new ArrayList<>();
|
|
||||||
if (this.m_friends == null || this.m_friends.size() <= 0) {
|
|
||||||
Log.Helper.LOGE(this, "Current Friends list is empty. Unable to process the PID update", new Object[0]);
|
|
||||||
invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_FRIENDS_LIST_EMPTY, "Current Friends list is empty. Unable to process the PID update", friendsListType);
|
|
||||||
} else if (arrayList == null || arrayList.size() <= 0) {
|
|
||||||
Log.Helper.LOGE(this, "Updated friends array is empty", new Object[0]);
|
|
||||||
invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_IDENTITY_SERVER_EMPTY_RESPONSE, "Updated friends array is empty", friendsListType);
|
|
||||||
} else {
|
|
||||||
for (int i = 0; i < arrayList.size(); i++) {
|
|
||||||
NimbleUser nimbleUser = this.m_friends.get(arrayList.get(i).getExternalRefValue());
|
|
||||||
if (nimbleUser != null && nimbleUser.getPid() == null) {
|
|
||||||
NimbleUser nimbleUser2 = new NimbleUser(nimbleUser);
|
|
||||||
nimbleUser2.setPid(arrayList.get(i).getPidId());
|
|
||||||
nimbleUser2.setPersonaId(arrayList.get(i).getPersonaId());
|
|
||||||
this.m_friends.put(arrayList.get(i).getExternalRefValue(), nimbleUser2);
|
|
||||||
arrayList2.add(nimbleUser2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (arrayList2.size() == 0) {
|
|
||||||
Log.Helper.LOGD(this, "No Pid Info updates were made to the Friends List", new Object[0]);
|
|
||||||
invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_FRIENDS_LIST_NOT_UPDATED, "No Pid Info updates were made to the Friends List", friendsListType);
|
|
||||||
} else {
|
|
||||||
Log.Helper.LOGD(this, String.format("%d Friends were updated for Identity Scope", Integer.valueOf(arrayList2.size())), new Object[0]);
|
|
||||||
sendUpdateNotification();
|
|
||||||
if (nimbleFriendsRefreshCallback != null) {
|
|
||||||
Log.Helper.LOGD(this, "Friends list was updated. Invoking the callback", new Object[0]);
|
|
||||||
NimbleFriendsRefreshResult nimbleFriendsRefreshResult = new NimbleFriendsRefreshResult();
|
|
||||||
nimbleFriendsRefreshResult.m_success = true;
|
|
||||||
nimbleFriendsRefreshResult.m_error = null;
|
|
||||||
nimbleFriendsRefreshResult.m_userList = arrayList2;
|
|
||||||
if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) {
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult);
|
|
||||||
} else {
|
|
||||||
nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void updateInternalCache(NimbleUser nimbleUser, NimbleFriendsList.FriendsListType friendsListType, ArrayList<NimbleUser> arrayList) {
|
|
||||||
if (this.m_friends == null || nimbleUser == null || nimbleUser.getUserId() == null) {
|
|
||||||
Log.Helper.LOGI(this, "updateInternalCache - Cannot update internal cache because the friend map or the new friend is null", new Object[0]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
boolean z = true;
|
|
||||||
if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) {
|
|
||||||
z = false;
|
|
||||||
}
|
|
||||||
if (this.m_friends.get(nimbleUser.getUserId()) == null) {
|
|
||||||
if (z) {
|
|
||||||
nimbleUser.addedToAllFriends = true;
|
|
||||||
this.m_friendsList.add(nimbleUser.getUserId());
|
|
||||||
if (nimbleUser.getPlayedCurrentGame() == NimbleUser.PlayedCurrentGameFlag.PLAYED) {
|
|
||||||
this.m_playedFriendsList.add(nimbleUser.getUserId());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
nimbleUser.addedToAllFriends = false;
|
|
||||||
this.m_playedFriendsList.add(nimbleUser.getUserId());
|
|
||||||
}
|
|
||||||
this.m_friends.put(nimbleUser.getUserId(), nimbleUser);
|
|
||||||
arrayList.add(nimbleUser);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
NimbleUser nimbleUser2 = this.m_friends.get(nimbleUser.getUserId());
|
|
||||||
if (z && !nimbleUser2.addedToAllFriends) {
|
|
||||||
nimbleUser.addedToAllFriends = true;
|
|
||||||
this.m_friends.put(nimbleUser.getUserId(), nimbleUser);
|
|
||||||
this.m_friendsList.add(nimbleUser.getUserId());
|
|
||||||
}
|
|
||||||
if (nimbleUser2.isUserUpdated(nimbleUser)) {
|
|
||||||
nimbleUser.setPersonaId(nimbleUser2.getPersonaId());
|
|
||||||
nimbleUser.setPid(nimbleUser2.getPid());
|
|
||||||
nimbleUser.addedToAllFriends = nimbleUser2.addedToAllFriends;
|
|
||||||
nimbleUser.setRefreshTimestamp(new Date());
|
|
||||||
this.m_friends.put(nimbleUser.getUserId(), nimbleUser);
|
|
||||||
arrayList.add(nimbleUser);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,418 +0,0 @@
|
|||||||
package com.ea.nimble.friends;
|
|
||||||
|
|
||||||
import com.ea.nimble.Base;
|
|
||||||
import com.ea.nimble.Error;
|
|
||||||
import com.ea.nimble.Global;
|
|
||||||
import com.ea.nimble.HttpRequest;
|
|
||||||
import com.ea.nimble.IHttpRequest;
|
|
||||||
import com.ea.nimble.Log;
|
|
||||||
import com.ea.nimble.Network;
|
|
||||||
import com.ea.nimble.NetworkConnectionCallback;
|
|
||||||
import com.ea.nimble.NetworkConnectionHandle;
|
|
||||||
import com.ea.nimble.SynergyEnvironment;
|
|
||||||
import com.ea.nimble.Utility;
|
|
||||||
import com.ea.nimble.identity.INimbleIdentity;
|
|
||||||
import com.ea.nimble.identity.INimbleIdentityAuthenticator;
|
|
||||||
import com.ea.nimble.identity.NimbleIdentityPidInfo;
|
|
||||||
|
|
||||||
import org.json.JSONArray;
|
|
||||||
import org.json.JSONException;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
import org.xmlpull.v1.XmlPullParser;
|
|
||||||
import org.xmlpull.v1.XmlPullParserFactory;
|
|
||||||
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.net.MalformedURLException;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Scanner;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/friends/.class */
|
|
||||||
public class NimbleFriendsListOrigin extends NimbleFriendsListImpl {
|
|
||||||
private NimbleFriendsError lastError = null;
|
|
||||||
private static String GET_FRIENDS_URI_PARAMS = "/friends/2/users/%s/friends?start=%d&size=%d&names=%s";
|
|
||||||
private static String GET_FRIENDS_AVATAR_URI = "/avatar/user/%s/avatars";
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: package-private */
|
|
||||||
public NimbleFriendsListOrigin() {
|
|
||||||
this.LOG_SOURCE_TITLE = "";
|
|
||||||
this.m_authenticatorId = Global.NIMBLE_AUTHENTICATOR_ORIGIN;
|
|
||||||
Log.Helper.LOGV(this, "Constructed");
|
|
||||||
this.m_pageSize = 20;
|
|
||||||
this.m_nimbleFriendsList = new NimbleFriendsList(this, NimbleFriendsList.FriendsListType.ALL_FRIENDS);
|
|
||||||
this.m_nimblePlayedFriendsList = new NimbleFriendsList(this, NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS);
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getMdmAppKey() {
|
|
||||||
return SynergyEnvironment.getComponent().getGosMdmAppKey();
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getOriginAvatarsUrlFromSynergy() {
|
|
||||||
String serverUrlWithKey = SynergyEnvironment.getComponent().getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_ORIGIN_AVATAR);
|
|
||||||
if (serverUrlWithKey == null || serverUrlWithKey.length() <= 0) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
String str = serverUrlWithKey;
|
|
||||||
if (serverUrlWithKey.charAt(serverUrlWithKey.length() - 1) == '/') {
|
|
||||||
str = serverUrlWithKey.substring(0, serverUrlWithKey.length() - 1);
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getOriginFriendsUrlFromSynergy() {
|
|
||||||
String serverUrlWithKey = SynergyEnvironment.getComponent().getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_EADP_FRIENDS_HOST);
|
|
||||||
if (serverUrlWithKey == null || serverUrlWithKey.length() <= 0) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
String str = serverUrlWithKey;
|
|
||||||
if (serverUrlWithKey.charAt(serverUrlWithKey.length() - 1) == '/') {
|
|
||||||
str = serverUrlWithKey.substring(0, serverUrlWithKey.length() - 1);
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
private HttpRequest makeGetFriendsAvatarInfoRequest(String str, String str2, List<String> list) {
|
|
||||||
MalformedURLException e;
|
|
||||||
String originAvatarsUrlFromSynergy = getOriginAvatarsUrlFromSynergy();
|
|
||||||
if (str == null || str.length() <= 0 || list == null || list.size() <= 0 || list.size() > 20 || originAvatarsUrlFromSynergy == null || originAvatarsUrlFromSynergy.length() <= 0) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
HttpRequest httpRequest = null;
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
for (String str3 : list) {
|
|
||||||
sb.append(str3);
|
|
||||||
sb.append(";");
|
|
||||||
}
|
|
||||||
sb.deleteCharAt(sb.length() - 1);
|
|
||||||
try {
|
|
||||||
HttpRequest httpRequest2 = new HttpRequest(new URL(originAvatarsUrlFromSynergy + String.format(GET_FRIENDS_AVATAR_URI, sb.toString())));
|
|
||||||
httpRequest2.method = IHttpRequest.Method.GET;
|
|
||||||
HashMap<String, String> hashMap = new HashMap<>();
|
|
||||||
hashMap.put("AuthToken", str);
|
|
||||||
httpRequest2.headers = hashMap;
|
|
||||||
return httpRequest2;
|
|
||||||
} catch (MalformedURLException e3) {
|
|
||||||
e = e3;
|
|
||||||
}
|
|
||||||
return new HttpRequest();
|
|
||||||
}
|
|
||||||
|
|
||||||
private HttpRequest makeGetFriendsRequest(int i, int i2, boolean z, String str, String str2, String str3) {
|
|
||||||
MalformedURLException e;
|
|
||||||
String originFriendsUrlFromSynergy = getOriginFriendsUrlFromSynergy();
|
|
||||||
String mdmAppKey = getMdmAppKey();
|
|
||||||
if (str == null || str.length() <= 0) {
|
|
||||||
Log.Helper.LOGE(this, "Failed to create GOS friends request because access token for Origin is null or invalid");
|
|
||||||
return null;
|
|
||||||
} else if (originFriendsUrlFromSynergy == null || originFriendsUrlFromSynergy.length() <= 0) {
|
|
||||||
Log.Helper.LOGE(this, "Failed to create GOS friends request because GOS request URL is null or invalid");
|
|
||||||
return null;
|
|
||||||
} else if (mdmAppKey == null || mdmAppKey.length() <= 0) {
|
|
||||||
Log.Helper.LOGE(this, "Failed to create GOS friends request because MDM App Key is null or invalid");
|
|
||||||
return null;
|
|
||||||
} else if (str3 == null || str3.length() <= 0) {
|
|
||||||
Log.Helper.LOGE(this, "Failed to create GOS friends request because Origin user's PID is null or invalid");
|
|
||||||
return null;
|
|
||||||
} else {
|
|
||||||
String str4 = str2 + " " + str;
|
|
||||||
HttpRequest httpRequest = null;
|
|
||||||
try {
|
|
||||||
HttpRequest httpRequest2 = new HttpRequest(new URL(originFriendsUrlFromSynergy + (z ? String.format(GET_FRIENDS_URI_PARAMS, str3, Integer.valueOf(i), Integer.valueOf(i2), "true") : String.format(GET_FRIENDS_URI_PARAMS, str3, Integer.valueOf(i), Integer.valueOf(i2), "false"))));
|
|
||||||
httpRequest2.method = IHttpRequest.Method.GET;
|
|
||||||
HashMap<String, String> hashMap = new HashMap<>();
|
|
||||||
hashMap.put("Authorization", str4);
|
|
||||||
hashMap.put("X-Application-Key", mdmAppKey);
|
|
||||||
hashMap.put("X-Api-Version", "2");
|
|
||||||
httpRequest2.headers = hashMap;
|
|
||||||
return httpRequest2;
|
|
||||||
} catch (MalformedURLException e3) {
|
|
||||||
e = e3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new HttpRequest();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: private */
|
|
||||||
public ArrayList<NimbleUser> parseAvatarInfoXml(NetworkConnectionHandle networkConnectionHandle) throws Error {
|
|
||||||
Exception e;
|
|
||||||
this.lastError = null;
|
|
||||||
int statusCode = networkConnectionHandle.getResponse().getStatusCode();
|
|
||||||
if (statusCode != 200) {
|
|
||||||
switch (statusCode) {
|
|
||||||
case Log.LEVEL_WARN /* 400 */:
|
|
||||||
this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR, String.format("Avatar Info HTTP Resonse Error. Description: %s", "The indicated parameter is empty or invalid."));
|
|
||||||
break;
|
|
||||||
case 401:
|
|
||||||
this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR, String.format("Avatar Info HTTP Resonse Error. Description: %s", "The specified AuthToken is empty or invalid."));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR, "Avatar Info HTTP Resonse Error");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
throw this.lastError;
|
|
||||||
}
|
|
||||||
InputStream dataStream = networkConnectionHandle.getResponse().getDataStream();
|
|
||||||
if (dataStream == null || dataStream.toString().length() == 0) {
|
|
||||||
throw new NimbleFriendsError(networkConnectionHandle.getResponse().getStatusCode(), networkConnectionHandle.getResponse().getError().getMessage());
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
XmlPullParser newPullParser = XmlPullParserFactory.newInstance().newPullParser();
|
|
||||||
newPullParser.setFeature("http://xmlpull.org/v1/doc/features.html#process-namespaces", false);
|
|
||||||
newPullParser.setInput(dataStream, null);
|
|
||||||
NimbleUser nimbleUser = null;
|
|
||||||
ArrayList<NimbleUser> arrayList = null;
|
|
||||||
for (int eventType = newPullParser.getEventType(); eventType != 1; eventType = newPullParser.next()) {
|
|
||||||
switch (eventType) {
|
|
||||||
case 0:
|
|
||||||
try {
|
|
||||||
arrayList = new ArrayList<>();
|
|
||||||
break;
|
|
||||||
} catch (Exception e2) {
|
|
||||||
e = e2;
|
|
||||||
Log.Helper.LOGE(this, String.format("Parsing of GOS Avatar Info XML raised an exception. Details: %s", e.getMessage()));
|
|
||||||
e.printStackTrace();
|
|
||||||
this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_ERROR_PARSING_HTTP_RESPONSE, "Failed to parse the response XML from GOS Avatar service");
|
|
||||||
throw this.lastError;
|
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
String name = newPullParser.getName();
|
|
||||||
if (name.equalsIgnoreCase("user")) {
|
|
||||||
nimbleUser = new NimbleUser();
|
|
||||||
try {
|
|
||||||
nimbleUser.setAuthenticatorId(Global.NIMBLE_AUTHENTICATOR_ORIGIN);
|
|
||||||
break;
|
|
||||||
} catch (Exception e3) {
|
|
||||||
e = e3;
|
|
||||||
Log.Helper.LOGE(this, String.format("Parsing of GOS Avatar Info XML raised an exception. Details: %s", e.getMessage()));
|
|
||||||
e.printStackTrace();
|
|
||||||
this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_ERROR_PARSING_HTTP_RESPONSE, "Failed to parse the response XML from GOS Avatar service");
|
|
||||||
throw this.lastError;
|
|
||||||
}
|
|
||||||
} else if (nimbleUser == null) {
|
|
||||||
continue;
|
|
||||||
} else if (name.equalsIgnoreCase("userId")) {
|
|
||||||
String nextText = newPullParser.nextText();
|
|
||||||
nimbleUser.setUserId(nextText);
|
|
||||||
nimbleUser.setPid(nextText);
|
|
||||||
continue;
|
|
||||||
} else if (name.equalsIgnoreCase("link")) {
|
|
||||||
nimbleUser.setImageUrl(newPullParser.nextText());
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
case 3:
|
|
||||||
if (newPullParser.getName().equalsIgnoreCase("user") && nimbleUser != null) {
|
|
||||||
arrayList.add(nimbleUser);
|
|
||||||
nimbleUser = null;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return arrayList;
|
|
||||||
} catch (Exception e4) {
|
|
||||||
e = e4;
|
|
||||||
}
|
|
||||||
return new ArrayList<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: private */
|
|
||||||
public ArrayList<NimbleUser> parseBodyJSONData(NetworkConnectionHandle networkConnectionHandle) throws Error {
|
|
||||||
InputStream dataStream = networkConnectionHandle.getResponse().getDataStream();
|
|
||||||
this.lastError = null;
|
|
||||||
if (dataStream == null || dataStream.toString().length() == 0) {
|
|
||||||
throw new NimbleFriendsError(networkConnectionHandle.getResponse().getStatusCode(), networkConnectionHandle.getResponse().getError().getMessage());
|
|
||||||
}
|
|
||||||
Scanner useDelimiter = new Scanner(dataStream).useDelimiter("\\A");
|
|
||||||
String str = "";
|
|
||||||
if (useDelimiter.hasNext()) {
|
|
||||||
str = useDelimiter.next();
|
|
||||||
}
|
|
||||||
useDelimiter.close();
|
|
||||||
ArrayList<NimbleUser> arrayList = new ArrayList<>();
|
|
||||||
if (str == null || str.length() <= 0) {
|
|
||||||
Log.Helper.LOGE(this, "Generic Server error when retrieving GOS Friends.");
|
|
||||||
this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR, "Generic Server error when retrieving GOS Friends.");
|
|
||||||
return arrayList;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
JSONObject jSONObject = new JSONObject(str);
|
|
||||||
ArrayList<NimbleUser> arrayList2 = arrayList;
|
|
||||||
if (jSONObject != null) {
|
|
||||||
if (jSONObject.optJSONObject("error") == null) {
|
|
||||||
JSONArray optJSONArray = jSONObject.optJSONArray("entries");
|
|
||||||
if (optJSONArray != null && optJSONArray.length() > 0) {
|
|
||||||
int i = 0;
|
|
||||||
while (true) {
|
|
||||||
arrayList2 = arrayList;
|
|
||||||
if (i >= optJSONArray.length()) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
JSONObject jSONObject2 = optJSONArray.getJSONObject(i);
|
|
||||||
if (jSONObject2 != null) {
|
|
||||||
NimbleUser createNimbleUser = createNimbleUser(jSONObject2);
|
|
||||||
if (createNimbleUser.getUserId() != null && createNimbleUser.getUserId().length() > 0) {
|
|
||||||
arrayList.add(createNimbleUser);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
} else if (optJSONArray == null || optJSONArray.length() != 0) {
|
|
||||||
JSONObject jSONObject3 = jSONObject.getJSONObject("error");
|
|
||||||
if (jSONObject3 != null) {
|
|
||||||
int optInt = jSONObject3.optInt("code", -1);
|
|
||||||
String optString = jSONObject3.optString("type", "");
|
|
||||||
Log.Helper.LOGE(this, String.format("Server error when retrieving GOS Friends. Code = %d, Message = %s", Integer.valueOf(optInt), optString));
|
|
||||||
this.lastError = new NimbleFriendsError(optInt, optString);
|
|
||||||
return arrayList;
|
|
||||||
}
|
|
||||||
Log.Helper.LOGE(this, "Generic Server error when retrieving GOS Friends.");
|
|
||||||
this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR, "Generic Server error when retrieving GOS Friends.");
|
|
||||||
return arrayList;
|
|
||||||
} else {
|
|
||||||
Log.Helper.LOGD(this, "GOS response indicates there are no friends for this Origin user");
|
|
||||||
this.lastError = null;
|
|
||||||
return arrayList;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
JSONObject optJSONObject = jSONObject.optJSONObject("error");
|
|
||||||
String optString2 = optJSONObject.optString("type");
|
|
||||||
int optInt2 = optJSONObject.optInt("code", -1);
|
|
||||||
if (optString2 != null && optString2.length() > 0) {
|
|
||||||
this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR, String.format("Code: %d, Type: %s", Integer.valueOf(optInt2), optString2));
|
|
||||||
}
|
|
||||||
arrayList2 = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return arrayList2;
|
|
||||||
} catch (JSONException e) {
|
|
||||||
Log.Helper.LOGE(this, String.format("Exception when parsing JSON response. Error: %s", e.getMessage()));
|
|
||||||
this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR, e.getMessage());
|
|
||||||
return arrayList;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: private */
|
|
||||||
public void sendGosRefreshAvatarsRequest(String str, String str2, List<String> list, final NimbleFriendsList.FriendsListType friendsListType, final NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, final NimbleFriendsRefreshScope nimbleFriendsRefreshScope) {
|
|
||||||
try {
|
|
||||||
HttpRequest makeGetFriendsAvatarInfoRequest = makeGetFriendsAvatarInfoRequest(str, str2, list);
|
|
||||||
if (makeGetFriendsAvatarInfoRequest == null) {
|
|
||||||
Log.Helper.LOGE(this, "Failed to create HTTP Request for GOS getAvatarInfo");
|
|
||||||
invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_FAILED_TO_CREATE_GOS_REQUEST, "Failed to create HTTP Request for GOS getAvatarInfo", friendsListType);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Network.getComponent().sendRequest(makeGetFriendsAvatarInfoRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.friends..4
|
|
||||||
@Override // com.ea.nimble.NetworkConnectionCallback
|
|
||||||
public void callback(NetworkConnectionHandle networkConnectionHandle) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.Helper.LOGE(this, String.format("Exception raised when creating GoS Avatar URL refresh request. Exception: %s", e.getMessage()));
|
|
||||||
invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_ERROR_PARSING_HTTP_RESPONSE, "Failed to process request for Avatar Info"), friendsListType);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: private */
|
|
||||||
public void sendGosRefreshFriendsRequest(int i, int i2, String str, String str2, String str3, final NimbleFriendsList.FriendsListType friendsListType, final NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, final NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo) {
|
|
||||||
try {
|
|
||||||
HttpRequest makeGetFriendsRequest = makeGetFriendsRequest(i, i2, true, str, str2, str3);
|
|
||||||
if (makeGetFriendsRequest == null) {
|
|
||||||
try {
|
|
||||||
Log.Helper.LOGE(this, "Failed to create HTTP Request for GOS getFriendsList");
|
|
||||||
invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_FAILED_TO_CREATE_GOS_REQUEST, "Failed to create HTTP Request for GOS getFriendsList", friendsListType);
|
|
||||||
} catch (Exception e) {
|
|
||||||
String format = String.format("Authenticator (%s) does not support Identity Refresh for Friends List", this.m_authenticatorId);
|
|
||||||
Log.Helper.LOGE(this, format);
|
|
||||||
invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_SUPPORTED, format, friendsListType);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Network.getComponent().sendRequest(makeGetFriendsRequest, networkConnectionHandle -> { });
|
|
||||||
}
|
|
||||||
} catch (Exception e2) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.friends.NimbleFriendsListImpl
|
|
||||||
protected NimbleUser createNimbleUser(JSONObject jSONObject) {
|
|
||||||
NimbleUser nimbleUser = new NimbleUser();
|
|
||||||
try {
|
|
||||||
nimbleUser.setAuthenticatorId(this.m_authenticatorId);
|
|
||||||
nimbleUser.setDisplayName(jSONObject.optString("displayName", ""));
|
|
||||||
nimbleUser.setFriendType(jSONObject.optString("friendType", ""));
|
|
||||||
nimbleUser.setUserId(String.valueOf(jSONObject.optLong("userId")));
|
|
||||||
nimbleUser.setPersonaId(String.valueOf(jSONObject.optLong("personaId")));
|
|
||||||
nimbleUser.setPid(String.valueOf(jSONObject.optLong("userId")));
|
|
||||||
if (jSONObject.optLong("timestamp", 0) != 0) {
|
|
||||||
nimbleUser.setRefreshTimestamp(new Date(jSONObject.optLong("timestamp") * 1000));
|
|
||||||
}
|
|
||||||
return nimbleUser;
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.Helper.LOGW(this, String.format("Exception when parsing JSON for Friends. Message: %s", e.getMessage()));
|
|
||||||
return nimbleUser;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.friends.NimbleFriendsListImpl, com.ea.nimble.LogSource
|
|
||||||
public /* bridge */ /* synthetic */ String getLogSourceTitle() {
|
|
||||||
return super.getLogSourceTitle();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.friends.NimbleFriendsListImpl
|
|
||||||
protected void refreshFriendsListBasicInfo(final int i, final int i2, String str, final NimbleFriendsList.FriendsListType friendsListType, final NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, final NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo) {
|
|
||||||
if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) {
|
|
||||||
Log.Helper.LOGE(this, "Origin Friends Service does not support getting friends with PlayedCurrentGame flag");
|
|
||||||
invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_FRIENDS_LIST_TYPE_UNSUPPORTED, "Origin Friends Service does not support getting friends with PlayedCurrentGame flag", friendsListType);
|
|
||||||
} else if (!isNimbleComponentAvailable("com.ea.nimble.identity")) {
|
|
||||||
Log.Helper.LOGE(this, "Unable to refresh friends Identity information because NimbleIdentity is not available");
|
|
||||||
invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE, "Unable to refresh friends Identity information because NimbleIdentity is not available", friendsListType);
|
|
||||||
} else {
|
|
||||||
INimbleIdentity iNimbleIdentity = (INimbleIdentity) Base.getComponent("com.ea.nimble.identity");
|
|
||||||
NimbleIdentityPidInfo pidInfo = iNimbleIdentity.getAuthenticatorById(this.m_authenticatorId).getPidInfo();
|
|
||||||
String str2 = null;
|
|
||||||
if (pidInfo != null) {
|
|
||||||
str2 = pidInfo.getPid();
|
|
||||||
}
|
|
||||||
if (!Utility.validString(str2)) {
|
|
||||||
invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_LOGGED_IN, "Origin PID for the current user is not available.", friendsListType);
|
|
||||||
} else {
|
|
||||||
// from class: com.ea.nimble.friends..1
|
|
||||||
// com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback
|
|
||||||
iNimbleIdentity.getAuthenticatorById(this.m_authenticatorId).requestAccessToken((iNimbleIdentityAuthenticator, str3, str4, error) -> {
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.friends.NimbleFriendsListImpl
|
|
||||||
protected void refreshFriendsListIdentityInfo(ArrayList<String> arrayList, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshScope nimbleFriendsRefreshScope, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback) {
|
|
||||||
Log.Helper.LOGI(this, "Origin Friends Service does not support IdentityInfo refresh because Origin friends already have Identity information");
|
|
||||||
invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_TYPE_UNSUPPORTED, "Origin Friends Service does not support IdentityInfo refresh because Origin friends already have Identity information", friendsListType);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // com.ea.nimble.friends.NimbleFriendsListImpl
|
|
||||||
protected void refreshFriendsListImageUrl(final List<String> list, final NimbleFriendsList.FriendsListType friendsListType, final NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, final NimbleFriendsRefreshScope nimbleFriendsRefreshScope) {
|
|
||||||
if (!isNimbleComponentAvailable("com.ea.nimble.identity")) {
|
|
||||||
Log.Helper.LOGE(this, "Unable to refresh friends Avatar information because NimbleIdentity is not available");
|
|
||||||
invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE, "Unable to refresh friends Avatar information because NimbleIdentity is not available", friendsListType);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
INimbleIdentity iNimbleIdentity = (INimbleIdentity) Base.getComponent("com.ea.nimble.identity");
|
|
||||||
if (iNimbleIdentity == null) {
|
|
||||||
Log.Helper.LOGE(this, "Identity Component not found. Not able to get friends Avatars.");
|
|
||||||
invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE, "Identity Component not found. Not able to get friends Avatars.", friendsListType);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
iNimbleIdentity.getAuthenticatorById(this.m_authenticatorId).requestAccessToken(new INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback() { // from class: com.ea.nimble.friends..3
|
|
||||||
@Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback
|
|
||||||
public void AccessTokenCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String str, String str2, Error error) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
package com.ea.nimble.friends;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsRangeRefreshResult.class */
|
|
||||||
public class NimbleFriendsRangeRefreshResult extends NimbleFriendsRefreshResult {
|
|
||||||
protected boolean m_friendListEndInRefresh;
|
|
||||||
protected int m_size;
|
|
||||||
protected int m_startIndex;
|
|
||||||
protected int m_totalFriendCount;
|
|
||||||
|
|
||||||
public int getRefreshSize() {
|
|
||||||
return this.m_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getRefreshStartIndex() {
|
|
||||||
return this.m_startIndex;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getTotalFriendCount() {
|
|
||||||
return this.m_totalFriendCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isFriendListEndInRefresh() {
|
|
||||||
return this.m_friendListEndInRefresh;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
package com.ea.nimble.friends;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsRefreshBasicInfo.class */
|
|
||||||
public class NimbleFriendsRefreshBasicInfo extends NimbleFriendsRefreshScope {
|
|
||||||
private boolean m_nextPage;
|
|
||||||
private int m_range;
|
|
||||||
private int m_startIndex;
|
|
||||||
|
|
||||||
public NimbleFriendsRefreshBasicInfo() {
|
|
||||||
this.m_startIndex = -1;
|
|
||||||
this.m_range = -1;
|
|
||||||
this.m_nextPage = false;
|
|
||||||
this.m_nextPage = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public NimbleFriendsRefreshBasicInfo(int i, int i2) {
|
|
||||||
this.m_startIndex = -1;
|
|
||||||
this.m_range = -1;
|
|
||||||
this.m_nextPage = false;
|
|
||||||
this.m_startIndex = i;
|
|
||||||
this.m_range = i2;
|
|
||||||
this.m_nextPage = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: package-private */
|
|
||||||
public boolean getNextPage() {
|
|
||||||
return this.m_nextPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: package-private */
|
|
||||||
public int getRange() {
|
|
||||||
return this.m_range;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: package-private */
|
|
||||||
public int getStartIndex() {
|
|
||||||
return this.m_startIndex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
package com.ea.nimble.friends;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsRefreshCallback.class */
|
|
||||||
public interface NimbleFriendsRefreshCallback {
|
|
||||||
void onCallback(NimbleFriendsList nimbleFriendsList, NimbleFriendsRefreshScope nimbleFriendsRefreshScope, NimbleFriendsRefreshResult nimbleFriendsRefreshResult);
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
package com.ea.nimble.friends;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsRefreshIdentityInfo.class */
|
|
||||||
public class NimbleFriendsRefreshIdentityInfo extends NimbleFriendsRefreshScope {
|
|
||||||
private ArrayList<String> userIds;
|
|
||||||
|
|
||||||
public NimbleFriendsRefreshIdentityInfo(ArrayList<String> arrayList) {
|
|
||||||
this.userIds = arrayList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArrayList<String> getTargetedFriendIds() {
|
|
||||||
return this.userIds;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
package com.ea.nimble.friends;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsRefreshImageUrl.class */
|
|
||||||
public class NimbleFriendsRefreshImageUrl extends NimbleFriendsRefreshScope {
|
|
||||||
private ArrayList<String> userIds;
|
|
||||||
|
|
||||||
public NimbleFriendsRefreshImageUrl(ArrayList<String> arrayList) {
|
|
||||||
this.userIds = arrayList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArrayList<String> getTargetedFriendIds() {
|
|
||||||
return this.userIds;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
package com.ea.nimble.friends;
|
|
||||||
|
|
||||||
import com.ea.nimble.Error;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsRefreshResult.class */
|
|
||||||
public class NimbleFriendsRefreshResult {
|
|
||||||
protected Error m_error;
|
|
||||||
protected boolean m_success;
|
|
||||||
protected ArrayList<NimbleUser> m_userList = new ArrayList<>();
|
|
||||||
|
|
||||||
public Error getError() {
|
|
||||||
return this.m_error;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<NimbleUser> getUpdatedFriends() {
|
|
||||||
return this.m_userList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSuccess() {
|
|
||||||
return this.m_success;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
package com.ea.nimble.friends;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsRefreshScope.class */
|
|
||||||
public abstract class NimbleFriendsRefreshScope {
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
package com.ea.nimble.friends;
|
|
||||||
|
|
||||||
import com.ea.nimble.Base;
|
|
||||||
import com.ea.nimble.Error;
|
|
||||||
import com.ea.nimble.NetworkConnectionHandle;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Scanner;
|
|
||||||
import org.json.JSONArray;
|
|
||||||
import org.json.JSONException;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
class NimbleFriendsUtility {
|
|
||||||
NimbleFriendsUtility() {
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static JSONArray cutJSONArray(JSONArray jSONArray, int i) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static boolean isNimbleComponentAvailable(String str) {
|
|
||||||
boolean z = false;
|
|
||||||
if (Base.getComponent(str) != null) {
|
|
||||||
z = true;
|
|
||||||
}
|
|
||||||
return z;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static HashMap<String, Object> parseBodyJSONData(NetworkConnectionHandle networkConnectionHandle) throws Error {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: protected */
|
|
||||||
public static ArrayList<UserInfoFromIdentity> parseJSONObjectToArrayOfUserInfo(JSONObject jSONObject) {
|
|
||||||
ArrayList<UserInfoFromIdentity> arrayList = null;
|
|
||||||
if (jSONObject != null) {
|
|
||||||
if (jSONObject.optJSONObject("pidInfos") == null) {
|
|
||||||
arrayList = null;
|
|
||||||
} else {
|
|
||||||
JSONArray optJSONArray = jSONObject.optJSONObject("pidInfos").optJSONArray("pidInfo");
|
|
||||||
arrayList = null;
|
|
||||||
if (optJSONArray != null) {
|
|
||||||
ArrayList<UserInfoFromIdentity> arrayList2 = new ArrayList<>();
|
|
||||||
int i = 0;
|
|
||||||
while (true) {
|
|
||||||
arrayList = arrayList2;
|
|
||||||
if (i >= optJSONArray.length()) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
UserInfoFromIdentity userInfoFromIdentity = new UserInfoFromIdentity(optJSONArray.getJSONObject(i));
|
|
||||||
if (!(userInfoFromIdentity.getPidId() == null || userInfoFromIdentity.getPidId() == "" || userInfoFromIdentity.getExternalRefValue() == null || userInfoFromIdentity.getExternalRefValue() == "")) {
|
|
||||||
arrayList2.add(userInfoFromIdentity);
|
|
||||||
}
|
|
||||||
} catch (JSONException e) {
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return arrayList;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
package com.ea.nimble.friends;
|
|
||||||
|
|
||||||
import com.ea.nimble.Base;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleOriginFriendsService.class */
|
|
||||||
public class NimbleOriginFriendsService {
|
|
||||||
public static final String NIMBLE_COMPONENT_ID_FRIENDS_ORIGIN = "com.ea.nimble.friends.originfriendsservice";
|
|
||||||
|
|
||||||
public static INimbleOriginFriendsService getComponent() {
|
|
||||||
return (INimbleOriginFriendsService) Base.getComponent(NIMBLE_COMPONENT_ID_FRIENDS_ORIGIN);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,233 +0,0 @@
|
|||||||
package com.ea.nimble.friends;
|
|
||||||
|
|
||||||
import com.ea.nimble.Global;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.TimeZone;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleUser.class */
|
|
||||||
public class NimbleUser {
|
|
||||||
protected boolean addedToAllFriends;
|
|
||||||
protected String authenticatorId;
|
|
||||||
protected String displayName;
|
|
||||||
protected Map<String, String> extraInfo;
|
|
||||||
protected String friendType;
|
|
||||||
protected String imageUrl;
|
|
||||||
protected String personaId;
|
|
||||||
protected String pid;
|
|
||||||
protected PlayedCurrentGameFlag playedCurrentGame;
|
|
||||||
protected Date refreshTimestamp;
|
|
||||||
protected String userId;
|
|
||||||
|
|
||||||
/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleUser$PlayedCurrentGameFlag.class */
|
|
||||||
public enum PlayedCurrentGameFlag {
|
|
||||||
NOT_AVAILABLE,
|
|
||||||
PLAYED,
|
|
||||||
NOT_PLAYED
|
|
||||||
}
|
|
||||||
|
|
||||||
public NimbleUser() {
|
|
||||||
this.playedCurrentGame = PlayedCurrentGameFlag.NOT_AVAILABLE;
|
|
||||||
this.addedToAllFriends = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public NimbleUser(NimbleUser nimbleUser) {
|
|
||||||
this.playedCurrentGame = PlayedCurrentGameFlag.NOT_AVAILABLE;
|
|
||||||
this.addedToAllFriends = false;
|
|
||||||
this.displayName = nimbleUser.getDisplayName();
|
|
||||||
this.authenticatorId = nimbleUser.getAuthenticatorId();
|
|
||||||
this.userId = nimbleUser.getUserId();
|
|
||||||
this.pid = nimbleUser.getPid();
|
|
||||||
this.personaId = nimbleUser.getPersonaId();
|
|
||||||
this.playedCurrentGame = nimbleUser.getPlayedCurrentGame();
|
|
||||||
this.imageUrl = nimbleUser.getImageUrl();
|
|
||||||
this.refreshTimestamp = nimbleUser.getRefreshTimestamp();
|
|
||||||
this.friendType = nimbleUser.getFriendType();
|
|
||||||
this.addedToAllFriends = nimbleUser.addedToAllFriends;
|
|
||||||
if (nimbleUser.getExtraInfo() == null) {
|
|
||||||
this.extraInfo = null;
|
|
||||||
} else {
|
|
||||||
this.extraInfo = new HashMap(nimbleUser.getExtraInfo());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAuthenticatorId() {
|
|
||||||
return this.authenticatorId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDisplayName() {
|
|
||||||
return this.displayName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, String> getExtraInfo() {
|
|
||||||
return this.extraInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFriendType() {
|
|
||||||
return this.friendType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getImageUrl() {
|
|
||||||
return (this.authenticatorId == null || !this.authenticatorId.equals(Global.NIMBLE_AUTHENTICATOR_FACEBOOK) || this.userId == null || this.userId.length() <= 0) ? this.imageUrl : String.format("https://graph.facebook.com/%s/picture?type=normal", this.userId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPersonaId() {
|
|
||||||
return this.personaId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPid() {
|
|
||||||
return this.pid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PlayedCurrentGameFlag getPlayedCurrentGame() {
|
|
||||||
return this.playedCurrentGame;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getRefreshTimestamp() {
|
|
||||||
return this.refreshTimestamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUserId() {
|
|
||||||
return this.userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: package-private */
|
|
||||||
public boolean isUserUpdated(NimbleUser nimbleUser) {
|
|
||||||
if (nimbleUser == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
boolean z = false;
|
|
||||||
if (nimbleUser.getDisplayName() != null) {
|
|
||||||
z = false;
|
|
||||||
if (nimbleUser.getDisplayName() != "") {
|
|
||||||
if (getDisplayName() == null) {
|
|
||||||
z = true;
|
|
||||||
} else {
|
|
||||||
z = false;
|
|
||||||
if (!nimbleUser.getDisplayName().equals(getDisplayName())) {
|
|
||||||
z = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
boolean z2 = z;
|
|
||||||
if (nimbleUser.getPid() != null) {
|
|
||||||
z2 = z;
|
|
||||||
if (nimbleUser.getPid() != "") {
|
|
||||||
if (getPid() == null) {
|
|
||||||
z2 = true;
|
|
||||||
} else {
|
|
||||||
z2 = z;
|
|
||||||
if (!nimbleUser.getPid().equals(getPid())) {
|
|
||||||
z2 = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
boolean z3 = z2;
|
|
||||||
if (nimbleUser.getPersonaId() != null) {
|
|
||||||
z3 = z2;
|
|
||||||
if (nimbleUser.getPersonaId() != "") {
|
|
||||||
if (getPersonaId() == null) {
|
|
||||||
z3 = true;
|
|
||||||
} else {
|
|
||||||
z3 = z2;
|
|
||||||
if (!nimbleUser.getPersonaId().equals(getPersonaId())) {
|
|
||||||
z3 = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
boolean z4 = z3;
|
|
||||||
if (nimbleUser.getImageUrl() != null) {
|
|
||||||
z4 = z3;
|
|
||||||
if (nimbleUser.getImageUrl() != "") {
|
|
||||||
if (getImageUrl() == null) {
|
|
||||||
z4 = true;
|
|
||||||
} else {
|
|
||||||
z4 = z3;
|
|
||||||
if (!nimbleUser.getImageUrl().equals(getImageUrl())) {
|
|
||||||
z4 = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
boolean z5 = z4;
|
|
||||||
if (nimbleUser.getPlayedCurrentGame() != null) {
|
|
||||||
if (getPlayedCurrentGame() == null) {
|
|
||||||
z5 = true;
|
|
||||||
} else {
|
|
||||||
z5 = z4;
|
|
||||||
if (!nimbleUser.getPlayedCurrentGame().equals(getPlayedCurrentGame())) {
|
|
||||||
z5 = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return z5;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: protected */
|
|
||||||
public void setAuthenticatorId(String str) {
|
|
||||||
this.authenticatorId = str;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: protected */
|
|
||||||
public void setDisplayName(String str) {
|
|
||||||
this.displayName = str;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void setExtraInfo(Map<String, String> map) {
|
|
||||||
this.extraInfo = map;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: protected */
|
|
||||||
public void setFriendType(String str) {
|
|
||||||
this.friendType = str;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: protected */
|
|
||||||
public void setImageUrl(String str) {
|
|
||||||
this.imageUrl = str;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: protected */
|
|
||||||
public void setPersonaId(String str) {
|
|
||||||
this.personaId = str;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: protected */
|
|
||||||
public void setPid(String str) {
|
|
||||||
this.pid = str;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void setPlayedCurrentGame(PlayedCurrentGameFlag playedCurrentGameFlag) {
|
|
||||||
this.playedCurrentGame = playedCurrentGameFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: protected */
|
|
||||||
public void setRefreshTimestamp(Date date) {
|
|
||||||
this.refreshTimestamp = date;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* JADX INFO: Access modifiers changed from: protected */
|
|
||||||
public void setUserId(String str) {
|
|
||||||
this.userId = str;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
|
||||||
String str;
|
|
||||||
String str2 = this.playedCurrentGame == PlayedCurrentGameFlag.PLAYED ? "YES" : this.playedCurrentGame == PlayedCurrentGameFlag.NOT_PLAYED ? "NO" : this.playedCurrentGame == PlayedCurrentGameFlag.NOT_AVAILABLE ? "NOT AVAILABLE" : "UNKNOWN";
|
|
||||||
try {
|
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS", Locale.US);
|
|
||||||
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));
|
|
||||||
str = simpleDateFormat.format(this.refreshTimestamp);
|
|
||||||
} catch (Exception e) {
|
|
||||||
str = "";
|
|
||||||
}
|
|
||||||
new String();
|
|
||||||
return ("displayName(" + getDisplayName() + ") friendId(" + getUserId() + ") pid(" + this.pid + ") personaId(" + getPersonaId() + ") imageUrl(" + getImageUrl() + ") authenticatorId(" + getAuthenticatorId() + ") playedCurrentGame(" + str2 + ")refreshTimestamp(" + str + ")") + "ExtraInfo(" + (getExtraInfo() == null ? "" : getExtraInfo().toString()) + ") \n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user