diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index e3df730..5468daa 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -31,29 +31,24 @@
android:icon="@drawable/icon"
android:label="@string/app_name"
android:screenOrientation="landscape">
-
-
-
-
-
-
+
+
+
+
-
-
diff --git a/app/src/main/java/com/ea/ironmonkey/GameActivity.kt b/app/src/main/java/com/ea/ironmonkey/GameActivity.kt
index 0098c8f..28c4185 100644
--- a/app/src/main/java/com/ea/ironmonkey/GameActivity.kt
+++ b/app/src/main/java/com/ea/ironmonkey/GameActivity.kt
@@ -23,7 +23,7 @@ import com.ea.EAIO.EAIO
import com.ea.EAMIO.StorageDirectory
import com.ea.easp.EASPHandler
import com.ea.games.nfs13_na.BuildConfig
-import com.ea.nimble.ApplicationLifecycle
+//import com.ea.nimble.ApplicationLifecycle
import java.io.BufferedReader
import java.io.File
import java.io.FileReader
@@ -283,7 +283,7 @@ class GameActivity : ComponentActivity(), DrawFrameListener {
public override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.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?) {
@@ -352,7 +352,7 @@ class GameActivity : ComponentActivity(), DrawFrameListener {
easpHandler = EASPHandler(this, frameLayout, gameGLSurfaceView)
easpHandler.onCreate()
- ApplicationLifecycle.onActivityCreate(bundle, this)
+ //ApplicationLifecycle.onActivityCreate(bundle, this)
Log.d(className, "nativeOnCreate")
nativeOnCreate()
@@ -366,7 +366,7 @@ class GameActivity : ComponentActivity(), DrawFrameListener {
super.onDestroy()
easpHandler.onDestroy()
if (state == 8) {
- ApplicationLifecycle.onActivityDestroy(this)
+ //ApplicationLifecycle.onActivityDestroy(this)
nativeOnDestroy()
}
StorageDirectory.Shutdown()
@@ -480,7 +480,7 @@ class GameActivity : ComponentActivity(), DrawFrameListener {
mAudioManager!!.setStreamMute(3, true)
gameGLSurfaceView.onPause()
onWindowFocusChanged(false)
- ApplicationLifecycle.onActivityPause(this)
+ //ApplicationLifecycle.onActivityPause(this)
nativeOnPause()
}
@@ -489,7 +489,7 @@ class GameActivity : ComponentActivity(), DrawFrameListener {
Log.i(this.localClassName, "onRestart")
Log.i(this.localClassName, "TouchEvent, GameActivity.state = $state")
super.onRestart()
- ApplicationLifecycle.onActivityRestart(this)
+ //ApplicationLifecycle.onActivityRestart(this)
nativeOnRestart()
}
@@ -504,7 +504,7 @@ class GameActivity : ComponentActivity(), DrawFrameListener {
gameRenderer.setDrawFrameListener(this)
}
gameGLSurfaceView.onResume()
- ApplicationLifecycle.onActivityResume(this)
+ //ApplicationLifecycle.onActivityResume(this)
nativeOnResume()
MogaController.doForAllControllers {
val event = MogaController.createConnectEvent(it)
@@ -514,7 +514,7 @@ class GameActivity : ComponentActivity(), DrawFrameListener {
public override fun onSaveInstanceState(bundle: Bundle) {
super.onSaveInstanceState(bundle)
- ApplicationLifecycle.onActivitySaveInstanceState(bundle, this)
+ //ApplicationLifecycle.onActivitySaveInstanceState(bundle, this)
}
public override fun onStart() {
@@ -531,7 +531,7 @@ class GameActivity : ComponentActivity(), DrawFrameListener {
nativeOnStart()
Log.i(this.localClassName, "nativeOnStart - end")
Log.i(this.localClassName, "ApplicationLifecycle")
- ApplicationLifecycle.onActivityStart(this)
+ //ApplicationLifecycle.onActivityStart(this)
}
Log.w(
this.localClassName,
@@ -576,7 +576,7 @@ class GameActivity : ComponentActivity(), DrawFrameListener {
gameRenderer.setDrawFrameListener(this)
}
}
- ApplicationLifecycle.onActivityWindowFocusChanged(hasFocus, this)
+ //ApplicationLifecycle.onActivityWindowFocusChanged(hasFocus, this)
}
fun parseCpuList(cpuInfo: String): List {
diff --git a/app/src/main/java/com/ea/nimble/ApplicationEnvironment.java b/app/src/main/java/com/ea/nimble/ApplicationEnvironment.java
deleted file mode 100644
index 15c96a6..0000000
--- a/app/src/main/java/com/ea/nimble/ApplicationEnvironment.java
+++ /dev/null
@@ -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);
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/ApplicationEnvironmentImpl.java b/app/src/main/java/com/ea/nimble/ApplicationEnvironmentImpl.java
deleted file mode 100644
index 7b791a7..0000000
--- a/app/src/main/java/com/ea/nimble/ApplicationEnvironmentImpl.java
+++ /dev/null
@@ -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 hashMap = new HashMap();
- 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 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;
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/ApplicationLifecycle.java b/app/src/main/java/com/ea/nimble/ApplicationLifecycle.java
deleted file mode 100644
index 22e26ec..0000000
--- a/app/src/main/java/com/ea/nimble/ApplicationLifecycle.java
+++ /dev/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();
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/ApplicationLifecycleImpl.java b/app/src/main/java/com/ea/nimble/ApplicationLifecycleImpl.java
deleted file mode 100644
index 079fa29..0000000
--- a/app/src/main/java/com/ea/nimble/ApplicationLifecycleImpl.java
+++ /dev/null
@@ -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 m_activityEventCallbacks;
- private ArrayList m_activityLifecycleCallbacks;
- private ArrayList 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 iterator = this.m_applicationLifecycleCallbacks.iterator();
- while (iterator.hasNext()) {
- iterator.next().onApplicationLaunch(intent);
- }
- }
-
- private void notifyApplicationQuit() {
- Iterator 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 iterator = this.m_applicationLifecycleCallbacks.iterator();
- while (iterator.hasNext()) {
- iterator.next().onApplicationResume();
- }
- }
-
- private void notifyApplicationSuspend() {
- Iterator 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 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 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 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 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 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, "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 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 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 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 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 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;
-
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/BackgroundNetworkConnection.java b/app/src/main/java/com/ea/nimble/BackgroundNetworkConnection.java
deleted file mode 100644
index 26ad2b8..0000000
--- a/app/src/main/java/com/ea/nimble/BackgroundNetworkConnection.java
+++ /dev/null
@@ -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() {
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/Base.java b/app/src/main/java/com/ea/nimble/Base.java
deleted file mode 100644
index d78b109..0000000
--- a/app/src/main/java/com/ea/nimble/Base.java
+++ /dev/null
@@ -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();
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/BaseCore.java b/app/src/main/java/com/ea/nimble/BaseCore.java
deleted file mode 100644
index 2f654bc..0000000
--- a/app/src/main/java/com/ea/nimble/BaseCore.java
+++ /dev/null
@@ -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 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]);
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/ea/nimble/ByteBufferIOStream.java b/app/src/main/java/com/ea/nimble/ByteBufferIOStream.java
deleted file mode 100644
index 12dd844..0000000
--- a/app/src/main/java/com/ea/nimble/ByteBufferIOStream.java
+++ /dev/null
@@ -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 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 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 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;
- }
- }
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/Component.java b/app/src/main/java/com/ea/nimble/Component.java
deleted file mode 100644
index 6509932..0000000
--- a/app/src/main/java/com/ea/nimble/Component.java
+++ /dev/null
@@ -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() {
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/ComponentManager.java b/app/src/main/java/com/ea/nimble/ComponentManager.java
deleted file mode 100644
index b16fe0b..0000000
--- a/app/src/main/java/com/ea/nimble/ComponentManager.java
+++ /dev/null
@@ -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 m_components = new LinkedHashMap();
- private Stage m_stage = Stage.CREATE;
-
- ComponentManager() {
- }
-
- void cleanup() {
- ListIterator listIterator = new ArrayList(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 arrayList = new ArrayList(this.m_components.size());
- Iterator> iterator = this.m_components.entrySet().iterator();
- while (iterator.hasNext()) {
- Map.Entry 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 iterator = this.m_components.values().iterator();
- while (true) {
- if (!iterator.hasNext()) {
- this.m_stage = Stage.READY;
- return;
- }
- iterator.next().restore();
- }
- }
-
- void resume() {
- Iterator iterator = this.m_components.values().iterator();
- while (true) {
- if (!iterator.hasNext()) {
- this.m_stage = Stage.READY;
- return;
- }
- iterator.next().resume();
- }
- }
-
- void setup() {
- Iterator iterator = this.m_components.values().iterator();
- while (true) {
- if (!iterator.hasNext()) {
- this.m_stage = Stage.SETUP;
- return;
- }
- iterator.next().setup();
- }
- }
-
- void suspend() {
- ListIterator listIterator = new ArrayList(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 listIterator = new ArrayList(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;
-
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/EASPDataLoader.java b/app/src/main/java/com/ea/nimble/EASPDataLoader.java
deleted file mode 100644
index 62a4dcb..0000000
--- a/app/src/main/java/com/ea/nimble/EASPDataLoader.java
+++ /dev/null
@@ -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 "";
- }
-}
diff --git a/app/src/main/java/com/ea/nimble/Encryptor.java b/app/src/main/java/com/ea/nimble/Encryptor.java
deleted file mode 100644
index 695eebf..0000000
--- a/app/src/main/java/com/ea/nimble/Encryptor.java
+++ /dev/null
@@ -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));
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/EnvironmentDataContainer.java b/app/src/main/java/com/ea/nimble/EnvironmentDataContainer.java
deleted file mode 100644
index ab3d1ec..0000000
--- a/app/src/main/java/com/ea/nimble/EnvironmentDataContainer.java
+++ /dev/null
@@ -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 m_getDirectionResponseDictionary = new HashMap();
- private Long m_lastDirectorResponseTimestamp;
- private Map 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 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 getKeysOfDifferences(ISynergyEnvironment var1_1) {
- HashSet var2_3 = new HashSet();
- 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 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 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();
- }
-
- void setMostRecentDirectorResponseTimestamp(Long l2) {
- this.m_lastDirectorResponseTimestamp = l2;
- }
-
- void setServerUrls(Map 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() : this.m_getDirectionResponseDictionary;
- objectOutput.writeObject(object);
- object = this.m_serverUrls == null ? new HashMap() : 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);
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/Error.java b/app/src/main/java/com/ea/nimble/Error.java
deleted file mode 100644
index 8821da1..0000000
--- a/app/src/main/java/com/ea/nimble/Error.java
+++ /dev/null
@@ -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 CREATOR = new Parcelable.Creator(){
-
- 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;
- }
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/Facebook.java b/app/src/main/java/com/ea/nimble/Facebook.java
deleted file mode 100644
index d93efb5..0000000
--- a/app/src/main/java/com/ea/nimble/Facebook.java
+++ /dev/null
@@ -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);
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/FacebookCallback.java b/app/src/main/java/com/ea/nimble/FacebookCallback.java
deleted file mode 100644
index b6cc81b..0000000
--- a/app/src/main/java/com/ea/nimble/FacebookCallback.java
+++ /dev/null
@@ -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);
-}
-
diff --git a/app/src/main/java/com/ea/nimble/FacebookImpl.java b/app/src/main/java/com/ea/nimble/FacebookImpl.java
deleted file mode 100644
index dd4cf7d..0000000
--- a/app/src/main/java/com/ea/nimble/FacebookImpl.java
+++ /dev/null
@@ -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 m_callbackQueue = new ArrayList();
- private Map 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 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 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() {
-
- }
-}
diff --git a/app/src/main/java/com/ea/nimble/Global.java b/app/src/main/java/com/ea/nimble/Global.java
deleted file mode 100644
index 5e7d895..0000000
--- a/app/src/main/java/com/ea/nimble/Global.java
+++ /dev/null
@@ -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";
-}
-
diff --git a/app/src/main/java/com/ea/nimble/HttpError.java b/app/src/main/java/com/ea/nimble/HttpError.java
deleted file mode 100644
index b0a6048..0000000
--- a/app/src/main/java/com/ea/nimble/HttpError.java
+++ /dev/null
@@ -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);
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/HttpRequest.java b/app/src/main/java/com/ea/nimble/HttpRequest.java
deleted file mode 100644
index 1b8506e..0000000
--- a/app/src/main/java/com/ea/nimble/HttpRequest.java
+++ /dev/null
@@ -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 headers;
- public IHttpRequest.Method method = IHttpRequest.Method.GET;
- public EnumSet 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 getHeaders() {
- return this.headers;
- }
-
- @Override
- public IHttpRequest.Method getMethod() {
- return this.method;
- }
-
- @Override
- public EnumSet 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;
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/HttpResponse.java b/app/src/main/java/com/ea/nimble/HttpResponse.java
deleted file mode 100644
index 30291f2..0000000
--- a/app/src/main/java/com/ea/nimble/HttpResponse.java
+++ /dev/null
@@ -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 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 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;
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/IApplicationEnvironment.java b/app/src/main/java/com/ea/nimble/IApplicationEnvironment.java
deleted file mode 100644
index 80868ad..0000000
--- a/app/src/main/java/com/ea/nimble/IApplicationEnvironment.java
+++ /dev/null
@@ -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);
-}
-
diff --git a/app/src/main/java/com/ea/nimble/IApplicationLifecycle.java b/app/src/main/java/com/ea/nimble/IApplicationLifecycle.java
deleted file mode 100644
index 47dd9cb..0000000
--- a/app/src/main/java/com/ea/nimble/IApplicationLifecycle.java
+++ /dev/null
@@ -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();
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/IFacebook.java b/app/src/main/java/com/ea/nimble/IFacebook.java
deleted file mode 100644
index 7a16515..0000000
--- a/app/src/main/java/com/ea/nimble/IFacebook.java
+++ /dev/null
@@ -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 getGraphUser();
-
- public boolean hasOpenSession();
-
- public void login(List 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);
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/IHttpRequest.java b/app/src/main/java/com/ea/nimble/IHttpRequest.java
deleted file mode 100644
index 6d93eaf..0000000
--- a/app/src/main/java/com/ea/nimble/IHttpRequest.java
+++ /dev/null
@@ -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 getHeaders();
-
- Method getMethod();
-
- EnumSet 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 OVERWRITE;
- static final EnumSet SMART;
-
- static {
- OVERWRITE = EnumSet.noneOf(OverwritePolicy.class);
- SMART = EnumSet.allOf(OverwritePolicy.class);
- }
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/IHttpResponse.java b/app/src/main/java/com/ea/nimble/IHttpResponse.java
deleted file mode 100644
index 875496b..0000000
--- a/app/src/main/java/com/ea/nimble/IHttpResponse.java
+++ /dev/null
@@ -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 getHeaders();
-
- public Date getLastModified();
-
- public int getStatusCode();
-
- public URL getUrl();
-
- public boolean isCompleted();
-}
-
diff --git a/app/src/main/java/com/ea/nimble/ILog.java b/app/src/main/java/com/ea/nimble/ILog.java
deleted file mode 100644
index 0046b56..0000000
--- a/app/src/main/java/com/ea/nimble/ILog.java
+++ /dev/null
@@ -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);
-}
-
diff --git a/app/src/main/java/com/ea/nimble/INetwork.java b/app/src/main/java/com/ea/nimble/INetwork.java
deleted file mode 100644
index 64dc6ea..0000000
--- a/app/src/main/java/com/ea/nimble/INetwork.java
+++ /dev/null
@@ -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 var2, NetworkConnectionCallback var3);
-
- public NetworkConnectionHandle sendGetRequest(URL var1, HashMap var2, NetworkConnectionCallback var3);
-
- public NetworkConnectionHandle sendPostRequest(URL var1, HashMap var2, byte[] var3, NetworkConnectionCallback var4);
-
- public NetworkConnectionHandle sendRequest(HttpRequest var1, NetworkConnectionCallback var2);
-
- public NetworkConnectionHandle sendRequest(HttpRequest var1, NetworkConnectionCallback var2, IOperationalTelemetryDispatch var3);
-}
-
diff --git a/app/src/main/java/com/ea/nimble/IOperationalTelemetryDispatch.java b/app/src/main/java/com/ea/nimble/IOperationalTelemetryDispatch.java
deleted file mode 100644
index c62c097..0000000
--- a/app/src/main/java/com/ea/nimble/IOperationalTelemetryDispatch.java
+++ /dev/null
@@ -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 getEvents(String var1);
-
- public int getMaxEventCount(String var1);
-
- public void logEvent(String var1, Map var2);
-
- public void setMaxEventCount(String var1, int var2);
-}
-
diff --git a/app/src/main/java/com/ea/nimble/IPersistenceService.java b/app/src/main/java/com/ea/nimble/IPersistenceService.java
deleted file mode 100644
index f758dd9..0000000
--- a/app/src/main/java/com/ea/nimble/IPersistenceService.java
+++ /dev/null
@@ -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);
-}
-
diff --git a/app/src/main/java/com/ea/nimble/ISynergyEnvironment.java b/app/src/main/java/com/ea/nimble/ISynergyEnvironment.java
deleted file mode 100644
index 6797dd2..0000000
--- a/app/src/main/java/com/ea/nimble/ISynergyEnvironment.java
+++ /dev/null
@@ -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();
-}
-
diff --git a/app/src/main/java/com/ea/nimble/ISynergyIdManager.java b/app/src/main/java/com/ea/nimble/ISynergyIdManager.java
deleted file mode 100644
index e5c3540..0000000
--- a/app/src/main/java/com/ea/nimble/ISynergyIdManager.java
+++ /dev/null
@@ -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);
-}
-
diff --git a/app/src/main/java/com/ea/nimble/ISynergyNetwork.java b/app/src/main/java/com/ea/nimble/ISynergyNetwork.java
deleted file mode 100644
index dee64de..0000000
--- a/app/src/main/java/com/ea/nimble/ISynergyNetwork.java
+++ /dev/null
@@ -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 var3, SynergyNetworkConnectionCallback var4);
-
- public SynergyNetworkConnectionHandle sendPostRequest(String var1, String var2, Map var3, Map var4, SynergyNetworkConnectionCallback var5);
-
- public SynergyNetworkConnectionHandle sendPostRequest(String var1, String var2, Map var3, Map var4, SynergyNetworkConnectionCallback var5, Map var6);
-
- public void sendRequest(SynergyRequest var1, SynergyNetworkConnectionCallback var2);
-}
-
diff --git a/app/src/main/java/com/ea/nimble/ISynergyRequest.java b/app/src/main/java/com/ea/nimble/ISynergyRequest.java
deleted file mode 100644
index 24ddbc5..0000000
--- a/app/src/main/java/com/ea/nimble/ISynergyRequest.java
+++ /dev/null
@@ -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 getJsonData();
-
- public Map getUrlParameters();
-}
-
diff --git a/app/src/main/java/com/ea/nimble/ISynergyResponse.java b/app/src/main/java/com/ea/nimble/ISynergyResponse.java
deleted file mode 100644
index 070d0b8..0000000
--- a/app/src/main/java/com/ea/nimble/ISynergyResponse.java
+++ /dev/null
@@ -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 getJsonData();
-
- public boolean isCompleted();
-}
-
diff --git a/app/src/main/java/com/ea/nimble/Log.java b/app/src/main/java/com/ea/nimble/Log.java
deleted file mode 100644
index 01178f2..0000000
--- a/app/src/main/java/com/ea/nimble/Log.java
+++ /dev/null
@@ -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);
- }
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/LogImpl.java b/app/src/main/java/com/ea/nimble/LogImpl.java
deleted file mode 100644
index 3654d71..0000000
--- a/app/src/main/java/com/ea/nimble/LogImpl.java
+++ /dev/null
@@ -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 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 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 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() {
- }
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/LogSource.java b/app/src/main/java/com/ea/nimble/LogSource.java
deleted file mode 100644
index 197da4f..0000000
--- a/app/src/main/java/com/ea/nimble/LogSource.java
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * Decompiled with CFR 0.152.
- */
-package com.ea.nimble;
-
-public interface LogSource {
- public String getLogSourceTitle();
-}
-
diff --git a/app/src/main/java/com/ea/nimble/Network.java b/app/src/main/java/com/ea/nimble/Network.java
deleted file mode 100644
index 4c38966..0000000
--- a/app/src/main/java/com/ea/nimble/Network.java
+++ /dev/null
@@ -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 object) {
- if (object == null) {
- return null;
- }
- if (object.size() == 0) return null;
- String string2 = "";
- Iterator> iterator = object.entrySet().iterator();
- return "";
- }
-
- public static URL generateURL(String string2, Map 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";
- }
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/NetworkConnection.java b/app/src/main/java/com/ea/nimble/NetworkConnection.java
deleted file mode 100644
index c04892b..0000000
--- a/app/src/main/java/com/ea/nimble/NetworkConnection.java
+++ /dev/null
@@ -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> 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 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 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 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 = ": 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 = ": there is no response body for this call";
- if (this.m_response != null) {
- str3 = ": there is no response body for this call";
- if (this.m_response.getError() != null) {
- str3 = ": 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 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.(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 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 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) {
- }
- }
- }
- }
-}
diff --git a/app/src/main/java/com/ea/nimble/NetworkConnectionCallback.java b/app/src/main/java/com/ea/nimble/NetworkConnectionCallback.java
deleted file mode 100644
index a1b2a99..0000000
--- a/app/src/main/java/com/ea/nimble/NetworkConnectionCallback.java
+++ /dev/null
@@ -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);
-}
-
diff --git a/app/src/main/java/com/ea/nimble/NetworkConnectionHandle.java b/app/src/main/java/com/ea/nimble/NetworkConnectionHandle.java
deleted file mode 100644
index 141bf0f..0000000
--- a/app/src/main/java/com/ea/nimble/NetworkConnectionHandle.java
+++ /dev/null
@@ -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();
-}
-
diff --git a/app/src/main/java/com/ea/nimble/NetworkImpl.java b/app/src/main/java/com/ea/nimble/NetworkImpl.java
deleted file mode 100644
index 620c818..0000000
--- a/app/src/main/java/com/ea/nimble/NetworkImpl.java
+++ /dev/null
@@ -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 m_queue;
- private Network.Status m_status;
- private Timer m_timer;
- private LinkedList 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();
- 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 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 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 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 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(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;
- }
- }
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/NimbleConfiguration.java b/app/src/main/java/com/ea/nimble/NimbleConfiguration.java
deleted file mode 100644
index dadf0f5..0000000
--- a/app/src/main/java/com/ea/nimble/NimbleConfiguration.java
+++ /dev/null
@@ -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";
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/NimbleFacebookError.java b/app/src/main/java/com/ea/nimble/NimbleFacebookError.java
deleted file mode 100644
index e3bd84e..0000000
--- a/app/src/main/java/com/ea/nimble/NimbleFacebookError.java
+++ /dev/null
@@ -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;
- }
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/OperationalTelemetryDispatch.java b/app/src/main/java/com/ea/nimble/OperationalTelemetryDispatch.java
deleted file mode 100644
index 5aad8f3..0000000
--- a/app/src/main/java/com/ea/nimble/OperationalTelemetryDispatch.java
+++ /dev/null
@@ -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));
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/OperationalTelemetryDispatchImpl.java b/app/src/main/java/com/ea/nimble/OperationalTelemetryDispatchImpl.java
deleted file mode 100644
index a2cd60e..0000000
--- a/app/src/main/java/com/ea/nimble/OperationalTelemetryDispatchImpl.java
+++ /dev/null
@@ -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 m_maxEventQueueSizeDict;
- private List m_networkMetricsArray = new ArrayList();
- private List m_networkPayloadsArray = new ArrayList();
-
- public OperationalTelemetryDispatchImpl() {
- this.m_maxEventQueueSizeDict = new HashMap();
- 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 list) {
- synchronized (this) {
- if (list.size() == 0) {
- Log.Helper.LOGD(this, "purgeOldestEvent called with empty event array.");
- return;
- }
- OperationalTelemetryEvent operationalTelemetryEvent = null;
- Iterator 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 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();
- 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 getEvents(String string2) {
- if (!Utility.validString(string2)) {
- Log.Helper.LOGE(this, "getEvents called with null or empty eventType.");
- return null;
- }
- List list = null;
- synchronized (this) {
- if (string2.equals("com.ea.nimble.network")) {
- list = this.m_networkMetricsArray;
- this.m_networkMetricsArray = new ArrayList();
- } else if (string2.equals("com.ea.nimble.trackingimpl.synergy")) {
- list = this.m_networkPayloadsArray;
- this.m_networkPayloadsArray = new ArrayList();
- }
- }
- 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 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() {
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/OperationalTelemetryEvent.java b/app/src/main/java/com/ea/nimble/OperationalTelemetryEvent.java
deleted file mode 100644
index 99d25d7..0000000
--- a/app/src/main/java/com/ea/nimble/OperationalTelemetryEvent.java
+++ /dev/null
@@ -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 getEventDictionary();
-
- public String getEventType();
-
- public Date getLoggedTime();
-}
-
diff --git a/app/src/main/java/com/ea/nimble/OperationalTelemetryEventImpl.java b/app/src/main/java/com/ea/nimble/OperationalTelemetryEventImpl.java
deleted file mode 100644
index c09935e..0000000
--- a/app/src/main/java/com/ea/nimble/OperationalTelemetryEventImpl.java
+++ /dev/null
@@ -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 m_eventDictionary;
- private String m_eventType;
- private Date m_loggedTime;
-
- public OperationalTelemetryEventImpl(String string2, Map map, Date date) {
- this.m_eventType = string2;
- this.m_eventDictionary = map;
- this.m_loggedTime = date;
- }
-
- @Override
- public Map 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());
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/Persistence.java b/app/src/main/java/com/ea/nimble/Persistence.java
deleted file mode 100644
index d0ba7ba..0000000
--- a/app/src/main/java/com/ea/nimble/Persistence.java
+++ /dev/null
@@ -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 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 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();
- }
- }
- }
-
-}
diff --git a/app/src/main/java/com/ea/nimble/PersistenceService.java b/app/src/main/java/com/ea/nimble/PersistenceService.java
deleted file mode 100644
index 9ba61de..0000000
--- a/app/src/main/java/com/ea/nimble/PersistenceService.java
+++ /dev/null
@@ -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();
- }
-}
diff --git a/app/src/main/java/com/ea/nimble/PersistenceServiceImpl.java b/app/src/main/java/com/ea/nimble/PersistenceServiceImpl.java
deleted file mode 100644
index f2c3f86..0000000
--- a/app/src/main/java/com/ea/nimble/PersistenceServiceImpl.java
+++ /dev/null
@@ -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 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;
- }
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/QA.java b/app/src/main/java/com/ea/nimble/QA.java
deleted file mode 100644
index ee7b7c0..0000000
--- a/app/src/main/java/com/ea/nimble/QA.java
+++ /dev/null
@@ -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);
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/SynergyEnvironment.java b/app/src/main/java/com/ea/nimble/SynergyEnvironment.java
deleted file mode 100644
index 36e158f..0000000
--- a/app/src/main/java/com/ea/nimble/SynergyEnvironment.java
+++ /dev/null
@@ -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));
- }
-}
-
diff --git a/app/src/main/java/com/ea/nimble/SynergyEnvironmentImpl.java b/app/src/main/java/com/ea/nimble/SynergyEnvironmentImpl.java
deleted file mode 100644
index e2968c8..0000000
--- a/app/src/main/java/com/ea/nimble/SynergyEnvironmentImpl.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/app/src/main/java/com/ea/nimble/SynergyEnvironmentUpdater.java b/app/src/main/java/com/ea/nimble/SynergyEnvironmentUpdater.java
deleted file mode 100644
index 8176532..0000000
--- a/app/src/main/java/com/ea/nimble/SynergyEnvironmentUpdater.java
+++ /dev/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 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